]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorAndrey Belevantsev <abel@gcc.gnu.org>
Thu, 13 Aug 2009 08:10:21 +0000 (12:10 +0400)
committerAndrey Belevantsev <abel@gcc.gnu.org>
Thu, 13 Aug 2009 08:10:21 +0000 (12:10 +0400)
2009-08-13  Andrey Belevantsev  <abel@ispras.ru>

    PR rtl-optimization/41033
    * alias.c (nonoverlapping_component_refs_p): Punt if strict aliasing is disabled.

2009-08-13  Richard Guenther  <rguenther@suse.de>

    PR rtl-optimization/41033
    * gcc.dg/pr41033.c: New test.

From-SVN: r150714

gcc/ChangeLog
gcc/alias.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr41033.c [new file with mode: 0644]

index ae1673f4dc0d61ef007ff7e1c5242fb1a54e160e..8cfc6075c74ad6f5feb7cad6b2520e1a2d391eb2 100644 (file)
@@ -1,3 +1,9 @@
+2009-08-13  Andrey Belevantsev  <abel@ispras.ru>
+
+       PR rtl-optimization/41033
+       * alias.c (nonoverlapping_component_refs_p): Punt when strict 
+       aliasing is disabled.
+
 2009-08-05  Uros Bizjak  <ubizjak@gmail.com>
            Mikulas Patocka  <mikulas@artax.karlin.mff.cuni.cz>
 
index 2148983e3b17f76b80d22257786a965b12454661..337ee6377297ddd4b17534382c07376574d3d472 100644 (file)
@@ -1881,6 +1881,9 @@ nonoverlapping_component_refs_p (const_tree x, const_tree y)
 {
   const_tree fieldx, fieldy, typex, typey, orig_y;
 
+  if (!flag_strict_aliasing)
+    return false;
+
   do
     {
       /* The comparison has to be done at a common type, since we don't
index d383ecc0e78a3c61f77de6bfbaed4d546621f3c4..685e5774c63aee247433d07696d8bf5ccf7c3d90 100644 (file)
@@ -1,3 +1,8 @@
+2009-08-13  Richard Guenther  <rguenther@suse.de>
+    
+       PR rtl-optimization/41033
+       * gcc.dg/pr41033.c: New test. 
+
 2009-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        Backport:
diff --git a/gcc/testsuite/gcc.dg/pr41033.c b/gcc/testsuite/gcc.dg/pr41033.c
new file mode 100644 (file)
index 0000000..5043be2
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-options "-O1 -fno-strict-aliasing" } */
+/* PR rtl-optimization/41033 */
+
+struct X {
+  int i;
+  int j;
+};
+
+int foo(struct X *p, struct X *q)
+{
+  p->j = 1;
+  q->i = 0;
+  return p->j;
+}
+
+extern void abort (void);
+
+int main()
+{
+  struct X x;
+  if (foo (&x, (struct X *)&x.j) != 0)
+    abort ();
+  return 0;
+}