This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
new register allocator and HARD_REGNO_CALL_PART_CLOBBERED
- From: hermantenbrugge at home dot nl (Herman ten Brugge)
- To: gcc at gcc dot gnu dot org
- Date: Wed, 30 Apr 2003 21:31:21 +0200 (CEST)
- Subject: new register allocator and HARD_REGNO_CALL_PART_CLOBBERED
Hello,
I found a problem with the -fnew-ra option of the compiler. I analysed
the problem and found that the macro HARD_REGNO_CALL_PART_CLOBBERED
is not used by the new register allocator.
I think this is also a bit difficult to implement because we now
have to check the mode for every register that is used during a CALL_INSN.
I currently made a local patch for the c4x target that seems to bypass
the problem. I simply make the effected registers call_used so they
can not be used accross a call. This is less optimal for the c4x
target but is works. The sh target is the only other target that
is using HARD_REGNO_CALL_PART_CLOBBERED at the moment. A simular
patch is also possible for that target.
Can some one with more understanding of the new register allocator
have a look at this problem.
Herman.
--- c4x.h 2003-04-30 21:06:40.000000000 +0200
+++ c4x.h.new 2003-04-30 21:07:55.000000000 +0200
@@ -571,12 +573,23 @@ extern const char *c4x_rpts_cycles_strin
#define CONDITIONAL_REGISTER_USAGE \
{ \
+ extern int flag_new_regalloc; \
if (! TARGET_BK) \
{ \
fixed_regs[BK_REGNO] = 1; \
call_used_regs[BK_REGNO] = 1; \
c4x_regclass_map[BK_REGNO] = NO_REGS; \
} \
+ /* HACK. HARD_REGNO_CALL_PART_CLOBBERED should be \
+ checked in the new regalloc pass! */ \
+ if (flag_new_regalloc) \
+ { \
+ call_used_regs[R4_REGNO] = 1; \
+ call_used_regs[R5_REGNO] = 1; \
+ call_used_regs[R6_REGNO] = 1; \
+ call_used_regs[R7_REGNO] = 1; \
+ call_used_regs[R8_REGNO] = 1; \
+ } \
if (TARGET_C3X) \
{ \
int i; \