public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/114184] [12/13/14 Regression] ICE: in extract_insn, at recog.cc:2812 (unrecognizable insn ) with _Complex long double and vector VCE
Date: Fri, 01 Mar 2024 09:54:51 +0000	[thread overview]
Message-ID: <bug-114184-4-x14WoOdNbb@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114184-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
            Summary|ICE: in extract_insn, at    |[12/13/14 Regression] ICE:
                   |recog.cc:2812               |in extract_insn, at
                   |(unrecognizable insn ) with |recog.cc:2812
                   |-Og -mavx512f and           |(unrecognizable insn ) with
                   |__builtin_memmove()         |_Complex long double and
                   |_BitInt(256)                |vector VCE
   Target Milestone|---                         |12.4

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Seems unrelated to _BitInt.
E.g. following testcase ICEs with -O2 -mavx2 since
r14-4537-g70b5c6981fcdff246f90e57e91f3e1667eab2eb3
typedef unsigned char V __attribute__((vector_size (32)));
_Complex long double
foo (void)
{
  _Complex long double d;
  *(V *)&d = (V) { 149, 136, 89, 42, 38, 240, 196, 194 };
  return d;
}
and the same with -Og -mavx2 since
r12-7240-g2801f23fb82a5ef51c8b460a500786797943e1e9
I don't see bugs in either of those commits.

What I see happing is that expand_assignment, because the destination is
complex, does
6211                          emit_move_insn (XEXP (to_rtx, 0),
6212                                          read_complex_part (from_rtx,
false));
6213                          emit_move_insn (XEXP (to_rtx, 1),
6214                                          read_complex_part (from_rtx,
true));
where from_rtx at that point is
(subreg:XC (const_vector:V32QI [
            (const_int -107 [0xffffffffffffff95])
            (const_int -120 [0xffffffffffffff88])
            (const_int 89 [0x59])
            (const_int 42 [0x2a])
            (const_int 38 [0x26])
            (const_int -16 [0xfffffffffffffff0])
            (const_int -60 [0xffffffffffffffc4])
            (const_int -62 [0xffffffffffffffc2])
            (const_int 0 [0]) repeated x24
        ]) 0)
which is supposedly a valid subreg, reinterpretation of a vector as complex
extended double, which is not foldable to constant because it isn't a valid
IEEE value which the compiler can express.  Or should this have been a concat?
Anyway, read_complex_part returns for that
(const_double:XF 0.0 [0x0.0p+0])
for the imag part and
(subreg:XF (const_vector:V32QI [
            (const_int -107 [0xffffffffffffff95])
            (const_int -120 [0xffffffffffffff88])
            (const_int 89 [0x59])
            (const_int 42 [0x2a])
            (const_int 38 [0x26])
            (const_int -16 [0xfffffffffffffff0])
            (const_int -60 [0xffffffffffffffc4])
            (const_int -62 [0xffffffffffffffc2])
            (const_int 0 [0]) repeated x24
        ]) 0)
for the real part.  The latter makes it through validate_subreg due to the
  /* ??? Similarly, e.g. with (subreg:DF (reg:TI)).  Though store_bit_field
     is the culprit here, and not the backends.  */
  else if (known_ge (osize, regsize) && known_ge (isize, osize))
    ;
- osize is 16, isize is 32 and regsize is 8.  If that wasn't for that rule,
there would be the
  /* Subregs involving floating point modes are not allowed to
     change size unless it's an insert into a complex mode.
     Therefore (subreg:DI (reg:DF) 0) and (subreg:CS (reg:SF) 0) are fine, but
     (subreg:SI (reg:DF) 0) isn't.  */
rule which would reject it.

  reply	other threads:[~2024-03-01  9:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01  6:24 [Bug target/114184] New: ICE: in extract_insn, at recog.cc:2812 (unrecognizable insn ) with -Og -mavx512f and __builtin_memmove() _BitInt(256) zsojka at seznam dot cz
2024-03-01  9:54 ` jakub at gcc dot gnu.org [this message]
2024-03-01  9:59 ` [Bug target/114184] [12/13/14 Regression] ICE: in extract_insn, at recog.cc:2812 (unrecognizable insn ) with _Complex long double and vector VCE jakub at gcc dot gnu.org
2024-03-01 11:57 ` jakub at gcc dot gnu.org
2024-03-04  9:04 ` cvs-commit at gcc dot gnu.org
2024-03-04  9:09 ` [Bug target/114184] [12/13 " jakub at gcc dot gnu.org
2024-03-15 23:29 ` cvs-commit at gcc dot gnu.org
2024-03-18 14:40 ` [Bug target/114184] [12 " jakub 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-114184-4-x14WoOdNbb@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).