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:53:22 +0000	[thread overview]
Message-ID: <bug-94614-4-5vcqRTaEqv@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 #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #4)
> 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;

but only to get to the next one:

during RTL pass: subreg1
pr94574.c: In function ‘foo’:
pr94574.c:15:1: internal compiler error: in simplify_gen_subreg_concatn, at
lower-subreg.c:717
   15 | }
      | ^
0x1f7188d simplify_gen_subreg_concatn
        /space/rguenther/src/gcc/gcc/lower-subreg.c:717
0x1f72a3d resolve_clobber
        /space/rguenther/src/gcc/gcc/lower-subreg.c:1160
0x1f73e5b decompose_multiword_subregs
        /space/rguenther/src/gcc/gcc/lower-subreg.c:1610
0x1f743f5 execute
        /space/rguenther/src/gcc/gcc/lower-subreg.c:1765
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

#1  0x0000000001f7188e in simplify_gen_subreg_concatn (outermode=E_SImode, 
    op=0x7ffff69f66c0, innermode=E_TImode, byte=0)
    at /space/rguenther/src/gcc/gcc/lower-subreg.c:717
717               gcc_assert (!paradoxical_subreg_p (op));

where it tries to fixup

(clobber (subreg:TI (concatn/v:DI [
                (reg:SI 117 [ res ])
                (reg:SI 118 [ res+4 ])
            ]) 0))

but a clobber of a paradoxical subreg is simply the same as a clobber of
the SUBREG_REG (the concat in this case)?  Thus, fixed by

diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index a170f0ff93b..a11e535b5bf 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -1150,6 +1150,10 @@ resolve_clobber (rtx pat, rtx_insn *insn)
   int ret;

   reg = XEXP (pat, 0);
+  /* For clobbers we can look through paradoxical subregs which
+     we do not handle in simplify_gen_subreg_concatn.  */
+  if (paradoxical_subreg_p (reg))
+    reg = SUBREG_REG (reg);
   if (!resolve_reg_p (reg) && !resolve_subreg_p (reg))
     return false;

  parent reply	other threads:[~2020-04-16  7:53 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
2020-04-16  7:53 ` rguenth at gcc dot gnu.org [this message]
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-5vcqRTaEqv@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).