[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."

From: Paul Eggert
Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
Date: Sat, 30 Dec 2006 21:57:20 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

"Dave Korn" <address@hidden> writes:

> Maybe the answer (as far as autoconf goes) is that autoconf tests should be
> compiled at -O0.

No, since one of the first rules of Autoconf is that you should test
the compiler with the same options that you intend to use use when
compiling.  Otherwise there are too many cases where compilers would
behave differently during testing than during actual compilation, and
the differences can wreak havoc on the code.

> (Maybe they could be compiled at -O0 *and* at -O2, and the results
> compared, to infer overflow behaviour and decide whether to add
> -fwrapv to the generated CFLAGS?)

That's an interesting suggestion, but it sounds a bit tricky,
since it'd mean Autoconf would have to track GCC's optimization
strategies fairly closely.  For example, if gcc -O2 enabled some
new optimization that broke wrapv assumptions in a different
way, we'd need to modify Autoconf to add a test case to detect

reply via email to

[Prev in Thread] Current Thread [Next in Thread]