LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 1111 - instcombine miscompiles fp X == X
Summary: instcombine miscompiles fp X == X
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Scalar Optimizations (show other bugs)
Version: 1.0
Hardware: All All
: P normal
Assignee: Chris Lattner
URL:
Keywords: miscompilation
Depends on:
Blocks:
 
Reported: 2007-01-14 13:26 PST by Chris Lattner
Modified: 2010-02-22 12:45 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lattner 2007-01-14 13:26:12 PST
instcombine isn't handling nan's right when folding fcmp X, X.  For example, it turns this into false:

define i1 %test(double %X) {
        %tmp = fcmp une double %X, %X           ; <i1> [#uses=1]
        ret i1 %tmp
}

-Chris
Comment 1 Chris Lattner 2007-01-14 13:42:52 PST
Fixed, testcase here: Transforms/InstCombine/2007-01-14-FcmpSelf.ll

Patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070108/042661.html

-Chris