This is the mail archive of the
mailing list for the GCC project.
Re: ICE in gcc.dg/pr77834.c test for MIPS
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Toma Tabacu <Toma dot Tabacu at imgtec dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- Date: Thu, 16 Feb 2017 10:50:25 -0600
- Subject: Re: ICE in gcc.dg/pr77834.c test for MIPS
- Authentication-results: sourceware.org; auth=none
- References: <A614194ED15B4844BC4C9FB7F21FCD9270454177@hhmail02.hh.imgtec.org>
On Thu, Feb 16, 2017 at 02:39:12PM +0000, Toma Tabacu wrote:
> It is caused by "gcc_assert (!JUMP_P (last))" in
> commit_one_edge_insertion (gcc/cfgrtl.c:2059-2077):
> if (returnjump_p (last))
> /* ??? Remove all outgoing edges from BB and add one for EXIT.
> This is not currently a problem because this only happens
> for the (single) epilogue, which already has a fallthru edge
> to EXIT. */
> e = single_succ_edge (bb);
> gcc_assert (e->dest == EXIT_BLOCK_PTR_FOR_FN (cfun)
> && single_succ_p (bb) && (e->flags & EDGE_FALLTHRU));
> e->flags &= ~EDGE_FALLTHRU;
> emit_barrier_after (last);
> if (before)
> delete_insn (before);
> gcc_assert (!JUMP_P (last));
> I can't come up with a reason for this assert and this code hasn't been touched
> in a long time, so I'm not sure it's necessary. It looks to me like it was
> added more out of habit rather than for a specific reason.
This happens when you have inserted code ending in a jump on an edge.
This then will need updating of the CFG, and this code does not know
how to do that.