This is the mail archive of the gcc-patches@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]

Re: new sign/zero extension elimination pass


On Sun, 31 Oct 2010, Tom de Vries wrote:

> The pass assumes wraparound overflow for plus and minus. The documentation of
> the rtl operator 'plus' states that 'plus wraps round modulo the width of m'
> (similar for 'minus'). I interpreted this independently from -fwrapv and
> -fstrict-overflow, am I wrong there?

-fwrapv and -fstrict-overflow relate only to source code, GENERIC and 
GIMPLE semantics, and do not affect RTL which is always modulo.  (This is 
true at least for addition, subtraction, multiplication and absolute 
value.  I make no claims about the semantics for division and modulo 
operations for INT_MIN and -1, but my suggestion in bug 30484 was that the 
target should specify the semantics of its RTL insns, not that they should 
depend on command-line options.  The aim is to stop the options from 
affecting GENERIC and GIMPLE semantics in future; see the 
no-undefined-overflow branch.)

-- 
Joseph S. Myers
joseph@codesourcery.com


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