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

            Bug ID: 120146
           Summary: [15/16 Regression] ICE: SIGSEGV in all_refs_explicit_p
                    (cgraph.h:3201) with -O -fopenacc
           Product: gcc
           Version: 15.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
            Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fopenacc testcase.C -wrapper valgrind,-q
==30938== Invalid read of size 8
==30938==    at 0x9C3806: all_refs_explicit_p (cgraph.h:3201)
==30938==    by 0x9C3806: create_variable_info_for
(tree-ssa-structalias.cc:6565)
==30938==    by 0x9C3806: get_vi_for_tree(tree_node*) [clone .cold]
(tree-ssa-structalias.cc:3049)
==30938==    by 0x1C0902C: get_constraint_for_ssa_var(tree_node*,
vec<constraint_expr, va_heap, vl_ptr>*, bool) (tree-ssa-structalias.cc:3141)
==30938==    by 0x1C0AC22: get_constraint_for_address_of(tree_node*,
vec<constraint_expr, va_heap, vl_ptr>*) (tree-ssa-structalias.cc:3574)
==30938==    by 0x1C09A94: get_constraint_for_1(tree_node*,
vec<constraint_expr, va_heap, vl_ptr>*, bool, bool)
(tree-ssa-structalias.cc:3660)
==30938==    by 0x1C0AC22: get_constraint_for_address_of(tree_node*,
vec<constraint_expr, va_heap, vl_ptr>*) (tree-ssa-structalias.cc:3574)
==30938==    by 0x1C0989E: get_constraint_for_1(tree_node*,
vec<constraint_expr, va_heap, vl_ptr>*, bool, bool)
(tree-ssa-structalias.cc:3739)
==30938==    by 0x1C08CFB: get_constraint_for (tree-ssa-structalias.cc:3787)
==30938==    by 0x1C08CFB: create_variable_info_for
(tree-ssa-structalias.cc:6579)
==30938==    by 0x1C08CFB: get_vi_for_tree(tree_node*)
(tree-ssa-structalias.cc:3049)
==30938==    by 0x1C11EEE: ipa_pta_execute (tree-ssa-structalias.cc:8490)
==30938==    by 0x1C11EEE: (anonymous
namespace)::pass_ipa_pta::execute(function*) (tree-ssa-structalias.cc:8871)
==30938==    by 0x1852947: execute_one_pass(opt_pass*) (passes.cc:2659)
==30938==    by 0x1853D26: execute_ipa_pass_list(opt_pass*) (passes.cc:3112)
==30938==    by 0x1853D4B: execute_ipa_pass_list(opt_pass*) (passes.cc:3124)
==30938==    by 0x14275E0: ipa_passes (cgraphunit.cc:2228)
==30938==    by 0x14275E0: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2351)
==30938==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==30938== 
during IPA pass: pta
testcase.C:9:74: internal compiler error: Segmentation fault
    9 | void CompareFiles_path2() { basic_ifstream<char>(CompareFiles_path2,
0); }
      |                                                                        
 ^
...

$ 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-20250506130010-r16-402-g81475602c3dd57-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.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 --without-cloog --without-ppl --without-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20250506130010-r16-402-g81475602c3dd57-checking-yes-rtl-df-extra-nobootstrap-nographite-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20250506 (experimental) (GCC)

Reply via email to