@@ -7588,7 +7588,7 @@
;; __builtin_mips_get_fcsr: move the FCSR into operand 0.
(define_expand "mips_get_fcsr"
[(set (match_operand:SI 0 "register_operand")
- (unspec_volatile [(const_int 0)] UNSPEC_GET_FCSR))]
+ (unspec_volatile:SI [(const_int 0)] UNSPEC_GET_FCSR))]
"TARGET_HARD_FLOAT_ABI"
{
if (TARGET_MIPS16)
@@ -7600,7 +7600,7 @@
(define_insn "*mips_get_fcsr"
[(set (match_operand:SI 0 "register_operand" "=d")
- (unspec_volatile [(const_int 0)] UNSPEC_GET_FCSR))]
+ (unspec_volatile:SI [(const_int 0)] UNSPEC_GET_FCSR))]
"TARGET_HARD_FLOAT"
"cfc1\t%0,$31")
new file mode 100644
@@ -0,0 +1,9 @@
+/* { dg-options "-mabi=64 -mhard-float" } */
+
+NOMIPS16 unsigned int
+foo (void)
+{
+ return __builtin_mips_get_fcsr () & 0x1;
+}
+
+/* { dg-final { scan-assembler "cfc1" } } */
From: Mihailo Stojanovic <mistojanovic@wavecomp.com> Hi, Missing machine mode for the unspec_volatile operand of get_fcsr patterns causes an ICE in simplify_subreg on n64 ABI. This adds the missing machine modes and a new test. Tested on mips64el-mti-linux-gnu. Ok for trunk and possibly backport? Cheers, Mihailo gcc/ * config/mips/mips.md (mips_get_fcsr, *mips_get_fcsr): Use SI machine mode for unspec_volatile operand. * testsuite/gcc.target/mips/get-fcsr-3.c: New test. --- gcc/config/mips/mips.md | 4 ++-- gcc/testsuite/gcc.target/mips/get-fcsr-3.c | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/mips/get-fcsr-3.c