On Wed, Oct 12, 2022 at 1:01 AM Eric Botcazou via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > Hi, > > the recent optimization implemented for complex modes in: > https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595865.html > contains an oversight for big-endian platforms in the "interesting corner > case" mentioned in the message: it uses a lowpart SUBREG when the integer > modes have different sizes, but this does not match the semantics of the > PARALLELs which have a bundled byte offset; this offset is always zero in the > code path and the lowpart is not at offset zero on big-endian platforms. > > Calling validate_subreg with this zero offset would fix the regression by > disabling the optimization on big-endian platforms, so instead the attached > fix adds the appropriate right shift for them. > > This fixes the following regressions in the C testsuite on SPARC64/Linux: > FAIL: gcc.c-torture/execute/20041124-1.c -O0 execution test > FAIL: gcc.c-torture/execute/20041124-1.c -O1 execution test > FAIL: gcc.c-torture/execute/20041124-1.c -O2 execution test > FAIL: gcc.c-torture/execute/20041124-1.c -O2 -flto -fno-use-linker-plugin - > flto-partition=none execution test > FAIL: gcc.c-torture/execute/20041124-1.c -O2 -flto -fuse-linker-plugin -fno- > fat-lto-objects execution test > FAIL: gcc.c-torture/execute/20041124-1.c -O3 -g execution test > FAIL: gcc.c-torture/execute/20041124-1.c -Os execution test > FAIL: gcc.dg/compat/struct-by-value-11 c_compat_x_tst.o-c_compat_y_tst.o > execute > FAIL: gcc.dg/compat/struct-by-value-12 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 > > Tested on SPARC64/Linux, OK for the mainline?
OK. Thanks, Richard. > > 2022-10-11 Eric Botcazou <ebotca...@adacore.com> > > * expr.cc (emit_group_stote): Fix handling of modes of different > sizes for big-endian targets in latest change and add commentary. > > -- > Eric Botcazou