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

            Bug ID: 112610
           Summary: [12/13/14 Regression] ICE: SIGSEGV with
                    -flive-range-shrinkage -fdump-rtl-all-all
                    -fira-verbose=9
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-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 56634
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56634&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -flive-range-shrinkage -fdump-rtl-all-all
-fira-verbose=9 testcase.c -wrapper
valgrind,-q,--exit-on-first-error=yes,--error-exitcode=1
==31926== Invalid read of size 4
==31926==    at 0x4E688E7: __vfprintf_internal (in /lib64/libc.so.6)
==31926==    by 0x4F221A9: __fprintf_chk (in /lib64/libc.so.6)
==31926==    by 0x1285694: fprintf (stdio2.h:79)
==31926==    by 0x1285694: record_reg_classes(int, int, rtx_def**,
machine_mode*, char const**, rtx_insn*, reg_class*) [clone .constprop.0]
(ira-costs.cc:512)
==31926==    by 0x1287415: record_operand_costs(rtx_insn*, reg_class*)
(ira-costs.cc:1502)
==31926==    by 0x1287A47: scan_one_insn (ira-costs.cc:1596)
==31926==    by 0x1287A47: process_bb_for_costs(basic_block_def*)
(ira-costs.cc:1746)
==31926==    by 0x128A20F: find_costs_and_classes(_IO_FILE*)
(ira-costs.cc:2030)
==31926==    by 0x128AC7A: ira_set_pseudo_classes(bool, _IO_FILE*)
(ira-costs.cc:2614)
==31926==    by 0x26736F5: alloc_global_sched_pressure_data
(haifa-sched.cc:7201)
==31926==    by 0x26736F5: sched_init() (haifa-sched.cc:7356)
==31926==    by 0x2674F5D: haifa_sched_init() (haifa-sched.cc:7368)
==31926==    by 0x14714BC: schedule_insns() [clone .part.0] (sched-rgn.cc:3524)
==31926==    by 0x1471B9B: schedule_insns (sched-rgn.cc:3518)
==31926==    by 0x1471B9B: rest_of_handle_live_range_shrinkage
(sched-rgn.cc:3720)
==31926==    by 0x1471B9B: (anonymous
namespace)::pass_live_range_shrinkage::execute(function*) (sched-rgn.cc:3807)
==31926==    by 0x139801A: execute_one_pass(opt_pass*) (passes.cc:2641)
==31926==  Address 0x5628c30 is 192 bytes inside a block of size 472 free'd
==31926==    at 0x4843A5F: free (vg_replace_malloc.c:985)
==31926==    by 0x4E7EA19: fclose@@GLIBC_2.2.5 (in /lib64/libc.so.6)
==31926==    by 0xFE7F4A: gcc::dump_manager::dump_finish(int)
(dumpfile.cc:1519)
==31926==    by 0x1397421: pass_fini_dump_file(opt_pass*) (passes.cc:2258)
==31926==    by 0x13984AD: execute_one_pass(opt_pass*) (passes.cc:2722)
==31926==    by 0x13988FF: execute_pass_list_1(opt_pass*) (passes.cc:2750)
==31926==    by 0x1398911: execute_pass_list_1(opt_pass*) (passes.cc:2751)
==31926==    by 0x1398938: execute_pass_list(function*, opt_pass*)
(passes.cc:2761)
==31926==    by 0xFA89F5: expand (cgraphunit.cc:1841)
==31926==    by 0xFA89F5: cgraph_node::expand() (cgraphunit.cc:1794)
==31926==    by 0xFA9909: output_in_order (cgraphunit.cc:2191)
==31926==    by 0xFA9909: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2395)
==31926==    by 0xFAC8A7: compile (cgraphunit.cc:2311)
==31926==    by 0xFAC8A7: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2583)
==31926==    by 0x14D99B1: compile_file() (toplev.cc:473)
==31926==  Block was alloc'd at
==31926==    at 0x4840804: malloc (vg_replace_malloc.c:442)
==31926==    by 0x4E7F42A: __fopen_internal (in /lib64/libc.so.6)
==31926==    by 0xFE61D8: dump_open (dumpfile.cc:378)
==31926==    by 0xFE61D8: dump_open(char const*, bool) (dumpfile.cc:369)
==31926==    by 0xFE8265: gcc::dump_manager::dump_start(int, dump_flag*)
(dumpfile.cc:1477)
==31926==    by 0x13954FD: pass_init_dump_file(opt_pass*) [clone .part.0]
(passes.cc:2228)
==31926==    by 0x1398337: pass_init_dump_file (passes.cc:2563)
==31926==    by 0x1398337: execute_one_pass(opt_pass*) (passes.cc:2626)
==31926==    by 0x13988FF: execute_pass_list_1(opt_pass*) (passes.cc:2750)
==31926==    by 0x1398911: execute_pass_list_1(opt_pass*) (passes.cc:2751)
==31926==    by 0x1398938: execute_pass_list(function*, opt_pass*)
(passes.cc:2761)
==31926==    by 0xFA89F5: expand (cgraphunit.cc:1841)
==31926==    by 0xFA89F5: cgraph_node::expand() (cgraphunit.cc:1794)
==31926==    by 0xFA9909: output_in_order (cgraphunit.cc:2191)
==31926==    by 0xFA9909: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2395)
==31926==    by 0xFAC8A7: compile (cgraphunit.cc:2311)
==31926==    by 0xFAC8A7: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2583)
==31926== 
==31926== 
==31926== Exit program on first error (--exit-on-first-error=yes)

$ x86_64-pc-linux-gnu-gcc -vUsing 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-5545-20231117101845-g37183018134-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-5545-20231117101845-g37183018134-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231117 (experimental) (GCC)

Reply via email to