public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zsojka at seznam dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/111960] New: ICE: during GIMPLE pass: rebuild_frequencies: SIGSEGV (Invalid read of size 4) with -fdump-tree-rebuild_frequencies-all
Date: Tue, 24 Oct 2023 16:32:50 +0000	[thread overview]
Message-ID: <bug-111960-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 111960
           Summary: ICE: during GIMPLE pass: rebuild_frequencies: SIGSEGV
                    (Invalid read of size 4) with
                    -fdump-tree-rebuild_frequencies-all
           Product: gcc
           Version: 14.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 56189
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56189&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O --param=max-inline-recursive-depth=1000000
-fdump-tree-rebuild_frequencies-all -wrapper valgrind,-q,--num-callers=100
testcase.C 
==13679== Invalid read of size 4
==13679==    at 0x4E7AF1A: fwrite (in /lib64/libc.so.6)
==13679==    by 0x26E3D0E: dump_bb_info(_IO_FILE*, basic_block_def*, int,
dump_flag, bool, bool) (cfg.cc:815)
==13679==    by 0x1257DD7: dump_bb(_IO_FILE*, basic_block_def*, int, dump_flag)
(cfghooks.cc:302)
==13679==    by 0x17FA372: dump_function_to_file(tree_node*, _IO_FILE*,
dump_flag) (tree-cfg.cc:8431)
==13679==    by 0x1680652: execute_function_dump(function*, void*) [clone
.part.0] (passes.cc:1797)
==13679==    by 0x1683CC0: execute_one_pass(opt_pass*) (passes.cc:2717)
==13679==    by 0x168412F: execute_pass_list_1(opt_pass*) (passes.cc:2750)
==13679==    by 0x1684141: execute_pass_list_1(opt_pass*) (passes.cc:2751)
==13679==    by 0x1684168: execute_pass_list(function*, opt_pass*)
(passes.cc:2761)
==13679==    by 0x1295665: expand (cgraphunit.cc:1841)
==13679==    by 0x1295665: cgraph_node::expand() (cgraphunit.cc:1794)
==13679==    by 0x12969AA: expand_all_functions (cgraphunit.cc:2024)
==13679==    by 0x12969AA: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2398)
==13679==    by 0x1299517: compile (cgraphunit.cc:2311)
==13679==    by 0x1299517: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2583)
==13679==    by 0x17BC4E1: compile_file() (toplev.cc:471)
==13679==    by 0xEAB049: do_compile (toplev.cc:2126)
==13679==    by 0xEAB049: toplev::main(int, char**) (toplev.cc:2282)
==13679==    by 0xEAC7CA: main (main.cc:39)
==13679==  Address 0x2930303030 is not stack'd, malloc'd or (recently) free'd
==13679== 
during GIMPLE pass: rebuild_frequencies
dump file: a-testcase.C.108t.rebuild_frequencies1
==13679== 
==13679== Process terminating with default action of signal 11 (SIGSEGV)
==13679==  Access not within mapped region at address 0x2930303030
==13679==    at 0x4E7AF1A: fwrite (in /lib64/libc.so.6)
==13679==    by 0x26E3D0E: dump_bb_info(_IO_FILE*, basic_block_def*, int,
dump_flag, bool, bool) (cfg.cc:815)
==13679==    by 0x1257DD7: dump_bb(_IO_FILE*, basic_block_def*, int, dump_flag)
(cfghooks.cc:302)
==13679==    by 0x17FA372: dump_function_to_file(tree_node*, _IO_FILE*,
dump_flag) (tree-cfg.cc:8431)
==13679==    by 0x1680652: execute_function_dump(function*, void*) [clone
.part.0] (passes.cc:1797)
==13679==    by 0x16825EB: execute_function_dump (passes.cc:1792)
==13679==    by 0x16825EB: emergency_dump_function() (passes.cc:1839)
==13679==    by 0x2C07B9E: diagnostic_report_diagnostic(diagnostic_context*,
diagnostic_info*) (diagnostic.cc:1563)
==13679==    by 0x2C08392: diagnostic_impl(rich_location*, diagnostic_metadata
const*, int, char const*, __va_list_tag (*) [1], diagnostic_t)
(diagnostic.cc:1738)
==13679==    by 0x2C090F6: internal_error(char const*, ...)
(diagnostic.cc:2184)
==13679==    by 0x17BBFFF: crash_signal(int) (toplev.cc:314)
==13679==    by 0x4E4358F: ??? (in /lib64/libc.so.6)
==13679==    by 0x4E7AF19: fwrite (in /lib64/libc.so.6)
==13679==    by 0x26E3D0E: dump_bb_info(_IO_FILE*, basic_block_def*, int,
dump_flag, bool, bool) (cfg.cc:815)
==13679==    by 0x1257DD7: dump_bb(_IO_FILE*, basic_block_def*, int, dump_flag)
(cfghooks.cc:302)
==13679==    by 0x17FA372: dump_function_to_file(tree_node*, _IO_FILE*,
dump_flag) (tree-cfg.cc:8431)
==13679==    by 0x1680652: execute_function_dump(function*, void*) [clone
.part.0] (passes.cc:1797)
==13679==    by 0x1683CC0: execute_one_pass(opt_pass*) (passes.cc:2717)
==13679==    by 0x168412F: execute_pass_list_1(opt_pass*) (passes.cc:2750)
==13679==    by 0x1684141: execute_pass_list_1(opt_pass*) (passes.cc:2751)
==13679==    by 0x1684168: execute_pass_list(function*, opt_pass*)
(passes.cc:2761)
==13679==    by 0x1295665: expand (cgraphunit.cc:1841)
==13679==    by 0x1295665: cgraph_node::expand() (cgraphunit.cc:1794)
==13679==    by 0x12969AA: expand_all_functions (cgraphunit.cc:2024)
==13679==    by 0x12969AA: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2398)
==13679==    by 0x1299517: compile (cgraphunit.cc:2311)
==13679==    by 0x1299517: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2583)
==13679==    by 0x17BC4E1: compile_file() (toplev.cc:471)
==13679==    by 0xEAB049: do_compile (toplev.cc:2126)
==13679==    by 0xEAB049: toplev::main(int, char**) (toplev.cc:2282)
==13679==    by 0xEAC7CA: main (main.cc:39)
==13679==  If you believe this happened as a result of a stack
==13679==  overflow in your program's main thread (unlikely but
==13679==  possible), you can try to increase the size of the
==13679==  main thread stack using the --main-stacksize= flag.
==13679==  The main thread stack size used in this run was 16777216.
x86_64-pc-linux-gnu-gcc: internal compiler error: Segmentation fault signal
terminated program valgrind
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
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-r14-4866-20231023153002-g458db9b6149-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.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-r14-4866-20231023153002-g458db9b6149-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231023 (experimental) (GCC)

             reply	other threads:[~2023-10-24 16:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 16:32 zsojka at seznam dot cz [this message]
2023-10-27  7:19 ` [Bug tree-optimization/111960] [14 Regression] " pinskia at gcc dot gnu.org
2023-10-27  7:23 ` [Bug ipa/111960] " pinskia at gcc dot gnu.org
2023-10-31 12:02 ` sjames at gcc dot gnu.org
2023-10-31 15:05 ` zsojka at seznam dot cz
2024-01-10 10:36 ` rguenth at gcc dot gnu.org
2024-02-16 16:25 ` hubicka at gcc dot gnu.org
2024-02-21 16:32 ` jakub at gcc dot gnu.org
2024-02-21 16:35 ` pinskia at gcc dot gnu.org
2024-02-21 16:35 ` jakub at gcc dot gnu.org
2024-02-21 19:59 ` jakub at gcc dot gnu.org
2024-02-21 20:21 ` jakub at gcc dot gnu.org
2024-02-22 12:08 ` cvs-commit at gcc dot gnu.org
2024-02-22 12:20 ` jakub at gcc dot gnu.org
2024-02-22 12:58 ` hubicka at ucw dot cz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-111960-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).