sparc.c (sparc_override_options): Initialize fpu mask correctly.
authorEric Botcazou <ebotcazou@libertysurf.fr>
Wed, 13 Jun 2007 13:58:31 +0000 (15:58 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 13 Jun 2007 13:58:31 +0000 (13:58 +0000)
* config/sparc/sparc.c (sparc_override_options): Initialize
fpu mask correctly.

From-SVN: r125674

gcc/ChangeLog
gcc/config/sparc/sparc.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/sparc/mfpu.c [new file with mode: 0644]

index d5a3eaa553646696aaced0155d6332fd39dbe442..8fc77de101244145333cc3bbb66fee43300a0ee2 100644 (file)
@@ -1,3 +1,8 @@
+2007-06-13  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * config/sparc/sparc.c (sparc_override_options): Initialize
+       fpu mask correctly.
+
 2007-06-13  Dave Korn  <dave.korn@artimi.com>
 
        * config/i386/i386.c (ix86_eax_live_at_start_p): Use
index e8c539e64b4426d28351db36a2b8c0aa015b9abc..190c82ec0ce278d47161df1db2e29dd15bdabcd1 100644 (file)
@@ -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)
index 7d677eb94a6466913a210a0a1c2cf7b5a315f128..a0d61bef205a73a616003b1508b127dcd05f1ce9 100644 (file)
@@ -1,3 +1,7 @@
+2007-06-13  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * gcc.target/sparc/mfpu.c: New test.
+
 2007-06-12  Geoff Keating  <geoffk@apple.com>
 
        * 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 (file)
index 0000000..e95754c
--- /dev/null
@@ -0,0 +1,11 @@
+/* Reported by Peter A. Krauss <peter.a.krauss@web.de> */
+
+/* { dg-do compile } */
+/* { dg-options "-mfpu" } */
+
+float square(float x)
+{
+  return x * x;
+}
+
+/* { dg-final { scan-assembler "fmuls" } } */