]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AVR: target/114752 - Fix ICE on inline asm const 64-bit float operand
authorGeorg-Johann Lay <avr@gjlay.de>
Wed, 17 Apr 2024 08:26:05 +0000 (10:26 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Wed, 17 Apr 2024 08:47:09 +0000 (10:47 +0200)
gcc/
PR target/114752
* config/avr/avr.cc (avr_print_operand) [CONST_DOUBLE_P]: Handle DFmode.

(cherry picked from commit 909c6faf2c726178d115726e56304eac91cff6e9)

gcc/config/avr/avr.cc

index d91fa51e78c3940c5dbe4055ff9f694b6343ab1d..f8c4eb327a2cd5c093ef1f2c2158914cd807e70c 100644 (file)
@@ -3333,11 +3333,20 @@ avr_print_operand (FILE *file, rtx x, int code)
     }
   else if (CONST_DOUBLE_P (x))
     {
-      long val;
-      if (GET_MODE (x) != SFmode)
-        fatal_insn ("internal compiler error.  Unknown mode:", x);
-      REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (x), val);
-      fprintf (file, "0x%lx", val);
+      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);
     }
   else if (GET_CODE (x) == CONST_STRING)
     fputs (XSTR (x, 0), file);