From 95cbf8515a67cc41daa12f858d5db1277f1f2fa0 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Thu, 19 Jul 2012 11:48:46 +0000 Subject: tree-ssa-ccp.c (valid_lattice_transition): Clarify comment about transition from invariant to known bits. 2012-07-19 Richard Guenther Eric Botcazou * 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 From-SVN: r189650 --- gcc/tree-ssa-ccp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/tree-ssa-ccp.c') 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: ; } -- cgit v1.1