This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
- From: Paul Eggert <eggert at CS dot UCLA dot EDU>
- To: gcc at gcc dot gnu dot org, autoconf-patches at gnu dot org, bug-gnulib at gnu dot org
- Date: Sun, 31 Dec 2006 17:32:40 -0800
- Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
- References: <200612300047.kBU0lFwk014817@localhost.localdomain> <45963E6D.5070203@t-online.de> <10612301301.AA14129@vlsi1.ultra.nyu.edu> <871wmht4ab.fsf@penguin.cs.ucla.edu> <10612302258.AA24598@vlsi1.ultra.nyu.edu> <87lkkosz1n.fsf@penguin.cs.ucla.edu> <45970416.80407@adacore.com> <8764bssikm.fsf@penguin.cs.ucla.edu> <571f6b510612310047r3b7ef9acl4a0ab082e88e17a3@mail.gmail.com> <87bqlkmm3r.fsf@penguin.cs.ucla.edu> <4aca3dc20612310641n78e8898euf1c003444e2303eb@mail.gmail.com> <45980964.7000406@gnu.org> <45980C39.7030404@adacore.com>
Robert Dewar <dewar@adacore.com> writes:
> We have not seen ONE imaginary example, let
> alone a real example, where the optimziation of loop invariants
> (by far the most important optimization in the class we are
> discussing) would break existing code.
But didn't this thread get started by a real program that was broken
by an optimization of loop invariants? Certainly I got a real bug
report of a real problem, which you can see here:
http://lists.gnu.org/archive/html/bug-gnulib/2006-12/msg00084.html
Here is a bit more discussion:
http://gcc.gnu.org/ml/gcc/2006-12/msg00607.html
If this doesn't count as "optimization of loop invariants"
then what would count?
This particular example was just a test program run by "configure", so
the penalty for getting it wrong wasn't that severe -- the application
compiled its own version of mktime rather than using the system
mktime. But I daresay I can find an example of real-world production
code that does something similar.