re PR tree-optimization/57318 (optimizer takes several seconds on nested loops)
authorRichard Biener <rguenther@suse.de>
Tue, 21 May 2013 11:59:28 +0000 (11:59 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 21 May 2013 11:59:28 +0000 (11:59 +0000)
2013-05-21  Richard Biener  <rguenther@suse.de>

PR tree-optimization/57318
* tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Do not
estimate stmts with side-effects as likely eliminated.

From-SVN: r199140

gcc/ChangeLog
gcc/tree-ssa-loop-ivcanon.c

index bab6db43cf2c27d7b0226ac740916fc4330215d2..3abc99ce73ae33e5d65f7621375e69ee3c28116d 100644 (file)
@@ -1,3 +1,9 @@
+2013-05-21  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/57318
+       * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Do not
+       estimate stmts with side-effects as likely eliminated.
+
 2013-05-21  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/57330
index b5751cb7f7fcc11b7706eff9a8f7e1eed33c7036..45774e60dd8e82654d57191874d2e31761bd4e6f 100644 (file)
@@ -257,8 +257,10 @@ tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel, stru
 
          /* Look for reasons why we might optimize this stmt away. */
 
+         if (gimple_has_side_effects (stmt))
+           ;
          /* Exit conditional.  */
-         if (exit && body[i] == exit->src
+         else if (exit && body[i] == exit->src
                   && stmt == last_stmt (exit->src))
            {
              if (dump_file && (dump_flags & TDF_DETAILS))