Re: non trivial constant folding

"Conor O'Neill" <ONeillCJ@logica.com>
11 Jan 2001 12:27:13 -0500

          From comp.compilers

Related articles
[10 earlier articles]
Re: non trivial constant folding sjmeyer@www.tdl.com (2001-01-09)
Re: non trivial constant folding henry@spsystems.net (2001-01-09)
Re: non trivial constant folding dew@cray.com (2001-01-09)
Re: non trivial constant folding mpointie@eden-studios.fr (Mickaƫl Pointier) (2001-01-09)
Re: non trivial constant folding morrell@morrell.cup.hp.com (Michael Morrell) (2001-01-09)
Re: non trivial constant folding dmr@bell-labs.com (Dennis Ritchie) (2001-01-11)
Re: non trivial constant folding ONeillCJ@logica.com (Conor O'Neill) (2001-01-11)
Re: non trivial constant folding sjmeyer@www.tdl.com (2001-01-18)
Re: non trivial constant folding genew@shuswap.net (2001-01-18)
Re: non trivial constant folding anton@mips.complang.tuwien.ac.at (2001-01-19)
Re: non trivial constant folding genew@shuswap.net (2001-01-20)
Re: non trivial constant folding anton@mips.complang.tuwien.ac.at (2001-01-26)
Re: non trivial constant folding broeker@physik.rwth-aachen.de (Hans-Bernhard Broeker) (2001-02-01)
| List of all articles for this month |
From: "Conor O'Neill" <ONeillCJ@logica.com>
Newsgroups: comp.compilers
Date: 11 Jan 2001 12:27:13 -0500
Organization: Speaking for myself
References: 01-01-015 01-01-022 01-01-033
Keywords: optimize
Posted-Date: 11 Jan 2001 12:27:13 EST

Anton Ertl <anton@mips.complang.tuwien.ac.at> writes
> "Mihai Christodorescu" <mihai@cs.wisc.edu> writes:
>> There is also another problem: the optimized expression can behave
>>differently than the original expression, due to operations being executed
>>in different order/with different operands.
>
>And even if the original code had undefined behaviour, a particular
>compiler should implement a consistent behaviour for that, if possible
>(for practical reasons, like finding the bug).


I have to disagree with this. One of the points of specifying
'undefined' behaviour for a construct is to give latitude to the
implementors to assume that such a case can be ignored when
considering how to optimize.


Hence, for the following (undefined) C code, I would certainly assume
that an optimised and non-optimised version could have different
behaviours:


                i = i++; /* undefined behaviour */


--
Conor O'Neill, Bristol, UK


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.