public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/101046] New: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl
@ 2021-06-13 10:37 zsojka at seznam dot cz
  2021-06-13 19:16 ` [Bug target/101046] " jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: zsojka at seznam dot cz @ 2021-06-13 10:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101046
           Summary: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with
                    -mavx512vbmi -mavx512vl
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 50990
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50990&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -ftree-ter -mavx512vbmi -mavx512vl testcase.c
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:6:10: internal compiler error: in gen_rtx_CONST_VECTOR, at
emit-rtl.c:6031
    6 |   return __builtin_convertvector(
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
    7 |          __builtin_shufflevector((V){}, (W){}, 0, 0, 1, 0, 5, 5, 0, 2),
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    8 |          U);
      |          ~~
0x672322 gen_rtx_CONST_VECTOR(machine_mode, rtvec_def*)
        /repo/gcc-trunk/gcc/emit-rtl.c:6031
0x149c4b9 ix86_expand_vec_perm_vpermt2
        /repo/gcc-trunk/gcc/config/i386/i386-expand.c:4669
0x14a64be expand_vec_perm_1
        /repo/gcc-trunk/gcc/config/i386/i386-expand.c:17902
0x14a8d68 ix86_expand_vec_perm_const_1
        /repo/gcc-trunk/gcc/config/i386/i386-expand.c:20202
0x14d18e5 ix86_vectorize_vec_perm_const(machine_mode, rtx_def*, rtx_def*,
rtx_def*, vec_perm_indices const&)
        /repo/gcc-trunk/gcc/config/i386/i386-expand.c:20529
0xf55cea expand_vec_perm_const(machine_mode, rtx_def*, rtx_def*,
int_vector_builder<poly_int<1u, long> > const&, machine_mode, rtx_def*)
        /repo/gcc-trunk/gcc/optabs.c:6069
0xcdc158 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
        /repo/gcc-trunk/gcc/expr.c:10046
0xce083a expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.c:10399
0xceaf34 expand_expr
        /repo/gcc-trunk/gcc/expr.h:301
0xceaf34 expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**,
rtx_def**, expand_modifier)
        /repo/gcc-trunk/gcc/expr.c:8212
0xcd8dff expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
        /repo/gcc-trunk/gcc/expr.c:10189
0xba6b4f expand_gimple_stmt_1
        /repo/gcc-trunk/gcc/cfgexpand.c:3953
0xba6b4f expand_gimple_stmt
        /repo/gcc-trunk/gcc/cfgexpand.c:4014
0xbacd3a expand_gimple_basic_block
        /repo/gcc-trunk/gcc/cfgexpand.c:6056
0xbae9e7 execute
        /repo/gcc-trunk/gcc/cfgexpand.c:6782
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.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-1408-20210613074654-gd554f43c98e-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-1408-20210613074654-gd554f43c98e-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210613 (experimental) (GCC)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/101046] ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl
  2021-06-13 10:37 [Bug target/101046] New: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl zsojka at seznam dot cz
@ 2021-06-13 19:16 ` jakub at gcc dot gnu.org
  2021-06-14  9:07 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-13 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1
                 CC|                            |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2021-06-13
             Status|UNCONFIRMED                 |ASSIGNED

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/101046] ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl
  2021-06-13 10:37 [Bug target/101046] New: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl zsojka at seznam dot cz
  2021-06-13 19:16 ` [Bug target/101046] " jakub at gcc dot gnu.org
@ 2021-06-14  9:07 ` marxin at gcc dot gnu.org
  2021-06-14  9:16 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-14  9:07 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Just for the record, started with r12-1128-gef8176e0fac935c0.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/101046] ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl
  2021-06-13 10:37 [Bug target/101046] New: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl zsojka at seznam dot cz
  2021-06-13 19:16 ` [Bug target/101046] " jakub at gcc dot gnu.org
  2021-06-14  9:07 ` marxin at gcc dot gnu.org
@ 2021-06-14  9:16 ` jakub at gcc dot gnu.org
  2021-06-15  9:37 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-14  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 51005
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51005&action=edit
gcc12-pr101046.patch

Untested fix.  For ops that have different mode of the arguments from the
result mode, subtarget obviously can't be used.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/101046] ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl
  2021-06-13 10:37 [Bug target/101046] New: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2021-06-14  9:16 ` jakub at gcc dot gnu.org
@ 2021-06-15  9:37 ` cvs-commit at gcc dot gnu.org
  2021-06-15  9:58 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-15  9:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:008153c8435ca3bf587e11654c31f05c0f99b43a

commit r12-1448-g008153c8435ca3bf587e11654c31f05c0f99b43a
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Jun 15 11:36:47 2021 +0200

    expr: Fix up VEC_PACK_TRUNC_EXPR expansion [PR101046]

    The following testcase ICEs, because we have a mode mismatch.
    VEC_PACK_TRUNC_EXPR's operands have different modes from the result
    (same vector mode size but twice as large element),
    but we were passing non-NULL subtarget with the mode of the result
    to the expansion of its arguments, so the VEC_PERM_EXPR in one of the
    operands which had V8SImode operands and result had V16HImode target.

    Fixed by clearing the subtarget if we are changing mode.

    2021-06-15  Jakub Jelinek  <jakub@redhat.com>

            PR target/101046
            * expr.c (expand_expr_real_2) <case VEC_PACK_FIX_TRUNC_EXPR,
            case VEC_PACK_TRUNC_EXPR>: Clear subtarget when changing mode.

            * gcc.target/i386/pr101046.c: New test.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/101046] ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl
  2021-06-13 10:37 [Bug target/101046] New: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2021-06-15  9:37 ` cvs-commit at gcc dot gnu.org
@ 2021-06-15  9:58 ` jakub at gcc dot gnu.org
  2021-06-15  9:59 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-15  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/101046] ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl
  2021-06-13 10:37 [Bug target/101046] New: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2021-06-15  9:58 ` jakub at gcc dot gnu.org
@ 2021-06-15  9:59 ` jakub at gcc dot gnu.org
  2021-06-17  5:59 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-15  9:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/101046] ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl
  2021-06-13 10:37 [Bug target/101046] New: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2021-06-15  9:59 ` jakub at gcc dot gnu.org
@ 2021-06-17  5:59 ` cvs-commit at gcc dot gnu.org
  2022-05-10  8:18 ` cvs-commit at gcc dot gnu.org
  2022-05-11  6:20 ` cvs-commit at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-17  5:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:5ece5ac99e804cccc3d8534d8871eb72e08edb06

commit r11-8594-g5ece5ac99e804cccc3d8534d8871eb72e08edb06
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Jun 15 11:36:47 2021 +0200

    expr: Fix up VEC_PACK_TRUNC_EXPR expansion [PR101046]

    The following testcase ICEs, because we have a mode mismatch.
    VEC_PACK_TRUNC_EXPR's operands have different modes from the result
    (same vector mode size but twice as large element),
    but we were passing non-NULL subtarget with the mode of the result
    to the expansion of its arguments, so the VEC_PERM_EXPR in one of the
    operands which had V8SImode operands and result had V16HImode target.

    Fixed by clearing the subtarget if we are changing mode.

    2021-06-15  Jakub Jelinek  <jakub@redhat.com>

            PR target/101046
            * expr.c (expand_expr_real_2) <case VEC_PACK_FIX_TRUNC_EXPR,
            case VEC_PACK_TRUNC_EXPR>: Clear subtarget when changing mode.

    (cherry picked from commit 008153c8435ca3bf587e11654c31f05c0f99b43a)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/101046] ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl
  2021-06-13 10:37 [Bug target/101046] New: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2021-06-17  5:59 ` cvs-commit at gcc dot gnu.org
@ 2022-05-10  8:18 ` cvs-commit at gcc dot gnu.org
  2022-05-11  6:20 ` cvs-commit at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:8f79b09894c6037d0a376be239567ebdce42ea0e

commit r10-10619-g8f79b09894c6037d0a376be239567ebdce42ea0e
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Jun 15 11:36:47 2021 +0200

    expr: Fix up VEC_PACK_TRUNC_EXPR expansion [PR101046]

    The following testcase ICEs, because we have a mode mismatch.
    VEC_PACK_TRUNC_EXPR's operands have different modes from the result
    (same vector mode size but twice as large element),
    but we were passing non-NULL subtarget with the mode of the result
    to the expansion of its arguments, so the VEC_PERM_EXPR in one of the
    operands which had V8SImode operands and result had V16HImode target.

    Fixed by clearing the subtarget if we are changing mode.

    2021-06-15  Jakub Jelinek  <jakub@redhat.com>

            PR target/101046
            * expr.c (expand_expr_real_2) <case VEC_PACK_FIX_TRUNC_EXPR,
            case VEC_PACK_TRUNC_EXPR>: Clear subtarget when changing mode.

    (cherry picked from commit 008153c8435ca3bf587e11654c31f05c0f99b43a)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/101046] ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl
  2021-06-13 10:37 [Bug target/101046] New: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2022-05-10  8:18 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11  6:20 ` cvs-commit at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-11  6:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:2f682080c136412897b5d350abb337e694ad51de

commit r9-10076-g2f682080c136412897b5d350abb337e694ad51de
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Jun 15 11:36:47 2021 +0200

    expr: Fix up VEC_PACK_TRUNC_EXPR expansion [PR101046]

    The following testcase ICEs, because we have a mode mismatch.
    VEC_PACK_TRUNC_EXPR's operands have different modes from the result
    (same vector mode size but twice as large element),
    but we were passing non-NULL subtarget with the mode of the result
    to the expansion of its arguments, so the VEC_PERM_EXPR in one of the
    operands which had V8SImode operands and result had V16HImode target.

    Fixed by clearing the subtarget if we are changing mode.

    2021-06-15  Jakub Jelinek  <jakub@redhat.com>

            PR target/101046
            * expr.c (expand_expr_real_2) <case VEC_PACK_FIX_TRUNC_EXPR,
            case VEC_PACK_TRUNC_EXPR>: Clear subtarget when changing mode.

    (cherry picked from commit 008153c8435ca3bf587e11654c31f05c0f99b43a)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-05-11  6:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-13 10:37 [Bug target/101046] New: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl zsojka at seznam dot cz
2021-06-13 19:16 ` [Bug target/101046] " jakub at gcc dot gnu.org
2021-06-14  9:07 ` marxin at gcc dot gnu.org
2021-06-14  9:16 ` jakub at gcc dot gnu.org
2021-06-15  9:37 ` cvs-commit at gcc dot gnu.org
2021-06-15  9:58 ` jakub at gcc dot gnu.org
2021-06-15  9:59 ` jakub at gcc dot gnu.org
2021-06-17  5:59 ` cvs-commit at gcc dot gnu.org
2022-05-10  8:18 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:20 ` cvs-commit at gcc dot gnu.org

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).