This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [rtl, delay-slot] Fix overload of "unchanging" bit
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, bernds at codesourcery dot com, hp at axis dot com, ebotcazou at libertysurf dot fr, kkojima at gcc dot gnu dot org, nickc at redhat dot com
- Date: Sat, 20 Aug 2011 19:56:04 +0100
- Subject: Re: [rtl, delay-slot] Fix overload of "unchanging" bit
- References: <4E4D96C9.9080103@redhat.com>
Richard Henderson <rth@redhat.com> writes:
> As found by a c6x build failure, INSN_ANNULLED_BRANCH_P and RTL_CONST_CALL_P
> both resolve to the same bit for CALL_INSNs. I want to fix this by
> restricting INSN_ANNULLED_BRANCH_P to JUMP_INSNs, since annulling the slots
> for a call or a plain insn doesn't really make sense.
>
> The following has passed stage2-gcc on sparc64-linux host (full build still
> in progress), with --enable-checking=yes,rtl. It surely needs more than that,
> and I'm asking for help from the relevant maintainers to give this a try.
'spect you'll have noticed this by now, but there was a typo in:
> + rtx annul_p = JUMP_P (control) && INSN_ANNULLED_BRANCH_P (control);
(should be bool). Otherwise it tests fine on mips64-linux-gnu with the
additional patch below, which I've just applied.
Richard
gcc/
* config/mips/mips.c (mips_reorg_process_insns): Check for jumps
before checking for annulled branches.
Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c 2011-08-20 19:44:06.000000000 +0100
+++ gcc/config/mips/mips.c 2011-08-20 19:44:44.000000000 +0100
@@ -14831,6 +14831,7 @@ mips_reorg_process_insns (void)
executed. */
else if (recog_memoized (insn) == CODE_FOR_r10k_cache_barrier
&& last_insn
+ && JUMP_P (SEQ_BEGIN (last_insn))
&& INSN_ANNULLED_BRANCH_P (SEQ_BEGIN (last_insn)))
delete_insn (insn);
else