From: Uros Bizjak Date: Mon, 24 May 2010 16:28:53 +0000 (+0200) Subject: backport: re PR target/43733 (bootstrap fails on Solaris 10 x86 with GNU as 2.15... X-Git-Tag: releases/gcc-4.3.6~479 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58345bdb9aa97217760117e0cd6f992e21b73bfd;p=thirdparty%2Fgcc.git backport: re PR target/43733 (bootstrap fails on Solaris 10 x86 with GNU as 2.15 and --with-arch=core2) Backport from mainline: 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. From-SVN: r159787 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0f9dbcd1537b..d062536754f1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2010-05-24 Uros Bizjak + + Backport from mainline: + 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-22 Richard Guenther * BASE-VER: Set to 4.3.6. diff --git a/gcc/config.in b/gcc/config.in index 723b88fc8e7a..c61ce5269b7d 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -272,7 +272,7 @@ #endif -/* Define if your assembler supports the sahf mnemonic. */ +/* 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 8370b810c053..c5f8e173de7c 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -1165,11 +1165,12 @@ UNSPEC_SAHF))] "TARGET_SAHF" { -#ifdef HAVE_AS_IX86_SAHF - return "sahf"; -#else - return ".byte\t0x9e"; +#ifndef HAVE_AS_IX86_SAHF + if (TARGET_64BIT) + return ".byte\t0x9e"; + else #endif + return "sahf"; } [(set_attr "length" "1") (set_attr "athlon_decode" "vector") diff --git a/gcc/configure b/gcc/configure index f7d4161e8ac5..3e2fa4ea0c10 100755 --- a/gcc/configure +++ b/gcc/configure @@ -21369,7 +21369,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 -o conftest.o conftest.s >&5' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 diff --git a/gcc/configure.ac b/gcc/configure.ac index 057c4804bbe1..5a7f2440ea69 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -2850,9 +2850,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([different section symbol subtraction], gcc_cv_as_ix86_diff_sect_delta,,,