Change profile-build options to produce 1% to 2% faster executables.
authormstembera <MissingEmail@email>
Thu, 18 Dec 2014 19:56:00 +0000 (03:56 +0800)
committerGary Linscott <glinscott@gmail.com>
Thu, 18 Dec 2014 19:57:04 +0000 (03:57 +0800)
The "@rm ucioption.gc*" line is necessary to avoid a gcc 4.7.x bug.
Confirmed for gcc 4.7.4, 4.8.1, and 4.9.1
Suggested by Kiran Panditrao on fishcooking forum.
https://groups.google.com/forum/?fromgroups=#!topic/fishcooking/AY8gN53nG18

No functional change.

Resolves #160

src/Makefile

index 80867fe..b641747 100644 (file)
@@ -373,6 +373,9 @@ profile-build:
        @$(PGOBENCH) > /dev/null
        @echo ""
        @echo "Step 3/4. Building final executable ..."
+# Deleting corrupt ucioption.gc* profile files is necessary to avoid an 
+# "internal compiler error" for gcc versions 4.7.x
+       @rm ucioption.gc*
        @touch *.cpp *.h syzygy/*.cpp syzygy/*.h
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_use)
        @echo ""
@@ -439,13 +442,13 @@ gcc-profile-prepare:
 
 gcc-profile-make:
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
-       EXTRACXXFLAGS='-fprofile-generate' \
+       EXTRACXXFLAGS='-fprofile-arcs' \
        EXTRALDFLAGS='-lgcov' \
        all
 
 gcc-profile-use:
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
-       EXTRACXXFLAGS='-fprofile-use' \
+       EXTRACXXFLAGS='-fbranch-probabilities' \
        EXTRALDFLAGS='-lgcov' \
        all