2013-10-22 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/58805
* tree-ssa-tail-merge.c (stmt_local_def): Add gimple_vdef check.
* gcc.dg/pr58805.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203973
138bc75d-0d04-0410-961f-
82ee72b054a4
+2013-10-23 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/58805
+ * tree-ssa-tail-merge.c (stmt_local_def): Add gimple_vdef check.
+
2013-10-23 Jakub Jelinek <jakub@redhat.com>
* tree-vect-patterns.c (vect_recog_divmod_pattern): Optimize
+2013-10-23 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/58805
+ * gcc.dg/pr58805.c: New test.
+
2013-10-23 Jakub Jelinek <jakub@redhat.com>
* gcc.target/i386/vect-div-1.c: New test.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-tail-merge -fdump-tree-pre" } */
+
+/* Type that matches the 'p' constraint. */
+#define TYPE void *
+
+static inline
+void bar (TYPE *r)
+{
+ TYPE t;
+ __asm__ ("" : "=&p" (t), "=p" (*r));
+}
+
+void
+foo (int n, TYPE *x, TYPE *y)
+{
+ if (n == 0)
+ bar (x);
+ else
+ bar (y);
+}
+
+/* { dg-final { scan-tree-dump-times "__asm__" 2 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
tree val;
def_operand_p def_p;
- if (gimple_has_side_effects (stmt))
+ if (gimple_has_side_effects (stmt)
+ || gimple_vdef (stmt) != NULL_TREE)
return false;
def_p = SINGLE_SSA_DEF_OPERAND (stmt, SSA_OP_DEF);