MIPS: Only pass floating-point options to the assembler when necessary
authorMatthew Fortune <matthew.fortune@imgtec.com>
Mon, 19 Jan 2015 23:05:41 +0000 (23:05 +0000)
committerMatthew Fortune <mpf@gcc.gnu.org>
Mon, 19 Jan 2015 23:05:41 +0000 (23:05 +0000)
gcc/
* config/mips/mips.h (FP_ASM_SPEC): New define.
(ASM_SPEC): Remove floating-point options and use FP_ASM_SPEC
instead.

From-SVN: r219867

gcc/ChangeLog
gcc/config/mips/mips.h

index 7078d40cfa9705b5e19f717c9e1831dfb8760761..7e182f3c3f2d139fc8c314f083fa6bd942ac3971 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-19  Matthew Fortune  <matthew.fortune@imgtec.com>
+
+       * config/mips/mips.h (FP_ASM_SPEC): New define.
+       (ASM_SPEC): Remove floating-point options and use FP_ASM_SPEC
+       instead.
+
 2015-01-19  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/53988
index c5ea2401a17a00fba5860ae809f2ec4ff0a8f61d..ec69ed5d0610e57290d03afc242110ba18ce3716 100644 (file)
@@ -1243,6 +1243,22 @@ struct mips_cpu_info {
 %{gcoff*:-mdebug} %{!gcoff*:-no-mdebug}"
 #endif
 
+/* FP_ASM_SPEC represents the floating-point options that must be passed
+   to the assembler when FPXX support exists.  Prior to that point the
+   assembler could accept the options but were not required for
+   correctness.  We only add the options when absolutely necessary
+   because passing -msoft-float to the assembler will cause it to reject
+   all hard-float instructions which may require some user code to be
+   updated.  */
+
+#ifdef HAVE_AS_DOT_MODULE
+#define FP_ASM_SPEC "\
+%{mhard-float} %{msoft-float} \
+%{msingle-float} %{mdouble-float}"
+#else
+#define FP_ASM_SPEC
+#endif
+
 /* SUBTARGET_ASM_SPEC is always passed to the assembler.  It may be
    overridden by subtargets.  */
 
@@ -1277,9 +1293,8 @@ struct mips_cpu_info {
 %{modd-spreg} %{mno-odd-spreg} \
 %{mshared} %{mno-shared} \
 %{msym32} %{mno-sym32} \
-%{mtune=*} \
-%{mhard-float} %{msoft-float} \
-%{msingle-float} %{mdouble-float} \
+%{mtune=*}" \
+FP_ASM_SPEC "\
 %(subtarget_asm_spec)"
 
 /* Extra switches sometimes passed to the linker.  */