[Bug c/29519] New: [4.2 Regression] Bad code on MIPS with -fnon-call-exceptions

daney at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Oct 19 21:59:00 GMT 2006


This is a reduced testcase from a failure I am seeing on libgcj testsuite. 
java.lang.Class.isPrimitive() is being compiled incorrectly.

This is a regression from 3.4.3.

Configured as: ../clean/configure   --target=mipsel-linux
--with-sysroot=/usr/local/mipsel-linux-test
--prefix=/usr/local/mipsel-linux-test --with-arch=mips32 --with-float=soft
--with-system-zlib --disable-java-awt --without-x --disable-libmudflap
--disable-libgomp --disable-jvmpi --disable-tls --enable-languages=c,c++,java

on i686-pc-linux-gnu

Here is the test case in C  isprim.c:
-------------8<------------
struct F;
struct C
{
    struct F *f13;
};
int isM1(struct C *t)
{
    return t->f13 == (struct F*)-1;
}
-------------8<------------
$ mipsel-linux-gcc -O1 -S isprim.c -o isprim.s

Generates this correct code:
        lw      $2,0($4)
        addiu   $2,$2,1
        j       $31
        sltu    $2,$2,1


$ mipsel-linux-gcc -fnon-call-exceptions -O1 -S isprim.c -o isprim.s

Generates this incorrect code that unconditionally returns 0:

        lw      $2,0($4)
        .set    noreorder
        .set    nomacro
        j       $31
        move    $2,$0
        .set    macro
        .set    reorder


-- 
           Summary: [4.2 Regression] Bad code on MIPS with -fnon-call-
                    exceptions
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: daney at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mipsel-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29519



More information about the Gcc-bugs mailing list