[LLVMbugs] [Bug 16202] New: Code is "optimized" with -O0

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jun 2 19:57:40 PDT 2013


            Bug ID: 16202
           Summary: Code is "optimized" with -O0
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tydeman at tybor.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Using the command line options: -std=c1x -O0 -pedantic
still "optimizes" some floating-point (FP) code and produces the wrong answer.
FP exceptions flags are not being raised when expected.
The wrong value is computed for: float f = (float)DBL_MIN; when the rounding
direction is upward (instead of the normal nearest).

How is a user supposed to turn off ALL floating-point optimizations?

Adding 'volatile' to all variables helps.  But, I see no way to add volatile to
an expression of FP constants (other than rewrite the code using variables).

This is clang 3.3-0.4 on Intel Core 2 Duo in 32-bit mode running Fedora Core 19

Aside:  I do not see version 3.3 in the choices of Version when I opened this

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130603/b6c50dfe/attachment.html>

More information about the llvm-bugs mailing list