OSDN Git Service

2013-02-21 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Feb 2013 10:52:39 +0000 (10:52 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Feb 2013 10:52:39 +0000 (10:52 +0000)
PR tree-optimization/56415
Revert
2013-02-11  Richard Biener  <rguenther@suse.de>

PR tree-optimization/56273
* tree-vrp.c (simplify_cond_using_ranges): Disable for the
first VRP run.

* g++.dg/warn/Warray-bounds-6.C: New testcase.
* gcc.dg/tree-ssa/pr21559.c: Adjust.
* gcc.dg/tree-ssa/vrp17.c: Likewise.
* gcc.dg/tree-ssa/vrp18.c: Likewise.
* gcc.dg/tree-ssa/vrp23.c: Likewise.
* gcc.dg/tree-ssa/vrp24.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196200 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Warray-bounds-6.C [deleted file]
gcc/testsuite/gcc.dg/tree-ssa/pr21559.c
gcc/testsuite/gcc.dg/tree-ssa/vrp17.c
gcc/testsuite/gcc.dg/tree-ssa/vrp18.c
gcc/testsuite/gcc.dg/tree-ssa/vrp23.c
gcc/testsuite/gcc.dg/tree-ssa/vrp24.c
gcc/tree-vrp.c

index da0fd49..067a61f 100644 (file)
@@ -1,3 +1,13 @@
+2013-02-21  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/56415
+       Revert
+       2013-02-11  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/56273
+       * tree-vrp.c (simplify_cond_using_ranges): Disable for the
+       first VRP run.
+
 2013-02-21  Jakub Jelinek  <jakub@redhat.com>
 
        PR bootstrap/56258
index 5b6bf14..5a2e02b 100644 (file)
@@ -1,3 +1,17 @@
+2013-02-21  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/56415
+       Revert
+       2013-02-11  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/56273
+       * g++.dg/warn/Warray-bounds-6.C: New testcase.
+       * gcc.dg/tree-ssa/pr21559.c: Adjust.
+       * gcc.dg/tree-ssa/vrp17.c: Likewise.
+       * gcc.dg/tree-ssa/vrp18.c: Likewise.
+       * gcc.dg/tree-ssa/vrp23.c: Likewise.
+       * gcc.dg/tree-ssa/vrp24.c: Likewise.
+
 2013-02-21  Marek Polacek  <polacek@redhat.com>
 
        PR tree-optimization/56398
diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-6.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-6.C
deleted file mode 100644 (file)
index ee2862f..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// { dg-do compile }
-// { dg-options "-O3 -Warray-bounds" }
-
-struct type {
-    bool a, b;
-    bool get_b() { return b; }
-};
-
-type stuff[9u];
-
-void bar();
-
-void foo() {
-
-    for(unsigned i = 0u; i < 9u; i++) {
-
-       if(!stuff[i].a) {
-           continue;
-       }
-
-       bar();
-
-       for(unsigned j = i + 1u; j < 9u; j++) {
-           if(stuff[j].a && stuff[j].get_b()) { // { dg-bogus "array bounds" }
-               return;
-           }
-       }
-
-    }
-}
index d7d3bab..34f4a01 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp-details" } */
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
 
 static int blocksize = 4096;
 
@@ -32,7 +32,7 @@ void foo (void)
 
 
 /* First, we should simplify the bits < 0 test within the loop.  */
-/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp2" } } */
+/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp1" } } */
 
 /* Second, we should thread the edge out of the loop via the break
    statement.  We also realize that the final bytes == 0 test is useless,
@@ -40,4 +40,4 @@ void foo (void)
 /* { dg-final { scan-tree-dump-times "Threaded jump" 3 "vrp1" } } */
 
 /* { dg-final { cleanup-tree-dump "vrp1" } } */
-/* { dg-final { cleanup-tree-dump "vrp2" } } */
+
index 2f112ae..c04b9ba 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-tree-tail-merge -fdump-tree-vrp2" } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
 
 extern void abort (void) __attribute__ ((__noreturn__));
 union tree_node;
@@ -27,5 +27,6 @@ gimplify_for_stmt (tree stmt)
     abort ();
 }
 
-/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp2" } } */
-/* { dg-final { cleanup-tree-dump "vrp2" } } */
+/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
index 610dd44..a3cc536 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp2" } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
 
 static int blocksize = 4096;
 
@@ -30,5 +30,5 @@ void foo (void)
     eof_reached = 1;
 }
 
-/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp2" } } */
-/* { dg-final { cleanup-tree-dump "vrp2" } } */
+/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
index 6bca02b..77899a6 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp2-details" } */
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
 
 blah (int code1, int code2)
 {
@@ -40,5 +40,6 @@ L8:
 /* The n_sets > 0 test can be simplified into n_sets == 1 since the
    only way to reach the test is when n_sets <= 1, and the only value
    which satisfies both conditions is n_sets == 1.  */
-/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp2" } } */
-/* { dg-final { cleanup-tree-dump "vrp2" } } */
+/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
index 28e1a92..85e5b62 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-vrp2-details" } */
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+
 
 struct rtx_def;
 typedef struct rtx_def *rtx;
@@ -85,5 +86,6 @@ L7:
    The second n_sets > 0 test can also be simplified into n_sets == 1
    as the only way to reach the tests is when n_sets <= 1 and the only
    value which satisfies both conditions is n_sets == 1.  */
-/* { dg-final { scan-tree-dump-times "Simplified relational" 2 "vrp2" } } */
-/* { dg-final { cleanup-tree-dump "vrp2" } } */
+/* { dg-final { scan-tree-dump-times "Simplified relational" 2 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
index a023a46..a38b14d 100644 (file)
@@ -8503,8 +8503,9 @@ test_for_singularity (enum tree_code cond_code, tree op0,
   return NULL;
 }
 
-/* Simplify the conditional stmt STMT using final range information.
-   Return true if we simplified the statement.  */
+/* Simplify a conditional using a relational operator to an equality
+   test if the range information indicates only one value can satisfy
+   the original conditional.  */
 
 static bool
 simplify_cond_using_ranges (gimple stmt)
@@ -8513,13 +8514,7 @@ simplify_cond_using_ranges (gimple stmt)
   tree op1 = gimple_cond_rhs (stmt);
   enum tree_code cond_code = gimple_cond_code (stmt);
 
-  /* Simplify a conditional using a relational operator to an equality
-     test if the range information indicates only one value can satisfy
-     the original conditional.
-     Do that only in the second VRP pass as otherwise assertions derived
-     from this predicate are weakened.  */
-  if (!first_pass_instance
-      && cond_code != NE_EXPR
+  if (cond_code != NE_EXPR
       && cond_code != EQ_EXPR
       && TREE_CODE (op0) == SSA_NAME
       && INTEGRAL_TYPE_P (TREE_TYPE (op0))