aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-03-28 10:10:01 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-03-28 10:10:01 +0000
commit737f500a0bb2cfdf1e28975a27403e555ede633e (patch)
treee79b9e94380748bba99a522e52b8dd348721a2c6 /gcc/fold-const.c
parent62f96a79f10e0c6772e5302c076b8c062e42b0d9 (diff)
downloadgcc-737f500a0bb2cfdf1e28975a27403e555ede633e.zip
gcc-737f500a0bb2cfdf1e28975a27403e555ede633e.tar.gz
gcc-737f500a0bb2cfdf1e28975a27403e555ede633e.tar.bz2
re PR middle-end/80222 (may_alias folded away)
2017-03-28 Richard Biener <rguenther@suse.de> 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: r246527
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 6db16b5..fb54ffa 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -14006,7 +14006,8 @@ fold_indirect_ref_1 (location_t loc, tree type, tree op0)
STRIP_NOPS (sub);
subtype = TREE_TYPE (sub);
- if (!POINTER_TYPE_P (subtype))
+ if (!POINTER_TYPE_P (subtype)
+ || TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (op0)))
return NULL_TREE;
if (TREE_CODE (sub) == ADDR_EXPR)