On Fri, Sep 27, 2013 at 06:10:41PM +0400, Yury Gribov wrote:
> Hi all,
> 
> I've recently submitted a bug report regarding invalid unpoisoning
> of stack frame redzones
> (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58543). Could someone
> take a look at proposed patch (a simple one-liner) and check whether
> it's ok for commit?

Can you please be more verbose on why do you think it is the right fix,
what exactly is the problem and why force_reg wasn't sufficient?
What exactly was XEXP (shadow_mem, 0) that force_reg didn't force it into
a pseudo?

Also, you are missing a ChangeLog entry.

> diff --git a/gcc/asan.c b/gcc/asan.c
> index 32f1837..acb00ea 100644
> --- a/gcc/asan.c
> +++ b/gcc/asan.c
> @@ -895,7 +895,7 @@ asan_clear_shadow (rtx shadow_mem, HOST_WIDE_INT len)
>  
>    gcc_assert ((len & 3) == 0);
>    top_label = gen_label_rtx ();
> -  addr = force_reg (Pmode, XEXP (shadow_mem, 0));
> +  addr = copy_to_reg (force_reg (Pmode, XEXP (shadow_mem, 0)));
>    shadow_mem = adjust_automodify_address (shadow_mem, SImode, addr, 0);
>    end = force_reg (Pmode, plus_constant (Pmode, addr, len));
>    emit_label (top_label);


        Jakub

Reply via email to