This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: flow patch for building ia64


>> On Thu, Jul 26, 2001 at 02:30:52PM -0700, amacleod@cygnus.com wrote:
>> > So... there are 2 solutions. Since this doesn't seem to be 
>> > affecting anything except ia64, the simple thing is to 
>> > not mark the return_address_register as call-killed. b0 is
>> > marked, so I dont think this will have any undesired side effects.
>> 
>> This one is in pricipal correct, but can't actually be used.
>> CALL_USED_REGISTERS *must* include all fixed registers.  This
>> is a bit of historical stupidity that I've not been brave 
>> enough to fix for 3 years now.
>> 
>> I think the best short-term solution is to add an optional
>> CALL_SAVED_FIXED_REGISTERS (or something) that the target can use
>> to communicate what the contents of CALL_USED_REGISTERS ought to
>> be were it not for the historical mistake.
>> 
>> We can then use that in building regs_invalidated_by_call.

So something like this you mean? Which of the magic pseudos
should be clear? 

    /*FP RA CCV UNAT PFS LC EC */

Ive tried clearing them all, and so far so good.
I have a sneaking suspicion thats not correct however :-)

This is really icky. 

What is the real issue as to why CALL_USED must have all the fixed 
registers? Are there simply numerous places which reference call_used 
or some derivitive that also should have FIXED registers or'd in
as well?  Presumably numerous and not trivially available if
you havent tackled it before...? Just wondering how much work it would be 
to do it right...

This solves the problem, and coupled with one of the dfa_dominance fix's
allows ia64 to bootstrap on the trunk.

Andrew


Index: regclass.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/regclass.c,v
retrieving revision 1.124
diff -c -p -r1.124 regclass.c
*** regclass.c	2001/07/20 16:55:03	1.124
--- regclass.c	2001/07/27 15:04:22
*************** HARD_REG_SET losing_caller_save_reg_set;
*** 94,99 ****
--- 94,106 ----
  /* Data for initializing the above.  */
  
  static char initial_call_used_regs[] = CALL_USED_REGISTERS;
+ 
+ /* If this optional macro is specified, we'll use this instead
+    when defining regs_invalidated_by_call.  */
+ 
+ #ifdef CALL_REALLY_USED_REGISTERS
+ static char call_really_used_regs[] = CALL_REALLY_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
*************** init_reg_sets_1 ()
*** 464,470 ****
--- 471,481 ----
        else if (i == PIC_OFFSET_TABLE_REGNUM && flag_pic)
  	;
  #endif
+ #ifdef CALL_REALLY_USED_REGISTERS
+       else if (call_really_used_regs[i] || global_regs[i])
+ #else
        else if (call_used_regs[i] || global_regs[i])
+ #endif
  	SET_HARD_REG_BIT (regs_invalidated_by_call, i);
      }
  
Index: config/ia64/ia64.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/ia64.h,v
retrieving revision 1.78
diff -c -p -r1.78 ia64.h
*** ia64.h	2001/07/25 13:21:49	1.78
--- ia64.h	2001/07/27 15:04:30
*************** while (0)
*** 633,638 ****
--- 633,680 ----
       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 the situation
+    where we have a number of 'symbolic' registers at the end
+    of the fixed register list, but before the first
+    pseudo which can reference various hardware registers at various
+    times. 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, 1, 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,  0,   0,  0, 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]