On Sat, 2020-01-25 at 15:14 +0100, Hans-Peter Nilsson wrote: > Compared to the cc0 version, I noticed a regression in > delay-slot-filling for CRIS for several functions in libgcc with > a similar layout, one being lshrdi3, where with cc0 all > delay-slots were filled, as exposed by the test-case. I ended > up including the thankfully-small lshrdi3 as-is, for simplicity > of testing, after failing to cook up an artificial test-case. > > There's one slot that fails to be filled for the decc0rated CRIS > port. A gdb session shows it is because of the automatic > inclusion of TARGET_FLAGS_REGNUM in "registers needed at the end > of the function" because there are insns in the epilogue that > clobber the condition-code register. I'm not trying to tell a > clobber from a set, as parallels with set instead of clobber > seems likely to happen too, for targets with TARGET_FLAGS_REGNUM > set. > > Other targets with delay-slots and one dedicated often-clobbered > condition-code-register should consider defining > TARGET_FLAGS_REGNUM. I noticed it improved delay-slot-filling > also in other situations than this. (Author of introduction of > TARGET_FLAGS_REGNUM use in dbr is CC:ed.) > > Tested cris-elf. > > Ok to commit or perhaps wait to gcc11? > > (The test-case goes in either way, as it passes with cc0-CRIS.) > > gcc: > * resource.c (init_resource_info): Filter-out TARGET_FLAGS_REGNUM > from end_of_function_needs. > > gcc/testsuite: > * gcc.target/cris/pr93372-1.c: New. Looks reasonable to me. I'd probably wait for gcc-11 though out of an abundance of caution.
jeff >