Hi,

i get an ICE with this reduced testcase:
-------------------------------------------
typedef struct _Parameters Parameters;
typedef double real_T;

typedef struct _BlockIO {
  real_T bio1;
  real_T bio2;
  real_T bio3;
  real_T bio4;
  real_T bio5;
  real_T bio6;
  real_T bio7;
  real_T bio8;
  real_T bio9;
} BlockIO;


struct _Parameters {
  real_T par1;
  real_T par2;
  real_T par3;
  real_T par4;
  real_T par5;
  real_T par6;
  real_T par7;

};


Parameters rtP;

BlockIO rtB;


void error_func(void)
{
  if (0.0 >= rtP.par1) {
//    rtB.bio2 = 0.0;
  } else {
    rtB.bio2 = rtB.bio1;
  }

  if (0.0 >= rtP.par2) {
    rtB.bio3 = 0.0;
  } else {
    rtB.bio3 = 0.0;
  }

  rtB.bio4 = rtB.bio3 * rtP.par3;

  if (0.0 >= rtP.par4) {
    rtB.bio5 = 0.0;
  } else {
    rtB.bio5 = rtB.bio4;
  }

  rtB.bio6 = rtB.bio5 * rtP.par5;

  if (0.0 >= rtP.par6) {
 //   rtB.bio8 = 0.0;
  } else {
    rtB.bio8 = rtB.bio7;
  }
  rtB.bio9 = rtB.bio5 * rtP.par7;
}
--------------------------------------------

GCC command line and output:

/opt/gcc-3.3.5/bin/gcc -v -c gcc_ice.i -o gcc_ice.o -O1
-fexpensive-optimizations  -fcse-follow-jumps  -frerun-cse-after-loop   -fgcse 
   -march=pentium4 -mfpmath=sse  -ffast-math

Reading specs from /opt/gcc-3.3.5/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/specs
Configured with: ./configure --prefix=/opt/gcc-3.3.5
Thread model: posix
gcc version 3.3.5
 /opt/gcc-3.3.5/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/cc1 -fpreprocessed gcc_ice.i
-quiet -dumpbase gcc_ice.i -march=pentium4 -mfpmath=sse -auxbase-strip gcc_ice.o
-O1 -version -fexpensive-optimizations -fcse-follow-jumps -frerun-cse-after-loop
-fgcse -ffast-math -o /tmp/ccsHtO1S.s
GNU C version 3.3.5 (i686-pc-linux-gnu)
        compiled by GNU C version 3.2.1.
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64529
gcc_ice.i: In function `error_func':
gcc_ice.i:69: internal compiler error: in gen_split_1204, at insn-emit.c:17860

The optimization flags are a subset of "-O2 -march=pentium4 -mfpmath=sse 
-ffast-math" and I was able to trigger exactly the same ICE with a larger
testcase and these flags. Unfortunately the testcase shown here, does not crash
with "-O2 -march=pentium4 -mfpmath=sse -ffast-math". 

I got the same ICE with GCC 3.3.3 and 3.3.1. 
GCC 3.2.1, GCC 3.4.0 and newer versions do not show this bug.

The testcase seems fairly minimal, that is, I cannot remove a single statement
or command line flag without loosing the ICE.

-- 
           Summary: [3.3 regression] ICE in in gen_split_1204 on i686-pc-
                    linux-gnu target
           Product: gcc
           Version: 3.3.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rgrosseboerger at dspace dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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

Reply via email to