public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49855] New: internal compiler error: in fold_convert_const_int_from_real
@ 2011-07-26 17:46 xinliangli at gmail dot com
  2011-09-27 22:23 ` [Bug c++/49855] " navin.kumar at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: xinliangli at gmail dot com @ 2011-07-26 17:46 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-01-28 23:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-26 17:46 [Bug c++/49855] New: internal compiler error: in fold_convert_const_int_from_real xinliangli at gmail dot com
2011-09-27 22:23 ` [Bug c++/49855] " navin.kumar at gmail dot com
2011-09-27 22:54 ` [Bug c++/49855] [4.6/4.7 Regression] " paolo.carlini at oracle dot com
2011-09-28  8:48 ` rguenth at gcc dot gnu.org
2011-09-28  8:51 ` rguenth at gcc dot gnu.org
2011-10-10 12:11 ` rguenth at gcc dot gnu.org
2011-10-11 17:33 ` jason at gcc dot gnu.org
2011-10-11 17:54 ` jason at gcc dot gnu.org
2011-10-11 18:20 ` jason at gcc dot gnu.org
2011-10-11 18:21 ` jason at gcc dot gnu.org
2011-10-24 23:55 ` paolo.carlini at oracle dot com
2012-01-29  0:16 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).