public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Georg-Johann Lay <gjl@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-10003] AVR: target/114752 - Fix ICE on inline asm const 64-bit float operand
Date: Wed, 17 Apr 2024 08:39:30 +0000 (GMT)	[thread overview]
Message-ID: <20240417083931.026B23858D20@sourceware.org> (raw)

https://gcc.gnu.org/g:909c6faf2c726178d115726e56304eac91cff6e9

commit r14-10003-g909c6faf2c726178d115726e56304eac91cff6e9
Author: Georg-Johann Lay <avr@gjlay.de>
Date:   Wed Apr 17 10:26:05 2024 +0200

    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.

Diff:
---
 gcc/config/avr/avr.cc | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

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)
     fputs (XSTR (x, 0), file);

                 reply	other threads:[~2024-04-17  8:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240417083931.026B23858D20@sourceware.org \
    --to=gjl@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).