re PR tree-optimization/88444 (ICE: tree check: expected ssa_name, have integer_cst...
authorJakub Jelinek <jakub@redhat.com>
Thu, 13 Dec 2018 23:35:10 +0000 (00:35 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 13 Dec 2018 23:35:10 +0000 (00:35 +0100)
PR tree-optimization/88444
* tree-inline.c (fold_marked_statements): Iterate up to
last_basic_block_for_fn rather than n_basic_blocks_for_fn.

* gcc.dg/tree-ssa/pr88444.c: New test.

From-SVN: r267113

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr88444.c [new file with mode: 0644]
gcc/tree-inline.c

index 3f1eeb7ba4182ece58051ee6c414be96dcc3a9fa..7b4c219e7614a01fa4daf726cc0051d38f429785 100644 (file)
@@ -1,5 +1,9 @@
 2018-12-13  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/88444
+       * tree-inline.c (fold_marked_statements): Iterate up to
+       last_basic_block_for_fn rather than n_basic_blocks_for_fn.
+
        PR rtl-optimization/88470
        * cfgcleanup.c (outgoing_edges_match): If the function is
        shrink-wrapped and bb1 ends with a JUMP_INSN with a single fake
index b0dae2b68d89670c3626217d634b0b95398ac4cf..3ce50c8a05cd98eb7367bd0c924fb9b97f5a6720 100644 (file)
@@ -1,5 +1,8 @@
 2018-12-13  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/88444
+       * gcc.dg/tree-ssa/pr88444.c: New test.
+
        PR rtl-optimization/88470
        * gcc.target/i386/pr88470.c: New test.
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr88444.c b/gcc/testsuite/gcc.dg/tree-ssa/pr88444.c
new file mode 100644 (file)
index 0000000..31ed316
--- /dev/null
@@ -0,0 +1,6 @@
+/* PR tree-optimization/88444 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -finline-functions -finline-small-functions -fdump-tree-fixup_cfg3" } */
+/* { dg-final { scan-tree-dump-not " = \\(long int\\) 0;" "fixup_cfg3" } } */
+
+#include "../pr88444.c"
index 52f0310021e558813694d6a98ad56663cfb9d563..8c4c82e54e8bc59908967974ebd4e097279ff9ff 100644 (file)
@@ -4906,7 +4906,7 @@ gimple_expand_calls_inline (basic_block bb, copy_body_data *id)
 static void
 fold_marked_statements (int first, hash_set<gimple *> *statements)
 {
-  for (; first < n_basic_blocks_for_fn (cfun); first++)
+  for (; first < last_basic_block_for_fn (cfun); first++)
     if (BASIC_BLOCK_FOR_FN (cfun, first))
       {
         gimple_stmt_iterator gsi;