public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/27394]  New: double -> char conversion varies with optimization level
@ 2006-05-02 17:14 amylaar at gcc dot gnu dot org
  2006-05-02 17:53 ` [Bug tree-optimization/27394] " amylaar at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-05-02 17:14 UTC (permalink / raw)
  To: gcc-bugs

This testcase:

int
f
()
{
  double d = 128.;
  return (signed char) d;
}


int
main ()
{
  return f () != -128;
}

Succeeds at -O0 and fails at -O1.  While the C standard says that the result
of the conversion is unspecified, it is a quality of implementation issue to
give, where reasonably possible, the same results when optimizing as when
not optimizing.  Doing otherwise makes debugging unnecessarily difficult.


-- 
           Summary: double -> char conversion varies with optimization level
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: amylaar at gcc dot gnu dot org


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


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

end of thread, other threads:[~2006-11-15 16:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-02 17:14 [Bug tree-optimization/27394] New: double -> char conversion varies with optimization level amylaar at gcc dot gnu dot org
2006-05-02 17:53 ` [Bug tree-optimization/27394] " amylaar at gcc dot gnu dot org
2006-05-02 17:55 ` pinskia at gcc dot gnu dot org
2006-05-02 17:58 ` pinskia at gcc dot gnu dot org
2006-05-02 18:00 ` pinskia at gcc dot gnu dot org
2006-05-02 18:21 ` amylaar at gcc dot gnu dot org
2006-05-03  9:17 ` schwab at suse dot de
2006-05-29 22:19 ` pinskia at gcc dot gnu dot org
2006-11-15 16:28 ` amylaar at gcc dot gnu dot org

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).