diff mbox

[wide-int] tree-ssa-ccp fix

Message ID 87zjjae6ls.fsf@talisman.default
State New
Headers show

Commit Message

Richard Sandiford April 24, 2014, 9:54 p.m. UTC
The asm comparison showed a problem with my r204593 change, which dropped
a "val.mask &" in the second hunk below.

Seeing that the problem was in ccp made me look at the whole file again.
I noticed that we'd changed the VARYING mask value from -1 to 1, which
didn't look intentional.

Tested on x86_64-linux-gnu.  OK to install?

Thanks,
Richard

Comments

Richard Biener April 25, 2014, 8:57 a.m. UTC | #1
On Thu, Apr 24, 2014 at 11:54 PM, Richard Sandiford
<rdsandiford@googlemail.com> wrote:
> The asm comparison showed a problem with my r204593 change, which dropped
> a "val.mask &" in the second hunk below.
>
> Seeing that the problem was in ccp made me look at the whole file again.
> I noticed that we'd changed the VARYING mask value from -1 to 1, which
> didn't look intentional.
>
> Tested on x86_64-linux-gnu.  OK to install?

Ok.

Thanks,
Richard.

> Thanks,
> Richard
>
>
> Index: gcc/tree-ssa-ccp.c
> ===================================================================
> --- gcc/tree-ssa-ccp.c  2014-04-23 19:13:20.488547331 +0100
> +++ gcc/tree-ssa-ccp.c  2014-04-23 19:30:07.025416946 +0100
> @@ -607,7 +607,7 @@ get_value_for_expr (tree expr, bool for_
>    else
>      {
>        val.lattice_val = VARYING;
> -      val.mask = 1;
> +      val.mask = -1;
>        val.value = NULL_TREE;
>      }
>    return val;
> @@ -1848,7 +1848,7 @@ evaluate_stmt (gimple stmt)
>               if (nonzero_bits == 0)
>                 val.mask = 0;
>               else
> -               val.mask = extend_mask (nonzero_bits);
> +               val.mask = val.mask & extend_mask (nonzero_bits);
>             }
>         }
>      }
diff mbox

Patch

Index: gcc/tree-ssa-ccp.c
===================================================================
--- gcc/tree-ssa-ccp.c	2014-04-23 19:13:20.488547331 +0100
+++ gcc/tree-ssa-ccp.c	2014-04-23 19:30:07.025416946 +0100
@@ -607,7 +607,7 @@  get_value_for_expr (tree expr, bool for_
   else
     {
       val.lattice_val = VARYING;
-      val.mask = 1;
+      val.mask = -1;
       val.value = NULL_TREE;
     }
   return val;
@@ -1848,7 +1848,7 @@  evaluate_stmt (gimple stmt)
 	      if (nonzero_bits == 0)
 		val.mask = 0;
 	      else
-		val.mask = extend_mask (nonzero_bits);
+		val.mask = val.mask & extend_mask (nonzero_bits);
 	    }
 	}
     }