Hi,
PR62151 is about wrong code generated on x86_641, which starts from
one of my checkin. I did some investigation, now can confirm it's
another latent bug in combine pass as analyzed by comment#7 in the PR.
Here is a patch can fix the problem, as well as the code given in the
comment. It passes bootstrap on x86_64, but the problem is code in
that part of combine is kind of ad-hoc implemented. To be honest, I
don't fully understand it, so it would be better to have some combine
pass experts look into it and give some comments.
Thanks,
bin
Index: gcc/combine.c
===================================================================
--- gcc/combine.c (revision 214083)
+++ gcc/combine.c (working copy)
@@ -13489,7 +13489,13 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3
|| rtx_equal_p (XEXP (note, 0), elim_i1)
|| rtx_equal_p (XEXP (note, 0), elim_i0))
break;
- tem = i3;
+
+ if (from_insn && i2
+ && from_insn != i2 && from_insn != i3
+ && reg_set_p (XEXP (note, 0), PATTERN (i2)))
+ tem = i2;
+ else
+ tem = i3;
}
if (place == 0)