public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/53805] New: combine_comparisons changes trapping behavior
@ 2012-06-29 11:00 glisse at gcc dot gnu.org
  2012-06-29 12:02 ` [Bug tree-optimization/53805] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-06-29 11:00 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53805
           Summary: combine_comparisons changes trapping behavior
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: glisse@gcc.gnu.org


Hello,

int f(double a,double b){
  if(a>b) if(a<b) return 1;
  return 0;
}

gets simplified by tree-ssa-ifcombine to just return 0; which is wrong if the
comparison would trap.

This is caused by combine_comparisons:

        bool trap = (compcode & COMPCODE_UNORD) == 0
                    && (compcode != COMPCODE_EQ)
                    && (compcode != COMPCODE_ORD);

which is missing:

                    && (compcode != COMPCODE_FALSE)

(this isn't needed for ltrap and rtrap)


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

end of thread, other threads:[~2012-08-02 19:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-29 11:00 [Bug tree-optimization/53805] New: combine_comparisons changes trapping behavior glisse at gcc dot gnu.org
2012-06-29 12:02 ` [Bug tree-optimization/53805] " rguenth at gcc dot gnu.org
2012-06-29 12:19 ` glisse at gcc dot gnu.org
2012-06-29 12:22 ` rguenth at gcc dot gnu.org
2012-06-29 14:24 ` joseph at codesourcery dot com
2012-06-29 14:34 ` rguenth at gcc dot gnu.org
2012-06-29 14:43 ` joseph at codesourcery dot com
2012-06-29 14:54 ` rguenth at gcc dot gnu.org
2012-07-02  7:27 ` jakub at gcc dot gnu.org
2012-07-06 21:53 ` glisse at gcc dot gnu.org
2012-08-02 19:55 ` glisse at gcc dot gnu.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).