jump.c (duplicate_loop_exit_test): Strip REG_WAS_0 notes off all insns we're going...
authorBernd Schmidt <crux@pool.informatik.rwth-aachen.de>
Wed, 7 Oct 1998 09:50:05 +0000 (03:50 -0600)
committerJeff Law <law@gcc.gnu.org>
Wed, 7 Oct 1998 09:50:05 +0000 (03:50 -0600)
* jump.c (duplicate_loop_exit_test): Strip REG_WAS_0 notes off all
insns we're going to copy.
* regclass.c (reg_scan_mark_refs): Don't test X for NULL_RTX.

From-SVN: r22887

gcc/ChangeLog
gcc/jump.c
gcc/regclass.c

index c47326d56083a92d44db86ca9d8e087de22f98de..e176a7e348826233381e0c384774c7697b3072ac 100644 (file)
@@ -21,6 +21,10 @@ Wed Oct  7 02:27:52 1998  Jeffrey A Law  (law@cygnus.com)
        
 Wed Oct  7 01:08:43 1998  Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
 
+       * jump.c (duplicate_loop_exit_test): Strip REG_WAS_0 notes off all
+       insns we're going to copy.
+       * regclass.c (reg_scan_mark_refs): Don't test X for NULL_RTX.
+
        * loop.c (count_one_set): Add prototype.
 
        * caller-save.c (restore_referenced_regs): Lose mode argument.
index 77c3556a8b7fbd5fcc778f613e450381b701c490..967981aef44e4d1b57fd87e4b416ee70c33ca13f 100644 (file)
@@ -480,12 +480,9 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
                                remove_death (dreg, trial);
                                break;
                              }
-#ifdef PRESERVE_DEATH_INFO_REGNO_P
-                       /* Deleting insn could lose a death-note for SREG
-                          so don't do it if final needs accurate
-                          death-notes.  */
-                       if (PRESERVE_DEATH_INFO_REGNO_P (sreg)
-                           && (trial = find_regno_note (insn, REG_DEAD, sreg)))
+
+                       /* Deleting insn could lose a death-note for SREG.  */
+                       if ((trial = find_regno_note (insn, REG_DEAD, sreg)))
                          {
                            /* Change this into a USE so that we won't emit
                               code for it, but still can keep the note.  */
@@ -497,7 +494,6 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
                            XEXP (trial, 1) = NULL_RTX;
                          }
                        else
-#endif
                          delete_insn (insn);
                      }
                  }
@@ -2434,8 +2430,7 @@ duplicate_loop_exit_test (loop_start)
         has a REG_RETVAL or REG_LIBCALL note (hard to adjust)
         is a NOTE_INSN_LOOP_BEG because this means we have a nested loop
         is a NOTE_INSN_BLOCK_{BEG,END} because duplicating these notes
-             are not valid
-           
+             is not valid.
 
      We also do not do this if we find an insn with ASM_OPERANDS.  While
      this restriction should not be necessary, copying an insn with
@@ -2480,6 +2475,10 @@ duplicate_loop_exit_test (loop_start)
          break;
        case JUMP_INSN:
        case INSN:
+         /* The code below would grossly mishandle REG_WAS_0 notes,
+            so get rid of them here.  */
+         while ((p = find_reg_note (insn, REG_WAS_0, NULL_RTX)) != 0)
+           remove_note (insn, p);
          if (++num_insns > 20
              || find_reg_note (insn, REG_RETVAL, NULL_RTX)
              || find_reg_note (insn, REG_LIBCALL, NULL_RTX)
index 793c9ac050ee78540ce89e96967fbdea9adb95dd..cd882df5cd1e74b3337d04a9adbeceb67f388fbf 100644 (file)
@@ -1995,13 +1995,6 @@ reg_scan_mark_refs (x, insn, note_flag, min_regno)
   register rtx dest;
   register rtx note;
 
-  /* This can happen when scanning insns referenced by certain notes.
-
-     It is unclear if we should be scanning such insns; until someone can
-     say for sure this seems like the safest fix.  */
-  if (x == NULL_RTX)
-    return;
-
   code = GET_CODE (x);
   switch (code)
     {