[gnu.gcc.bug] 1.33 crash bug

kimbo@EDDIE.MIT.EDU (Kimbo Mundy x5550) (03/07/89)

[I may have mis-addressed this the first time, so here it is again:]

On a Sun-3/60 running SunOS 3.5, using gcc version 1.33
(tm-sun3-nfp.h, m68k.md), I get a fatal signal when I compile the
following with "gcc -O -c":
---------------------------------------
#define IMX	    -10			/* default window x position */
int
foo()
{
    short wx, ww;
    short screensize = foo();

    ww = 0;
    wx = (IMX > 0) ? (IMX > ww) ? ww : IMX
		   : (screensize+IMX-ww < 0) ? 0 : screensize+IMX-ww;
    return ( wx );
}
---------------------------------------
This seems to be due to the abort() call in final():

		/* If the C code returns 0, it means that it is a jump insn
		   which follows a deleted test insn, and that test insn
		   needs to be reinserted.  */
		if (template == 0)
		  {
		    if (PREV_INSN (insn) != last_ignored_compare)
		      abort ();
		    insn = PREV_INSN (insn);
		    body = PATTERN (insn);
		    goto reinsert_compare;
		  }

I can easily work around this by getting rid of some of the dead code
in the ternary.  However, it was pretty hard to track down the code in
question.  Is there any way in gdb to get from an rtx back to a rough
idea of the source line it might have come from?  (Do you even have
time to answer questions like this??)

In any case, thanks for such spiffy software!