public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/112860] New: ICE: in expand_expr_real_2, at expr.cc:10620 with -O0 -fgimple -mavx512f
@ 2023-12-05 11:27 iamanonymous.cs at gmail dot com
  2023-12-05 13:27 ` [Bug target/112860] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: iamanonymous.cs at gmail dot com @ 2023-12-05 11:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112860
           Summary: ICE: in expand_expr_real_2, at expr.cc:10620 with -O0
                    -fgimple -mavx512f
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

*******************************************************************************
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
*******************************************************************************
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
*******************************************************************************
Program:
$ cat mutant.c
typedef _Bool sbool1 __attribute__((signed_bool_precision(1)));
typedef int v16si __attribute__((vector_size(64)));
typedef v16si v16sim __attribute__((vector_mask));
typedef long v16di __attribute__((vector_size(128)));

void __GIMPLE (ssa,guessed_local(118111600),startwith("slp"))
bar (int * restrict a, int * restrict d, int * restrict e)
{
  int * vectp_14;
  v16si * vectp_e_13;
  v16si vect_iftmp_12;
  v16sim mask__75_11;
  v16sim mask__74_10;
  v16si vect__6_9;
  v16si vect__1_8;
  int * vectp_7;
  v16si * vectp_a_6;
  int _2;
  int _5;
  int _7;
  int _9;
  int _11;
  int _13;
  int _15;
  int _17;
  _Bool _41;
  _Bool _49;
  _Bool _53;
  _Bool _57;
  _Bool _61;
  _Bool _65;
  _Bool _69;
  _Bool _73;
  sbool1 _135;
  sbool1 _136;
  sbool1 _137;
  sbool1 _138;
  sbool1 _139;
  sbool1 _140;
  sbool1 _141;
  sbool1 _142;
  sbool1 _143;
  sbool1 _144;
  sbool1 _145;
  sbool1 _146;
  sbool1 _147;
  sbool1 _148;
  sbool1 _149;
  sbool1 _150;
  v16sim _151;

  __BB(2,guessed_local(105119324)):
  _2 = __MEM <int> (d_26(D) + _Literal (int * restrict) 32);
  _73 = _2 != 0;
  _5 = __MEM <int> (d_26(D) + _Literal (int * restrict) 36);
  _69 = _5 != 0;
  _7 = __MEM <int> (d_26(D));
  _65 = _7 != 0;
  _9 = __MEM <int> (d_26(D) + _Literal (int * restrict) 4);
  _61 = _9 != 0;
  _11 = __MEM <int> (d_26(D) + _Literal (int * restrict) 48);
  _57 = _11 != 0;
  _13 = __MEM <int> (d_26(D) + _Literal (int * restrict) 52);
  _53 = _13 != 0;
  _15 = __MEM <int> (d_26(D) + _Literal (int * restrict) 16);
  _41 = _15 != 0;
  _17 = __MEM <int> (d_26(D) + _Literal (int * restrict) 60);
  _49 = _17 != 0;
  _135 = _49 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _136 = _41 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _137 = _53 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _138 = _57 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _139 = _61 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _140 = _65 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _141 = _69 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _142 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _143 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _144 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _145 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _146 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _147 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _148 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _149 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _150 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _151 = _Literal (v16sim) {_150, _149, _148, _147, _146, _145, _144, _143,
_142, _141, _140, _139, _138, _137, _136, _135};
  vect__1_8_154 = __MEM <v16si, 32> ((int * restrict)a_22(D));
  vect_iftmp_12_158 = _151 ? vect__6_9_154 : _Literal (v16si) { 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  __MEM <v16si, 32> ((int * restrict)e_23(D)) = vect_iftmp_12_158;
  return;
}

*******************************************************************************
Compiler explorer: 
Command Lines:
$ gcc -O0 -fgimple -mavx512f mutant.c
during RTL pass: expand
mutant.c: In function ‘bar’:
mutant.c:7:1: internal compiler error: in expand_expr_real_2, at expr.cc:10620
    7 | bar (int * restrict a, int * restrict d, int * restrict e)
      | ^~~
0x773215 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
        ../../gcc/gcc/expr.cc:10620
0xaddfc1 expand_gimple_stmt_1
        ../../gcc/gcc/cfgexpand.cc:3984
0xaddfc1 expand_gimple_stmt
        ../../gcc/gcc/cfgexpand.cc:4045
0xadec97 expand_gimple_basic_block
        ../../gcc/gcc/cfgexpand.cc:6101
0xae08f6 execute
        ../../gcc/gcc/cfgexpand.cc:6836
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Also ICE on trunk, compiler explorer: https://godbolt.org/z/fd7z3o5nM

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

* [Bug target/112860] ICE: in expand_expr_real_2, at expr.cc:10620 with -O0 -fgimple -mavx512f
  2023-12-05 11:27 [Bug target/112860] New: ICE: in expand_expr_real_2, at expr.cc:10620 with -O0 -fgimple -mavx512f iamanonymous.cs at gmail dot com
@ 2023-12-05 13:27 ` rguenth at gcc dot gnu.org
  2023-12-05 14:58 ` cvs-commit at gcc dot gnu.org
  2023-12-05 14:58 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-12-05 13:27 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |101057
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2023-12-05
             Target|                            |x86_64-*-*
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
vect_iftmp_12_158 = VEC_COND_EXPR <_151, vect__1_8_154, { 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0 }>;

this shows startwith("slp") and -O0 don't play together and the ISEL pass
is skipped.

Don't mix startwith with an optimization level that doesn't enable the pass
or with a name that doesn't exist.

For ISEL specifically we should possibly provide a property as we lower
VEC_COND_EXPR there.  Or always execute it.

diff --git a/gcc/passes.cc b/gcc/passes.cc
index 6f894a41d22..cfdfe77e122 100644
--- a/gcc/passes.cc
+++ b/gcc/passes.cc
@@ -2514,6 +2514,10 @@ should_skip_pass_p (opt_pass *pass)
   if (strstr (pass->name, "build_cgraph_edges") != NULL)
     return false;

+  /* We need to run ISEL.  */
+  if (strstr (pass->name, "isel") != NULL)
+    return false;
+
   /* Don't skip df init; later RTL passes need it.  */
   if (strstr (pass->name, "dfinit") != NULL
       || strstr (pass->name, "dfinish") != NULL)


"Confirmed."


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101057
[Bug 101057] [gimplefe] GIMPLE frontend issues

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

* [Bug target/112860] ICE: in expand_expr_real_2, at expr.cc:10620 with -O0 -fgimple -mavx512f
  2023-12-05 11:27 [Bug target/112860] New: ICE: in expand_expr_real_2, at expr.cc:10620 with -O0 -fgimple -mavx512f iamanonymous.cs at gmail dot com
  2023-12-05 13:27 ` [Bug target/112860] " rguenth at gcc dot gnu.org
@ 2023-12-05 14:58 ` cvs-commit at gcc dot gnu.org
  2023-12-05 14:58 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-05 14:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:d9403153f925c71ceab655af7ed040966f2b4c9c

commit r14-6186-gd9403153f925c71ceab655af7ed040966f2b4c9c
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Dec 5 14:24:34 2023 +0100

    middle-end/112860 - -fgimple can skip ISEL

    The following makes sure we don't skip ISEL.

            PR middle-end/112860
            * passes.cc (should_skip_pass_p): Do not skip ISEL.

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

* [Bug target/112860] ICE: in expand_expr_real_2, at expr.cc:10620 with -O0 -fgimple -mavx512f
  2023-12-05 11:27 [Bug target/112860] New: ICE: in expand_expr_real_2, at expr.cc:10620 with -O0 -fgimple -mavx512f iamanonymous.cs at gmail dot com
  2023-12-05 13:27 ` [Bug target/112860] " rguenth at gcc dot gnu.org
  2023-12-05 14:58 ` cvs-commit at gcc dot gnu.org
@ 2023-12-05 14:58 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-12-05 14:58 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-12-05 14:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05 11:27 [Bug target/112860] New: ICE: in expand_expr_real_2, at expr.cc:10620 with -O0 -fgimple -mavx512f iamanonymous.cs at gmail dot com
2023-12-05 13:27 ` [Bug target/112860] " rguenth at gcc dot gnu.org
2023-12-05 14:58 ` cvs-commit at gcc dot gnu.org
2023-12-05 14:58 ` rguenth 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).