regclass.c (call_really_used_regs): New array for registers which are actually used...
authorAndrew MacLeod <amacleod@redhat.com>
Wed, 1 Aug 2001 21:40:43 +0000 (21:40 +0000)
committerAndrew Macleod <amacleod@gcc.gnu.org>
Wed, 1 Aug 2001 21:40:43 +0000 (21:40 +0000)
2001-08-01  Andrew MacLeod  <amacleod@redhat.com>

* regclass.c (call_really_used_regs): New array for registers which
are actually used by a call.
(init_reg_sets_1): Initialize regs_invalidated_by_call with the
new array.
(fix_register): Set call_really_used too.
* config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): Initialize.
* doc/tm.texi (CALL_REALLY_USED_REGISTERS): Document.

From-SVN: r44558

gcc/ChangeLog
gcc/config/ia64/ia64.h
gcc/doc/tm.texi
gcc/regclass.c

index 75a65020c61742edde01f0bcfd71c9a994fd04e9..6639e9414566fdd85d03f34dee7e4dfd889384a7 100644 (file)
@@ -1,3 +1,13 @@
+2001-08-01  Andrew MacLeod  <amacleod@redhat.com>
+
+       * regclass.c (call_really_used_regs): New array for registers which
+       are actually used by a call.
+       (init_reg_sets_1): Initialize regs_invalidated_by_call with the
+       new array.
+       (fix_register): Set call_really_used too.
+       * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): Initialize.
+       * doc/tm.texi (CALL_REALLY_USED_REGISTERS): Document.
+
 2001-08-01  Richard Henderson  <rth@redhat.com>
 
        * read-rtl.c (read_name): Consider \r whitespace.
index 5bb79e8634ef535927d475d31fc4bd3645448985..0df4ceb8b18489b55c9681aa245ee34b3be1ae99 100644 (file)
@@ -633,6 +633,45 @@ while (0)
      1, 1,  1,   1,  1, 0, 1                           \
 }
 
+/* Like `CALL_USED_REGISTERS' but used to overcome a historical 
+   problem which makes CALL_USED_REGISTERS *always* include
+   all the FIXED_REGISTERS. Until this problem has been 
+   resolved this macro can be used to overcome this situation.
+   In particular, block_propagate() requires this list 
+   be acurate, or we can remove registers which should be live.  
+   This macro is used in regs_invalidated_by_call ()*/
+
+#define CALL_REALLY_USED_REGISTERS \
+{ /* General registers.  */                            \
+  1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1,      \
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,      \
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      \
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      \
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      \
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      \
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      \
+  0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,      \
+  /* Floating-point registers.  */                     \
+  1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,      \
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      \
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,      \
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,      \
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,      \
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,      \
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,      \
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,      \
+  /* Predicate registers.  */                          \
+  1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,      \
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      \
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      \
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      \
+  /* Branch registers.  */                             \
+  1, 0, 0, 0, 0, 0, 1, 1,                              \
+  /*FP RA CCV UNAT PFS LC EC */                                \
+     0, 0,  1,   1,  1, 0, 0                           \
+}
+
+
 /* Define this macro if the target machine has register windows.  This C
    expression returns the register number as seen by the called function
    corresponding to the register number OUT as seen by the calling function.
index ee621aeebfa9e1df3a67a7472e0c0b8185afa517..34bea569d928a7dddc8a9cb1d89b1e4c1566dcf3 100644 (file)
@@ -1700,6 +1700,17 @@ If a register has 0 in @code{CALL_USED_REGISTERS}, the compiler
 automatically saves it on function entry and restores it on function
 exit, if the register is used within the function.
 
+@findex CALL_REALLY_USED_REGISTERS
+@item CALL_REALLY_USED_REGISTERS
+@cindex call-used register
+@cindex call-clobbered register
+@cindex call-saved register
+Like @code{CALL_USED_REGISTERS} except this macro doesn't require 
+that the entire set of @code{FIXED_REGISTERS} be included.  
+(@code{CALL_USED_REGISTERS} must be a superset of @code{FIXED_REGISTERS}).
+This macro is optional.  If not specified, it defaults to the value 
+of @code{CALL_USED_REGISTERS}.
+
 @findex HARD_REGNO_CALL_PART_CLOBBERED
 @item HARD_REGNO_CALL_PART_CLOBBERED (@var{regno}, @var{mode})
 @cindex call-used register
index b16a677d8056648035fd99fa00d13a2c536766fa..9d1fe55b4b5d8e2a975a114042103793be81e4c0 100644 (file)
@@ -94,6 +94,18 @@ HARD_REG_SET losing_caller_save_reg_set;
 /* Data for initializing the above.  */
 
 static char initial_call_used_regs[] = CALL_USED_REGISTERS;
+
+/* This is much like call_used_regs, except it doesn't have to
+   be a superset of FIXED_REGISTERS. This vector indicates
+   what is really call clobbered, and is used when defining 
+   regs_invalidated_by_call.  */
+
+char call_really_used_regs[] = 
+#ifdef CALL_REALLY_USED_REGISTERS
+                               CALL_REALLY_USED_REGISTERS;
+#else
+                               CALL_USED_REGISTERS;
+#endif
   
 /* Indexed by hard register number, contains 1 for registers that are
    fixed use or call used registers that cannot hold quantities across
@@ -464,7 +476,7 @@ init_reg_sets_1 ()
       else if (i == PIC_OFFSET_TABLE_REGNUM && flag_pic)
        ;
 #endif
-      else if (call_used_regs[i] || global_regs[i])
+      else if (call_really_used_regs[i] || global_regs[i])
        SET_HARD_REG_BIT (regs_invalidated_by_call, i);
     }
 
@@ -747,6 +759,8 @@ fix_register (name, fixed, call_used)
        {
          fixed_regs[i] = fixed;
          call_used_regs[i] = call_used;
+         if (fixed == 0)
+           call_really_used_regs[i] = call_used;
        }
     }
   else