* [PATCH] Fix PR41728
@ 2009-10-16 17:08 Richard Guenther
0 siblings, 0 replies; only message in thread
From: Richard Guenther @ 2009-10-16 17:08 UTC (permalink / raw)
To: gcc-patches
DOM relies on the modified flag, so set it if fold_stmt folded
anything.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
Richard.
2009-10-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/41728
* tree-ssa-dom.c (optimize_stmt): Mark the stmt modified
if fold_stmt did anything.
* gcc.c-torture/compile/pr41728.c: New testcase.
Index: gcc/tree-ssa-dom.c
===================================================================
*** gcc/tree-ssa-dom.c (revision 152897)
--- gcc/tree-ssa-dom.c (working copy)
*************** optimize_stmt (basic_block bb, gimple_st
*** 2099,2104 ****
--- 2099,2105 ----
if (fold_stmt (&si))
{
stmt = gsi_stmt (si);
+ gimple_set_modified (stmt, true);
if (dump_file && (dump_flags & TDF_DETAILS))
{
Index: gcc/testsuite/gcc.c-torture/compile/pr41728.c
===================================================================
*** gcc/testsuite/gcc.c-torture/compile/pr41728.c (revision 0)
--- gcc/testsuite/gcc.c-torture/compile/pr41728.c (revision 0)
***************
*** 0 ****
--- 1,12 ----
+ int a[8];
+ int s244(void)
+ {
+ int lrc, j;
+ lrc = 0;
+ for (j=0; j<7; j++)
+ if(a[j] != a[j+1])
+ lrc = 1;
+ if (lrc != 0)
+ return 0;
+ return 1;
+ }
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-10-16 16:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-16 17:08 [PATCH] Fix PR41728 Richard Guenther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).