From 953c29f73eb8ad665a5e1324bb0b66f98a8e6839 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 20 May 2010 20:52:03 +0200 Subject: [PATCH] re PR target/43733 (bootstrap fails on Solaris 10 x86 with GNU as 2.15 and --with-arch=core2) PR target/43733 * configure.ac (gcc_cv_as_ix86_sahf): Switch to 64bit mode. * configure: Regenerate. * config.in: Regenerate. * config/i386/i386.md (x86_sahf_1): Conditionally output 0x9e instead of sahf only for 64bit targets. From-SVN: r159636 --- gcc/ChangeLog | 9 +++++++++ gcc/config.in | 14 +++++++------- gcc/config/i386/i386.md | 9 +++++---- gcc/configure | 3 ++- gcc/configure.ac | 5 +++-- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 769697c8716..520bbb67678 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2010-05-20 Uros Bizjak + + PR target/43733 + * configure.ac (gcc_cv_as_ix86_sahf): Switch to 64bit mode. + * configure: Regenerate. + * config.in: Regenerate. + * config/i386/i386.md (x86_sahf_1): Conditionally output 0x9e + instead of sahf only for 64bit targets. + 2010-05-20 Jakub Jelinek PR debug/44178 diff --git a/gcc/config.in b/gcc/config.in index a1c117ab0b1..86b237b2d7c 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -309,19 +309,19 @@ #endif -/* Define true if the assembler supports 'rep , lock '. */ -#ifndef USED_FOR_TARGET -#undef HAVE_AS_IX86_REP_LOCK_PREFIX -#endif - - /* Define if your assembler supports the .quad directive. */ #ifndef USED_FOR_TARGET #undef HAVE_AS_IX86_QUAD #endif -/* Define if your assembler supports the sahf mnemonic. */ +/* Define true if the assembler supports 'rep , lock '. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_IX86_REP_LOCK_PREFIX +#endif + + +/* Define if your assembler supports the sahf mnemonic in 64bit mode. */ #ifndef USED_FOR_TARGET #undef HAVE_AS_IX86_SAHF #endif diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 35b2f215f28..2dd6699ae1d 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -1428,11 +1428,12 @@ UNSPEC_SAHF))] "TARGET_SAHF" { -#ifdef HAVE_AS_IX86_SAHF - return "sahf"; -#else - return ASM_BYTE "0x9e"; +#ifndef HAVE_AS_IX86_SAHF + if (TARGET_64BIT) + return ASM_BYTE "0x9e"; + else #endif + return "sahf"; } [(set_attr "length" "1") (set_attr "athlon_decode" "vector") diff --git a/gcc/configure b/gcc/configure index 82f65046aed..8013a15079a 100755 --- a/gcc/configure +++ b/gcc/configure @@ -23195,7 +23195,8 @@ if test "${gcc_cv_as_ix86_sahf+set}" = set; then : else gcc_cv_as_ix86_sahf=no if test x$gcc_cv_as != x; then - echo 'sahf' > conftest.s + echo '.code64 + sahf' > conftest.s if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 diff --git a/gcc/configure.ac b/gcc/configure.ac index 15b126fe347..a80900c7c44 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3288,9 +3288,10 @@ foo: nop gcc_GAS_CHECK_FEATURE([sahf mnemonic], gcc_cv_as_ix86_sahf,,, - [sahf],, + [.code64 + sahf],, [AC_DEFINE(HAVE_AS_IX86_SAHF, 1, - [Define if your assembler supports the sahf mnemonic.])]) + [Define if your assembler supports the sahf mnemonic in 64bit mode.])]) gcc_GAS_CHECK_FEATURE([swap suffix], gcc_cv_as_ix86_swap,,,