This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/34825] New: ICE (SIGSEGV) in compiling valid code with -funsafe-math-optimizations


gcc reports ICE when compiling SVMlight software package
(http://svmlight.joachims.org/) on x86_64 with -funsafe-math-optimizations.
The following is the reduced code from the svm_hideo.c in SVMlight 6.01.

Occurs on: gcc-4.2.2 on x86_64, gcc-4.3.0 on x86_64,  
           gcc-4.2.3 on i386, gcc-4.3.0 on i386
Doesn't occur on: gcc-4.1.3 on x86_64, gcc-4.1.3 on i386

$ cat >test.i <<__END__
double optimize_hildreth_despo(long n,long b1,long b2, double *g, double *g0,
double *ce, double *ce0, double *low, double *up, double *init)
{
        double t;

        if(ce[b1] != ce[b2]) {
                t = 0;
        }
        else if(((g[b1*n+b1]>0) || (g[b2*n+b2]>0))) {
               
t=((ce[b2]/ce[b1])*g0[b1]-g0[b2]+ce0[0]*(g[b1*n+b1]*ce[b2]/ce[b1]-g[b1*n+b2]/ce[b1]))/((ce[b2]*ce[b2]/(ce[b1]*ce[b1]))*g[b1*n+b1]+g[b2*n+b2]-2*(g[b1*n+b2]*ce[b2]/ce[b1]))-init[b2];
                if((up[b2]-init[b2]) < t) {
                        t=up[b2]-init[b2];
                }
                if((init[b2]-low[b2]) < -t) {
                        t=-(init[b2]-low[b2]);
                }
                if((up[b1]-init[b1]) < -t) {
                        t=-(up[b1]-init[b1]);
                }
                if((init[b1]-low[b1]) < t) {
                        t=init[b1]-low[b1];
                }
        }
        return t;
}
__END__
$ gcc-4.3 -funsafe-math-optimizations -O -c test.i
test.i: In function 'optimize_hildreth_despo':
test.i:2: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$ gcc-4.3 -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3-20080104-1'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3
--enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.0 20080104 (experimental) [trunk revision 131316] (Debian
4.3-20080104-1) 
$ uname -a
Linux rainbow 2.6.22-3-amd64 #1 SMP Thu Oct 11 15:23:23 UTC 2007 x86_64
GNU/Linux


-- 
           Summary: ICE (SIGSEGV) in compiling valid code with -funsafe-
                    math-optimizations
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: t-gcc-bugzilla at snowelm dot com
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]