]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Revert backport of PR middle-end/80222
authorRichard Biener <rguenther@suse.de>
Mon, 15 May 2017 07:56:00 +0000 (07:56 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 15 May 2017 07:56:00 +0000 (07:56 +0000)
2017-05-15  Richard Biener  <rguenther@suse.de>

        Revert backport of
PR middle-end/80222
* gimple-fold.c (gimple_fold_indirect_ref): Do not touch
TYPE_REF_CAN_ALIAS_ALL references.
* fold-const.c (fold_indirect_ref_1): Likewise.

* g++.dg/pr80222.C: New testcase.

From-SVN: r248048

gcc/ChangeLog
gcc/fold-const.c
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr80222.C [deleted file]

index b26b3552369183244264796c5f4a4e90f258cba8..a5c810fbb9f2ef51a2e4fd7677eea845e01e51a9 100644 (file)
@@ -1,3 +1,11 @@
+2017-05-15  Richard Biener  <rguenther@suse.de>
+
+       Revert backport of
+       PR middle-end/80222
+       * gimple-fold.c (gimple_fold_indirect_ref): Do not touch
+       TYPE_REF_CAN_ALIAS_ALL references.
+       * fold-const.c (fold_indirect_ref_1): Likewise.
+
 2017-05-10  Richard Biener  <rguenther@suse.de>
 
        Backport from mainline
index 48b32532421db536f60c0c8195f00d40de209dae..7adefba83cbc1244dbcff239bf785654cc07a08c 100644 (file)
@@ -15876,8 +15876,7 @@ fold_indirect_ref_1 (location_t loc, tree type, tree op0)
 
   STRIP_NOPS (sub);
   subtype = TREE_TYPE (sub);
-  if (!POINTER_TYPE_P (subtype)
-      || TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (op0)))
+  if (!POINTER_TYPE_P (subtype))
     return NULL_TREE;
 
   if (TREE_CODE (sub) == ADDR_EXPR)
index 81dc92064e2471a77b647d3cd7c707e04316a208..7950cb627fd05f8652104ba512142387685c4394 100644 (file)
@@ -5910,8 +5910,8 @@ gimple_val_nonnegative_real_p (tree val)
   return false;
 }
 
-/* Given a pointer value T, return a simplified version of an
-   indirection through T, or NULL_TREE if no simplification is
+/* Given a pointer value OP0, return a simplified version of an
+   indirection through OP0, or NULL_TREE if no simplification is
    possible.  Note that the resulting type may be different from
    the type pointed to in the sense that it is still compatible
    from the langhooks point of view. */
@@ -5925,8 +5925,7 @@ gimple_fold_indirect_ref (tree t)
 
   STRIP_NOPS (sub);
   subtype = TREE_TYPE (sub);
-  if (!POINTER_TYPE_P (subtype)
-      || TYPE_REF_CAN_ALIAS_ALL (ptype))
+  if (!POINTER_TYPE_P (subtype))
     return NULL_TREE;
 
   if (TREE_CODE (sub) == ADDR_EXPR)
index cb54cdcd45fffb1a58b4c6b46559c4747aa5a9d6..2bd85262f593ee4c750385911b8163de4941a087 100644 (file)
@@ -1,3 +1,9 @@
+2017-05-15  Richard Biener  <rguenther@suse.de>
+
+       Revert backport of
+       PR middle-end/80222
+       * g++.dg/pr80222.C: New testcase.
+
 2017-05-10  Richard Biener  <rguenther@suse.de>
 
        Backport from mainline
diff --git a/gcc/testsuite/g++.dg/pr80222.C b/gcc/testsuite/g++.dg/pr80222.C
deleted file mode 100644 (file)
index ed1b37f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// { dg-do compile }
-// { dg-options "-O2 -fdump-tree-optimized" } */
-
-struct C { int i; }__attribute__((may_alias)) ;
-
-C a, b;
-
-int main()
-{
-  a = static_cast <C&> (b);
-}
-
-// { dg-final { scan-tree-dump "{ref-all}\\\)&b\];" "optimized" } } */