aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-09-25 07:51:51 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-09-25 07:51:51 +0000
commitb2e519796c72be6179052d738b0b645b926ab23a (patch)
treef7a0c4b55d01c93be4fab5798dc573d9d80f6bc2 /gcc/tree-ssa-sccvn.c
parent9fe7fbd5dfbb38e1d7fc4e3f5dea2f51eb8a9bf7 (diff)
downloadgcc-b2e519796c72be6179052d738b0b645b926ab23a.zip
gcc-b2e519796c72be6179052d738b0b645b926ab23a.tar.gz
gcc-b2e519796c72be6179052d738b0b645b926ab23a.tar.bz2
re PR tree-optimization/53663 (inconsistent inline handling of bool within union)
2012-09-25 Richard Guenther <rguenther@suse.de> PR tree-optimization/53663 * tree-ssa-sccvn.c (vn_reference_lookup_3): Conditional native encode/interpret translation on VN_WALKREWRITE. * gcc.dg/torture/pr53663-1.c: New testcase. * gcc.dg/torture/pr53663-2.c: Likewise. * gcc.dg/torture/pr53663-3.c: Likewise. From-SVN: r191694
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 2e5ed74..9e62ebe 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1555,7 +1555,8 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
/* 3) Assignment from a constant. We can use folds native encode/interpret
routines to extract the assigned bits. */
- else if (CHAR_BIT == 8 && BITS_PER_UNIT == 8
+ else if (vn_walk_kind == VN_WALKREWRITE
+ && CHAR_BIT == 8 && BITS_PER_UNIT == 8
&& ref->size == maxsize
&& maxsize % BITS_PER_UNIT == 0
&& offset % BITS_PER_UNIT == 0