Re: [PATCH 1/2] compare-elim: Test the successor's live-in set for the flags register

Jeffrey Law <[email protected]>
Newsgroups gmane.comp.gcc.patches
Message-ID <[email protected]>

On 8/9/2026 1:25 PM, [email protected] wrote:
> From: Kyrylo Tkachov <[email protected]>
>
> find_comparisons_in_bb looks for a flags value that is live out of BB and
> live into a successor that is not part of the extended basic block.  The
> edge walk computes DEST but then queries the live-in set of BB rather than
> of DEST, so the answer says nothing about the successor being examined.
> The pass can therefore leave missing_uses clear for a comparison whose
> flags really are used in a join block.
>
> The test read DF_LIVE_BB_INFO (dest)->in when the pass was added in
> r169131.  r179749 mechanically converted the accessors and changed DEST to
> BB at the same time.  Restore the original test.
>
> The condition is only reachable when the flags register is live across a
> basic block boundary, which is why this has gone unnoticed.
>
> Bootstrapped and tested on aarch64-none-linux-gnu.
> Ok for trunk?
> Thanks,
> Kyrill
>
> gcc/ChangeLog:
>
> 	* compare-elim.cc (find_comparisons_in_bb): Test the live-in set
> 	of the successor block rather than of the current block.
OK.   Guessing the testcase in patch #2 of the series actually tests this?

Jeff
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.