From 49b4ff639e15ea4f04355395f2d87d7fff94824d Mon Sep 17 00:00:00 2001 From: Uros Bizjak <ubizjak@gmail.com> Date: Thu, 20 Jun 2013 20:13:31 +0200 Subject: [PATCH] re PR target/57655 (ICE: in create_pre_exit, at mode-switching.c:418 with -mno-fp-ret-in-387 -mvzeroupper -mxop and __builtin_ilogbl()) PR target/57655 * config/i386/i386.c (construct_container): Report error if long double is used with disabled x87 float returns. testsuite/ChangeLog: PR target/57655 * gcc.target/i386/pr57655.c: New test. From-SVN: r200260 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr57655.c | 10 ++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr57655.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8fad2257455b..40a36c0df5a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-06-20 Uros Bizjak <ubizjak@gmail.com> + + PR target/57655 + * config/i386/i386.c (construct_container): Report error if + long double is used with disabled x87 float returns. + 2013-06-20 Jan Hubicka <jh@suse.cz> * lto-cgraph.c (input_symtab): Do not set cgraph state. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 0060b793807e..d134604eee3f 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6498,7 +6498,7 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode, /* 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) + if (!TARGET_FLOAT_RETURNS_IN_80387 && in_return) for (i = 0; i < n; i++) if (regclass[i] == X86_64_X87_CLASS || regclass[i] == X86_64_X87UP_CLASS diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 94ebf89f03aa..c606a6ecf3d9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-06-20 Uros Bizjak <ubizjak@gmail.com> + + PR target/57655 + * gcc.target/i386/pr57655.c: New test. + 2013-06-20 Eric Botcazou <ebotcazou@adacore.com> * ada/acats/tests/gcc: Delete. diff --git a/gcc/testsuite/gcc.target/i386/pr57655.c b/gcc/testsuite/gcc.target/i386/pr57655.c new file mode 100644 index 000000000000..586d33862223 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr57655.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx -mvzeroupper -mno-fp-ret-in-387" } + +/* { dg-error "x87 register return with x87 disabled" "" { target { ! ia32 } } 8 } */ + +long double +foo (long double x) +{ + return __builtin_ilogbl (x); +} -- GitLab