Re: Insn missing in Size optimization(-Os)

2009-12-07 Thread daniel tian
Hi Jeff: I have already fixed the bug. this occurs due to register allocation failed in function global_alloc. After calling the find_reg(), the reg_renumber still keep the value -1 in it. So the reload() in reload1.c delete the insns. I didn't set any call saved registers which means ever

Re: Insn missing in Size optimization(-Os)

2009-12-07 Thread Jeff Law
On 12/06/09 20:10, daniel tian wrote: You might start by monitoring emit_reload_insns's behavior when it handles your insn. I just debug the source code with your advice. Check the function emit_reload_insns. That insn was deleted before entering funcion emit_reload_insns. It was deleted

Re: Insn missing in Size optimization(-Os)

2009-12-06 Thread daniel tian
> > You might start by monitoring emit_reload_insns's behavior when it handles > your insn. I just debug the source code with your advice. Check the function emit_reload_insns. That insn was deleted before entering funcion emit_reload_insns. It was deleted in reload(...) in reload1.c file just bef

Re: Insn missing in Size optimization(-Os)

2009-12-05 Thread Jeff Law
On 12/05/09 01:01, daniel tian wrote: Yeah. The Move Symbol to R0 register is deleted, which is weird. And I still can not figure out why. Which means I still need to dig it. But I found when I used the gcc-4.0.2 version, the Call insn call the function direction call the function symbol which is

Re: Insn missing in Size optimization(-Os)

2009-12-05 Thread daniel tian
> Yeah. The Move Symbol to R0 register is deleted, which is weird. > And I still can not figure out why. Which means I still need to dig it. > But I found when I used the gcc-4.0.2 version, the Call insn call the > function direction > call the function symbol which is OK. > I mean how gcc determin

Re: Insn missing in Size optimization(-Os)

2009-12-03 Thread daniel tian
> When a pseudo which has an equivalent form (via the REG_EQUIV note) fails to > get a hard register, reload deletes the insn which sets the pseudo and > instead will reload the equivalent form into a suitable hard register prior > to use points. > > What you want to do is look at the reloads gener

Re: Insn missing in Size optimization(-Os)

2009-12-02 Thread Jeff Law
On 12/02/09 05:29, daniel tian wrote: Hi, Addition information, I just found. It was deleted in function: void set_insn_deleted (rtx insn), in emit-rtl.c. It is called by reload() in reload1.c. Here is the code in reload(): /* If a pseudo has no hard reg, delete the insns that made the

Re: Insn missing in Size optimization(-Os)

2009-12-02 Thread Ian Lance Taylor
daniel tian writes: > Addition information, I just found. It was deleted in function: void > set_insn_deleted (rtx insn), in emit-rtl.c. You need to figure out how register 42 in the call insn got changed to register 0 if reg_renumber[42] was not set to 0. Ian

Re: Insn missing in Size optimization(-Os)

2009-12-02 Thread daniel tian
Hi, Addition information, I just found. It was deleted in function: void set_insn_deleted (rtx insn), in emit-rtl.c. It is called by reload() in reload1.c. Here is the code in reload(): /* If a pseudo has no hard reg, delete the insns that made the equivalence. If that insn didn't set t

Insn missing in Size optimization(-Os)

2009-12-02 Thread daniel tian
Hi, I met a bug in my gcc porting. It work fine when executing with -O0. But with -Os, there is a insn missed. I dumped the RTL and checked them. When in movebug.c.175r.lreg, it is fine. But in next phase -- movebug.c.176r.greg, the insn missed. Here is the simple c program (movebu