re PR tree-optimization/63841 (Incorrect strlen optimization after complete unroll)
authorTeresa Johnson <tejohnson@google.com>
Fri, 14 Nov 2014 06:35:35 +0000 (06:35 +0000)
committerTeresa Johnson <tejohnson@gcc.gnu.org>
Fri, 14 Nov 2014 06:35:35 +0000 (06:35 +0000)
2014-11-13  Teresa Johnson  <tejohnson@google.com>

gcc:
PR tree-optimization/63841
* tree-ssa-strlen.c (strlen_optimize_stmt): Ignore clobbers.

2014-11-13  Teresa Johnson  <tejohnson@google.com>

gcc/testsuite:
PR tree-optimization/63841
* g++.dg/tree-ssa/pr63841.C: Remove prints, use abort.

From-SVN: r217537

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr63841.C
gcc/tree-ssa-strlen.c

index 1d20459bc7a8290537701bef3709c904542cd1c3..b7b72dabccfc1eeba3602a7b52bae8e7d7262bc0 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-13  Teresa Johnson  <tejohnson@google.com>
+
+       PR tree-optimization/63841
+       * tree-ssa-strlen.c (strlen_optimize_stmt): Ignore clobbers.
+
 2014-11-14  Bin Cheng  <bin.cheng@arm.com>
 
        * timevar.def (TV_SCHED_FUSION): New time var.
        * ipa-profile.c: Likewise.
        * tree-ssa-loop-ivcanon.c: Fix typo in comments and debugging dumps.
 
+2014-11-13  Teresa Johnson  <tejohnson@google.com>
+
+       PR tree-optimization/63841
+       * tree-ssa-strlen.c (strlen_optimize_stmt): Ignore clobbers.
+
 2014-11-13  Teresa Johnson  <tejohnson@google.com>
 
        PR tree-optimization/63841
index b1e9bc39f0871156dd41171d3adbf979bec83355..0c2e465b6ca5a9961c7368241fcceb87cbb034d9 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-13  Teresa Johnson  <tejohnson@google.com>
+
+       PR tree-optimization/63841
+       * g++.dg/tree-ssa/pr63841.C: Remove prints, use abort.
+
 2014-11-14  Bin Cheng  <bin.cheng@arm.com>
 
        * gcc.target/arm/ldrd-strd-pair-1.c: New test.
@@ -8,6 +13,11 @@
        PR debug/63581
        * g++.dg/tree-prof/pr63581.C: New test.
 
+2014-11-13  Teresa Johnson  <tejohnson@google.com>
+
+       PR tree-optimization/63841
+       * g++.dg/tree-ssa/pr63841.C: Remove prints, use abort.
+
 2014-11-13  Teresa Johnson  <tejohnson@google.com>
 
        PR tree-optimization/63841
index 466e320d431c7539a9614e4abf6ad28f6b921497..2a2c78f9fb25e96f1d9cdcfb490669efe446ea9d 100644 (file)
@@ -1,7 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O2" } */
 
-#include <cstdio>
 #include <string>
 
 std::string __attribute__ ((noinline)) comp_test_write() {
@@ -29,10 +28,8 @@ std::string __attribute__ ((noinline)) comp_test_write_good() {
 
 int main() {
   std::string good = comp_test_write_good();
-  printf("expected: %hx\n", *(short*)good.c_str());
-
   std::string bad = comp_test_write();
-  printf("got: %hx\n", *(short*)bad.c_str());
 
-  return good != bad;
+  if (good != bad)
+    __builtin_abort ();
 }
index c224fd9a3f8a9a734e9692f5e28dd2b4bf12bfa1..3789e30449d9a6e3d72e21c8ea30af22de8758f3 100644 (file)
@@ -1934,7 +1934,7 @@ strlen_optimize_stmt (gimple_stmt_iterator *gsi)
            break;
          }
     }
-  else if (is_gimple_assign (stmt))
+  else if (is_gimple_assign (stmt) && !gimple_clobber_p (stmt))
     {
       tree lhs = gimple_assign_lhs (stmt);