This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/49800] New: segfault with -fsched-pressure -fdump-rtl-sched1
- From: "krebbel at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 Jul 2011 08:22:16 +0000
- Subject: [Bug rtl-optimization/49800] New: segfault with -fsched-pressure -fdump-rtl-sched1
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49800
Summary: segfault with -fsched-pressure -fdump-rtl-sched1
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: krebbel@gcc.gnu.org
t.c:
void foo (int a)
{
}
/home/andreas/clean/gcc-head-build/gcc/cc1 -O2 -fdump-rtl-sched1
-fsched-pressure -quiet t.c
Program received signal SIGSEGV, Segmentation fault.
print_pseudo_costs (f=0x80cc9340) at
/home/andreas/clean/gcc-head/gcc/ira-costs.c:1404
1404 if (REG_N_REFS (regno) <= 0)
#0 print_pseudo_costs (f=0x80cc9340) at
/home/andreas/clean/gcc-head/gcc/ira-costs.c:1404
#1 find_costs_and_classes (dump_file=0x80cc9340) at
/home/andreas/clean/gcc-head/gcc/ira-costs.c:1770
#2 0x00000000803edf9e in ira_set_pseudo_classes (dump_file=0x80cc9340)
at /home/andreas/clean/gcc-head/gcc/ira-costs.c:2031
#3 0x000000008085cda8 in sched_init () at
/home/andreas/clean/gcc-head/gcc/haifa-sched.c:4250
#4 0x00000000808654f4 in haifa_sched_init () at
/home/andreas/clean/gcc-head/gcc/haifa-sched.c:4273
#5 0x00000000804dcbca in schedule_insns () at
/home/andreas/clean/gcc-head/gcc/sched-rgn.c:3299
#6 schedule_insns () at /home/andreas/clean/gcc-head/gcc/sched-rgn.c:3287
#7 0x00000000804dd4ce in rest_of_handle_sched () at
/home/andreas/clean/gcc-head/gcc/sched-rgn.c:3501
(gdb) p regstat_n_sets_and_refs
$1 = (regstat_n_sets_and_refs_t *) 0x0
regstat_n_sets_and_refs is not initialized when sched-pressure perhaps invoking
regstat_init_n_sets_and_refs in sched_init is needed?
This worked with 4.6. The check in print_pseudo_costs was:
for (regno = max_reg_num () - 1; regno >= FIRST_PSEUDO_REGISTER; regno--)
{
if (regno_reg_rtx[regno] == NULL_RTX)
continue;
and has been changed to:
for (regno = max_reg_num () - 1; regno >= FIRST_PSEUDO_REGISTER; regno--)
{
if (REG_N_REFS (regno) <= 0)
continue;