This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: mktime.c fixes (part 4 of 6): verify assumptions at compile-time
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: Paul Eggert <eggert at CS dot UCLA dot EDU>
- Cc: Richard Henderson <rth at twiddle dot net>, libc-alpha at sources dot redhat dot com, gcc at gcc dot gnu dot org
- Date: Wed, 31 Dec 2003 19:56:23 +0000 (UTC)
- Subject: Re: mktime.c fixes (part 4 of 6): verify assumptions at compile-time
- References: <873cb11irp.fsf@penguin.cs.ucla.edu> <20031231181905.GA11676@twiddle.net><87llos2344.fsf@penguin.cs.ucla.edu>
On Wed, 31 Dec 2003, Paul Eggert wrote:
> If you are modifying GCC to do GCC-2.2.2-style optimization again,
> please disable the optimization by default. It's quite OK to have it
Having these optimizations again is hardly new. For example, GCC 3.0.4
optimizes out the multiplication and division in
int f (int a) { return (2 * a) / 2; }
(so do 2.7.2.3 through 2.95.3, but in those cases it's simply a broken
optimization as they do it for unsigned as well). I suspect there have
been other instances for longer (and -fwrapv may not yet work perfectly,
as such assumptions about undefined behavior have had a long time to get
into various parts of the compiler).
--
Joseph S. Myers
jsm@polyomino.org.uk