diff mbox series

[avr,applied] PR114752 - Fix ICE on inline asm const 64-bit float operand

Message ID d9d69778-f6c4-449e-b3be-8cf40f1aad08@gjlay.de
State New
Headers show
Series [avr,applied] PR114752 - Fix ICE on inline asm const 64-bit float operand | expand

Commit Message

Georg-Johann Lay April 17, 2024, 8:33 a.m. UTC
Applied as obvious

Johann

--

AVR: target/114752 - Fix ICE on inline asm const 64-bit float operand

gcc/
         PR target/114752
         * config/avr/avr.cc (avr_print_operand) [CONST_DOUBLE_P]: 
Handle DFmode.

      fputs (XSTR (x, 0), file);
diff mbox series

Patch

diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
index 4a5a921107b..510e4cea19f 100644
--- a/gcc/config/avr/avr.cc
+++ b/gcc/config/avr/avr.cc
@@ -3932,11 +3932,20 @@  avr_print_operand (FILE *file, rtx x, int code)
      }
    else if (CONST_DOUBLE_P (x))
      {
-      long val;
-      if (GET_MODE (x) != SFmode)
+      if (GET_MODE (x) == SFmode)
+       {
+         long val;
+         REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (x), val);
+         fprintf (file, "0x%lx", val);
+       }
+      else if (GET_MODE (x) == DFmode)
+       {
+         long l[2];
+         REAL_VALUE_TO_TARGET_DOUBLE (*CONST_DOUBLE_REAL_VALUE (x), l);
+         fprintf (file, "0x%lx%08lx", l[1] & 0xffffffff, l[0] & 
0xffffffff);
+       }
+      else
         fatal_insn ("internal compiler error.  Unknown mode:", x);
-      REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (x), val);
-      fprintf (file, "0x%lx", val);
      }
    else if (GET_CODE (x) == CONST_STRING)