Skip to content

floating-point operations have side effects #6422

Open
@sunfishcode

Description

@sunfishcode
Bugzilla Link 6050
Version unspecified
OS All
CC @andykaylor,@chfast,@lattner,@DimitryAndric,@emaste,@thielema,@nlewycky,@rotateright,@vinc17fr,@yuanfang-chen,@ZviRackover

Extended Description

Floating-point instructions, such as add, sub, mul, and div, as well as math library functions in -fno-math-errno mode, are considered to have no side effects in LLVM. This is incorrect; they may set floating-point exception flags, and they may trap if the processor is configured to trap on floating-point exceptions.

As a consequence of this, these side effects may be reordered or eliminated by the optimizer and codegen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions