public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/94614] ICE in emit_move_multi_word, at expr.c:3716
Date: Thu, 16 Apr 2020 07:40:26 +0000	[thread overview]
Message-ID: <bug-94614-4-oQDtDawrXE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94614-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94614

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
#1  0x0000000000cecacc in emit_move_multi_word (mode=E_TImode, 
    x=0x7ffff69f66c0, y=0x7ffff69f64e0)
    at /space/rguenther/src/gcc/gcc/expr.c:3716
(gdb) p debug_rtx  (x)
(subreg:TI (reg/v:DI 113 [ res ]) 0)
$3 = void
(gdb) p debug_rtx  (y)
(reg/v:TI 115 [ v ])
$4 = void

so this is another part not expecting the "invalid" source writing
outside the bounds of a register.  We have

      /* Do not generate code for a move if it would come entirely
         from the undefined bits of a paradoxical subreg.  */
      if (undefined_operand_subword_p (y, i))
        continue;

but lack the same check for the x parts.  The following fixes it:

diff --git a/gcc/expr.c b/gcc/expr.c
index b97c217e86d..dfbeae71518 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3692,6 +3692,11 @@ emit_move_multi_word (machine_mode mode, rtx x, rtx y)
   need_clobber = false;
   for (i = 0; i < CEIL (mode_size, UNITS_PER_WORD); i++)
     {
+      /* Do not generate code for a move if it would go entirely
+        to the non-existing bits of a paradoxical subreg.  */
+      if (undefined_operand_subword_p (x, i))
+       continue;
+
       rtx xpart = operand_subword (x, i, 1, mode);
       rtx ypart;

  parent reply	other threads:[~2020-04-16  7:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16  7:21 [Bug target/94614] New: [10 Regression] ICE in emit_move_multi_word, at expr.c:3716 since r10-416-g1bf2a0b90f2457f6d9301535560eb5e05978261b marxin at gcc dot gnu.org
2020-04-16  7:21 ` [Bug target/94614] " marxin at gcc dot gnu.org
2020-04-16  7:28 ` rguenth at gcc dot gnu.org
2020-04-16  7:36 ` marxin at gcc dot gnu.org
2020-04-16  7:39 ` [Bug target/94614] ICE in emit_move_multi_word, at expr.c:3716 marxin at gcc dot gnu.org
2020-04-16  7:40 ` rguenth at gcc dot gnu.org [this message]
2020-04-16  7:53 ` rguenth at gcc dot gnu.org
2020-04-16 10:55 ` cvs-commit at gcc dot gnu.org
2020-04-16 10:55 ` rguenth at gcc dot gnu.org

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=bug-94614-4-oQDtDawrXE@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).