[PATCH] reloading of subregs

Bernd Schmidt bernds_cb1@t-online.de
Mon May 28 11:06:00 GMT 2007


Rask Ingemann Lambertsen wrote:
>    Fixing testsuite failures on my 16-bit x86 port, I've found
> miscompilation of this simple testcase extracted from
> gcc.c-torture/execute/20020108-1.c:
> 
> long int ashiftsi3_1 (long int x)
> {
>   return x << 1;
> }

[..]
> 
>    Note that the first 8 hard regs are 8 bits wide while the rest are 16
> bits wide. The problem with insn 12 is that reload thinks it can't use
> (subreg:HI (reg:SI 2 a) 0) for reload_out_reg. It happens in push_reload()
> from around line 1097 in reload.c:

[..]
> 
> 
> GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))) = 4
> UNITS_PER_WORD = 2
> hard_regno_nregs[2][SImode] = 4 (8-bit registers)

I don't think this is valid.  If UNITS_PER_WORD is 2, then I'm pretty
certain every hard reg that appears in a multi-word register must be 2
bytes wide.

:REVIEWMAIL:


Bernd
-- 
This footer brought to you by insane German lawmakers.
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif



More information about the Gcc-patches mailing list