tree-ssa-operands.c (add_virtual_operand): Only mark stores as has_volatile_ops if...
authorRichard Guenther <rguenther@suse.de>
Sun, 9 Sep 2007 16:23:26 +0000 (16:23 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sun, 9 Sep 2007 16:23:26 +0000 (16:23 +0000)
2007-09-09  Richard Guenther  <rguenther@suse.de>

* tree-ssa-operands.c (add_virtual_operand): Only mark
stores as has_volatile_ops if alias information is not available.

* gcc.c-torture/compile/20070906-1.c: New testcase.

From-SVN: r128300

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20070906-1.c [new file with mode: 0644]
gcc/tree-ssa-operands.c

index 0aa727d10912bc9b00ea7d3098b26787fded78ca..ff54c4683666195332169d495ab40c9b47b7610a 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-09  Richard Guenther  <rguenther@suse.de>
+
+       * tree-ssa-operands.c (add_virtual_operand): Only mark
+       stores as has_volatile_ops if alias information is not available.
+
 2007-09-09  Revital Eres  <eres@il.ibm.com>
 
        * doc/contrib.texi: Add myself.
index 3772b7bbf3635c369ec3537a621e313c214a8f82..02fc4ac632f082a4779a186e069f9e5ca792c2d3 100644 (file)
@@ -1,3 +1,7 @@
+2007-09-09  Richard Guenther  <rguenther@suse.de>
+
+       * gcc.c-torture/compile/20070906-1.c: New testcase.
+
 2007-09-09  Ira Rosen  <irar@il.ibm.com>
 
        * gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c: Add
diff --git a/gcc/testsuite/gcc.c-torture/compile/20070906-1.c b/gcc/testsuite/gcc.c-torture/compile/20070906-1.c
new file mode 100644 (file)
index 0000000..bec983f
--- /dev/null
@@ -0,0 +1,8 @@
+struct Bar {
+  int i[8];
+};
+struct Bar foo(struct Bar **p)
+{
+  return foo((struct Bar**)*p);
+}
+
index a3e34ecc766b7d28ff8539edd8bef72c6af4e925..3562e71213726d85b40022a55b09e43cf46b9d50 100644 (file)
@@ -1511,7 +1511,8 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
 
   if (aliases == NULL)
     {
-      if (!gimple_aliases_computed_p (cfun))
+      if (!gimple_aliases_computed_p (cfun)
+         && (flags & opf_def))
         s_ann->has_volatile_ops = true;
 
       /* The variable is not aliased or it is an alias tag.  */