https://llvm.org/bugs/show_bug.cgi?id=23358

            Bug ID: 23358
           Summary: A Division by Zero does not generate a floating point
                    exception when optimizations are enabled
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

The following program

#include <stdio.h>
#include <stdlib.h>

int main () {
    int volatile l = 123;
    int volatile v = (1 / (l - l));

    printf ("Value of v is %d\n", v);
}

will not generate a floating point exception when compiled in -O1/-O2/-O3
optimization.

This starded when upgrading the latest Xcode (v6.3) from Apple:

cc --version
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to