OSDN Git Service

* config/i386/i386.c (bdesc_args) [IX86_BUILTIN_CVTTPD2DQ256]: Use
[pf3gnuchains/gcc-fork.git] / gcc / df-problems.c
index e5b88e3..8928454 100644 (file)
@@ -906,6 +906,7 @@ df_lr_local_compute (bitmap all_blocks ATTRIBUTE_UNUSED)
      blocks within infinite loops.  */
   if (!reload_completed)
     {
+      unsigned int pic_offset_table_regnum = PIC_OFFSET_TABLE_REGNUM;
       /* Any reference to any pseudo before reload is a potential
         reference of the frame pointer.  */
       bitmap_set_bit (&df->hardware_regs_used, FRAME_POINTER_REGNUM);
@@ -919,9 +920,9 @@ df_lr_local_compute (bitmap all_blocks ATTRIBUTE_UNUSED)
 
       /* Any constant, or pseudo with constant equivalences, may
         require reloading from memory using the pic register.  */
-      if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
-         && fixed_regs[PIC_OFFSET_TABLE_REGNUM])
-       bitmap_set_bit (&df->hardware_regs_used, PIC_OFFSET_TABLE_REGNUM);
+      if (pic_offset_table_regnum != INVALID_REGNUM
+         && fixed_regs[pic_offset_table_regnum])
+       bitmap_set_bit (&df->hardware_regs_used, pic_offset_table_regnum);
     }
 
   EXECUTE_IF_SET_IN_BITMAP (df_lr->out_of_date_transfer_functions, 0, bb_index, bi)
@@ -3095,6 +3096,7 @@ static void
 dead_debug_reset (struct dead_debug *debug, unsigned int dregno)
 {
   struct dead_debug_use **tailp = &debug->head;
+  struct dead_debug_use **insnp = &debug->head;
   struct dead_debug_use *cur;
   rtx insn;
 
@@ -3112,9 +3114,25 @@ dead_debug_reset (struct dead_debug *debug, unsigned int dregno)
            debug->to_rescan = BITMAP_ALLOC (NULL);
          bitmap_set_bit (debug->to_rescan, INSN_UID (insn));
          XDELETE (cur);
+         /* If the current use isn't the first one attached to INSN, go back
+            to this first use.  We assume that the uses attached to an insn
+            are adjacent.  */                                                                       
+         if (tailp != insnp && DF_REF_INSN ((*insnp)->use) == insn)
+           tailp = insnp;
+         /* Then remove all the other uses attached to INSN.  */
+         while ((cur = *tailp) && DF_REF_INSN (cur->use) == insn)
+           {
+             *tailp = cur->next;
+             XDELETE (cur);
+           }
+         insnp = tailp;
        }
       else
-       tailp = &(*tailp)->next;
+       {
+         if (DF_REF_INSN ((*insnp)->use) != DF_REF_INSN (cur->use))
+           insnp = tailp;
+         tailp = &(*tailp)->next;
+       }
     }
 }
 
@@ -3173,7 +3191,10 @@ dead_debug_insert_before (struct dead_debug *debug, unsigned int uregno,
        tailp = &(*tailp)->next;
     }
 
-  gcc_assert (reg);
+  /* We may have dangling bits in debug->used for registers that were part
+     of a multi-register use, one component of which has been reset.  */
+  if (reg == NULL)
+    return;
 
   /* Create DEBUG_EXPR (and DEBUG_EXPR_DECL).  */
   dval = make_debug_expr_from_rtl (reg);
@@ -3355,7 +3376,7 @@ df_note_bb_compute (unsigned int bb_index,
       while (*mws_rec)
        {
          struct df_mw_hardreg *mws = *mws_rec;
-         if ((DF_MWS_REG_DEF_P (mws))
+         if (DF_MWS_REG_USE_P (mws)
              && !df_ignore_stack_reg (mws->start_regno))
            {
              bool really_add_notes = debug_insn != 0;