Fix crashes in split_all_insns
authorBernd Schmidt <bernds@redhat.co.uk>
Tue, 31 Oct 2000 10:06:49 +0000 (10:06 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Tue, 31 Oct 2000 10:06:49 +0000 (10:06 +0000)
From-SVN: r37155

gcc/ChangeLog
gcc/recog.c

index 39ddefc3e801789c8ac1e3f983bdb7f71b1a9f27..0bb9420b4c11f99daa81e30e9473fb57237ef7fd 100644 (file)
        Renumber case labels to match the _mm_prefetch constants defined in
        xmmintrin.h.
 
+       * recog.c (split_all_insns): Don't try to call cleanup_subreg_operands
+       if the splitter didn't emit new insns.
+       Make sure we call cleanup_subreg_operands even when splitting the last
+       insn in a basic block.
+
 2000-10-30  Neil Booth  <neilb@earthling.net>
 
        * cppfiles.c (stack_include_file): Check for stacked contexts
index 5c45cdb683e7c93a69eb958d3fa8125636e738a0..b7cc2b7377df074248f279498dfd12ad59bef804 100644 (file)
@@ -2747,29 +2747,31 @@ split_all_insns (upd_life)
                  changed = 1;
 
                  /* try_split returns the NOTE that INSN became.  */
-                 first = NEXT_INSN (first);
                  PUT_CODE (insn, NOTE);
                  NOTE_SOURCE_FILE (insn) = 0;
                  NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
 
+                 /* ??? Coddle to md files that generate subregs in post-
+                    reload splitters instead of computing the proper 
+                    hard register.  */
+                 if (reload_completed && first != last)
+                   {
+                     first = NEXT_INSN (first);
+                     while (1)
+                       {
+                         if (INSN_P (first))
+                           cleanup_subreg_operands (first);
+                         if (first == last)
+                           break;
+                         first = NEXT_INSN (first);
+                       }
+                   }
+
                  if (insn == bb->end)
                    {
                      bb->end = last;
                      break;
                    }
-
-                 /* ??? Coddle to md files that generate subregs in post-
-                    reload splitters instead of computing the proper 
-                    hard register.  */
-                 if (reload_completed)
-                   while (1)
-                     {
-                       if (INSN_P (first))
-                         cleanup_subreg_operands (first);
-                       if (first == last)
-                         break;
-                       first = NEXT_INSN (first);
-                     }
                }
            }