From e51917ae365c16e909bf8ec4f9d3acb6e4d6fb31 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 2 Jul 2007 11:46:35 +0100 Subject: [PATCH] configure.ac: Check for .gnu_attribute on Power. * 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. From-SVN: r126197 --- gcc/ChangeLog | 7 +++++++ gcc/config/rs6000/rs6000.c | 6 ++++++ gcc/configure | 37 +++++++++++++++++++++++++++++++++++++ gcc/configure.ac | 6 ++++++ 4 files changed, 56 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a2691656661..036f8f373bd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-07-02 Joseph Myers + + * 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. + 2007-07-02 Ira Rosen PR tree-optimization/32230 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index f9bca5002a6..f54a216c0ee 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2205,6 +2205,12 @@ rs6000_file_start (void) 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); diff --git a/gcc/configure b/gcc/configure index 68f8ed6e425..c50bf8ccb00 100755 --- a/gcc/configure +++ b/gcc/configure @@ -15758,6 +15758,43 @@ cat >>confdefs.h <<\_ACEOF #define HAVE_AS_DFP 1 _ACEOF +fi + + echo "$as_me:$LINENO: checking assembler for .gnu_attribute support" >&5 +echo $ECHO_N "checking assembler for .gnu_attribute support... $ECHO_C" >&6 +if test "${gcc_cv_as_powerpc_gnu_attribute+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_powerpc_gnu_attribute=no + if test $in_tree_gas = yes; then + if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 18 \) \* 1000 + 0` + then gcc_cv_as_powerpc_gnu_attribute=yes +fi + elif test x$gcc_cv_as != x; then + echo '.gnu_attribute 4,1' > conftest.s + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + gcc_cv_as_powerpc_gnu_attribute=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_gnu_attribute" >&5 +echo "${ECHO_T}$gcc_cv_as_powerpc_gnu_attribute" >&6 +if test $gcc_cv_as_powerpc_gnu_attribute = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_AS_GNU_ATTRIBUTE 1 +_ACEOF + fi ;; diff --git a/gcc/configure.ac b/gcc/configure.ac index 3e0f53adbec..56a986a9f90 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -2929,6 +2929,12 @@ LCF0: [$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*-*-*) -- 2.30.2