This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[vta] merge fallout


This patch fixes various merge errors I (or svn) introduced when I
merged tuples et al from the trunk into vta.  The changes to ipa-*
were present (in a different form) in the branch before the merge, but
rather than reporting a conflict, it seems that svn simply discarded
the changes, because the surrounding code had been so reworked that it
seemed to have all been removed :-(

I'm checking this in the vta branch.

for gcc/ChangeLog.vta
from  Alexandre Oliva  <aoliva@redhat.com>

	* tree-if-conv.c (tree_if_convert_stmt, if_convertible_stmt_p):
	Check for GIMPLE_DEBUG rather than VAR_DEBUG_VALUE.
	* tree-cfgcleanup.c (tree_forwarder_block_p): Likewise.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
	(eliminate_unnecessary_stmts): Move debug stmt handler.
	* tree-inline.c (remap_gimple_stmt): Defer work on debug stmts.
	(copy_bb): Likewise.
	(copy_debug_stmt): Update.
	* tree-ssa-aliase.c (update_alias_info): Skip debug stmts.
	* ipa-reference.c (scan_stmt_for_static_refs): Likewise.
	* ipa-pure-const.c (scan_function_stmt): Likewise.

Index: gcc/tree-if-conv.c
===================================================================
--- gcc/tree-if-conv.c.orig	2008-08-09 02:58:13.000000000 -0300
+++ gcc/tree-if-conv.c	2008-08-11 05:23:08.000000000 -0300
@@ -239,7 +239,7 @@ tree_if_convert_stmt (struct loop *  loo
     case GIMPLE_LABEL:
       break;
 
-    case VAR_DEBUG_VALUE:
+    case GIMPLE_DEBUG:
       /* ??? Should there be conditional VAR_DEBUG_VALUEs?  */
       VAR_DEBUG_VALUE_VALUE (gsi_stmt (*gsi)) = VAR_DEBUG_VALUE_NOVALUE;
       update_stmt (gsi_stmt (*gsi));
@@ -428,7 +428,7 @@ if_convertible_stmt_p (struct loop *loop
     case GIMPLE_LABEL:
       break;
 
-    case VAR_DEBUG_VALUE:
+    case GIMPLE_DEBUG:
       break;
 
     case GIMPLE_ASSIGN:
Index: gcc/tree-cfgcleanup.c
===================================================================
--- gcc/tree-cfgcleanup.c.orig	2008-08-09 02:58:13.000000000 -0300
+++ gcc/tree-cfgcleanup.c	2008-08-06 04:09:47.000000000 -0300
@@ -257,7 +257,7 @@ tree_forwarder_block_p (basic_block bb, 
 
 	  /* ??? For now, hope there's a corresponding debug
 	     assignment at the destination.  */
-	case VAR_DEBUG_VALUE:
+	case GIMPLE_DEBUG:
 	  break;
 
 	default:
Index: gcc/tree-ssa-dce.c
===================================================================
--- gcc/tree-ssa-dce.c.orig	2008-08-09 02:58:13.000000000 -0300
+++ gcc/tree-ssa-dce.c	2008-08-11 05:23:08.000000000 -0300
@@ -314,7 +314,7 @@ mark_stmt_if_obviously_necessary (gimple
 	}
       break;
 
-    case VAR_DEBUG_VALUE:
+    case GIMPLE_DEBUG:
       mark_stmt_necessary (stmt, false);
       return;
 
@@ -701,14 +701,8 @@ eliminate_unnecessary_stmts (void)
 	    }
 	  else if (is_gimple_call (stmt))
 	    {
-	      if (IS_DEBUG_STMT (stmt) == VAR_DEBUG_VALUE)
-		{
-		  if (something_changed
-		      && (VAR_DEBUG_VALUE_VALUE (stmt)
-			  != VAR_DEBUG_VALUE_NOVALUE))
-		    check_and_update_debug_stmt (stmt, necessary_p);
-		}
-	      else if ((call = gimple_call_fndecl (stmt)))
+	      call = gimple_call_fndecl (stmt);
+	      if (call)
 		{
 		  tree name;
 		  gimple g;
@@ -742,6 +736,13 @@ eliminate_unnecessary_stmts (void)
 	    }
 	  else
 	    {
+	      if (IS_DEBUG_STMT (stmt))
+		{
+		  if (something_changed
+		      && (VAR_DEBUG_VALUE_VALUE (stmt)
+			  != VAR_DEBUG_VALUE_NOVALUE))
+		    check_and_update_debug_stmt (stmt, necessary_p);
+		}
 	      gsi_next (&gsi);
 	    }
 	}
Index: gcc/tree-inline.c
===================================================================
--- gcc/tree-inline.c.orig	2008-08-09 02:58:13.000000000 -0300
+++ gcc/tree-inline.c	2008-08-11 05:23:09.000000000 -0300
@@ -1223,6 +1223,9 @@ remap_gimple_stmt (gimple stmt, copy_bod
 
   gimple_set_block (copy, new_block);
 
+  if (IS_DEBUG_STMT (copy))
+    return copy;
+
   /* Remap all the operands in COPY.  */
   memset (&wi, 0, sizeof (wi));
   wi.info = id;
@@ -1459,7 +1462,7 @@ copy_bb (copy_body_data *id, basic_block
 		add_stmt_to_eh_region (stmt, id->eh_region);
 	    }
 
-	  if (gimple_in_ssa_p (cfun))
+	  if (gimple_in_ssa_p (cfun) && !IS_DEBUG_STMT (stmt))
 	    {
 	      ssa_op_iter i;
 	      tree def;
@@ -1852,17 +1855,24 @@ static void
 copy_debug_stmt (gimple stmt, copy_body_data *id)
 {
   tree t;
+  struct walk_stmt_info wi;
+
+  /* Remap all the operands in COPY.  */
+  memset (&wi, 0, sizeof (wi));
+  wi.info = id;
 
   processing_debug_stmt = 1;
 
   t = VAR_DEBUG_VALUE_VAR (stmt);
-  walk_tree (&t, copy_tree_body_r, id, NULL);
+  walk_tree (&t, remap_gimple_op_r, &wi, NULL);
   VAR_DEBUG_VALUE_SET_VAR (stmt, t);
 
   gcc_assert (processing_debug_stmt == 1);
 
-  walk_tree (&VAR_DEBUG_VALUE_VALUE (stmt), copy_tree_body_r, id, NULL);
+  if (VAR_DEBUG_VALUE_VALUE (stmt) != VAR_DEBUG_VALUE_NOVALUE)
+    walk_tree (&VAR_DEBUG_VALUE_VALUE (stmt), remap_gimple_op_r, &wi, NULL);
 
+  /* Punt if any decl couldn't be remapped.  */
   if (processing_debug_stmt < 0)
     VAR_DEBUG_VALUE_VALUE (stmt) = VAR_DEBUG_VALUE_NOVALUE;
 
Index: gcc/tree-ssa-alias.c
===================================================================
--- gcc/tree-ssa-alias.c.orig	2008-08-09 02:58:13.000000000 -0300
+++ gcc/tree-ssa-alias.c	2008-08-08 20:23:36.000000000 -0300
@@ -2731,7 +2731,11 @@ update_alias_info (struct alias_info *ai
 	}
 
       for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
-	update_alias_info_1 (gsi_stmt (gsi), ai);
+	{
+	  if (IS_DEBUG_STMT (gsi_stmt (gsi)))
+	    continue;
+	  update_alias_info_1 (gsi_stmt (gsi), ai);
+	}
     }
 }
 
Index: gcc/ipa-reference.c
===================================================================
--- gcc/ipa-reference.c.orig	2008-08-09 02:58:13.000000000 -0300
+++ gcc/ipa-reference.c	2008-08-07 20:46:14.000000000 -0300
@@ -1,5 +1,5 @@
 /* Callgraph based analysis of static variables.
-   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
    Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
 
 This file is part of GCC.
@@ -554,6 +554,10 @@ scan_stmt_for_static_refs (gimple_stmt_i
       *handled_ops_p = true;
       break;
       
+    case GIMPLE_DEBUG:
+      *handled_ops_p = true;
+      break;
+
     default:
       break;
     }
Index: gcc/ipa-pure-const.c
===================================================================
--- gcc/ipa-pure-const.c.orig	2008-07-30 15:55:48.000000000 -0300
+++ gcc/ipa-pure-const.c	2008-08-11 05:17:31.000000000 -0300
@@ -521,6 +521,10 @@ scan_function_stmt (gimple_stmt_iterator
       *handled_ops_p = true;
       break;
       
+    case GIMPLE_DEBUG:
+      *handled_ops_p = true;
+      break;
+
     default:
       break;
     }
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
FSFLA Board Member       ÂSÃ Libre! => http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]