This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[new regalloc]: Spill for SImode down in FP regs
- From: "Hartmut Penner" <HPENNER at de dot ibm dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 13 Jun 2002 08:55:14 +0200
- Subject: [new regalloc]: Spill for SImode down in FP regs
Hello,
I think, I have found the problem for the bootstrap failure for the
s390 compiler on the reg-alloc branch:
The compiler produces a insn (set (reg:SI 6 %r6) (reg:SI 17 %f2)) which
does not satisfy it's constraints,
since s390 has no instruction loading a floating point register into a
general purpose register.
This insn is introduced by the ra for a spill. The function
'remember_web_was_spilled' ignores the
preferred regclass and set the regclass to 'ALL_REGS'.
This leads to insn above. The detailed comment in
'remember_web_was_spilled' gives the rationals for doing
so, in short an 'over and over spill' of a single register class like
'AREG' on ia32 should be prevented.
For s390 (and maybe other architecture), the regclass should in this
specific case only be widened to
GENERAL_REGS.
The following curcumvention for a circumvention let gcc bootstrap on s390:
Index: ra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/ra.c,v
retrieving revision 1.1.2.55
diff -c -p -r1.1.2.55 ra.c
*** ra.c 7 May 2002 20:53:30 -0000 1.1.2.55
--- ra.c 13 Jun 2002 06:49:27 -0000
*************** remember_web_was_spilled (web)
*** 3462,3468 ****
alternatives needs applying. Currently this is dealt with by reload, as
many other things, but at some time we want to integrate that
functionality into the allocator. */
! COPY_HARD_REG_SET (web->usable_regs, reg_class_contents[(int) ALL_REGS]);
AND_COMPL_HARD_REG_SET (web->usable_regs, never_use_colors);
prune_hardregs_for_mode (&web->usable_regs, PSEUDO_REGNO_MODE (web->regno));
web->num_freedom = hard_regs_count (web->usable_regs);
--- 3462,3469 ----
alternatives needs applying. Currently this is dealt with by reload, as
many other things, but at some time we want to integrate that
functionality into the allocator. */
! if (hard_regs_count (web->usable_regs) < 2)
! COPY_HARD_REG_SET (web->usable_regs, reg_class_contents[(int) ALL_REGS]);
AND_COMPL_HARD_REG_SET (web->usable_regs, never_use_colors);
prune_hardregs_for_mode (&web->usable_regs, PSEUDO_REGNO_MODE (web->regno));
web->num_freedom = hard_regs_count (web->usable_regs);
Mit freundlichem Gruß / Best regards,
Hartmut Penner
GCC for S/390 Development
Internet Mail Address : hpenner@de.ibm.com
Tel: (49)-7031-16-4364