public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/112610] New: [12/13/14 Regression] ICE: SIGSEGV with -flive-range-shrinkage -fdump-rtl-all-all -fira-verbose=9
@ 2023-11-18 20:24 zsojka at seznam dot cz
  2023-11-20  9:30 ` [Bug rtl-optimization/112610] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: zsojka at seznam dot cz @ 2023-11-18 20:24 UTC (permalink / raw)
  To: gcc-bugs

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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/112610] [12/13/14 Regression] ICE: SIGSEGV with -flive-range-shrinkage -fdump-rtl-all-all -fira-verbose=9
  2023-11-18 20:24 [Bug rtl-optimization/112610] New: [12/13/14 Regression] ICE: SIGSEGV with -flive-range-shrinkage -fdump-rtl-all-all -fira-verbose=9 zsojka at seznam dot cz
@ 2023-11-20  9:30 ` rguenth at gcc dot gnu.org
  2023-11-22 14:04 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-11-20  9:30 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.4
   Last reconfirmed|                            |2023-11-20
                 CC|                            |vmakarov at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Probably should set ira_dump_file to NULL after the pass finished.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/112610] [12/13/14 Regression] ICE: SIGSEGV with -flive-range-shrinkage -fdump-rtl-all-all -fira-verbose=9
  2023-11-18 20:24 [Bug rtl-optimization/112610] New: [12/13/14 Regression] ICE: SIGSEGV with -flive-range-shrinkage -fdump-rtl-all-all -fira-verbose=9 zsojka at seznam dot cz
  2023-11-20  9:30 ` [Bug rtl-optimization/112610] " rguenth at gcc dot gnu.org
@ 2023-11-22 14:04 ` cvs-commit at gcc dot gnu.org
  2024-03-07 21:01 ` law at gcc dot gnu.org
  2024-03-09 17:13 ` law at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-22 14:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Vladimir Makarov <vmakarov@gcc.gnu.org>:

https://gcc.gnu.org/g:95f61de95bbcc2e4fb7020e27698140abea23788

commit r14-5757-g95f61de95bbcc2e4fb7020e27698140abea23788
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Wed Nov 22 09:01:02 2023 -0500

    [IRA]: Fix using undefined dump file in IRA code during insn scheduling

    Part of IRA code is used for register pressure sensitive insn
    scheduling and live range shrinkage.  Numerous changes of IRA resulted
    in that this IRA code uses dump file passed by the scheduler and
    internal ira dump file (in called functions) which can be undefined or
    freed by the scheduler during compiling previous functions.  The patch
    fixes this problem.  To reproduce the error valgrind should be used
    and GCC should be compiled with valgrind annotations.  Therefor the
    patch does not contain the test case.

    gcc/ChangeLog:

            PR rtl-optimization/112610
            * ira-costs.cc: (find_costs_and_classes): Remove arg.
            Use ira_dump_file for printing.
            (print_allocno_costs, print_pseudo_costs): Ditto.
            (ira_costs): Adjust call of find_costs_and_classes.
            (ira_set_pseudo_classes): Set up and restore ira_dump_file.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/112610] [12/13/14 Regression] ICE: SIGSEGV with -flive-range-shrinkage -fdump-rtl-all-all -fira-verbose=9
  2023-11-18 20:24 [Bug rtl-optimization/112610] New: [12/13/14 Regression] ICE: SIGSEGV with -flive-range-shrinkage -fdump-rtl-all-all -fira-verbose=9 zsojka at seznam dot cz
  2023-11-20  9:30 ` [Bug rtl-optimization/112610] " rguenth at gcc dot gnu.org
  2023-11-22 14:04 ` cvs-commit at gcc dot gnu.org
@ 2024-03-07 21:01 ` law at gcc dot gnu.org
  2024-03-09 17:13 ` law at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-07 21:01 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
                 CC|                            |law at gcc dot gnu.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/112610] [12/13/14 Regression] ICE: SIGSEGV with -flive-range-shrinkage -fdump-rtl-all-all -fira-verbose=9
  2023-11-18 20:24 [Bug rtl-optimization/112610] New: [12/13/14 Regression] ICE: SIGSEGV with -flive-range-shrinkage -fdump-rtl-all-all -fira-verbose=9 zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2024-03-07 21:01 ` law at gcc dot gnu.org
@ 2024-03-09 17:13 ` law at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-09 17:13 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Vlad fixed this on the trunk a while back.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-09 17:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-18 20:24 [Bug rtl-optimization/112610] New: [12/13/14 Regression] ICE: SIGSEGV with -flive-range-shrinkage -fdump-rtl-all-all -fira-verbose=9 zsojka at seznam dot cz
2023-11-20  9:30 ` [Bug rtl-optimization/112610] " rguenth at gcc dot gnu.org
2023-11-22 14:04 ` cvs-commit at gcc dot gnu.org
2024-03-07 21:01 ` law at gcc dot gnu.org
2024-03-09 17:13 ` law at gcc dot gnu.org

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).