Commit 5004bd00 by Teresa Johnson Committed by Teresa Johnson

re PR tree-optimization/63841 (Incorrect strlen optimization after complete unroll)

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
parent ca3d99a6
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> 2014-11-14 Bin Cheng <bin.cheng@arm.com>
* timevar.def (TV_SCHED_FUSION): New time var. * timevar.def (TV_SCHED_FUSION): New time var.
...@@ -106,6 +111,11 @@ ...@@ -106,6 +111,11 @@
2014-11-13 Teresa Johnson <tejohnson@google.com> 2014-11-13 Teresa Johnson <tejohnson@google.com>
PR tree-optimization/63841 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
* tree.c (initializer_zerop): A clobber does not zero initialize. * tree.c (initializer_zerop): A clobber does not zero initialize.
2014-11-13 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> 2014-11-13 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
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> 2014-11-14 Bin Cheng <bin.cheng@arm.com>
* gcc.target/arm/ldrd-strd-pair-1.c: New test. * gcc.target/arm/ldrd-strd-pair-1.c: New test.
...@@ -11,6 +16,11 @@ ...@@ -11,6 +16,11 @@
2014-11-13 Teresa Johnson <tejohnson@google.com> 2014-11-13 Teresa Johnson <tejohnson@google.com>
PR tree-optimization/63841 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
* g++.dg/tree-ssa/pr63841.C: New test. * g++.dg/tree-ssa/pr63841.C: New test.
2014-11-13 Richard Biener <rguenther@suse.de> 2014-11-13 Richard Biener <rguenther@suse.de>
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2" } */ /* { dg-options "-O2" } */
#include <cstdio>
#include <string> #include <string>
std::string __attribute__ ((noinline)) comp_test_write() { std::string __attribute__ ((noinline)) comp_test_write() {
...@@ -29,10 +28,8 @@ std::string __attribute__ ((noinline)) comp_test_write_good() { ...@@ -29,10 +28,8 @@ std::string __attribute__ ((noinline)) comp_test_write_good() {
int main() { int main() {
std::string good = comp_test_write_good(); std::string good = comp_test_write_good();
printf("expected: %hx\n", *(short*)good.c_str());
std::string bad = comp_test_write(); std::string bad = comp_test_write();
printf("got: %hx\n", *(short*)bad.c_str());
return good != bad; if (good != bad)
__builtin_abort ();
} }
...@@ -1934,7 +1934,7 @@ strlen_optimize_stmt (gimple_stmt_iterator *gsi) ...@@ -1934,7 +1934,7 @@ strlen_optimize_stmt (gimple_stmt_iterator *gsi)
break; break;
} }
} }
else if (is_gimple_assign (stmt)) else if (is_gimple_assign (stmt) && !gimple_clobber_p (stmt))
{ {
tree lhs = gimple_assign_lhs (stmt); tree lhs = gimple_assign_lhs (stmt);
......
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