Re: [PATCH] ext-dce: Avoid multi-register paradoxical subregs for reload [PR122438]

Karl Mehltretter <[email protected]> Sat, 1 Aug 2026 09:48:36 +0200
Newsgroups gmane.comp.gcc.patches
Message-ID <[email protected]>
On Fri, Jul 31, 2026 at 08:33:31PM +0100, Jeffrey Law wrote:
> This seems like it's just working around bugs elsewhere, particularly the
> targets and/or reload.   But that's a first glance at the patch.
> 
> What I would want to see to approve this is an analysis indicating how/why
> the transformed RTL is incorrect.
> 

Yes, it is a workaround for classic reload.

I don't think the transformed RTL is incorrect.

Michael Matz did an analysis in PR122438 comment 9
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122438#c9): ext-dce
"should probably be dumbed down a bit when reload is used"

There is already a similar workaround in the code:
non_conflicting_reg_copy_p in ira-lives.cc is disabled for
reload targets, see PR87600.

This bug has hit several people since GCC 15: sqlite3 and the Linux
kernel in PR122438, libstdc++ in PR119953, and the kernel again in
PR120070, which is how I found it.

I forgot to list PR120070 as fixed too.  I can add it in a v2
with a testcase.

This patch can be backported to 15 and 16.

Thanks,
Karl