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

            Bug ID: 105367
           Summary: [12 Regression] ICE: SIGSEGV in contains_struct_check
                    (tree.h:3570) with -Ofast -mveclibabi=acml
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Ofast -mveclibabi=acml testcase.c -wrapper
valgrind,-q
==27510== Invalid read of size 2
==27510==    at 0x172F0A7: contains_struct_check (tree.h:3570)
==27510==    by 0x172F0A7: ix86_veclibabi_acml(combined_fn, tree_node*,
tree_node*) (i386.cc:18903)
==27510==    by 0x24C3B67: vectorizable_call(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, gimple**, _slp_tree*, vec<stmt_info_for_cost, va_heap,
vl_ptr>*) (tree-vect-stmts.cc:3435)
==27510==    by 0x24D4CDC: vect_analyze_stmt(vec_info*, _stmt_vec_info*, bool*,
_slp_tree*, _slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
(tree-vect-stmts.cc:11173)
==27510==    by 0x1641EF8: vect_slp_analyze_node_operations_1
(tree-vect-slp.cc:4501)
==27510==    by 0x1641EF8: vect_slp_analyze_node_operations(vec_info*,
_slp_tree*, _slp_instance*, hash_set<_slp_tree*, false,
default_hash_traits<_slp_tree*> >&, vec<_slp_tree*, va_heap, vl_ptr>&,
vec<stmt_info_for_cost, va_heap, vl_ptr>*) (tree-vect-slp.cc:4685)
==27510==    by 0x164363A: vect_slp_analyze_operations(vec_info*)
(tree-vect-slp.cc:4924)
==27510==    by 0x164906B: vect_slp_analyze_bb_1 (tree-vect-slp.cc:5892)
==27510==    by 0x164906B: vect_slp_region(vec<basic_block_def*, va_heap,
vl_ptr>, vec<data_reference*, va_heap, vl_ptr>, vec<int, va_heap, vl_ptr>*,
unsigned int, loop*) (tree-vect-slp.cc:5939)
==27510==    by 0x164A864: vect_slp_bbs(vec<basic_block_def*, va_heap, vl_ptr>
const&, loop*) (tree-vect-slp.cc:6130)
==27510==    by 0x164AC2C: vect_slp_function(function*) (tree-vect-slp.cc:6218)
==27510==    by 0x1652A32: (anonymous
namespace)::pass_slp_vectorize::execute(function*) (tree-vectorizer.cc:1506)
==27510==    by 0x1298129: execute_one_pass(opt_pass*) (passes.cc:2638)
==27510==    by 0x12989EF: execute_pass_list_1(opt_pass*) (passes.cc:2738)
==27510==    by 0x1298A01: execute_pass_list_1(opt_pass*) (passes.cc:2739)
==27510==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==27510== 
during GIMPLE pass: slp
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: Segmentation fault
    4 | foo() {
      | ^~~
0x13a3d9f crash_signal
        /repo/gcc-trunk/gcc/toplev.cc:322
0x172f0a7 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        /repo/gcc-trunk/gcc/tree.h:3570
0x172f0a7 ix86_veclibabi_acml(combined_fn, tree_node*, tree_node*)
        /repo/gcc-trunk/gcc/config/i386/i386.cc:18903
0x24c3b67 vectorizable_call
        /repo/gcc-trunk/gcc/tree-vect-stmts.cc:3435
0x24d4cdc vect_analyze_stmt(vec_info*, _stmt_vec_info*, bool*, _slp_tree*,
_slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
        /repo/gcc-trunk/gcc/tree-vect-stmts.cc:11173
0x1641ef8 vect_slp_analyze_node_operations_1
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:4501
0x1641ef8 vect_slp_analyze_node_operations
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:4685
0x164363a vect_slp_analyze_operations(vec_info*)
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:4924
0x164906b vect_slp_analyze_bb_1
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:5892
0x164906b vect_slp_region
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:5939
0x164a864 vect_slp_bbs
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:6130
0x164ac2c vect_slp_function(function*)
        /repo/gcc-trunk/gcc/tree-vect-slp.cc:6218
0x1652a32 execute
        /repo/gcc-trunk/gcc/tree-vectorizer.cc:1506
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.

$ 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-8236-20220424133922-g6b7441a46c7-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.1/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-8236-20220424133922-g6b7441a46c7-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220424 (experimental) (GCC)

Reply via email to