From 06063fa227a70ca205543138499a3a024fefd3dd Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 13 Jun 2007 15:58:31 +0200 Subject: [PATCH] sparc.c (sparc_override_options): Initialize fpu mask correctly. * config/sparc/sparc.c (sparc_override_options): Initialize fpu mask correctly. From-SVN: r125674 --- gcc/ChangeLog | 5 +++++ gcc/config/sparc/sparc.c | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/sparc/mfpu.c | 11 +++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/sparc/mfpu.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d5a3eaa55364..8fc77de10124 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-06-13 Eric Botcazou + + * config/sparc/sparc.c (sparc_override_options): Initialize + fpu mask correctly. + 2007-06-13 Dave Korn * config/i386/i386.c (ix86_eax_live_at_start_p): Use diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index e8c539e64b44..190c82ec0ce2 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -705,7 +705,7 @@ sparc_override_options (void) error ("-mcmodel= is not supported on 32 bit systems"); } - fpu = TARGET_FPU; /* save current -mfpu status */ + fpu = target_flags & MASK_FPU; /* save current -mfpu status */ /* Set the default CPU. */ for (def = &cpu_default[0]; def->name; ++def) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7d677eb94a64..a0d61bef205a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-06-13 Eric Botcazou + + * gcc.target/sparc/mfpu.c: New test. + 2007-06-12 Geoff Keating * g++.dg/warn/weak1.C: Suppress on Darwin. diff --git a/gcc/testsuite/gcc.target/sparc/mfpu.c b/gcc/testsuite/gcc.target/sparc/mfpu.c new file mode 100644 index 000000000000..e95754c5d6ba --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/mfpu.c @@ -0,0 +1,11 @@ +/* Reported by Peter A. Krauss */ + +/* { dg-do compile } */ +/* { dg-options "-mfpu" } */ + +float square(float x) +{ + return x * x; +} + +/* { dg-final { scan-assembler "fmuls" } } */