Ada broken on i686-linux

Jan Hubicka jh@suse.cz
Fri Sep 10 10:10:00 GMT 2004


Hi,
and actually forgot to add.  The reason why it stops exploding on EH is
described in lcm.c

	      /* If this is an abnormal edge, we'll insert at the end
		 of the previous block.  */
	      if (eg->flags & EDGE_ABNORMAL)
		{
		  emited = true;
		  if (JUMP_P (BB_END (src_bb)))
		    emit_insn_before (mode_set, BB_END (src_bb));
		  /* It doesn't make sense to switch to normal mode
		     after a CALL_INSN, so we're going to abort if we
		     find one.  The cases in which a CALL_INSN may
		     have an abnormal edge are sibcalls and EH edges.
		     In the case of sibcalls, the dest basic-block is
		     the EXIT_BLOCK, that runs in normal mode; it is
		     assumed that a sibcall insn requires normal mode
		     itself, so no mode switch would be required after
		     the call (it wouldn't make sense, anyway).  In
		     the case of EH edges, EH entry points also start
		     in normal mode, so a similar reasoning applies.  */

The new i386.h code broke the assumption about calls requiring "normal
mode" as they happent suddenly to be "don't care about mode".  The
reasoning about CALLs makes sense, but just the code bellow:

		  else if (NONJUMP_INSN_P (BB_END (src_bb)))
		    emit_insn_after (mode_set, BB_END (src_bb));
		  else
		    abort ();

strikes very wrong for case of non-call EH edges as we will miss the
mode change on EH case.

Actually even the emit before jump in the code above is wrong, it just
will happen to work by accident on i386 as we don't use mode switching
for actual CW change so we will change CW on the right place.  I think
we need to do non-lazy work and emit the mode change at the destination
of the edge.

Joern, Andrew, what do you think about this issue?

We also never worked for the case of fistp throwing exception in region
with mode changed.  I think it is not too serious as Java disable FP EH
and no one else uses non-call-exceptions, but only way to fix it I see
is to rescuesce the idea of lcm after reload idea I guess.

Cool alternatie would be to make EH edges redirectable.  I've pondered
about this for a while and discussed this with Richard who claimed this
to be easy, but I always failed miserably trying to implement this...

Honza



More information about the Gcc mailing list