On 5/1/23 17:37, Roger Sayle wrote:

Jeff Law wrote:
This patch converts the xstormy16 patch to LRA.  It introduces a code
quality regression in the shiftsi testcase, but it also fixes numerous
aborts/errors.  IMHO it's a good tradeoff.

I've investigated the shiftsi regression on xstormy16 and the underlying
cause
appears to be an interaction between lower-subreg's "subreg3" pass and the
new LRA.  Previously, reload was not phased by the "clobbers" that are
introduced by the decompose_multiword_subregs function, but they appear
to interfere with LRA's register assignments.

combine's make_extra_copies introduces a new pseudo-to-pseudo move,
but when subreg3 inserts a naked clobber between the original and the
new move, LRA is recombine theses pseudos back to the same allocno.

The shiftsi.cc regression on xstormy16 is fixed by adding
-fno-split-wide-types.
In fact, if all the regression tests pass, I'd suggest that
flag_split_wide-types = false
should be the default on xstormy16 now that we've moved to LRA.  And if this
works for xstormy16, it might be useful to other targets for the LRA
transition;
it's a difference in behaviour between reload and LRA that could potentially
affect multiple targets.

For reference, xstormy16 has a post-reload define_insn_and_split for movsi
(i.e. a multi-word move).  If this insn was split during split1 (i.e. before
subreg3)
there wouldn't be a problem (no clobber), but alas the target's
xstormy16_split_move
function has several asserts insisting this only get called when
reload_completed.

I hope this is useful.
It is.

FWIW, turning that on by default for xstormy results in two new fails, but also in two new passes:

Tests that now fail, but worked before (2 tests):

xstormy16-sim: gcc.dg/ipa/iinline-attr.c scan-ipa-dump inline "hooray[^\\n]*inline 
copy in test"
xstormy16-sim: gcc.dg/setjmp-1.c spurious clobbered warning (test for bogus 
messages, line 17)

Tests that now work, but didn't before (2 tests):

xstormy16-sim: gcc.target/xstormy16/shiftsi.c --save-temps -fno-inline-functions -L/home/jlaw/jenkins/workspace/xstormy16-elf/gcc/gcc/testsuite/gcc.target/xstormy16 scan-assembler-not mov xstormy16-sim: gcc.target/xstormy16/zextendhisi2.c --save-temps -fno-inline-functions -L/home/jlaw/jenkins/workspace/xstormy16-elf/gcc/gcc/testsuite/gcc.target/xstormy16 scan-assembler mov r3,#0

What I find interesting is the two failures are in generic code. Definitely unexpected.

jeff

Reply via email to