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: Robert Dewar <dewar at adacore dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: 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
- Date: Sat, 24 Mar 2007 15:14:55 -0400
- Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
- References: <200612300047.kBU0lFwk014817@localhost.localdomain> <87bqlmkui3.fsf@penguin.cs.ucla.edu> <m33b3v5swl.fsf@localhost.localdomain> <4604BB5F.7050706@adacore.com> <m3aby24h3u.fsf@localhost.localdomain>
Ian Lance Taylor wrote:
You're right, I shouldn't have said "implementation defined."
What will happen with -fno-strict-overflow is whatever the processor
ISA happens to do when a signed arithmetic operation overflows. For
ordinary machines it will just wrap.
Given that all ordinary machines wrap, is there really enough
difference in performance in practice between -fno-strict-overflow
and -fwrapv to justify adding this vague and rather dubious (given
it is vague) switch. Saying "whatever the processor does" is not
enough, since on some processors there are multiple addition
instructions (e.g. trapping and non-trapping variants)
It is intentionally vague. If you need non-vague semantics, you
should use -fwrapv. -fno-strict-overflow is intended to provide the
vague semantics which C compilers have historically provided, in
support of existing code.
Well I find vague semantics intrinsically unappealing!