This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/43089] Optimizer ignores type in a conversion



------- Comment #2 from 0xe2 dot 0x9a dot 0x9b at gmail dot com  2010-02-16 10:59 -------
(In reply to comment #1)
> 0x7fffffff + 1 overflows.  Signed overflow invokes undefined behavior.

Like so what? Is this your way of saying "I am not going to fix it"? Do you
find it convenient to hide your laziness behind the words "undefined behavior".

If I were to modify the test case like this:

int i = ab.b;
b2 = i + i;

I would be ALSO triggering undefined behavior. But the modified test-case would
succeed at any optimization level.

I don't think you understand what I am demanding here: I demand the compiler to
have CONSISTENT BEHAVIOR in cases which are not defined by the standard. The
modified code does clearly the SAME thing as the code in the test-case, only
the intermediate conversion to the integer is now more explicit.


-- 

0xe2 dot 0x9a dot 0x9b at gmail dot com changed:

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


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43089


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]