This is the mail archive of the gcc@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: SIMPLE: A language-independent tree IR


On Fri, 4 Jan 2002, Florian Weimer wrote:

> "Joseph S. Myers" <jsm28@cam.ac.uk> writes:
> 
> > There may be other C assumptions in the current tree forms to consider and
> > maybe change - for example, are the C rules that overflow of signed
> > integer arithmetic is undefined appropriate for all languages,
> 
> I thought that in the GCC context, integer overflow has a defined
> meaning (which is not documented in the ISO standard, though).  In
> fact, I'm quite sure that tons of code will break if GCC behavior in
> this regard changes only slightly.

In the GCC context, signed integer overflow is undefined - and there are 
optimisations that use this.  (I don't know where they all are, though 
comments such as

          /* If EXP is signed, any overflow in the computation is undefined,
             so we don't worry about it [...]

in fold-const.c are probably relevant, and I've closed PRs that have
reported what appear to be such optimisations as bugs.)

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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