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.
Signed-off-by: Kyrylo Tkachov <[email protected]>
---
gcc/compare-elim.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/compare-elim.cc b/gcc/compare-elim.cc
index 723f9e31c79..6218324e1ab 100644
--- a/gcc/compare-elim.cc
+++ b/gcc/compare-elim.cc
@@ -465,7 +465,7 @@ find_comparison_dom_walker::before_dom_children (basic_block bb)
FOR_EACH_EDGE (e, ei, bb->succs)
{
basic_block dest = e->dest;
- if (bitmap_bit_p (df_get_live_in (bb), targetm.flags_regnum)
+ if (bitmap_bit_p (df_get_live_in (dest), targetm.flags_regnum)
&& !single_pred_p (dest))
{
last_cmp->missing_uses = true;
--
2.50.1 (Apple Git-155)
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.