[gnu.gcc.bug] finally nailed it

grunwald@FOOBAR.COLORADO.EDU (Dirk Grunwald) (10/17/89)

the following patch to out-mips.c fixes (honest) the problem for the
decstation-3100 that I mentioned previously. The test case program,
first compiled with the old gcc and then with the new one, is appended
at the end.

I belive that this patch was actually done by MDT. I yanked it from
another version of out-mips.c.

[foobar-88] rcsdiff out-mips.c
RCS file: RCS/out-mips.c,v
retrieving revision 1.1
diff -r1.1 out-mips.c
221a222,230
>   else if (regnum >= 0)
>     return gen_rtx (REG, mode, regnum);
>   else if (regnum == -2)
>     {
>       if (mode == SFmode)
>       return gen_rtx (SUBREG, SFmode, gen_rtx (REG, DFmode, 6), 0);
>       else
>       return gen_rtx (REG, DFmode, 6);
>     }
223,225c232
<     return (regnum >= 0 ? gen_rtx (REG, mode, regnum)
<           : regnum == -2 ? gen_rtx (REG, DFmode, 6)
<           : 0);
---
>     return 0;



Here's the test case program:

Script started on Tue Oct 17 10:50:45 1989
[foobar-1] cat test2.c
int
foo(int i, float x)
{
    return( i = i + x );
}


int
foo(int i, double d)
{
    return( i = i + d );
}

############ the old compiler

[foobar-3] gcc -c -v test2.c
gcc version 1.36
 /usr/local/Gnu/lib/gcc-cpp -v -undef -D__GNUC__ -Dmips -Dunix -D__mips__ -D__unix__ -DR3000 -DLANGUAGE_C -DMIPSEL -DSYSTYPE_BSD -Dultrix test2.c /usr/tmp/cca04463.cpp
GNU CPP version 1.36
 /usr/local/Gnu/lib/gcc-cc1 /usr/tmp/cca04463.cpp -quiet -dumpbase test2.c -version -o /usr/tmp/cca04463.s
GNU C version 1.36 (AL-MIPS 1.11) <Decstation>
 compiled by GNU C version 1.36.
default target switches: -munix -mnofixed-ovfl -mG0 -mG1
test2.c: In function foo:
test2.c:5: The following insn was not recognizable:
(insn 5 4 6 (parallel[ 
           (set (mem:SF (plus:SI (reg:SI 30)
                       (const_int 4)))
               (reg:DF 6))
           (clobber (reg:SI 24))
       ] ) -1 (nil)
   (nil))
gcc: Program cc1 got fatal signal 4.

############ the new compiler

[foobar-4] $GCC/gcc -B$GCC/ -c -v test23..c
gcc version 1.36
 /usr/local/src/Gcc/gcc-pmax/cpp -v -undef -D__GNUC__ -Dmips -Dunix -D__mips__ -D__unix__ -DR3000 -DLANGUAGE_C -DMIPSEL -DSYSTYPE_BSD -Dultrix test2.c /usr/tmp/cca04466.cpp
GNU CPP version 1.36
 /usr/local/src/Gcc/gcc-pmax/cc1 /usr/tmp/cca04466.cpp -quiet -dumpbase test2.c -version -o /usr/tmp/cca04466.s
GNU C version 1.36 (AL-MIPS 1.11) <Decstation>
 compiled by GNU C version 1.36.
default target switches: -munix -mnofixed-ovfl -mG0 -mG1
test2.c: In function foo:
test2.c:10: conflicting types for `foo'
test2.c:3: previous declaration of `foo'
[foobar-5] 
script done on Tue Oct 17 10:51:18 1989