[PATCH, rtl]: Fix PR42511, bootstrap error in stage3 on alpha-linux-gnu

Uros Bizjak ubizjak@gmail.com
Thu Jan 7 11:21:00 GMT 2010


Hello!

As shown in the PR (and discussed there in length), if-convert
sometimes moves instructions from after to before a conditional jump.
Some REG_EQUAL are no longer true after this transformation, yet they
are not removed [a quote from PR 21767, actually]. The fix for PR
21767 removes these invalid REG_EQUAL notes for cases where assignment
is !function_invariant_p. As shown in PR 42511, this fix is not enough
and should also apply to cases, where note itself is
!function_invariant_p.

Attached patch adds this missing condition to REG_EQUAL removal code.

2010-01-07  Uros Bizjak  <ubizjak@gmail.com>

	PR target/42511
	* ifcvt.c (dead_or_predicable): Also remove REG_EQUAL note when
	note itself is not function_invariant_p.

Thanks to Eric for suggesting less broad condition for note removal.

Patch was tested on x86_64-linux-gnu and alphaev68-linux-gnu. Also,
--host=--build=--target=alpha-linux-gnu was bootstrapped OK.

OK for mainline, 4.3 and 4.4 ?

Uros.

Index: ifcvt.c
===================================================================
--- ifcvt.c	(revision 155686)
+++ ifcvt.c	(working copy)
@@ -4087,7 +4087,8 @@ dead_or_predicable (basic_block test_bb,
 	  if (! note)
 	    continue;
 	  set = single_set (insn);
-	  if (!set || !function_invariant_p (SET_SRC (set)))
+	  if (!set || !function_invariant_p (SET_SRC (set))
+	      || !function_invariant_p (XEXP (note, 0)))
 	    remove_note (insn, note);
 	} while (insn != end && (insn = NEXT_INSN (insn)));



More information about the Gcc-patches mailing list