Force use of level 1 Liftetime DSE optimization on modern GCC

Instead of completely disabling it.
This commit is contained in:
trav90 2018-04-19 11:39:02 -05:00 • committed by Roy Tam
commit b2917cce1d

View file

@ -183,16 +183,15 @@ if test "$GNU_CC"; then
case "$CC_VERSION" in case "$CC_VERSION" in
4.*) 4.*)
;; ;;
5.*)
;;
*) *)
# Lifetime Dead Store Elimination level 2 (default in GCC6+) breaks Gecko. # Lifetime Dead Store Elimination level 2 (default in GCC6+) breaks Gecko.
# Ideally, we'd use -flifetime-dse=1, but that means we'd forcefully # Instead of completely disabling this optimization on newer GCC's,
# enable it on optimization levels where it would otherwise not be enabled. # we'll force them to use level 1 optimization with -flifetime-dse=1.
# So we disable it entirely. But since that would mean inconsistency with
# GCC5, which has level 1 depending on optimization level, disable it on
# GCC5 as well, because better safe than sorry.
# Add it first so that a mozconfig can override by setting CFLAGS/CXXFLAGS. # Add it first so that a mozconfig can override by setting CFLAGS/CXXFLAGS.
CFLAGS="-fno-lifetime-dse $CFLAGS" CFLAGS="-flifetime-dse=1 $CFLAGS"
CXXFLAGS="-fno-lifetime-dse $CXXFLAGS" CXXFLAGS="-flifetime-dse=1 $CXXFLAGS"
;; ;;
esac esac
fi fi