diff options
author | Roger Sayle <roger@eyesopen.com> | 2006-06-04 04:28:25 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2006-06-04 04:28:25 +0000 |
commit | 94e76332ac46967475264f588302fc74e499a9dd (patch) | |
tree | ee6376aa2b3571fc442487e86565a6ef7ea0077b /gcc | |
parent | cb1b2d52bb4f0665e03d32a90d879495f72a8469 (diff) | |
download | gcc-94e76332ac46967475264f588302fc74e499a9dd.zip gcc-94e76332ac46967475264f588302fc74e499a9dd.tar.gz gcc-94e76332ac46967475264f588302fc74e499a9dd.tar.bz2 |
re PR target/26223 (ICE on long double with -mno-80387)
PR target/26223
* config/i386/i386.c (construct_container): Split static issued_error
flag into issued_sse_arg_error, issued_sse_ret_error and
issued_x87_ret_error. Issue a daignostic if the x86-64 ABI
requires the use of x87 registers and the user explicitly
specified the -mno-80387 command line option.
* gcc.target/i386/amd64-abi-2.c: New test case.
From-SVN: r114355
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 39 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/amd64-abi-2.c | 6 |
4 files changed, 52 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 34d6f17..977f32a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2006-06-03 Roger Sayle <roger@eyesopen.com> + + PR target/26223 + * config/i386/i386.c (construct_container): Split static issued_error + flag into issued_sse_arg_error, issued_sse_ret_error and + issued_x87_ret_error. Issue a daignostic if the x86-64 ABI + requires the use of x87 registers and the user explicitly + specified the -mno-80387 command line option. + 2006-06-02 Geoffrey Keating <geoffk@apple.com> * config/rs6000/host-darwin.c (sigaltstack): Protect prototype with diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 145fc2e..743535c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3247,6 +3247,11 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode, tree type, int in_return, int nintregs, int nsseregs, const int *intreg, int sse_regno) { + /* The following variables hold the static issued_error state. */ + static bool issued_sse_arg_error; + static bool issued_sse_ret_error; + static bool issued_x87_ret_error; + enum machine_mode tmpmode; int bytes = (mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode); @@ -3285,18 +3290,38 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode, some less clueful developer tries to use floating-point anyway. */ if (needed_sseregs && !TARGET_SSE) { - static bool issued_error; - if (!issued_error) + if (in_return) { - issued_error = true; - if (in_return) - error ("SSE register return with SSE disabled"); - else - error ("SSE register argument with SSE disabled"); + if (!issued_sse_ret_error) + { + error ("SSE register return with SSE disabled"); + issued_sse_ret_error = true; + } + } + else if (!issued_sse_arg_error) + { + error ("SSE register argument with SSE disabled"); + issued_sse_arg_error = true; } return NULL; } + /* Likewise, error if the ABI requires us to return values in the + x87 registers and the user specified -mno-80387. */ + if (!TARGET_80387 && in_return) + for (i = 0; i < n; i++) + if (class[i] == X86_64_X87_CLASS + || class[i] == X86_64_X87UP_CLASS + || class[i] == X86_64_COMPLEX_X87_CLASS) + { + if (!issued_x87_ret_error) + { + error ("x87 register return with x87 disabled"); + issued_x87_ret_error = true; + } + return NULL; + } + /* First construct simple cases. Avoid SCmode, since we want to use single register to pass this type. */ if (n == 1 && mode != SCmode) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index da82da6..1553c98 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-06-03 Roger Sayle <roger@eyesopen.com> + + PR target/26223 + * gcc.target/i386/amd64-abi-2.c: New test case. + 2006-06-02 Eric Christopher <echristo@apple.com> * gcc.c-torture/compile/20000804-1.c: Skip if i?86-darwin. diff --git a/gcc/testsuite/gcc.target/i386/amd64-abi-2.c b/gcc/testsuite/gcc.target/i386/amd64-abi-2.c new file mode 100644 index 0000000..2ff642d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/amd64-abi-2.c @@ -0,0 +1,6 @@ +/* PR target/26223 */ +/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */ +/* { dg-options "-mno-80387" } */ +long double foo(long double x) { return x; } /* { dg-error "x87 disabled" } */ +long double bar(long double x) { return x; } + |