--- old/usr/src/Makefile.master	Tue Oct  7 15:48:33 2014
+++ new/usr/src/Makefile.master	Tue Oct  7 15:48:33 2014
@@ -23,6 +23,7 @@
 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright (c) 2012 by Delphix. All rights reserved.
 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
+# Copyright 2014 Gary Mills
 #
 
 #
@@ -414,15 +415,34 @@
 i386_ASFLAGS=	$(i386_AS_XARCH)
 amd64_ASFLAGS=	$(amd64_AS_XARCH)
 
-#
-sparc_COPTFLAG=		-xO3
-sparcv9_COPTFLAG=	-xO3
-i386_COPTFLAG=		-O
-amd64_COPTFLAG=		-xO3
+# Default adjustments to specified gcc optimization level
+# 
+# For -O and -O1
+ADJUST_OPT1=
+# For -O2
+ADJUST_OPT2=		-_gcc=-fno-strict-aliasing \
+			-_gcc=-fno-unit-at-a-time \
+			-_gcc=-fno-optimize-sibling-calls
 
-COPTFLAG= $($(MACH)_COPTFLAG)
-COPTFLAG64= $($(MACH64)_COPTFLAG)
+sparc_ADJCOPT=		$(ADJUST_OPT2)
+sparcv9_ADJCOPT=	$(ADJUST_OPT2)
+i386_ADJCOPT=		$(ADJUST_OPT1)
+amd64_ADJCOPT=		$(ADJUST_OPT2)
 
+# Symbols that can be redefined in individual Makefiles
+ADJCOPT= $($(MACH)_ADJCOPT)
+ADJCOPT64= $($(MACH64)_ADJCOPT)
+
+# These symbols are sometimes redefined in individual Makefiles
+sparc_COPTFLAG=		-_cc=-xO3 -_gcc=-O2
+sparcv9_COPTFLAG=	-_cc=-xO3 -_gcc=-O2
+i386_COPTFLAG=		-_cc=-O -_gcc=-O
+amd64_COPTFLAG=		-_cc=-xO3 -_gcc=-O2
+
+# Documented symbols that can be redefined in individual Makefiles
+COPTFLAG= $(ADJCOPT) $($(MACH)_COPTFLAG)
+COPTFLAG64= $(ADJCOPT64) $($(MACH64)_COPTFLAG)
+
 # When -g is used, the compiler globalizes static objects
 # (gives them a unique prefix). Disable that.
 CNOGLOBAL= -W0,-noglobal
@@ -603,18 +623,21 @@
 			-Qoption ccfe -features=no%conststrings \
 			$(CCERRWARN)
 
-sparc_CCOPTFLAG=	-O
-sparcv9_CCOPTFLAG=	-O
-i386_CCOPTFLAG=		-O
-amd64_CCOPTFLAG=	-O
+sparc_CCOPTFLAG=	-_CC=-O -_g++=-O
+sparcv9_CCOPTFLAG=	-_CC=-O -_g++=-O
+i386_CCOPTFLAG=		-_CC=-O -_g++=-O
+amd64_CCOPTFLAG=	-_CC=-O -_g++=-O
 
-CCOPTFLAG=	$($(MACH)_CCOPTFLAG)
-CCOPTFLAG64=	$($(MACH64)_CCOPTFLAG)
-CCFLAGS=	$(CCOPTFLAG) $($(MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
-		$(CCUSERFLAGS)
-CCFLAGS64=	$(CCOPTFLAG64) $($(MACH64)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
-		$(CCUSERFLAGS64)
+ADJCCOPT=	$(ADJUST_OPT1)
+ADJCCOPT64=	$(ADJUST_OPT1)
 
+CCOPTFLAG=	$(ADJCCOPT) $($(MACH)_CCOPTFLAG)
+CCOPTFLAG64=	$(ADJCCOPT) $($(MACH64)_CCOPTFLAG)
+CCFLAGS=	$(CCOPTFLAG) $($(MACH)_CCFLAGS) \
+		$(CCSOURCEDEBUGFLAGS) $(CCUSERFLAGS)
+CCFLAGS64=	$(CCOPTFLAG64) $($(MACH64)_CCFLAGS) \
+		$(CCSOURCEDEBUGFLAGS) $(CCUSERFLAGS64)
+
 #
 #
 #
--- old/usr/src/cmd/dtrace/test/tst/Makefile.com	Tue Oct  7 15:48:34 2014
+++ new/usr/src/cmd/dtrace/test/tst/Makefile.com	Tue Oct  7 15:48:34 2014
@@ -20,6 +20,7 @@
 #
 
 #
+# Copyright 2014 Gary Mills
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -58,7 +59,7 @@
 # agressive optimization of small, simple, one compilation-unit programs may
 # utterly subvert.  We force the compiler to not optimize rather than engage
 # in an arms race with increasingly belligerent optimizers.
-COPTFLAG=	-xO0
+COPTFLAG=	-_cc=-xO0 -_gcc=-O0
 
 CERRWARN +=	-_gcc=-Wno-switch
 CERRWARN +=	-_gcc=-Wno-unused-variable
--- old/usr/src/cmd/dtrace/test/tst/common/Makefile	Tue Oct  7 15:48:34 2014
+++ new/usr/src/cmd/dtrace/test/tst/common/Makefile	Tue Oct  7 15:48:34 2014
@@ -27,6 +27,7 @@
 #
 # Copyright (c) 2012 by Delphix. All rights reserved.
 # Copyright (c) 2013, Joyent, Inc. All rights reserved.
+# Copyright 2014 Gary Mills
 #
 
 #
@@ -54,7 +55,7 @@
 sysevent/tst.post.exe := LDLIBS += -lsysevent
 sysevent/tst.post_chan.exe := LDLIBS += -lsysevent
 
-ustack/tst.bigstack.exe := COPTFLAG += -xO1
+ustack/tst.bigstack.exe := COPTFLAG = $(ADJUST_OPT1) -_cc=-xO1 -_gcc=-O1
 
 GCC = $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
 
--- old/usr/src/lib/libc/sparc/Makefile.com	Tue Oct  7 15:48:34 2014
+++ new/usr/src/lib/libc/sparc/Makefile.com	Tue Oct  7 15:48:34 2014
@@ -23,6 +23,7 @@
 # Copyright (c) 2012, Joyent, Inc.  All rights reserved.
 # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
 # Copyright 2013 Garrett D'Amore <garrett@damore.org>
+# Copyright 2014 Gary Mills
 #
 # Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
 # Use is subject to license terms.
@@ -1250,8 +1251,8 @@
 	_Q_sub.o
 
 $(QIL:%=pics/%) := CFLAGS += $(LIBCDIR)/$(MACH)/fp/__quad.il
-pics/_Q%.o := sparc_COPTFLAG = -xO4 -dalign
-pics/__quad%.o := sparc_COPTFLAG = -xO4 -dalign
+pics/_Q%.o := sparc_COPTFLAG = -_cc=-xO4 -_gcc=-O2 -dalign
+pics/__quad%.o := sparc_COPTFLAG = -_cc=-xO4 -_gcc=-O2 -dalign
 
 # large-file-aware components that should be built large
 
@@ -1287,7 +1288,7 @@
 	CPPFLAGS += -D_WCS_LONGLONG
 
 # Files which need extra optimization
-pics/getenv.o := sparc_COPTFLAG = -xO4
+pics/getenv.o := sparc_COPTFLAG = -_cc=-xO4 -_gcc=-O2
 
 .KEEP_STATE:
 
--- old/usr/src/lib/libc/sparcv9/Makefile.com	Tue Oct  7 15:48:34 2014
+++ new/usr/src/lib/libc/sparcv9/Makefile.com	Tue Oct  7 15:48:34 2014
@@ -23,6 +23,7 @@
 # Copyright (c) 2012, Joyent, Inc.  All rights reserved.
 # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
 # Copyright 2013 Garrett D'Amore <garrett@damore.org>
+# Copyright 2014 Gary Mills
 #
 # Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
 # Use is subject to license terms.
@@ -1181,7 +1182,7 @@
 
 $(QIL:%=pics/%) := CFLAGS64 += $(LIBCDIR)/$(MACH)/fp/__quad.il
 pics/_Qp%.o := CFLAGS64 += -I$(LIBCDIR)/$(MACH)/fp
-pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra
+pics/_Q%.o := sparcv9_COPTFLAG = -_cc=-xO4 -_gcc=-O2 -xchip=ultra
 
 # Files in crt subdirectory which need muldiv64.il inline template
 #CIL=	mul64.o divrem64.o
@@ -1214,7 +1215,7 @@
 	CPPFLAGS += -D_WCS_LONGLONG
 
 # Files which need extra optimization
-pics/getenv.o := sparcv9_COPTFLAG = -xO4
+pics/getenv.o := sparcv9_COPTFLAG = -_cc=-xO4 -_gcc=-O2
 
 .KEEP_STATE:
 
--- old/usr/src/lib/libsum/Makefile.com	Tue Oct  7 15:48:34 2014
+++ new/usr/src/lib/libsum/Makefile.com	Tue Oct  7 15:48:34 2014
@@ -20,6 +20,8 @@
 #
 
 #
+# Copyright 2014 Gary Mills
+#
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -77,10 +79,12 @@
 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).
--- old/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile	Tue Oct  7 15:48:34 2014
+++ new/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile	Tue Oct  7 15:48:34 2014
@@ -20,6 +20,7 @@
 #
 
 #
+# Copyright 2014 Gary Mills
 # Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
@@ -56,7 +57,9 @@
 LIBS =		$(DYNLIB) $(LINTLIB)
 MAPFILEDIR =	../common
 
-CFLAGS +=	-xO4 -xcrossfile
+COPTFLAG	= $(ADJUST_OPT2) -_cc=-xO4 -_gcc=-O2
+COPTFLAG64	= $(ADJUST_OPT2) -_cc=-xO4 -_gcc=-O2
+CFLAGS +=	-xcrossfile
 CPPFLAGS +=	-I$(CRYPTODIR) -I$(UTSDIR) -D_POSIX_PTHREAD_SEMANTICS
 ASFLAGS +=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM
 BIGNUM_FLAGS +=	-DPSR_MUL
--- old/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com	Tue Oct  7 15:48:34 2014
+++ new/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com	Tue Oct  7 15:48:34 2014
@@ -20,6 +20,7 @@
 #
 
 #
+# Copyright 2014 Gary Mills
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
@@ -34,7 +35,9 @@
 
 AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH)
 ASFLAGS +=	$(AS_PICFLAGS) -P
-CFLAGS +=	$(CCVERBOSE) -xO5 -xbuiltin=%all -dalign
+COPTFLAG =	$(ADJUST_OPT2) -_cc=-xO5 -_gcc=-O2
+COPTFLAG64 =	$(ADJUST_OPT2) -_cc=-xO5 -_gcc=-O2
+CFLAGS +=	$(CCVERBOSE) -xbuiltin=%all -dalign
 CERRWARN +=	-_gcc=-Wno-parentheses
 CERRWARN +=	-_gcc=-Wno-uninitialized
 CERRWARN +=	-_gcc=-Wno-unused-variable
--- old/usr/src/tools/cw/cw.c	Tue Oct  7 15:48:35 2014
+++ new/usr/src/tools/cw/cw.c	Tue Oct  7 15:48:35 2014
@@ -20,6 +20,8 @@
  */
 
 /*
+ * Copyright 2014 Gary Mills
+ *
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -33,7 +35,7 @@
  */
 
 /* If you modify this file, you must increment CW_VERSION */
-#define	CW_VERSION	"1.29"
+#define	CW_VERSION	"1.30"
 
 /*
  * -#		Verbose mode
@@ -534,16 +536,6 @@
 	newae(h, "-Wextra");
 }
 
-static void
-optim_disable(struct aelist *h, int level)
-{
-	if (level >= 2) {
-		newae(h, "-fno-strict-aliasing");
-		newae(h, "-fno-unit-at-a-time");
-		newae(h, "-fno-optimize-sibling-calls");
-	}
-}
-
 /* ARGSUSED */
 static void
 Xamode(struct aelist *h)
@@ -1305,18 +1297,6 @@
 					level = atoi(arg + 3);
 					if (level > 5)
 						error(arg);
-					if (level >= 2) {
-						/*
-						 * For gcc-3.4.x at -O2 we
-						 * need to disable optimizations
-						 * that break ON.
-						 */
-						optim_disable(ctx->i_ae, level);
-						/*
-						 * limit -xO3 to -O2 as well.
-						 */
-						level = 2;
-					}
 					(void) snprintf(s, len, "-O%d", level);
 					newae(ctx->i_ae, s);
 					free(s);
--- old/usr/src/uts/intel/arcfour/Makefile	Tue Oct  7 15:48:35 2014
+++ new/usr/src/uts/intel/arcfour/Makefile	Tue Oct  7 15:48:35 2014
@@ -19,6 +19,7 @@
 # CDDL HEADER END
 #
 #
+# Copyright 2014 Gary Mills
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -62,8 +63,10 @@
 #
 # Overrides
 #
+COPTFLAG	= $(ADJUST_OPT2) -_cc=-xO4 -_gcc=-O2
+COPTFLAG64	= $(ADJUST_OPT2) -_cc=-xO4 -_gcc=-O2
 CPPFLAGS	+= -I$(COM_DIR)
-CFLAGS		+= -xO4 -xcrossfile
+CFLAGS		+= -xcrossfile
 CLEANFILES	+= arcfour-x86_64.s
 
 #
--- old/usr/src/uts/intel/bignum/Makefile.64	Tue Oct  7 15:48:35 2014
+++ new/usr/src/uts/intel/bignum/Makefile.64	Tue Oct  7 15:48:35 2014
@@ -19,6 +19,7 @@
 # CDDL HEADER END
 #
 #
+# Copyright 2014 Gary Mills
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -42,8 +43,9 @@
 # There is only one implementation, because the 128 bit multiply using
 # general-purpose registers is faster than any MMX or SSE2 implementation.
 
+COPTFLAG64	  = $(ADJUST_OPT2) -_cc=-xO4 -_gcc=-O2
 BIGNUM_CFG = -DPSR_MUL
-CFLAGS	+= -xO4 -xcrossfile
+CFLAGS	+= -xcrossfile
 $(OBJS_DIR)/bignumimpl.o $(LINTS_DIR)/bignumimpl.ln := \
 	CPPFLAGS += $(BIGNUM_CFG)
 $(OBJS_DIR)/bignum_amd64.o $(LINTS_DIR)/bignum_amd64.ln := \
--- old/usr/src/uts/intel/myri10ge/Makefile	Tue Oct  7 15:48:35 2014
+++ new/usr/src/uts/intel/myri10ge/Makefile	Tue Oct  7 15:48:35 2014
@@ -19,6 +19,7 @@
 # CDDL HEADER END
 #
 #
+# Copyright 2014 Gary Mills
 # Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
@@ -55,7 +56,7 @@
 #
 LINTTAGS  += -DSOLARIS_S11 -erroff=E_STATIC_UNUSED
 
-#COPTIMIZE = -xO4
+#COPTIMIZE = -_cc=-xO4 -_gcc=-O2
 
 INC_PATH  += -I$(UTSBASE)/common/io/myri10ge -I$(UTSBASE)/common/io/myri10ge/firmware
 
--- old/usr/src/uts/intel/ntxn/Makefile	Tue Oct  7 15:48:35 2014
+++ new/usr/src/uts/intel/ntxn/Makefile	Tue Oct  7 15:48:35 2014
@@ -20,6 +20,7 @@
 #
 
 #
+# Copyright 2014 Gary Mills
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -56,8 +57,10 @@
 
 INC_PATH	+= -I$(CONF_SRCDIR)
 
-CFLAGS		+=  -DSOLARIS11 -xO4
-CFLAGS64	+=  -DSOLARIS11 -xO -I./
+COPTFLAG	= $(ADJUST_OPT2) -_cc=-xO4 -_gcc=-O2
+COPTFLAG64	= $(ADJUST_OPT2) -_cc=-xO4 -_gcc=-O2
+CFLAGS		+=  -DSOLARIS11
+CFLAGS64	+=  -DSOLARIS11 -I./
 
 #
 #	Driver depends on MAC & IP
--- old/usr/src/uts/intel/xge/Makefile	Tue Oct  7 15:48:35 2014
+++ new/usr/src/uts/intel/xge/Makefile	Tue Oct  7 15:48:35 2014
@@ -20,6 +20,7 @@
 #
 
 #
+# Copyright 2014 Gary Mills
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -85,8 +86,10 @@
 		-I$(UTSBASE)/common/io/xge/hal/xgehal \
 		-I$(UTSBASE)/common/io/xge/drv -DSOLARIS
 
-CFLAGS		+= $(XGE_CFLAGS) -xO4 -xcrossfile -xc99=%all
-CFLAGS64	+= $(XGE_CFLAGS) -xO4 -xcrossfile -xc99=%all
+COPTFLAG	= $(ADJUST_OPT2) -_cc=-xO4 -_gcc=-O2
+COPTFLAG64	= $(ADJUST_OPT2) -_cc=-xO4 -_gcc=-O2
+CFLAGS		+= $(XGE_CFLAGS) -xcrossfile -xc99=%all
+CFLAGS64	+= $(XGE_CFLAGS) -xcrossfile -xc99=%all
 
 #
 #	Driver depends on MAC & IP
--- old/usr/src/uts/sparc/Makefile.sparc	Tue Oct  7 15:48:36 2014
+++ new/usr/src/uts/sparc/Makefile.sparc	Tue Oct  7 15:48:36 2014
@@ -21,8 +21,8 @@
 
 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright (c) 2013 Andrew Stormont.  All rights reserved.
+# Copyright 2014 Gary Mills
 
-
 #
 #	This makefile contains the common definitions for all sparc
 #	implementation architecture independent modules.
@@ -114,8 +114,8 @@
 XARCH_64	= -m64
 XARCH		= $(XARCH_$(CLASS))
 
-COPTIMIZE_32	= -xO3
-COPTIMIZE_64	= -xO3
+COPTIMIZE_32	= -_cc=-xO3 -_gcc=-O2
+COPTIMIZE_64	= -_cc=-xO3 -_gcc=-O2
 COPTIMIZE	= $(COPTIMIZE_$(CLASS))
 
 CCMODE		= -Xa
--- old/usr/src/uts/sparc/dld/Makefile	Tue Oct  7 15:48:36 2014
+++ new/usr/src/uts/sparc/dld/Makefile	Tue Oct  7 15:48:36 2014
@@ -19,6 +19,7 @@
 # CDDL HEADER END
 #
 #
+# Copyright 2014 Gary Mills
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -55,7 +56,7 @@
 #
 CFLAGS				+= $(CCVERBOSE)
 $(RELEASE_BUILD)CFLAGS		+= -xinline=auto -xcrossfile
-$(RELEASE_BUILD)COPTIMIZE	= -xO5
+$(RELEASE_BUILD)COPTIMIZE	= -_cc=-xO5 -_gcc=-O2
 LDFLAGS				+= -dy -N misc/dls -N misc/mac
 INC_PATH			+= -I$(UTSBASE)/common/io/bpf
 
--- old/usr/src/uts/sparc/dls/Makefile	Tue Oct  7 15:48:36 2014
+++ new/usr/src/uts/sparc/dls/Makefile	Tue Oct  7 15:48:36 2014
@@ -19,6 +19,7 @@
 # CDDL HEADER END
 #
 #
+# Copyright 2014 Gary Mills
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -53,7 +54,7 @@
 #
 CFLAGS				+= $(CCVERBOSE)
 $(RELEASE_BUILD)CFLAGS		+= -xinline=auto -xcrossfile
-$(RELEASE_BUILD)COPTIMIZE	= -xO5
+$(RELEASE_BUILD)COPTIMIZE	= -_cc=-xO5 -_gcc=-O2
 LDFLAGS				+= -dy -N misc/mac
 INC_PATH			+= -I$(UTSBASE)/common/io/bpf
 
--- old/usr/src/uts/sparc/mac/Makefile	Tue Oct  7 15:48:36 2014
+++ new/usr/src/uts/sparc/mac/Makefile	Tue Oct  7 15:48:36 2014
@@ -19,6 +19,7 @@
 # CDDL HEADER END
 #
 #
+# Copyright 2014 Gary Mills
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -58,7 +59,7 @@
 #
 CFLAGS				+= $(CCVERBOSE)
 $(RELEASE_BUILD)CFLAGS		+= -xinline=auto -xcrossfile
-$(RELEASE_BUILD)COPTIMIZE	= -xO5
+$(RELEASE_BUILD)COPTIMIZE	= -_cc=-xO5 -_gcc=-O2
 LDFLAGS				+= -dy
 INC_PATH			+= -I$(UTSBASE)/common/io/bpf
 
--- old/usr/src/uts/sparc/myri10ge/Makefile	Tue Oct  7 15:48:36 2014
+++ new/usr/src/uts/sparc/myri10ge/Makefile	Tue Oct  7 15:48:36 2014
@@ -19,6 +19,7 @@
 # CDDL HEADER END
 #
 #
+# Copyright 2014 Gary Mills
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -56,7 +57,7 @@
 #
 LINTTAGS  += -DSOLARIS_S11 -erroff=E_STATIC_UNUSED
 
-#COPTIMIZE = -xO4
+#COPTIMIZE = -_cc=-xO4 -_gcc=-O2
 
 INC_PATH  += -I$(UTSBASE)/common/io/myri10ge -I$(UTSBASE)/common/io/myri10ge/firmware
 
--- old/usr/src/uts/sparc/xge/Makefile	Tue Oct  7 15:48:36 2014
+++ new/usr/src/uts/sparc/xge/Makefile	Tue Oct  7 15:48:36 2014
@@ -20,6 +20,7 @@
 #
 
 #
+# Copyright 2014 Gary Mills
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -85,8 +86,10 @@
 		-I$(UTSBASE)/common/io/xge/hal/xgehal \
 		-I$(UTSBASE)/common/io/xge/drv -DSOLARIS
 
-CFLAGS		+= $(XGE_CFLAGS) -xO4 -xcrossfile -xc99=%all
-CFLAGS64	+= $(XGE_CFLAGS) -xO4 -xcrossfile -xc99=%all
+COPTFLAG	= $(ADJUST_OPT2) -_cc=-xO4 -_gcc=-O2
+COPTFLAG64	= $(ADJUST_OPT2) -_cc=-xO4 -_gcc=-O2
+CFLAGS		+= $(XGE_CFLAGS) -xcrossfile -xc99=%all
+CFLAGS64	+= $(XGE_CFLAGS) -xcrossfile -xc99=%all
 
 #
 #	Driver depends on MAC & IP
--- old/usr/src/uts/sun4u/Makefile.sun4u	Tue Oct  7 15:48:36 2014
+++ new/usr/src/uts/sun4u/Makefile.sun4u	Tue Oct  7 15:48:36 2014
@@ -23,6 +23,7 @@
 # Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 # Copyright (c) 2013 Andrew Stormont.  All rights reserved.
+# Copyright 2014 Gary Mills
 #
 #	This makefile contains the common definitions for the sun4u unix
 #	and all sun4u implementation architecture dependent modules.
@@ -191,7 +192,7 @@
 #
 CC_XARCH	= -m64 -xarch=sparcvis
 AS_XARCH	= -xarch=v9a
-COPTIMIZE	= -xO3
+COPTIMIZE	= -_cc=-xO3 -_gcc=-O2
 CCMODE		= -Xa
 
 CFLAGS		= -xchip=ultra $(CCABS32) $(CCREGSYM)
--- old/usr/src/uts/sun4v/Makefile.sun4v	Tue Oct  7 15:48:37 2014
+++ new/usr/src/uts/sun4v/Makefile.sun4v	Tue Oct  7 15:48:37 2014
@@ -23,6 +23,7 @@
 # Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 # Copyright (c) 2013 Andrew Stormont.  All rights reserved.
+# Copyright 2014 Gary Mills
 #
 #	This makefile contains the common definitions for the sun4v unix
 #	and all sun4v implementation architecture dependent modules.
@@ -168,7 +169,7 @@
 #
 CC_XARCH	= -m64 -xarch=sparcvis
 AS_XARCH	= -xarch=v9v
-COPTIMIZE	= -xO3
+COPTIMIZE	= -_cc=-xO3 -_gcc=-O2
 CCMODE		= -Xa
 
 CFLAGS		= -xchip=ultra $(CCABS32) $(CCREGSYM)
--- old/usr/src/uts/sun4v/arcfour/Makefile	Tue Oct  7 15:48:37 2014
+++ new/usr/src/uts/sun4v/arcfour/Makefile	Tue Oct  7 15:48:37 2014
@@ -21,6 +21,7 @@
 #
 # uts/sun4v/arcfour/Makefile
 #
+# Copyright 2014 Gary Mills
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -72,7 +73,7 @@
 #
 # For niagara specific optimizations
 #
-COPTIMIZE	= -xO5 -xbuiltin=%all
+COPTIMIZE	= -_cc=-xO5 -_gcc=-O2 -xbuiltin=%all
 
 #
 # Override the default -xspace setting
