This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: altivec trashing frame ptr reg
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 9 Mar 2002 11:04:40 +1100
- Subject: Re: altivec trashing frame ptr reg
sorry i took so long.
yes, this looks ok, provided dje is ok with it.
thanks for catching it.
>> besides, the rest of the pro/epilogue code uses r12 (david
>> suggested i use it). if you are tripping this with vrsave,
>> it just as likely will be tripped with other pro/epilogue code.
>
> The bug is pretty obvious if you'd care to take a look at the code.
>
> /* Save VRSAVE. */
> offset = info->vrsave_save_offset + sp_offset;
> mem
> = gen_rtx_MEM (SImode,
> gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (offset)));
> set_mem_alias_set (mem, rs6000_sr_alias_set);
> insn = emit_move_insn (mem, reg);
>
> Note that we use frame_reg_rtx. Further note that frame_reg_rtx may
> be set to r12 at the start of rs6000_emit_prologue, here:
>
> rtx frame_ptr_rtx = gen_rtx_REG (Pmode, 12);
> [snip]
> /* For V.4, update stack before we do any saving and set back
> pointer. */
> if (info->push_p && DEFAULT_ABI == ABI_V4)
> {
> if (info->total_size < 32767)
> sp_offset = info->total_size;
> else
> frame_reg_rtx = frame_ptr_rtx;
>
> So, ABI_V4, big stack frame, altivec vrsave -> zap random memory, boom.
>
> --
> Alan Modra
> IBM OzLabs - Linux Technology Centre
>
>
--
Aldy Hernandez E-mail: aldyh@redhat.com
Professional Gypsy Lost in Australia
Red Hat, Inc.