This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: enabling -O2 with gcc 2.96 and later
- To: oliva at lsd dot ic dot unicamp dot br
- Subject: Re: enabling -O2 with gcc 2.96 and later
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sat, 18 Dec 1999 00:17:20 +0100
- CC: pedwards at jaj dot com, libstdc++ at sourceware dot cygnus dot com
- References: <199912171814.NAA05999@jaj.com> <oriu1xl6t2.fsf@benta.lsd.ic.unicamp.br>
> No offense intended, but so is this second attempt, IMHO :-)
>
> How about:
>
> AC_EGREP_CPP([ok], [
> #if (__GNUC__ == 2 && __GNUC_MINOR__ > 95) || __GNUC__ > 2
> ok
> #fi
> ], [OPTLEVEL='-O2'], [OPTLEVEL=])
> AC_SUBST(OPTLEVEL)
I did not follow this closely, but I think checking version numbers in
autoconf is morally wrong. What is the reason not to use -O2 in
earlier versions? Something is miscompiled? Well, check for the
miscompilation then, instead of the version number.
Regards,
Martin