Commit 95cbf851 by Richard Guenther Committed by Richard Biener

tree-ssa-ccp.c (valid_lattice_transition): Clarify comment about transition from…

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
parent cd1cae35
2012-07-19 Richard Guenther <rguenther@suse.de> 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.
2012-07-19 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53970 PR tree-optimization/53970
* tree-vect-data-refs.c (not_size_aligned): Avoid sign-compare * tree-vect-data-refs.c (not_size_aligned): Avoid sign-compare
......
2012-07-19 Richard Guenther <rguenther@suse.de>
Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/loop_optimization11.adb: New testcase.
* gnat.dg/loop_optimization11_pkg.ads: Likewise.
2012-07-18 Paolo Carlini <paolo.carlini@oracle.com> 2012-07-18 Paolo Carlini <paolo.carlini@oracle.com>
Jason Merrill <jason@redhat.com> Jason Merrill <jason@redhat.com>
......
-- { dg-do compile }
-- { dg-options "-O" }
with Loop_Optimization11_Pkg; use Loop_Optimization11_Pkg;
procedure Loop_Optimization11 is
Arr : array (Prot, Mem) of Integer := (others => (others => 0));
begin
Put_Line (Img (0) & " ");
for I in Arr'Range (1) loop
for J in Arr'Range (2) loop
declare
Elem : Integer renames Arr (I, J);
begin
Put_Line (Img (Elem));
end;
end loop;
end loop;
end;
package Loop_Optimization11_Pkg is
function Img (X : Integer) return String;
procedure Put_Line (Data : String);
type Prot is (Execute, Execute_Read, Execute_Read_Write);
type Mem is (Mem_Image, Mem_Mapped, Mem_Private, Unknown);
end Loop_Optimization11_Pkg;
...@@ -405,7 +405,8 @@ valid_lattice_transition (prop_value_t old_val, prop_value_t new_val) ...@@ -405,7 +405,8 @@ valid_lattice_transition (prop_value_t old_val, prop_value_t new_val)
/* Now both lattice values are CONSTANT. */ /* 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 if (TREE_CODE (old_val.value) != INTEGER_CST
&& TREE_CODE (new_val.value) == INTEGER_CST) && TREE_CODE (new_val.value) == INTEGER_CST)
return true; return true;
...@@ -648,6 +649,11 @@ likely_value (gimple stmt) ...@@ -648,6 +649,11 @@ likely_value (gimple stmt)
the undefined operand may be promoted. */ the undefined operand may be promoted. */
return UNDEFINED; 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: default:
; ;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment