From bb8dad56465cee82440a0c54c9a8f32d709d396a Mon Sep 17 00:00:00 2001
From: pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 31 Dec 2005 19:38:05 +0000
Subject: [PATCH] 2005-12-31  Andrew Pinski  <pinskia@ohysics.uc.edu>

        PR tree-opt/25612
        * tree-ssa-pre.c (compute_avail): Treat the static chain decl as a
        parameter and pretend that it is defined in the entry basic block.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109200 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog      |  6 ++++++
 gcc/tree-ssa-pre.c | 13 +++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 76a237dd638f..43098de9f475 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2005-12-31  Andrew Pinski  <pinskia@ohysics.uc.edu>
+
+	PR tree-opt/25612
+	* tree-ssa-pre.c (compute_avail): Treat the static chain decl as a
+	parameter and pretend that it is defined in the entry basic block.
+
 2005-12-30  Kazu Hirata  <kazu@codesourcery.com>
 
 	* tree-outof-ssa.c (_elim_graph): Change the type of STACK to
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index f0bf0205297c..2e2fd64b626c 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -3086,6 +3086,19 @@ compute_avail (void)
 	}
     }
 
+  /* Likewise for the static chain decl. */
+  if (cfun->static_chain_decl)
+    {
+      param = cfun->static_chain_decl;
+      if (default_def (param) != NULL)
+        {
+          tree def = default_def (param);
+          vn_lookup_or_add (def, NULL);
+          bitmap_insert_into_set (TMP_GEN (ENTRY_BLOCK_PTR), def);
+          bitmap_value_insert_into_set (AVAIL_OUT (ENTRY_BLOCK_PTR), def);
+        }
+    }
+
   /* Allocate the worklist.  */
   worklist = XNEWVEC (basic_block, n_basic_blocks);
 
-- 
GitLab