combine.c (record_dead_and_set_regs): Use regs_invalidated_by_call.
authorZack Weinberg <zack@codesourcery.com>
Fri, 14 Dec 2001 21:20:03 +0000 (21:20 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Fri, 14 Dec 2001 21:20:03 +0000 (21:20 +0000)
* combine.c (record_dead_and_set_regs): Use
regs_invalidated_by_call.  Don't note stores for CALL_INSNs.

From-SVN: r48009

gcc/ChangeLog
gcc/combine.c

index 09f322a28d6120bebcc64c7d5c6f56aeb5fb3741..e013d73051c58aec4d0a1738ef893b7e0c583b70 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-14  Zack Weinberg  <zack@codesourcery.com>
+
+       * combine.c (record_dead_and_set_regs): Use
+       regs_invalidated_by_call.  Don't note stores for CALL_INSNs.
+
 2001-12-14  Roger Sayle <roger@eyesopen.com>
 
        * builtins.def: Rename BUILT_IN_FSQRT to BUILT_IN_SQRT and
index eb61c49ecfaa93c25fce51bae6ff8ea814f9a99f..82e86b2816e051a7071c71ca8c62ddaa9da51f59 100644 (file)
@@ -11202,7 +11202,7 @@ record_dead_and_set_regs (insn)
   if (GET_CODE (insn) == CALL_INSN)
     {
       for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
-       if (call_used_regs[i])
+       if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
          {
            reg_last_set_value[i] = 0;
            reg_last_set_mode[i] = 0;
@@ -11212,6 +11212,13 @@ record_dead_and_set_regs (insn)
          }
 
       last_call_cuid = mem_last_set = INSN_CUID (insn);
+
+      /* Don't bother recording what this insn does.  It might set the
+        return value register, but we can't combine into a call
+        pattern anyway, so there's no point trying (and it may cause
+        a crash, if e.g. we wind up asking for last_set_value of a
+        SUBREG of the return value register).  */
+      return;
     }
 
   note_stores (PATTERN (insn), record_dead_and_set_regs_1, insn);