> From: Jamie Prescott <[email protected]>
> To: [email protected]
> Sent: Friday, May 15, 2009 3:28:18 PM
> Subject: Different reload behavior from 4.3.3 to 4.4
>
>
> In my VM, the X_REGS class is a generic 64bit regsiter class that can hold
> both 64bit DImode and 64bit DFmode.
> Such class does not allow direct constant loading, so in 4.3.3 I had:
>
> enum reg_class
> xxx_preferred_reload_class(rtx x, enum reg_class regclass)
> {
> enum machine_mode mode = GET_MODE(x);
>
> if (regclass == NO_REGS ||
> ((GET_CODE(x) == CONST_INT ||
> GET_CODE(x) == CONST_DOUBLE) && regclass == X_REGS))
> return NO_REGS;
> switch (mode) {
> case DImode:
> case SFmode:
> case DFmode:
> return X_REGS;
> default:
> break;
> }
>
> return regclass;
> }
>
> This was working fine with 4.3.3, while with 4.4 I get an error like if GCC
> was
> trying
> to load a const_int directly anyway:
>
> ./csrc/test_sha512.c:294: error: insn does not satisfy its constraints:
> (insn 870 869 43 2 ./csrc/test_sha512.c:200 (set (reg:DI 55 x0)
> (const_int 7640891576956012808 [0x6a09e667f3bcc908])) 31 {movdi}
> (nil))
> ./csrc/test_sha512.c:294: internal compiler error: in
> reload_cse_simplify_operands, at postreload.c:396
Strange thing, this works:
<<<<<<<<
extern int loola(long long);
int noola(void)
{
return loola(19291291912LL);
}
>>>>>>>>
$LC0:
qword 19291291912
_noola:
push r8
lea $LC0,r8
ldr.q r8,x0
call _loola
pop r8
ret
While this chokes:
<<<<<<<<<
struct ff {
long long ll[4];
};
void noola(struct ff *p)
{
p->ll[0] = 19291291912LL;
}
>>>>>>>>>
ainl.c: In function 'noola':
ainl.c:11: error: insn does not satisfy its constraints:
(insn 17 16 6 2 ainl.c:10 (set (reg:DI 55 x0)
(const_int 19291291912 [0x47dd9c108])) 31 {movdi} (nil))
ainl.c:11: internal compiler error: in reload_cse_simplify_operands, at
postreload.c:396