This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Committed] PR17959: Use paradoxical SUBREGs in emit_group_store
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 11 Apr 2006 15:54:44 +0200
- Subject: Re: [Committed] PR17959: Use paradoxical SUBREGs in emit_group_store
- References: <Pine.LNX.4.44.0603300959070.15175-100000@www.eyesopen.com>
> Instead of initializing the desination to zero, and subsequently
> filling the upper and lower parts, the patch below tweaks expr.c's
> emit_group_store to identify which incoming register will form
> the lowpart of the result, and then uses a paradoxical SUBREG to
> initialize the destination, and the fills the uppers parts as before.
This appears to badly interact with the usual PARALLEL idiom:
(gdb) p debug_rtx(src)
(parallel:DI [
(expr_list:REG_DEP_TRUE (reg:SF 32 %f0)
(const_int 0 [0x0]))
])
(gdb) p debug_rtx(dst)
(reg:DI 107 [ D.2717 ])
used to move the contents of (reg:SF 32 %f0) to the high part of (reg:DI 107)
on SPARC, now it moves it to the low part.
In particular, the test
bytepos = subreg_lowpart_offset (outer, inner);
if (INTVAL (XEXP (XVECEXP (src, 0, start), 1)) == bytepos)
looks suspicious to me since 'bytes' is always 0 for a paradoxical subreg.
That's the cause of the following failures on SPARC 64-bit:
FAIL: tmpdir-gcc.dg-struct-layout-1/t026 c_compat_x_tst.o-c_compat_y_tst.o
execute
FAIL: tmpdir-gcc.dg-struct-layout-1/t027 c_compat_x_tst.o-c_compat_y_tst.o
execute
Testcase attached.
--
Eric Botcazou
struct S2439 { unsigned long long int a[0];float b; };
struct S2439 s2439;
extern struct S2439 a2439[5];
extern struct S2439 check2439 (struct S2439, struct S2439 *, struct S2439);
extern void check2439va (int i, ...);
extern void checkx2439 (struct S2439);
void test2439 (void)
{
s2439.b = -41742.765625;
checkx2439 (check2439 (s2439, &a2439[1], a2439[2]));
}