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

--- Comment #7 from Sergey Ostanevich <sergos.gnu at gmail dot com> 2011-09-15 
11:24:27 UTC ---
Richard, I believe your test should be reading as 

> So you can go from (a +no b) +no c to a + no (b + c), dropping overflow
knowledge on re-association.

And let me re-phrase what's Joseph said (just to be sure I got the idea):
we have to preserve the overflow semantics at GIMPLE level to avoid possible
problems during translation into RTL. 

Consider we have situation without overflow in 32-bit with particular
calculation order and can use either 32-bit or 64-bit operations to perform
that. But after reassociation in GIMPLE we can introduce overflow for 32-bit,
that will lead to wrong result in case we use 64-bit operations. 

Being aware of such situation during traslation we can evade error, but it
requires too much effort (or even impossible) to provide this data to the
translator. 

Is it right?

Reply via email to