From 0705d3f487d2b8c709c25051f55079a6e22cb3d0 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 17 Feb 2009 22:17:52 -0800 Subject: [PATCH] re PR target/38891 (using ms_abi function attribute with -mno-sse generates an internal compiler error) gcc/ 2009-02-17 Xuepeng Guo 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 PR target/38891 * gcc.dg/callabi/pr38891.c: New. 2009-02-17 H.J. Lu * gcc.dg/callabi/callabi.exp: New. From-SVN: r144258 --- gcc/ChangeLog | 6 +++++ gcc/config/i386/i386.h | 22 ++++++++--------- gcc/testsuite/ChangeLog | 9 +++++++ gcc/testsuite/gcc.dg/callabi/callabi.exp | 31 ++++++++++++++++++++++++ gcc/testsuite/gcc.dg/callabi/pr38891.c | 10 ++++++++ 5 files changed, 67 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/callabi/callabi.exp create mode 100644 gcc/testsuite/gcc.dg/callabi/pr38891.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 780468f393c..ac325e02264 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-02-17 Xuepeng Guo + + 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 PR target/39082 diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 14e7438c4a5..a8b97d3cbf1 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ca72b0223a4..9b8b8a98300 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2009-02-17 Xuepeng Guo + + PR target/38891 + * gcc.dg/callabi/pr38891.c: New. + +2009-02-17 H.J. Lu + + * gcc.dg/callabi/callabi.exp: New. + 2009-02-17 H.J. Lu 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 index 00000000000..1c11ecc611e --- /dev/null +++ b/gcc/testsuite/gcc.dg/callabi/callabi.exp @@ -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 +# . + +# 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 index 00000000000..586e99f143d --- /dev/null +++ b/gcc/testsuite/gcc.dg/callabi/pr38891.c @@ -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 () +{ +}