This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Only assume 4-byte stack alignment on Solaris 9/x86 (PR libgomp/60107)


As described in the PR, a few libgomp testcases FAIL on Solaris 9/x86
because the SSE insns assume 16-byte stack alignment, while Solaris 9,
unlike Solaris 10, only guarantees the 4-byte alignment prescribed by
the i386 psABI.  This can be fixed, at a slight performance penalty and
code size increase, by defaulting Solaris 9/x86 to
STACK_REALIGN_DEFAULT=1.

This patch does just that.  Bootstrapped without regressions on
i386-pc-solaris2.9, ok'ed for 4.9.0 by Jakub in the PR, installed on
mainline.

	Rainer


2014-02-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR libgomp/60107
	* config/i386/sol2-9.h: New file.
	* config.gcc (i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*,
	*-*-solaris2.9*): Use it.

# HG changeset patch
# Parent 3ca092d5b3d8fd8554991136a1a48c4eaabeb941
Only assume 4-byte stack alignment on Solaris 9/x86 (PR libgomp/60107)

diff --git a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1537,6 +1537,9 @@ i[34567]86-*-solaris2* | x86_64-*-solari
 	esac
 	with_tune_32=${with_tune_32:-generic}
 	case ${target} in
+	*-*-solaris2.9*)
+		tm_file="${tm_file} i386/sol2-9.h"
+		;;
 	*-*-solaris2.1[0-9]*)
 		tm_file="${tm_file} i386/x86-64.h i386/sol2-bi.h sol2-bi.h"
 		tm_defines="${tm_defines} TARGET_BI_ARCH=1"
diff --git a/gcc/config/i386/sol2-9.h b/gcc/config/i386/sol2-9.h
new file mode 100644
--- /dev/null
+++ b/gcc/config/i386/sol2-9.h
@@ -0,0 +1,23 @@
+/* Target definitions for GCC for Intel 80386 running Solaris 9
+   Copyright (C) 2014 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+/* Solaris 9 only guarantees 4-byte stack alignment as required by the i386
+   psABI, so realign it as necessary for SSE instructions.  */
+#undef STACK_REALIGN_DEFAULT
+#define STACK_REALIGN_DEFAULT 1
-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]