gcc dhd

David Huggins-Daines dhd@puffin.external.hp.com
Thu, 31 Aug 2000 15:52:00 -0600

CVSROOT:	/home/cvs/parisc
Module name:	gcc
Changes by:	dhd	00/08/31 15:52:00

Modified files:
	gcc            : reload.c 

Log message:
Re-merge from sourceware to fix glibc compile problems that look (sort
of) like this:

getusershell.c: In function `initshells':
getusershell.c:136: Unable to find a register to spill in class `R1_REGS'.
getusershell.c:136: This is the insn:

(insn 176 175 177 (set (reg:DI 129)
(mult:DI (zero_extend:DI (mem/s:SI (plus:SI (reg:SI 3 %r3)
(const_int 52 [0x34])) 0))
(const_double (const_int 0 [0x0]) -1431655765 [0xaaaaaaab] 0 [0x0]))) 175 {umulsidi3+1} (nil)
getusershell.c:136: Internal compiler error in spill_failure, at reload1.c:1815

This insn eventually compiles out (when GCC isn't broken) to something
like this:

addil LT'shells,%r19
copy %r1,%r3
ldw RT'shells(%r3),%r3
ldo -140(%r30),%r1
fldws 0(%r1),%fr24L
addil LT'.LC4,%r19
ldw RT'.LC4(%r1),%r1
fldds 0(%r1),%fr23
xmpyu %fr24L,%fr23R,%fr22
fstws %fr22L,-16(%r30)
ldw -16(%r30),%r1

The problem is that GCC (see push_secondary_reload, reload.c line 485)
sometimes tries to reuse reloads of %r1 when it shouldn't.

Formerly it would mark the secondary reloads to %r1 in the above insn
as RELOAD_FOR_INPUT (see the hunk at line 400), which made them
mergeable (see the MERGABLE_RELOADS() macro) and is also obviously
wrong since they are part of the addresses of the input operands to
the multiplication.

This seems to have bitten the Super-H as well, see gcc-patches
(subject 'reload bugfix')