+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
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)
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. */
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)
+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
+++ /dev/null
-// { 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" } } */