This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

sched/flow problem with memory corruption due to mark_set_resources


I got a segfault while trying to build a mips cross compiler from gcc sources
I checked out on Saturday.  I tracked the problem down to your Aug 24 flow
and sched changes.

new_insn_dead_notes calls mark_set_resources now.  However, that function
can only work after reload.  It takes a struct resource which contains a
HARD_REG_SET.  It sets a bit in that HARD_REG_SET for every used register.
If you have any pseudo regs, then you get an out-of-bounds array write,
and random memory locations get clobbered.

new_insn_dead_notes is called from the first sched pass, which runs before
reload.

This code was originally from reorg, so it never needed to handle pseudo
regs.  The code was merged in from the new_ia32_branch which only runs
the second sched pass after reload, so we wouldn't have noticed the problem
there.

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]