Message ID | 60fc2780-24f1-4567-a91f-7b227f299621@gmail.com |
---|---|
State | New |
Headers | show |
Series | [committed] Fix previously latent bug in reorg affecting cris port | expand |
> Date: Wed, 3 Jul 2024 12:46:46 -0600 > From: Jeff Law <jeffreyalaw@gmail.com> > The late-combine patch has triggered a previously latent bug in reorg. > > Basically we have a sequence like this in the middle of reorg before we > start relaxing delay slots (cris-elf, gcc.dg/torture/pr98289.c) [...] > Pushing to the trunk momentarily. Thanks for fixing that! One less for me to deal with! I see it in my autotester log, but just as one of many temporary regressions, which happen all the time. FWIW, I have a patch-set for the (other) late-combine regressions in gcc.target/cris, most prominently PR115883. I just have to check one more thing... brgds, H-P PS. That "[committed]" part ends up as part of the committed subject.
> From: Hans-Peter Nilsson <hp@axis.com> > Date: Fri, 12 Jul 2024 02:11:45 +0200 > > > Date: Wed, 3 Jul 2024 12:46:46 -0600 > > From: Jeff Law <jeffreyalaw@gmail.com> > > > The late-combine patch has triggered a previously latent bug in reorg. > > > > Basically we have a sequence like this in the middle of reorg before we > > start relaxing delay slots (cris-elf, gcc.dg/torture/pr98289.c) > > [...] > > > Pushing to the trunk momentarily. JFTR, for cris-elf, this can't be blamed on (to have been exposed by) late-combine, because this appeared with r15-1619-g3b9b8d6cfdf593 "ira: Scale save/restore costs of callee save registers with block frequency", even with -fno-late-combine-instructions. I noticed because I chased another regression, an XPASS, happening for gcc.dg/tree-ssa/loop-1.c which was also caused by that revision. Regarding that commit, checking the generated code for loop-1.c, that XPASS was reflecting a *regression*, not an improvement. To wit, it looks like _foo is no longer stored in a register for cris-elf, but there's no change in the number of saved registers. As coremark results are the same before/after that commit for cris-elf, I'm not going to make a fuss; IOW, not open a PR for the regression. (Phew, one less rabbit-hole. I see that patch exposed as many problems as late-combine!) Still, a heads-up to the author of that patch. Maybe the frequencies are miscalculated for that test-case. I tried to look at regs.h:REG_FREQ_FROM_BB, but it's a mystery to me: its value seems to vary between 1 and 1000, that doesn't seem right, but that macro's used all over the place. Not documented very much though. :( FAOD, not blaming the author of r15-1619-g3b9b8d6cfdf593 here. Also FTR, I had to search a bit to find the patch submission and review. It's in the archives of last October: https://gcc.gnu.org/pipermail/gcc-patches/2023-October/631849.html as mentioned in another message. brgds, H-P
diff --git a/gcc/reorg.cc b/gcc/reorg.cc index 99228a22c69..633099ca765 100644 --- a/gcc/reorg.cc +++ b/gcc/reorg.cc @@ -3409,7 +3409,8 @@ relax_delay_slots (rtx_insn *first) && next && simplejump_or_return_p (next) && (next_active_insn (as_a<rtx_insn *> (target_label)) == next_active_insn (next)) - && no_labels_between_p (insn, next)) + && no_labels_between_p (insn, next) + && !switch_text_sections_between_p (insn, next_active_insn (next))) { rtx label = JUMP_LABEL (next); rtx old_label = JUMP_LABEL (delay_jump_insn);