aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/avr/avr.cc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2024-04-17 10:26:05 +0200
committerGeorg-Johann Lay <avr@gjlay.de>2024-04-17 10:35:52 +0200
commit909c6faf2c726178d115726e56304eac91cff6e9 (patch)
tree2c4ba3ee483ca7540a9cf3622f01ba2ca0f66090 /gcc/config/avr/avr.cc
parent3cfe94ad28102618c14a91c0a83d9e5cc7df69d7 (diff)
downloadgcc-909c6faf2c726178d115726e56304eac91cff6e9.zip
gcc-909c6faf2c726178d115726e56304eac91cff6e9.tar.gz
gcc-909c6faf2c726178d115726e56304eac91cff6e9.tar.bz2
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.
Diffstat (limited to 'gcc/config/avr/avr.cc')
-rw-r--r--gcc/config/avr/avr.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
index 4a5a921..510e4ce 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)
fputs (XSTR (x, 0), file);