This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: unconditional pre-reload splitter
- To: Richard Henderson <rth at redhat dot com>
- Subject: Re: unconditional pre-reload splitter
- From: Graham Stott <grahams at redhat dot com>
- Date: Wed, 04 Jul 2001 11:29:48 +0100
- Cc: Jan Hubicka <jh at suse dot cz>, gcc-patches at gcc dot gnu dot org,patches at x86-64 dot org, gcc at gcc dot gnu dot org
- References: <20010625135229.S7932@atrey.karlin.mff.cuni.cz> <20010625090633.B13183@redhat.com>
Jan
Richard Henderson wrote:
>
> On Mon, Jun 25, 2001 at 01:52:29PM +0200, Jan Hubicka wrote:
> > * haifa-sched.c (sched_init): Do not split insns.
> > * toplev.c (rest_of_compilation): Call split_all_insns before
> > sched1 pass; simplify condition of post-reload splitter;
> > call split_all_insn before sched2 pass.
>
> Ok.
>
> r~
Adding the call to split_all_insns before scheduling may cause problems
when not optimizing because the register use information may be out of
date after the spliting (i.e., split_all_insns only updates life info
using PROP_DEATH_NOTES) this causes local alloc to do the wrong thing.
Here's an example
(insn 25 28 29 (set (reg:SI 115)
(const_int 1234567 [0x12d687])) 212 {movsi_internal2} (nil)
(expr_list:REG_EQUAL (const_int 1234567 [0x12d687])
(nil)))
This insn gets split into
(insn 298 218 299 (set (reg:SI 115)
(const_int 1179648 [0x120000])) 212 {movsi_internal2} (nil)
(nil)))
(insn 299 298 293 (set (reg:SI 115)
(ior:SI (reg:SI 115)
(const_int 54919 [0xd687]))) 122 {*mips.md:5268} (nil)
(nil))
Which after local alloc becomes
(insn 298 218 299 (set (reg:SI 115)
(const_int 1179648 [0x120000])) 212 {movsi_internal2} (nil)
(expr_list:REG_EQUIV (const_int 1179648 [0x120000])
(nil)))
(insn 299 298 293 (set (reg:SI 115)
(ior:SI (reg:SI 115)
(const_int 54919 [0xd687]))) 122 {*mips.md:5268} (nil)
(nil))
Which is wrong insn 298 shouldn't have a REG_EQUIV note because
it is set more than once.
Jan did you intended to do the spliting when not optimizing if so
then the register use info needs to get updated.
The easiest way is get rid of the register_life_up_to_date flag
and always call recompute_reg_usage.
Graham