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

            Bug ID: 101161
           Summary: [12 Regression] ICE: SIGSEGV in tree_class_check at
                    -O3 during GIMPLE pass: slp
           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 51044
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51044&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O3 testcase.c -wrapper valgrind,-q
==5080== Invalid read of size 2
==5080==    at 0xDE26C2: tree_class_check (tree.h:3493)
==5080==    by 0xDE26C2: direct_optab_supported_p(optab_tag,
std::pair<tree_node*, tree_node*>, optimization_type) (internal-fn.c:3533)
==5080==    by 0x1CCD7FE: vect_recog_popcount_pattern(vec_info*,
_stmt_vec_info*, tree_node**) (tree-vect-patterns.c:1388)
==5080==    by 0x1CD088A: vect_pattern_recog_1(vec_info*, vect_recog_func*,
_stmt_vec_info*) (tree-vect-patterns.c:5584)
==5080==    by 0x1CD7661: vect_pattern_recog(vec_info*)
(tree-vect-patterns.c:5742)
==5080==    by 0x1340443: vect_slp_analyze_bb_1 (tree-vect-slp.c:5561)
==5080==    by 0x1340443: vect_slp_region (tree-vect-slp.c:5669)
==5080==    by 0x1340443: vect_slp_bbs(vec<basic_block_def*, va_heap, vl_ptr>)
(tree-vect-slp.c:5819)
==5080==    by 0x1342464: vect_slp_function(function*) (tree-vect-slp.c:5905)
==5080==    by 0x1348982: (anonymous
namespace)::pass_slp_vectorize::execute(function*) (tree-vectorizer.c:1445)
==5080==    by 0xF8EDC7: execute_one_pass(opt_pass*) (passes.c:2567)
==5080==    by 0xF8F72F: execute_pass_list_1(opt_pass*) (passes.c:2656)
==5080==    by 0xF8F741: execute_pass_list_1(opt_pass*) (passes.c:2657)
==5080==    by 0xF8F741: execute_pass_list_1(opt_pass*) (passes.c:2657)
==5080==    by 0xF8F768: execute_pass_list(function*, opt_pass*)
(passes.c:2667)
==5080==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==5080== 
during GIMPLE pass: slp
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: Segmentation fault
    4 | foo (__int128 i)
      | ^~~
0x108adbf crash_signal
        /repo/gcc-trunk/gcc/toplev.c:327
0xde26c2 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
        /repo/gcc-trunk/gcc/tree.h:3493
0xde26c2 direct_optab_supported_p
        /repo/gcc-trunk/gcc/internal-fn.c:3533
0x1ccd7fe vect_recog_popcount_pattern
        /repo/gcc-trunk/gcc/tree-vect-patterns.c:1388
0x1cd088a vect_pattern_recog_1
        /repo/gcc-trunk/gcc/tree-vect-patterns.c:5584
0x1cd7661 vect_pattern_recog(vec_info*)
        /repo/gcc-trunk/gcc/tree-vect-patterns.c:5742
0x1340443 vect_slp_analyze_bb_1
        /repo/gcc-trunk/gcc/tree-vect-slp.c:5561
0x1340443 vect_slp_region
        /repo/gcc-trunk/gcc/tree-vect-slp.c:5669
0x1340443 vect_slp_bbs
        /repo/gcc-trunk/gcc/tree-vect-slp.c:5819
0x1342464 vect_slp_function(function*)
        /repo/gcc-trunk/gcc/tree-vect-slp.c:5905
0x1348982 execute
        /repo/gcc-trunk/gcc/tree-vectorizer.c:1445
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-1707-20210622104011-ge08a125b208-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-1707-20210622104011-ge08a125b208-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210622 (experimental) (GCC)

Reply via email to