Print this page
5196 The cw wrapper restricts gcc to -O2

@@ -18,10 +18,12 @@
 #
 # CDDL HEADER END
 #
 
 #
+# Copyright 2014 Gary Mills
+#
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 
 SHELL=/usr/bin/ksh93

@@ -75,14 +77,16 @@
         $(ASTCFLAGS64)
 
 CERRWARN        += -_gcc=-Wno-parentheses
 
 # This codepath is performance-critical
-sparc_COPTFLAG=-xO5 -_cc=-xprefetch=auto,explicit
-sparcv9_COPTFLAG=-xO5 -_cc=-xprefetch=auto,explicit
-i386_COPTFLAG=-_cc=-xO5 -_cc=-xprefetch=auto,explicit
-amd64_COPTFLAG=-_cc=-xO5  -_cc=-xprefetch=auto,explicit
+sparc_COPTFLAG=-_cc=-xO5 -_gcc=-O2 -_cc=-xprefetch=auto,explicit
+sparcv9_COPTFLAG=-_cc=-xO5 -_gcc=-O2 -_cc=-xprefetch=auto,explicit
+# No optimization for gcc
+i386_COPTFLAG=-_cc=-xO5 -_gcc=-O0 -_cc=-xprefetch=auto,explicit
+amd64_COPTFLAG=-_cc=-xO5 -_gcc=-O0  -_cc=-xprefetch=auto,explicit
+amd64_ADJCOPT=$(ADJUST_OPT1)
 
 # Suppress this one warning as the fix would break old gcc, which upstream
 # still supports. This needs a better fix (later).
 pics/sumlib.o   := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG