trying to build quake3 on ia64 ... reduced test case looks like this: $ gcc -O2 -c sym.c sym.c: In function `vtoa': sym.c:28: error: unable to find a register to spill in class `FR_REGS' sym.c:28: error: this is the insn: (insn 12 3 13 0 (set (reg:DF 134 f6 [343]) (float_truncate:DF (subreg:XF (reg/v:TI 112 in0 [orig:340 v ] [340]) 0))) 39 {truncxfdf2} (insn_list 3 (nil)) (expr_list:REG_DEAD (reg/v:TI 112 in0 [orig:340 v ] [340]) (nil))) sym.c:28: confused by earlier errors, bailing out tested Gentoo 3.3.2 / 3.3.6 / 3.4.4 / 4.0.2, all fail same way
Created attachment 10138 [details] reduced test case, sym.c
Created attachment 10139 [details] full test case from quake3 source quake3-register-spill-insn.tar.bz2
I cannot reproduce this on the mainline. Are you sure that this is not due to a modification that gentoo has done?
i had a SuSE guy report the samething, but i'll go ahead and rebuild a vanilla 4.0.2 to be sure
ok, gcc-4.0.2 on Gentoo with no Gentoo patches fails same way i'll see about creating a Debian chroot to doubly verify
Then maybe this has been fixed in 4.1.0 already.
if that's the case, since this doesnt seem to be a regression (unless it worked in like 3.2.x or older), does that mean i'm sol with 3.4.x/4.0.x ? :)
yes, debian 3.3.6-10 (3.3.6) and 3.4.4-9 (3.4.5 20051015) both fail in the same way ... debian's 4.0.3 (4.0.3 20051023) however fails in a different way: sym.c: In function 'vtoa': sym.c:28: internal compiler error: in find_valid_class, at reload.c:719 Please submit a full bug report, i'll see about installing gcc-4.1 on my Gentoo box
A shorter testcase (which at least breaks on SuSEs 3.3-hammer compiler) is: --------------------------------------- typedef union value { long double d; } Value; double ld2d(Value v) { return v.d; } --------------------------------------- The problem seems to be that the register containing the union is TImode, which gets converted to TFmode via subreg, which in turn is truncated to DFmode via float_truncate, which somehow confuses gcc.
Hmm, do we have an ABI change in 4.1: We get in 4.1.0: ld2d: .prologue .body fnorm.d f8 = f8 br.ret.sptk.many b0
You mean ABI change, because the input register seems to be f8, instead of in0 (as would be need for this union)? I'm not sure, but it looks fishy at least.
(In reply to comment #11) > You mean ABI change, because the input register seems to be f8, instead of > in0 (as would be need for this union)? I'm not sure, but it looks fishy > at least. Actually it is not an ABI change as the 3.4's RTL looks like: (insn 3 2 4 (set (reg/v:TI 340 [ v ]) (reg:TI 136 f8 [ v ])) -1 (nil) (nil)) so it comes in as f8. Note 4.0.3 20051105 fails the same way as your 4.0.3 does So closing as fixed as this is not a regression. Note gcc 4.1 produces the RTL as: (insn 6 11 7 0 (set (reg:XF 340) (reg:XF 136 f8 [ v ])) -1 (nil) (nil)) Which is in the correct mode right away.