Skip to content

floating-point constant expressions are incorrectly rounded #11778

@llvmbot

Description

@llvmbot
Bugzilla Link 11406
Resolution FIXED
Resolved on Nov 25, 2011 21:38
Version trunk
OS FreeBSD
Attachments fail.c
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic

Extended Description

In the default floating-point rounding mode (IEEE round-to-nearest), halfway cases are supposed to round to the nearest EVEN representable number, but in clang, apparently they don't always do that.

The attached program prints 0x1.0000000000001p+0 when compiled with clang -O, but it prints 0x1.0p+0 when compiled with gcc or clang -O0, or when 'd' is declared volatile. 0x1.0p+0 is the correct answer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions