https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117111

--- Comment #4 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Kazumoto Kojima from comment #3)
> Created attachment 59330 [details]
> a trial patch
> 
> This patch disables the above splitter after machine reorg pass so to hide
> it from dbr_schedule.  I thought about something like
> dbr_schedule_in_progress first, but it seemed a bit overkill for this
> specific issue.
> Tested devel/sh-lra branch with c/c++ testsuite only.

Thanks for going down the rabbit hole!

I'm a little surprised why the DBR pass would try to split insns in the first
place....

I haven't studied the DBR code in detail, but could it be that it's missing
some validation that the new insns generated by the splitter are still eligible
for delay slot filling?

Or is it that this splitting pattern is violating some implicit general rule to
not generate/modify the insns in such a way?

It's true, this split was supposed to be taken before the DBR pass, not during.
 Not sure why it isn't.

While your patch avoids the bug, maybe it's better to avoid this issue in
another way.  E.g. maybe it's a bug in DBR indeed, or maybe it's better to move
this into an SH-specific RTL pass.

I'll try to investigate a little more.

Reply via email to