diff mbox

PR 49809: write data refs can now be calls

Message ID g48vrmtr88.fsf@linaro.org
State New
Headers show

Commit Message

Richard Sandiford July 25, 2011, 1:38 p.m. UTC
PR 49809 is fallout from my patch to add write data references for the
lhs of calls.  tree-ssa-phiopt.c was still assuming that writes were
always assignments.

I tried to look for other examples of the same thing, but couldn't
find any.

Tested on x86_64-linux-gnu (all,ada).  OK to install?

Richard


gcc/
	PR tree-optimization/49809
	* tree-ssa-phiopt.c (cond_if_else_store_replacement): Use
	gimple_get_lhs instead of gimple_assign_lhs.

Comments

Richard Biener July 25, 2011, 1:47 p.m. UTC | #1
On Mon, Jul 25, 2011 at 3:38 PM, Richard Sandiford
<richard.sandiford@linaro.org> wrote:
> PR 49809 is fallout from my patch to add write data references for the
> lhs of calls.  tree-ssa-phiopt.c was still assuming that writes were
> always assignments.
>
> I tried to look for other examples of the same thing, but couldn't
> find any.
>
> Tested on x86_64-linux-gnu (all,ada).  OK to install?

Ok.

Thanks,
Richard.

> Richard
>
>
> gcc/
>        PR tree-optimization/49809
>        * tree-ssa-phiopt.c (cond_if_else_store_replacement): Use
>        gimple_get_lhs instead of gimple_assign_lhs.
>
> Index: gcc/tree-ssa-phiopt.c
> ===================================================================
> --- gcc/tree-ssa-phiopt.c       2011-07-21 11:10:34.000000000 +0100
> +++ gcc/tree-ssa-phiopt.c       2011-07-25 14:32:36.000000000 +0100
> @@ -1454,7 +1454,7 @@ cond_if_else_store_replacement (basic_bl
>         continue;
>
>       then_store = DR_STMT (then_dr);
> -      then_lhs = gimple_assign_lhs (then_store);
> +      then_lhs = gimple_get_lhs (then_store);
>       found = false;
>
>       FOR_EACH_VEC_ELT (data_reference_p, else_datarefs, j, else_dr)
> @@ -1463,7 +1463,7 @@ cond_if_else_store_replacement (basic_bl
>             continue;
>
>           else_store = DR_STMT (else_dr);
> -          else_lhs = gimple_assign_lhs (else_store);
> +          else_lhs = gimple_get_lhs (else_store);
>
>           if (operand_equal_p (then_lhs, else_lhs, 0))
>             {
>
Eric Botcazou July 25, 2011, 2 p.m. UTC | #2
> PR 49809 is fallout from my patch to add write data references for the
> lhs of calls.  tree-ssa-phiopt.c was still assuming that writes were
> always assignments.
>
> I tried to look for other examples of the same thing, but couldn't
> find any.
>
> Tested on x86_64-linux-gnu (all,ada).  OK to install?

Thanks for fixing this.  Please install the testcase as well.
diff mbox

Patch

Index: gcc/tree-ssa-phiopt.c
===================================================================
--- gcc/tree-ssa-phiopt.c	2011-07-21 11:10:34.000000000 +0100
+++ gcc/tree-ssa-phiopt.c	2011-07-25 14:32:36.000000000 +0100
@@ -1454,7 +1454,7 @@  cond_if_else_store_replacement (basic_bl
         continue;
 
       then_store = DR_STMT (then_dr);
-      then_lhs = gimple_assign_lhs (then_store);
+      then_lhs = gimple_get_lhs (then_store);
       found = false;
 
       FOR_EACH_VEC_ELT (data_reference_p, else_datarefs, j, else_dr)
@@ -1463,7 +1463,7 @@  cond_if_else_store_replacement (basic_bl
             continue;
 
           else_store = DR_STMT (else_dr);
-          else_lhs = gimple_assign_lhs (else_store);
+          else_lhs = gimple_get_lhs (else_store);
 
           if (operand_equal_p (then_lhs, else_lhs, 0))
             {