Power object attributes

Joseph S. Myers joseph@codesourcery.com
Sun Jul 1 22:00:00 GMT 2007


Further to my patch to use object attributes on MIPS 
<http://gcc.gnu.org/ml/gcc-patches/2007-06/msg02155.html>, here is one to 
use them on Power.  This patch marks the floating-point ABI; it's only 
relevant to 32-bit.

Tested with no regressions with cross to powerpc-linux-gnu.  OK to commit?

2007-07-01  Joseph Myers  <joseph@codesourcery.com>

	* configure.ac: Check for .gnu_attribute on Power.
	* configure: Regenerate.
	* config/rs6000/rs6000.c (rs6000_file_start): If supported, output
	attribute for floating-point ABI.

Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 126176)
+++ gcc/configure.ac	(working copy)
@@ -2929,6 +2929,12 @@
       [$conftest_s],,
       [AC_DEFINE(HAVE_AS_DFP, 1,
 	  [Define if your assembler supports DFP instructions.])])
+
+    gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
+      gcc_cv_as_powerpc_gnu_attribute, [2,18,0],,
+      [.gnu_attribute 4,1],,
+      [AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
+	  [Define if your assembler supports .gnu_attribute.])])
     ;;
 
   mips*-*-*)
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 126176)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -2205,6 +2205,12 @@
 	putc ('\n', file);
     }
 
+#ifdef HAVE_AS_GNU_ATTRIBUTE
+  if (TARGET_32BIT && DEFAULT_ABI == ABI_V4)
+    fprintf (file, "\t.gnu_attribute 4, %d\n",
+	     (TARGET_HARD_FLOAT && TARGET_FPRS) ? 1 : 2);
+#endif
+
   if (DEFAULT_ABI == ABI_AIX || (TARGET_ELF && flag_pic == 2))
     {
       switch_to_section (toc_section);

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list