re PR tree-optimization/77514 (ICE in VN_INFO_GET, at tree-ssa-sccvn.c:406 w/ -O2...
authorRichard Biener <rguenther@suse.de>
Mon, 19 Sep 2016 06:54:10 +0000 (06:54 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 19 Sep 2016 06:54:10 +0000 (06:54 +0000)
2016-09-19  Richard Biener  <rguenther@suse.de>

PR tree-optimization/77514
* tree-ssa-pre.c (create_expression_by_pieces): Optimize
search for folded stmt.

From-SVN: r240226

gcc/ChangeLog
gcc/tree-ssa-pre.c

index 8eecbfe5118f5d23ac67b90bffcfcb59b1df3988..e48f844882402fb1de84a5d53ca23ad2bd140a9d 100644 (file)
@@ -1,3 +1,9 @@
+2016-09-19  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/77514
+       * tree-ssa-pre.c (create_expression_by_pieces): Optimize
+       search for folded stmt.
+
 2016-09-17  Jan Hubicka  <hubicka@ucw.cz>
 
        * passes.def (pass_early_thread_jumps): Schedule after forwprop.
index d1fe72cca3f699402fc4e70c435ae692e47f462c..0c6f82093c41f6c6b75c062681b051862b4ff06c 100644 (file)
@@ -2881,13 +2881,16 @@ create_expression_by_pieces (basic_block block, pre_expr expr,
     }
   /* Likewise if we simplified to sth not queued for insertion.  */
   bool found = false;
-  gsi = gsi_start (forced_stmts);
-  for (; !gsi_end_p (gsi); gsi_next (&gsi))
+  gsi = gsi_last (forced_stmts);
+  for (; !gsi_end_p (gsi); gsi_prev (&gsi))
     {
       gimple *stmt = gsi_stmt (gsi);
       tree forcedname = gimple_get_lhs (stmt);
       if (forcedname == folded)
-       found = true;
+       {
+         found = true;
+         break;
+       }
     }
   if (! found)
     {