aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRoland McGrath <mcgrathr@google.com>2014-02-14 17:37:23 +0000
committerRoland McGrath <roland@gcc.gnu.org>2014-02-14 17:37:23 +0000
commit88f7c49a8bfe6c9e7ac04da2ef3ba8281d3dba06 (patch)
tree7422872cc11ad04279001f8b6bb4165435fcddfd /gcc
parentf8cdff388dbc035fd20d01bff7224c998c3aee17 (diff)
downloadgcc-88f7c49a8bfe6c9e7ac04da2ef3ba8281d3dba06.zip
gcc-88f7c49a8bfe6c9e7ac04da2ef3ba8281d3dba06.tar.gz
gcc-88f7c49a8bfe6c9e7ac04da2ef3ba8281d3dba06.tar.bz2
Use ud2 assembly mnemonic when available.
gcc/ * configure.ac (HAVE_AS_IX86_UD2): New test for 'ud2' mnemonic. * configure: Regenerated. * config.in: Regenerated. * config/i386/i386.md (trap) [HAVE_AS_IX86_UD2]: Use the mnemonic instead of ASM_SHORT. From-SVN: r207789
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config.in6
-rw-r--r--gcc/config/i386/i386.md8
-rwxr-xr-xgcc/configure31
-rw-r--r--gcc/configure.ac6
5 files changed, 58 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eef35b4..dd988ce 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2014-02-14 Roland McGrath <mcgrathr@google.com>
+
+ * configure.ac (HAVE_AS_IX86_UD2): New test for 'ud2' mnemonic.
+ * configure: Regenerated.
+ * config.in: Regenerated.
+ * config/i386/i386.md (trap) [HAVE_AS_IX86_UD2]: Use the mnemonic
+ instead of ASM_SHORT.
+
2014-02-14 Vladimir Makarov <vmakarov@redhat.com>
Richard Earnshaw <rearnsha@arm.com>
diff --git a/gcc/config.in b/gcc/config.in
index 3aefa06..5aa3221 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -375,6 +375,12 @@
#endif
+/* Define if your assembler supports the 'ud2' mnemonic. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_IX86_UD2
+#endif
+
+
/* Define if your assembler supports the lituse_jsrdirect relocation. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_JSRDIRECT_RELOCS
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 05fc00a..232a334 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -17843,7 +17843,13 @@
(define_insn "trap"
[(trap_if (const_int 1) (const_int 6))]
""
- { return ASM_SHORT "0x0b0f"; }
+{
+#ifdef HAVE_AS_IX86_UD2
+ return "ud2";
+#else
+ return ASM_SHORT "0x0b0f";
+#endif
+}
[(set_attr "length" "2")])
(define_expand "prefetch"
diff --git a/gcc/configure b/gcc/configure
index 3ecd194..cab3e92 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -25109,6 +25109,37 @@ $as_echo "#define HAVE_AS_IX86_REP_LOCK_PREFIX 1" >>confdefs.h
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for ud2 mnemonic" >&5
+$as_echo_n "checking assembler for ud2 mnemonic... " >&6; }
+if test "${gcc_cv_as_ix86_ud2+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_ix86_ud2=no
+ if test x$gcc_cv_as != x; then
+ $as_echo 'ud2' > 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
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+ then
+ gcc_cv_as_ix86_ud2=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ix86_ud2" >&5
+$as_echo "$gcc_cv_as_ix86_ud2" >&6; }
+if test $gcc_cv_as_ix86_ud2 = yes; then
+
+$as_echo "#define HAVE_AS_IX86_UD2 1" >>confdefs.h
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for R_386_TLS_GD_PLT reloc" >&5
$as_echo_n "checking assembler for R_386_TLS_GD_PLT reloc... " >&6; }
if test "${gcc_cv_as_ix86_tlsgdplt+set}" = set; then :
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 402494e..969a8a6 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3895,6 +3895,12 @@ foo: nop
[AC_DEFINE(HAVE_AS_IX86_REP_LOCK_PREFIX, 1,
[Define if the assembler supports 'rep <insn>, lock <insn>'.])])
+ gcc_GAS_CHECK_FEATURE([ud2 mnemonic],
+ gcc_cv_as_ix86_ud2,,,
+ [ud2],,
+ [AC_DEFINE(HAVE_AS_IX86_UD2, 1,
+ [Define if your assembler supports the 'ud2' mnemonic.])])
+
gcc_GAS_CHECK_FEATURE([R_386_TLS_GD_PLT reloc],
gcc_cv_as_ix86_tlsgdplt,,,
[call tls_gd@tlsgdplt],