[LLVMbugs] [Bug 4437] llvm optimization pass misoptimizes plumhall

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Jun 24 18:06:43 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=4437


Dan Gohman <gohman at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #4 from Dan Gohman <gohman at apple.com>  2009-06-24 20:06:43 ---
(In reply to comment #2)
>  Id[0] = 17;                                                
>  **ppCsc = 8;                                               
> 
>  **ppCsc *= Id[0];                                          

This code invokes undefined behavior, as it is attempting to convert
the double value 136.0 to signed char, in which type the value cannot
be represented.

(In reply to comment #3)

> BTW, it is duo to the optimization pass where may misconvert the value, because
> without any optimization, lli gave the correct answer as I mentioned in #1.

Undefined behavior is permitted to vary between optimization levels,
and it's even permitted to do precisely what is expected.

>From a quality-of-implementation perspective one may have a
preference for fptosi's undefined behavior working in a particular way, but
a conformance test such as Plum Hall shouldn't depend on undefined
behavior.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list