Skip to content

instrcombine causes miscompilation with fcmp and itofp #3393

@llvmbot

Description

@llvmbot
Bugzilla Link 3021
Resolution FIXED
Resolved on Nov 08, 2008 22:27
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor
CC @isanbard

Extended Description

Running opt -instcombine turns this:

define i1 @​bug(i32 %val) {
%1 = uitofp i32 %val to double
%2 = fcmp ole double %1, 0.000000e+00
ret i1 %2
}

into this:

define i1 @​bug(i32 %val) {
%1 = icmp slt i32 %val, 1 ; [#uses=1]
ret i1 %1
}

This transformation is invalid (consider the case %val = 0xffffffff).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions