Bug 107896 - [13 Regression] ICE in supportable_widening_operation, at tree-vect-stmts.cc:12199 breaking arm bootstrap
Summary: [13 Regression] ICE in supportable_widening_operation, at tree-vect-stmts.cc:...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 13.0
: P3 normal
Target Milestone: 13.0
Assignee: Richard Biener
URL:
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2022-11-28 16:04 UTC by Alex Coplan
Modified: 2022-11-28 18:41 UTC (History)
0 users

See Also:
Host:
Target: arm-linux-gnueabihf
Build:
Known to work:
Known to fail: 13.0
Last reconfirmed: 2022-11-28 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Coplan 2022-11-28 16:04:27 UTC
The following fails (reduced from arm bootstrap):

$ cat t.cc
struct gcc_options {
  int x_flag_tree_phiprop;
  int x_flag_tree_pre;
  int x_flag_tree_pta;
  int x_flag_tree_reassoc;
  int x_flag_tree_scev_cprop;
  int x_flag_tree_sink;
  int x_flag_tree_slp_vectorize;
  int x_flag_web;
} cl_optimization_restore_opts;
signed char cl_optimization_restore_ptr_1, cl_optimization_restore_ptr_0;
void cl_optimization_restore() {
  cl_optimization_restore_opts
      .x_flag_tree_phiprop = cl_optimization_restore_opts.x_flag_tree_pre =
      cl_optimization_restore_opts.x_flag_tree_pta =
          cl_optimization_restore_opts.x_flag_tree_reassoc =
              cl_optimization_restore_opts.x_flag_tree_scev_cprop =
                  cl_optimization_restore_opts.x_flag_tree_sink =
                      cl_optimization_restore_opts.x_flag_tree_slp_vectorize =
                          cl_optimization_restore_ptr_0;
  cl_optimization_restore_opts.x_flag_web = cl_optimization_restore_ptr_1;
}

$ gcc/xgcc -B gcc -c t.cc -O2 -march=armv8-a+crypto
during GIMPLE pass: slp
t.cc: In function ‘void cl_optimization_restore()’:
t.cc:12:6: internal compiler error: in supportable_widening_operation, at tree-vect-stmts.cc:12199
   12 | void cl_optimization_restore() {
      |      ^~~~~~~~~~~~~~~~~~~~~~~
0x1dd0b13 supportable_widening_operation(vec_info*, tree_code, _stmt_vec_info*, tree_node*, tree_node*, tree_code*, tree_code*, int*, vec<tree_node*, va_heap, vl_ptr>*)
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-stmts.cc:12199
0x1dd5ef5 vectorizable_conversion
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-stmts.cc:5064
0x1df36c6 vect_analyze_stmt(vec_info*, _stmt_vec_info*, bool*, _slp_tree*, _slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-stmts.cc:11256
0x13a164d vect_slp_analyze_node_operations_1
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.cc:5957
0x13a164d vect_slp_analyze_node_operations
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.cc:6147
0x13a1556 vect_slp_analyze_node_operations
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.cc:6126
0x13a3b37 vect_slp_analyze_operations(vec_info*)
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.cc:6387
0x13a8ce8 vect_slp_analyze_bb_1
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.cc:7372
0x13a8ce8 vect_slp_region
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.cc:7419
0x13a9b9d vect_slp_bbs
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.cc:7610
0x13aa1c1 vect_slp_function(function*)
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.cc:7698
0x13b3ec6 execute
        /home/alecop01/toolchain/src/gcc/gcc/tree-vectorizer.cc:1532
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.

$ gcc/xgcc -B gcc -v
Reading specs from gcc/specs
COLLECT_GCC=gcc/xgcc
COLLECT_LTO_WRAPPER=gcc/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: /home/alecop01/toolchain/src/gcc/configure --prefix=/data_sdb/toolchain/cc1s/arm-lin --enable-languages=c,c++ --disable-bootstrap --target=arm-linux-gnueabihf
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.0.0 20221128 (experimental) (GCC)
Comment 1 Andrew Pinski 2022-11-28 16:22:40 UTC
Going backwards:
          gcc_assert (VECTOR_MODE_P (intermediate_mode));
..
      intermediate_mode = insn_data[icode1].operand[0].mode;
...

  if ((icode1 = optab_handler (optab1, vec_mode)) == CODE_FOR_nothing
       || (icode2 = optab_handler (optab2, vec_mode)) == CODE_FOR_nothing)
    return false;
Comment 2 Richard Biener 2022-11-28 16:25:40 UTC
OK, so we have vec_unpacks_lo_v2si unpacking V2Si to DImode.

I can fix that easily.
Comment 3 GCC Commits 2022-11-28 18:41:35 UTC
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:2200b7054638bbf157192a4dca23886dd420becb

commit r13-4374-g2200b7054638bbf157192a4dca23886dd420becb
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Nov 28 17:26:15 2022 +0100

    tree-optimization/107896 - allow v2si to dimode unpacks
    
    The following avoids ICEing for V2SI -> DImode vec_unpacks_lo.
    
            PR tree-optimization/107896
            * tree-vect-stmts.cc (supportable_widening_operation):
            Handle non-vector mode intermediate mode.
Comment 4 Richard Biener 2022-11-28 18:41:46 UTC
Should be fixed.