This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: PATCH: PR rtl-optimization/45865: [4.6 Regression] ifcvt/crossjump failed to mark return jump
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: Jason Merrill <jason at redhat dot com>, Bernd Schmidt <bernds at codesourcery dot com>, Jeff Law <law at redhat dot com>, Eric Botcazou <ebotcazou at adacore dot com>, gcc-patches at gcc dot gnu dot org, Jim Wilson <wilson at codesourcery dot com>
- Date: Sat, 23 Oct 2010 09:16:35 -0700
- Subject: Re: RFC: PATCH: PR rtl-optimization/45865: [4.6 Regression] ifcvt/crossjump failed to mark return jump
- References: <AANLkTinTyYkLwph+XHwV_N=MJspK-zSNnBno9hSihj6d@mail.gmail.com> <AANLkTik9W7ypo8pt=0SAc7q2nyetw0GPbo2Tqts8sioE@mail.gmail.com>
On Sat, Oct 23, 2010 at 7:17 AM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> On Thu, Oct 21, 2010 at 7:46 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Sun, Oct 10, 2010 at 6:50 AM, Jason Merrill <jason@redhat.com> wrote:
>>>
>>> If the problem is that there's a return jump that isn't so marked, that
>>> seems to be the thing to fix, rather than assume that any jump within an
>>> epilogue is a return.
>>>
>>> Jason
>>>
>>
>> Does this patch make senses?
>
> I'd like to know where the unmarked jump is created, and mark it there.
>
The unmarked jump is created by force_nonfallthru_and_redirect:
if (e->goto_locus && e->goto_block == NULL)
loc = e->goto_locus;
else
loc = 0;
e->flags &= ~EDGE_FALLTHRU;
if (target == EXIT_BLOCK_PTR)
{
#ifdef HAVE_return
emit_jump_insn_after_setloc (gen_return (), BB_END (jump_block), loc);
#else
gcc_unreachable ();
#endif
}
else
{
rtx label = block_label (target);
emit_jump_insn_after_setloc (gen_jump (label), BB_END (jump_block), loc);
JUMP_LABEL (BB_END (jump_block)) = label;
LABEL_NUSES (label)++;
}
My patch adds:
/* If jump_block has an epilogue, mark the last insn as return jump
if needed. */
FOR_BB_INSNS (jump_block, note)
if (NOTE_P (note)
&& NOTE_KIND (note) == NOTE_INSN_EPILOGUE_BEG)
{
rtx jump = BB_END (jump_block);
if (!returnjump_p (jump))
{
jump = pc_set (jump);
SET_IS_RETURN_P (jump) = 1;
}
break;
}
immediately after the jump is created.
--
H.J.