]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/38891 (using ms_abi function attribute with -mno-sse generates an intern...
authorH.J. Lu <hjl@gcc.gnu.org>
Wed, 18 Feb 2009 06:17:52 +0000 (22:17 -0800)
committerH.J. Lu <hjl@gcc.gnu.org>
Wed, 18 Feb 2009 06:17:52 +0000 (22:17 -0800)
gcc/

2009-02-17  Xuepeng Guo  <xuepeng.guo@intel.com>

PR target/38891
* config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Move the hunk of
initialization for MS_ABI prior to the hunk of !TARGET_MMX.

gcc/testsuite

2009-02-17  Xuepeng Guo  <xuepeng.guo@intel.com>

PR target/38891
* gcc.dg/callabi/pr38891.c: New.

2009-02-17  H.J. Lu  <hongjiu.lu@intel.com>

* gcc.dg/callabi/callabi.exp: New.

From-SVN: r144258

gcc/ChangeLog
gcc/config/i386/i386.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/callabi/callabi.exp [new file with mode: 0644]
gcc/testsuite/gcc.dg/callabi/pr38891.c [new file with mode: 0644]

index 780468f393c976fb5d4a5fa94e1445e739ed2dc4..ac325e02264e0763d96aef5905e9fcf07c44e423 100644 (file)
@@ -1,3 +1,9 @@
+2009-02-17  Xuepeng Guo  <xuepeng.guo@intel.com>
+
+       PR target/38891
+       * config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Move the hunk of
+       initialization for MS_ABI prior to the hunk of !TARGET_MMX.
+
 2009-02-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/39082
index 14e7438c4a51a7432d447d7c70699583a670ef7b..a8b97d3cbf1b2cda237e7d1a14fe4e387deb6762 100644 (file)
@@ -937,6 +937,17 @@ do {                                                                       \
        fixed_regs[j] = 1;                                              \
        call_used_regs[j] = 1;                                          \
       }                                                                        \
+    if (TARGET_64BIT                                                   \
+        && ((cfun && cfun->machine->call_abi == MS_ABI)                        \
+            || (!cfun && DEFAULT_ABI == MS_ABI)))                      \
+      {                                                                        \
+        int i;                                                         \
+        call_used_regs[4 /*RSI*/] = 0;                                  \
+        call_used_regs[5 /*RDI*/] = 0;                                  \
+       for (i = 0; i < 8; i++)                                         \
+         call_used_regs[45+i] = 0;                                     \
+       call_used_regs[27] = call_used_regs[28] = 0;                    \
+      }                                                                        \
     if (! TARGET_MMX)                                                  \
       {                                                                        \
        int i;                                                          \
@@ -968,17 +979,6 @@ do {                                                                       \
        for (i = FIRST_REX_SSE_REG; i <= LAST_REX_SSE_REG; i++)         \
          reg_names[i] = "";                                            \
       }                                                                        \
-    if (TARGET_64BIT                                                   \
-        && ((cfun && cfun->machine->call_abi == MS_ABI)                        \
-            || (!cfun && DEFAULT_ABI == MS_ABI)))                      \
-      {                                                                        \
-        int i;                                                         \
-        call_used_regs[4 /*RSI*/] = 0;                                  \
-        call_used_regs[5 /*RDI*/] = 0;                                  \
-       for (i = 0; i < 8; i++)                                         \
-         call_used_regs[45+i] = 0;                                     \
-       call_used_regs[27] = call_used_regs[28] = 0;                    \
-      }                                                                        \
   } while (0)
 
 /* Return number of consecutive hard regs needed starting at reg REGNO
index ca72b0223a43d094b1d59e8a0a18c246c76f27d3..9b8b8a98300782f03a5645d233c636e276234aa2 100644 (file)
@@ -1,3 +1,12 @@
+2009-02-17  Xuepeng Guo  <xuepeng.guo@intel.com>
+
+       PR target/38891
+       * gcc.dg/callabi/pr38891.c: New.
+
+2009-02-17  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * gcc.dg/callabi/callabi.exp: New.
+
 2009-02-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/39082
diff --git a/gcc/testsuite/gcc.dg/callabi/callabi.exp b/gcc/testsuite/gcc.dg/callabi/callabi.exp
new file mode 100644 (file)
index 0000000..1c11ecc
--- /dev/null
@@ -0,0 +1,31 @@
+#   Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+    set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+dg-init
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+    "" $DEFAULT_CFLAGS
+dg-finish
diff --git a/gcc/testsuite/gcc.dg/callabi/pr38891.c b/gcc/testsuite/gcc.dg/callabi/pr38891.c
new file mode 100644 (file)
index 0000000..586e99f
--- /dev/null
@@ -0,0 +1,10 @@
+/* Test for cross x86_64<->w64 abi standard calls.
+*/
+/* { dg-do compile { target { x86_64-*-* } } } */
+/* { dg-options "-mno-sse" } */
+#include "callabi.h"
+
+long double
+CALLABI_CROSS func_cross ()
+{
+}