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: Florian Weimer <fw at deneb dot enyo dot de>
- To: "Daniel Berlin" <dberlin at dberlin dot org>
- Cc: "Ian Lance Taylor" <iant at google dot com>, "Paul Eggert" <eggert at cs dot ucla dot edu>, autoconf-patches at gnu dot org, bug-gnulib at gnu dot org, gcc at gcc dot gnu dot org, dnovillo at redhat dot com
- Date: Fri, 29 Dec 2006 22:46:58 +0100
- Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
- References: <87fybbyq27.fsf@penguin.cs.ucla.edu> <20061220123349.GE7947@iam.uni-bonn.de> <emc3jc$eap$1@sea.gmane.org> <87mz57xjlf.fsf@penguin.cs.ucla.edu> <m3odpmsnlc.fsf@localhost.localdomain> <4aca3dc20612291012x19bbb212l7d86b335a0bbeee4@mail.gmail.com>
* Daniel Berlin:
> OTOH, people who rely on signed overflow being wraparound generally
> *know* they are relying on it.
> Given this seems to be some small number of people and some small
> amount of code (since nobody has produced any examples showing this
> problem is rampant, in which case i'm happy to be proven wrong), why
> don't they just compile *their* code with -fwrapv?
A lot of security patches to address integer overflow issues use
post-overflow checks, unfortunately. Even if GCC optimizes them away,
it's unlikely that it'll break applications in an obvious way.
(Security-related test cases are typically not publicly available.)