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: Geert Bosch <bosch at adacore dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: autoconf-patches at gnu dot org, bug-gnulib at gnu dot org, gcc at gcc dot gnu dot org
- Date: Mon, 1 Jan 2007 12:23:34 -0500
- Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
- References: <200612300047.kBU0lFwk014817@localhost.localdomain> <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> <84fc9c000612310645h67066c70vf9eb11af74b639a7@mail.gmail.com> <4aca3dc20612311613r2992db50o851c7d73603b42ef@mail.gmail.com> <22C62FE7-259E-43F7-9DB5-5F3A9CF574E2@adacore.com> <Pine.LNX.4.64.0701011704140.27949@digraph.polyomino.org.uk>
On Jan 1, 2007, at 12:16, Joseph S. Myers wrote:
For a program to be secure in the face of overflow, it will
generally need
explicit checks for overflow, and so -fwrapv will only help if such
checks
have been written under the presumption of -fwrapv semantics.
Yes, but often people do write such defensive code,
and many such checks now get removed by gcc.
If I compute some value, I may check the result
before accessing an array or similar. Such local
defenses are of no use with current gcc without
-fwrapv.
-Grt