bug.cpp: In function 'void func()': 
bug.cpp:45: error: could not split insn 
(insn:HI 106 27 115 (parallel [ 
            (set (reg/v:SF 21 xmm0 [orig:59 _max.21 ] [59]) 
                (if_then_else:SF (le:SF (reg/v:SF 21 xmm0 [orig:59 _max.21 ] 
[59]) 
                        (reg/v:SF 21 xmm0 [orig:59 _max.21 ] [59])) 
                    (reg/v:SF 21 xmm0 [orig:59 _max.21 ] [59]) 
                    (reg/v:SF 21 xmm0 [orig:59 _max.21 ] [59]))) 
            (clobber (reg:V4SF 23 xmm2)) 
        ]) 658 {*movsfcc_1_sse} (insn_list:REG_DEP_TRUE 27 (nil)) 
    (expr_list:REG_UNUSED (reg:V4SF 23 xmm2) 
        (nil))) 
bug.cpp:45: internal compiler error: in final_scan_insn, at final.c:2508 
 
System: Debian unstable with Athlon-XP. 
 
Target: i486-linux-gnu 
Configured with: ../src/configure -v 
--enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr 
--enable-shared --with-system-zlib --libexecdir=/usr/lib --enable-nls 
--without-included-gettext --enable-threads=posix --program-suffix=-4.0 
--enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk 
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr 
--disable-werror --enable-checking=release i486-linux-gnu 
Thread model: posix 
gcc version 4.0.1 (Debian 4.0.1-2) 
 
Also happens with 4.0.0. 
 
I have created a self contained test case, which follows. Note that even 
apparently minor changes to this test case prevent the bug triggering. 
Use: g++ -O2 -ffast-math -mfpmath=sse -msse -c bug.cpp 
(-O3 also works) 
---------------------------------------- 
typedef float float_t; // type double does not trigger the bug 
 
struct Slot 
{ 
        virtual void invoke () {} 
}; 
 
struct Range 
{ 
        float_t  min; 
        float_t  max; 
 
        void set (float_t _min, float_t _max) 
        { 
                min = _min; 
                max = _max; 
        } 
}; 
 
#define MAX(a,b) (((a) > (b)) ? (a) : (b)) 
#define MIN(a,b) (((a) < (b)) ? (a) : (b)) 
 
struct Parameter 
{ 
        Slot*   m_slot; 
        float   m_value;  // type of m_value does not influence the bug 
        Range   m_range; 
 
        void init (float_t min, float_t max, float_t value) 
        { 
                m_range.set (min, max); 
                m_value = MAX (m_range.min, MIN (m_range.max, value)); 
                m_slot->invoke(); 
        } 
}; 
 
const unsigned count = 2; // count must be > 1 to trigger the bug 
const float upper = 10.0f; // values of 0.0f, 1.0f do not trigger the bug 
Parameter params[count]; 
 
void func() 
{ 
        for (unsigned i = 0; i < count; i++) 
                params[i].init (0, upper, upper); // bug triggered from here 
}

-- 
           Summary: with -O2 -ffast-math -mfpmath=sse -msse: could not split
                    insn: internal compiler error: in final_scan_insn, at
                    final.c:2508
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: simonjcan at yahoo dot co dot uk
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


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

Reply via email to