public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bouanto at zoho dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/107863] New: ICE with unrecognizable insn when using -funsigned-char with some AVX builtins
Date: Thu, 24 Nov 2022 19:06:17 +0000	[thread overview]
Message-ID: <bug-107863-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 107863
           Summary: ICE with unrecognizable insn when using
                    -funsigned-char with some AVX builtins
           Product: gcc
           Version: 12.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bouanto at zoho dot com
  Target Milestone: ---

Hi.
When I compile the following code:

#include <immintrin.h>

int main(int argc, char* argv[]) {
    __m256i a = _mm256_set1_epi8(4);
    __m256i b = _mm256_set1_epi8(2);
    __m256i mask = _mm256_insert_epi8(_mm256_set1_epi8(0), -1, 2);
    __m256i r = (__m256i) __builtin_ia32_pblendvb256 ((__v32qi)a, (__v32qi)b,
(__v32qi)mask);
    return 0;
}

with the following command:

gcc main.c -o main -mavx512f -funsigned-char

I get the following error:

main.c: In function ‘main’:
main.c:9:1: error: unrecognizable insn:
    9 | }
      | ^
(insn 655 654 656 2 (set (reg:QI 607)
        (const_int 255 [0xff])) "main.c":6:20 -1
     (nil))
during RTL pass: vregs
main.c:9:1: internal compiler error: in extract_insn, at recog.cc:2791
0x1840d78 internal_error(char const*, ...)
        ???:0
0x62a3ac fancy_abort(char const*, int, char const*)
        ???:0
0x60555b _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ???:0
0x60557d _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ???:0

The code compiles when not using -funsigned-char.

I'm not sure what would be the fix for this. Would it make sense that builtins
never use the char type, but instead use either unsigned char or signed char?

             reply	other threads:[~2022-11-24 19:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24 19:06 bouanto at zoho dot com [this message]
2022-11-24 19:30 ` [Bug target/107863] [10/11/12/13 Regression] ICE with unrecognizable insn when using -funsigned-char with some SSE/AVX builtins pinskia at gcc dot gnu.org
2022-11-24 19:35 ` pinskia at gcc dot gnu.org
2022-11-24 20:12 ` rguenth at gcc dot gnu.org
2022-11-25  2:26 ` crazylht at gmail dot com
2022-11-25  2:52 ` crazylht at gmail dot com
2022-11-25  5:16 ` crazylht at gmail dot com
2022-11-25  5:32 ` crazylht at gmail dot com
2022-11-25  6:06 ` crazylht at gmail dot com
2022-11-28  7:36 ` crazylht at gmail dot com
2022-11-29  6:17 ` crazylht at gmail dot com
2022-12-01  3:31 ` cvs-commit at gcc dot gnu.org
2022-12-01  3:33 ` cvs-commit at gcc dot gnu.org
2022-12-01  3:35 ` cvs-commit at gcc dot gnu.org
2022-12-01  3:37 ` cvs-commit at gcc dot gnu.org
2022-12-01  3:38 ` crazylht at gmail dot com
2022-12-01 15:45 ` 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-107863-4@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).