This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
sched/flow problem with memory corruption due to mark_set_resources
- To: rth at cygnus dot com
- Subject: sched/flow problem with memory corruption due to mark_set_resources
- From: Jim Wilson <wilson at cygnus dot com>
- Date: Sun, 29 Aug 1999 23:11:51 -0700
- cc: gcc-bugs at gcc dot gnu dot org, wilson at cygnus dot com
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