aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-07-19 11:48:46 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-07-19 11:48:46 +0000
commit95cbf8515a67cc41daa12f858d5db1277f1f2fa0 (patch)
treececadf196c7add77fde32a7370d3bee46bd56089 /gcc/tree-ssa-ccp.c
parentcd1cae3590e875901f0abbd61be8c3109c03d5bc (diff)
downloadgcc-95cbf8515a67cc41daa12f858d5db1277f1f2fa0.zip
gcc-95cbf8515a67cc41daa12f858d5db1277f1f2fa0.tar.gz
gcc-95cbf8515a67cc41daa12f858d5db1277f1f2fa0.tar.bz2
tree-ssa-ccp.c (valid_lattice_transition): Clarify comment about transition from invariant to known bits.
2012-07-19 Richard Guenther <rguenther@suse.de> Eric Botcazou <ebotcazou@adacore.com> * tree-ssa-ccp.c (valid_lattice_transition): Clarify comment about transition from invariant to known bits. (likely_value): Addresses with UNDEFINED components are UNDEFINED. * gnat.dg/loop_optimization11.adb: New testcase. * gnat.dg/loop_optimization11_pkg.ads: Likewise. Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com> From-SVN: r189650
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 6dc30e1..3f88f39 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -405,7 +405,8 @@ valid_lattice_transition (prop_value_t old_val, prop_value_t new_val)
/* Now both lattice values are CONSTANT. */
- /* Allow transitioning from &x to &x & ~3. */
+ /* Allow transitioning from PHI <&x, not executable> == &x
+ to PHI <&x, &y> == common alignment. */
if (TREE_CODE (old_val.value) != INTEGER_CST
&& TREE_CODE (new_val.value) == INTEGER_CST)
return true;
@@ -648,6 +649,11 @@ likely_value (gimple stmt)
the undefined operand may be promoted. */
return UNDEFINED;
+ case ADDR_EXPR:
+ /* If any part of an address is UNDEFINED, like the index
+ of an ARRAY_EXPR, then treat the result as UNDEFINED. */
+ return UNDEFINED;
+
default:
;
}