]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2011-10-10 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Oct 2011 15:45:53 +0000 (15:45 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Oct 2011 15:45:53 +0000 (15:45 +0000)
PR middle-end/50389
* gimple-fold.c (gimplify_and_update_call_from_tree): Do not
mark symbols for renaming.  Append the VUSE to all statements
that possibly can have one.

* gcc.dg/torture/pr50389.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179757 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr50389.c [new file with mode: 0644]

index 078c997c76ae35e3f95a5882c107afebdc6558f5..b3219b50c9fb068f2026f8b254be497e149a5de3 100644 (file)
@@ -1,3 +1,10 @@
+2011-10-10  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/50389
+       * gimple-fold.c (gimplify_and_update_call_from_tree): Do not
+       mark symbols for renaming.  Append the VUSE to all statements
+       that possibly can have one.
+
 2011-10-10  Richard Guenther  <rguenther@suse.de>
 
        * ipa-split.c (pass_split_functions): Add verification TODOs.
index b4993fdef924f70d3bc0ce272d2da760b33269cc..7df7e694aa2b9c980f32a01d53aa70823312a134 100644 (file)
@@ -588,13 +588,10 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
        }
       new_stmt = gsi_stmt (i);
       if (gimple_in_ssa_p (cfun))
-       {
-         find_new_referenced_vars (new_stmt);
-         mark_symbols_for_renaming (new_stmt);
-       }
-      /* If the new statement has a VUSE, update it with exact SSA name we
-         know will reach this one.  */
-      if (gimple_vuse (new_stmt))
+       find_new_referenced_vars (new_stmt);
+      /* If the new statement possibly has a VUSE, update it with exact SSA
+        name we know will reach this one.  */
+      if (gimple_has_mem_ops (new_stmt))
        {
          /* If we've also seen a previous store create a new VDEF for
             the latter one, and make that the new reaching VUSE.  */
index 7d978b82a379ff26a6251d92edf7610fab90bb7e..d3299d8d017d261d367eb225095b4d8b4a901f3d 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-10  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/50389
+       * gcc.dg/torture/pr50389.c: New testcase.
+
 2011-10-10  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/50195
diff --git a/gcc/testsuite/gcc.dg/torture/pr50389.c b/gcc/testsuite/gcc.dg/torture/pr50389.c
new file mode 100644 (file)
index 0000000..6d8b095
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-freorder-blocks -ftracer" } */
+
+extern int data[];
+extern int i;
+
+void
+foo (void)
+{
+  char buf[8];
+  __builtin___memcpy_chk (buf, data, i ? 8 : 4,
+                         __builtin_object_size (buf, 0));
+  __builtin___memcpy_chk (buf, data, i ? 8 : 4,
+                         __builtin_object_size (buf, 0));
+}