[LLVMbugs] [Bug 23358] A Division by Zero does not generate a floating point exception when optimizations are enabled

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 27 13:42:20 PDT 2015


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

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |INVALID

--- Comment #4 from Richard Smith <richard-llvm at metafoo.co.uk> ---
(In reply to comment #3)
> What I'm saying is that since I've been using clang, the clang definition of
> undefined behavior was to throw a floating point exception

That is not correct. Clang does not define this particular undefined behavior,
and never did. It is the nature of undefined behavior that sometimes you'll see
it behaving in some predictable way, but that does not make it defined.

[In the original testcase, we are in fact preserving the two volatile loads of
l, and if they produce different answers, we will correctly compute the value
of v.]

See http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html

-- 
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/20150427/8c7938cf/attachment.html>


More information about the llvm-bugs mailing list