Patchwork Fix PR44656, value-replace for disambiugation during VN

login
register
mail settings
Submitter Richard Guenther
Date July 4, 2010, 11:39 a.m.
Message ID <alpine.LNX.2.00.1007041338080.1429@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/57836/
State New
Headers show

Comments

Richard Guenther - July 4, 2010, 11:39 a.m.
On Sun, 4 Jul 2010, Richard Guenther wrote:

> 
> This makes sure we value-replace references we try to disambiguate
> against.  The easiest place is to do in the translation hook when
> we failed to disambiguate against the reference as it is in the IL.
> 
> gcc.dg/tree-ssa/loadpre6.c which I XFAILed during the mem-ref2
> merge shows how we can leverage more PTA (and not rely on false
> TBAA as we do for 4.5 and previous releases).
> 
> Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

I committed an old version.  Fixed like the following.

Richard.

Patch

Index: gcc/tree-ssa-sccvn.c
===================================================================
--- gcc/tree-ssa-sccvn.c	(revision 161798)
+++ gcc/tree-ssa-sccvn.c	(revision 161799)
@@ -1218,12 +1218,12 @@  vn_reference_lookup_3 (ao_ref *ref, tree
       tree lhs = gimple_assign_lhs (def_stmt);
       ao_ref ref1;
       VEC (vn_reference_op_s, heap) *operands = NULL;
-      bool res;
+      bool res = true;
       copy_reference_ops_from_ref (lhs, &operands);
       operands = valueize_refs (operands);
-      ao_ref_init_from_vn_reference (&ref1, get_alias_set (lhs),
-				     TREE_TYPE (lhs), operands);
-      res = refs_may_alias_p_1 (ref, &ref1, true);
+      if (ao_ref_init_from_vn_reference (&ref1, get_alias_set (lhs),
+					 TREE_TYPE (lhs), operands))
+	res = refs_may_alias_p_1 (ref, &ref1, true);
       VEC_free (vn_reference_op_s, heap, operands);
       if (!res)
 	return NULL;
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(revision 161798)
+++ gcc/ChangeLog	(revision 161799)
@@ -1,5 +1,9 @@ 
 2010-07-04  Richard Guenther  <rguenther@suse.de>
 
+	* tree-ssa-sccvn.c (vn_reference_lookup_3): Fix last commit.
+
+2010-07-04  Richard Guenther  <rguenther@suse.de>
+
 	PR tree-optimization/44656
 	* tree-ssa-sccvn.c (vn_reference_lookup_3): Try disambiguation
 	again after value-replacing in the defintions lhs.