enabling -O2 with gcc 2.96 and later
Phil Edwards
pedwards@jaj.com
Fri Dec 17 12:13:00 GMT 1999
> > My first approach was wonderfully freakin' braindead.
>
> No offense intended, but so is this second attempt, IMHO :-)
You didn't see my first attempt. :-)
> AC_EGREP_CPP([ok], [
> #if (__GNUC__ == 2 && __GNUC_MINOR__ > 95) || __GNUC__ > 2
> ok
> #fi
> ], [OPTLEVEL='-O2'], [OPTLEVEL=])
> AC_SUBST(OPTLEVEL)
Yes, I like that much better. (The last time I tried using EGREP_CPP,
bad things happened. But this works.)
Since the optimization level was set in AM_CXXFLAGS before, that's where
I'd left it. It's been moved to CXXFLAGS now.
Only one other issue before I check this in, barring protests: Theodore
Papadopoulo suggested that
Maybe you want to add -fstrict-aliasing for 2.96 as it has
been (temporarily?) invalidated....
I'm not qualified to speak on how aliasing issues affects the contents
of the src directory (since the Makefiles in, say, the math subdir,
aren't being changed).
(If you reply to the list, please don't cc another copy to me. Thanks!)
Phil
More information about the Libstdc++
mailing list