[Bug c++/49855] New: internal compiler error: in fold_convert_const_int_from_real

xinliangli at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jul 26 17:46:00 GMT 2011


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

           Summary: internal compiler error: in
                    fold_convert_const_int_from_real
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: xinliangli@gmail.com


In the following code, FE should generate FIX_TRUNC_EXPR instead of NOP_EXPR
for the float to int conversion. 

extern void foo(int);

template <class Key, class Value> void Basic() {

  const int kT = 1.5e6;        // <--- causes ICE 
  int size = kT*2/3;        
  do {
    foo(size);
    size = size * 0.5 - 1;
  } while (size >= 0 );

}

Note that removing the template specification, the right code is generated and
there is no ICE.


David



More information about the Gcc-bugs mailing list