https://llvm.org/bugs/show_bug.cgi?id=23707
Bug ID: 23707
Summary: Code in the false branch of an "if" is executed
Product: clang
Version: trunk
Hardware: Macintosh
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Created attachment 14405
--> https://llvm.org/bugs/attachment.cgi?id=14405&action=edit
test case
Hi,
I downloaded llvm and clang today from svn trunk. I built it on Debian Jessie
(libc++ from GCC 4.9 provided by Debian).
When I build the attached code with -O1 or -O2 and then execute it, the code
fails with SIGFPE. The division by 0 is in the false branch of an "if", so this
code should not be executed.
The example is minimal: removing cerr output or uncommenting either of the
commented-out lines results in correct behaviour.
The issue is not present when compiling with -O0, with clang++-3.4 or 3.5, or
with g++.
The bug has been reported as a Debian bug first but is present in trunk:
http://bugs.debian.org/787217
Kind regards, Thibaut.
--
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