aboutsummaryrefslogtreecommitdiff
path: root/gcc
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
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')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization11.adb19
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization11_pkg.ads11
-rw-r--r--gcc/tree-ssa-ccp.c8
5 files changed, 51 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c4b114e..4e8816a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,12 @@
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
* tree-vect-data-refs.c (not_size_aligned): Avoid sign-compare
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 32ed483..dee868f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+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>
Jason Merrill <jason@redhat.com>
diff --git a/gcc/testsuite/gnat.dg/loop_optimization11.adb b/gcc/testsuite/gnat.dg/loop_optimization11.adb
new file mode 100644
index 0000000..e4e27d4
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization11.adb
@@ -0,0 +1,19 @@
+-- { 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;
diff --git a/gcc/testsuite/gnat.dg/loop_optimization11_pkg.ads b/gcc/testsuite/gnat.dg/loop_optimization11_pkg.ads
new file mode 100644
index 0000000..f4248e5
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/loop_optimization11_pkg.ads
@@ -0,0 +1,11 @@
+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;
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:
;
}