[gnu.gcc.bug] gcc 1.33 aborts in final

mellon@TIS.LLNL.GOV (Ted Lemon) (02/17/89)

When I compile a certain test program with all optimizations enabled,
cc1 dies of a SIGIOT signal, because final() calls abort().   Two
examples of programs that exhibit this bug follow - the first one is
actually incorrect C code because the variable i is used before it is
initialized, but the second file is correct, because i is initialized.
The third program which follows is a version of gcctest.c in which i
is initialized.   It does not exhibit the bug.

I'm trying to trace this bug back to its origins myself, but I haven't
been getting very far - this is my first time looking at the optimizer
- so if someone fixes it, I'd appreciate hearing what the problem was.
Thanx!

			       _MelloN_


------------------------------gcctest.c-----------------------------
int brick[20 ];
int hand;
int isnum(), num();

void fred_villari (u2)
{
  int i;

  if ((brick [hand] - i) < 0)
      brick [hand] = 0;
}
--------------------------------------------------------------------

------------------------------gcctesti.c----------------------------
int brick[20 ];
int hand;
int isnum(), num();

void fred_villari (u2)
{
  int i;

  if (u2 == -1)
    i = 1;
  else {
    if (!isnum (u2))
      return;
    i = num (u2);
  }

  if ((brick [hand] - i) < 0)
      brick [hand] = 0;
}
--------------------------------------------------------------------

------------------------------gcctestn.c----------------------------
int brick[20 ];
int hand;
int isnum(), num();

void fred_villari (u2)
{
  int i = u2;

  if ((brick [hand] - i) < 0)
      brick [hand] = 0;
}
--------------------------------------------------------------------

The command I used to evoke this problem, and the output, are shown
below:

slypnir% cc1 gcctestn.c -quiet gcctestn.c -fstrength-reduce -fcombine-regs -fforce-mem -fforce-addr -finline-functions -fwritable-strings -O -Wall -version -o gcctestn.s
GNU C version 1.33 (68k, MIT syntax) compiled by GNU C version 1.33.
slypnir% cc1 gcctesti.c -quiet gcctesti.c -fstrength-reduce -fcombine-regs -fforce-mem -fforce-addr -finline-functions -fwritable-strings -O -Wall -version -o gcctesti.s
GNU C version 1.33 (68k, MIT syntax) compiled by GNU C version 1.33.
IOT trap (core dumped)
slypnir% cc1 gcctest.c -quiet gcctest.c -fstrength-reduce -fcombine-regs -fforce-mem -fforce-addr -finline-functions -fwritable-strings -O -Wall -version -o gcctest.s
GNU C version 1.33 (68k, MIT syntax) compiled by GNU C version 1.33.
gcctest.c: In function fred_villari:
gcctest.c:7: warning: variable `i' used uninitialized in this function
IOT trap (core dumped)
slypnir%