Fix PR54826

Submitted by Dehao Chen on Oct. 6, 2012, 2:24 a.m.

Details

Message ID CAO2gOZVmK41nbR2rPM0uY1vUCW5xTFr7BMFqLMKw_dQpA+vhcw@mail.gmail.com
State New
Headers show

Commit Message

Dehao Chen Oct. 6, 2012, 2:24 a.m.
Hi,

This patch fixes PR54826. When lowering the gimple, the block for call
arg also need to be reset.

Bootstrapped and passed gcc regression test on x86.

Okay for trunk?

Thanks,
Dehao

2012-10-05  Dehao Chen  <dehao@google.com>

        * gimple-low.c (lower_stmt): Set the block for call args.

Comments

Jakub Jelinek Oct. 6, 2012, 7:03 a.m.
On Fri, Oct 05, 2012 at 07:24:53PM -0700, Dehao Chen wrote:
> This patch fixes PR54826. When lowering the gimple, the block for call
> arg also need to be reset.
> 
> Bootstrapped and passed gcc regression test on x86.
> 
> Okay for trunk?
> 
> Thanks,
> Dehao
> 
> 2012-10-05  Dehao Chen  <dehao@google.com>
> 
>         * gimple-low.c (lower_stmt): Set the block for call args.

Yes, thanks.

> --- gcc/gimple-low.c	(revision 192147)
> +++ gcc/gimple-low.c	(working copy)
> @@ -425,7 +425,15 @@ lower_stmt (gimple_stmt_iterator *gsi, struct lowe
>      case GIMPLE_CALL:
>        {
>  	tree decl = gimple_call_fndecl (stmt);
> +	unsigned i;
>  
> +	for (i = 0; i < gimple_call_num_args (stmt); i++)
> +	  {
> +	    tree arg = gimple_call_arg (stmt, i);
> +	    if (EXPR_P (arg))
> +	      TREE_SET_BLOCK (arg, data->block);
> +	  }
> +
>  	if (decl
>  	    && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
>  	    && DECL_FUNCTION_CODE (decl) == BUILT_IN_SETJMP)


	Jakub

Patch hide | download patch | download mbox

Index: gcc/gimple-low.c
===================================================================
--- gcc/gimple-low.c	(revision 192147)
+++ gcc/gimple-low.c	(working copy)
@@ -425,7 +425,15 @@  lower_stmt (gimple_stmt_iterator *gsi, struct lowe
     case GIMPLE_CALL:
       {
 	tree decl = gimple_call_fndecl (stmt);
+	unsigned i;
 
+	for (i = 0; i < gimple_call_num_args (stmt); i++)
+	  {
+	    tree arg = gimple_call_arg (stmt, i);
+	    if (EXPR_P (arg))
+	      TREE_SET_BLOCK (arg, data->block);
+	  }
+
 	if (decl
 	    && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
 	    && DECL_FUNCTION_CODE (decl) == BUILT_IN_SETJMP)