This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, rtl]: Fix PR42511, bootstrap error in stage3 on alpha-linux-gnu
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Eric Botcazou <ebotcazou at adacore dot com>
- Date: Thu, 7 Jan 2010 12:21:10 +0100
- Subject: [PATCH, rtl]: Fix PR42511, bootstrap error in stage3 on alpha-linux-gnu
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)));