On Thursday 23 November 2006 12:39, Peter Humphrey wrote:
> On Wednesday 22 November 2006 16:28, I wrote:
> > So now I suppose I have a lot of CFLAGS to juggle to find out which one
> > hurts gnupg so that I can report it.
>
> It didn't take too long after all. I found that omitting, or
> removing, -fmerge-all-constants from CFLAGS enabled gnupg to compile
> with -ldap. I don't think gnupg uses C++ so I didn't play with CXXFLAGS.
>
> # grep FLAGS /etc/make.conf
> CFLAGS="-march=k8 -Os -pipe -frename-registers -fweb -freorder-blocks \
> -freorder-blocks-and-partition -combine -funit-at-a-time \
> -ftree-pre -fgcse-sm -fgcse-las -fgcse-after-reload -fmerge-all-constants"
> CXXFLAGS="-march=k8 -Os -pipe -frename-registers -fweb -freorder-blocks \
> -funit-at-a-time -ftree-pre -fgcse-sm -fgcse-las -fgcse-after-reload
> -fmerge-all-constants"
>
> #cat /etc/portage/env/app-crypt/gnupg
> CFLAGS=${CFLAGS//-fmerge-all-constants}
>
> I haven't decided whether it's worth reporting a bug; perhaps it's enough
> that people here know what's needed.
>
> --
> Rgds
> Peter
Sorry, but using that flag is just asking for trouble.
From the GCC man-page:

-fmerge-all-constants
"Languages like C or C++ require each non-automatic variable to have distinct 
location, so using this option will result in non-conforming behavior. "

Also, have you benchmarked in any way the effect of all these optimizations on 
the programs you run? You basically do -Os and then turn almost everything on 
which differs -O2 from -Os, negating the size difference, plus some extra 
very experimental flags, which might increase or decrease performance (sorry, 
but GCC works that way, extra optimizations could actually by 
pessimizations), and probably break some programs. 

Playing on your own computer is fine, but don't be surprised if something 
breaks, and please don't bother other people with it. It certainly is not a 
GCC 4.x problem.

Jan Jitse

Attachment: pgpBv6TGVSvvv.pgp
Description: PGP signature

Reply via email to