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 middle-end/36300] Incorrect type used for inlined expression



------- Comment #9 from rguenther at suse dot de  2008-05-27 12:53 -------
Subject: Re:  Incorrect type used for inlined expression

On Tue, 27 May 2008, acarmeli at mathworks dot com wrote:

> ------- Comment #8 from acarmeli at mathworks dot com  2008-05-27 12:50 -------
> Richard,
> 
> I truly appreciate your effort on this bug.
> 
> Can you please elaborate on your plan? Will this be fixed for -fwrapv only, or
> also for -fwrapv-free compilations?
> 
> I understand that downcasting an out-of-range value to a signed integer is not
> defined in the standard. However, many compilers offer an "expected" modulo-2^n
> behavior. This behavior helps avoid writing extra cumbersome "safe downcast"
> code. Having GCC offer it for non -fwrapv compilations is an important
> interoperability and readability feature.
> 
> Thank you for looking into it.

This is only fixed for -fwrapv (this is the "expected" modulo-2^n behavior 
switch).  It was never broken for the defined variant with the casts
to unsigned before the multiplication.

Richard.


-- 


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


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