public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Fwd: [lto]: Get SSA_NAME_DEF_STMT correct and fix VECTOR_CST.]
@ 2007-11-13 21:33 Kenneth Zadeck
  0 siblings, 0 replies; only message in thread
From: Kenneth Zadeck @ 2007-11-13 21:33 UTC (permalink / raw)
  To: gcc-patches, Nathan Froyd

[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]



-------- Original Message --------
Subject: 	[lto]: Get SSA_NAME_DEF_STMT correct and fix VECTOR_CST.
Date: 	Tue, 13 Nov 2007 15:11:18 -0500
From: 	Kenneth Zadeck <zadeck@naturalbridge.com>
To: 	gcc-patches <gcc-patches@gcc.gnu.org>, Nathan Froyd
<froydnj@codesourcery.com>



Get the types correct on VECTOR_CST.
Get the SSA_NAME_DEF_STMT correct for gimple_modify_stmts inside
return_exprs.
Add some more dumping in *-verbose mode.

2007-11-13  Kenneth Zadeck <zadeck@naturalbridge.com>

    * lto-function-out.c (output_expr_operand): Get the types correct for
    vector-cst.
    * tree-cfg.c (dump_function_to_file): Print the function_decl in
verbose mode.

2007-11-13  Kenneth Zadeck <zadeck@naturalbridge.com>

    * lto-read.c (input_type_ref): Renamed from get_type_ref.
    (input_expr_operand, input_local_var): Renamed get_type_ref to
    input_type_ref.
    (input_expr_operand): Get the types correct for
    vector-cst.  Get SSA_NAME_DEF_STMT correct for return_exprs.
   
committed as revision 130156

kenny



[-- Attachment #2: postmerge22.diff --]
[-- Type: text/x-patch, Size: 4785 bytes --]

Index: lto-function-out.c
===================================================================
--- lto-function-out.c	(revision 130142)
+++ lto-function-out.c	(working copy)
@@ -1271,23 +1271,24 @@ output_expr_operand (struct output_block
       {
 	tree t = TREE_VECTOR_CST_ELTS (expr);
 	int len = 1;
+
 	while ((t = TREE_CHAIN (t)) != NULL)
 	  len++;
 	t = TREE_VECTOR_CST_ELTS (expr);
 	if (TREE_CODE (TREE_VALUE(t)) == REAL_CST)
 	  {
-	    output_record_start (ob, expr, TREE_VALUE (t),
-				 LTO_vector_cst1);
+	    output_record_start (ob, expr, expr, LTO_vector_cst1);
 	    output_uleb128 (ob, len);
+	    output_type_ref (ob, TREE_TYPE (TREE_VALUE (t)));
 	    output_real (ob, TREE_VALUE (t));
 	    while ((t = TREE_CHAIN (t)) != NULL)
 	      output_real (ob, TREE_VALUE (t));
 	  }
 	else
 	  {
-	    output_record_start (ob, expr, TREE_VALUE (t),
-				 LTO_vector_cst0);
+	    output_record_start (ob, expr, expr, LTO_vector_cst0);
 	    output_uleb128 (ob, len);
+	    output_type_ref (ob, TREE_TYPE (TREE_VALUE (t)));
 	    output_integer (ob, TREE_VALUE (t));
 	    while ((t = TREE_CHAIN (t)) != NULL)
 	      output_integer (ob, TREE_VALUE (t));
Index: lto/lto-read.c
===================================================================
--- lto/lto-read.c	(revision 130142)
+++ lto/lto-read.c	(working copy)
@@ -342,7 +342,7 @@ get_label_decl (struct data_in *data_in,
 /* Get the type referenced by the next token in IB.  */
 
 static tree
-get_type_ref (struct data_in *data_in, struct input_block *ib)
+input_type_ref (struct data_in *data_in, struct input_block *ib)
 {
   int index;
 
@@ -581,7 +581,7 @@ input_expr_operand (struct input_block *
   tree result = NULL_TREE;
   
   if (TEST_BIT (lto_types_needed_for, code))
-    type = get_type_ref (data_in, ib);
+    type = input_type_ref (data_in, ib);
 
   flags = input_tree_flags (ib, code, false);
 
@@ -632,17 +632,18 @@ input_expr_operand (struct input_block *
       {
 	tree chain = NULL_TREE;
 	int len = input_uleb128 (ib);
+	tree elt_type = input_type_ref (data_in, ib);
 
 	if (len && tag == LTO_vector_cst1)
 	  {
 	    int i;
 	    tree last 
-	      = build_tree_list (NULL_TREE, input_real (ib, data_in, type));
+	      = build_tree_list (NULL_TREE, input_real (ib, data_in, elt_type));
 	    chain = last; 
 	    for (i = 1; i < len; i++)
 	      {
 		tree t 
-		  = build_tree_list (NULL_TREE, input_real (ib, data_in, type));
+		  = build_tree_list (NULL_TREE, input_real (ib, data_in, elt_type));
 		TREE_CHAIN (last) = t;
 		last = t;
 	      }
@@ -650,12 +651,12 @@ input_expr_operand (struct input_block *
 	else
 	  {
 	    int i;
-	    tree last = build_tree_list (NULL_TREE, input_integer (ib, type));
+	    tree last = build_tree_list (NULL_TREE, input_integer (ib, elt_type));
 	    chain = last; 
 	    for (i = 1; i < len; i++)
 	      {
 		tree t 
-		  = build_tree_list (NULL_TREE, input_integer (ib, type));
+		  = build_tree_list (NULL_TREE, input_integer (ib, elt_type));
 		TREE_CHAIN (last) = t;
 		last = t;
 	      }
@@ -942,6 +943,10 @@ input_expr_operand (struct input_block *
               op0 = DECL_RESULT (current_function_decl);
 
             result = build1 (code, type, op0);
+
+	    if ((TREE_CODE (op0) == GIMPLE_MODIFY_STMT)
+		&& (TREE_CODE (GIMPLE_STMT_OPERAND (op0, 0)) == SSA_NAME))
+		SSA_NAME_DEF_STMT (GIMPLE_STMT_OPERAND (op0, 0)) = result;
           }
 	  break;
 	  
@@ -963,8 +968,8 @@ input_expr_operand (struct input_block *
 
     case RANGE_EXPR:
       {
-	tree op0 = input_integer (ib, get_type_ref (data_in, ib));
-	tree op1 = input_integer (ib, get_type_ref (data_in, ib));
+	tree op0 = input_integer (ib, input_type_ref (data_in, ib));
+	tree op1 = input_integer (ib, input_type_ref (data_in, ib));
 	result = build2 (RANGE_EXPR, sizetype, op0, op1);
       }
       break;
@@ -1255,7 +1260,7 @@ input_local_var (struct input_block *ib,
   else 
     name = NULL_TREE;
   
-  type = get_type_ref (data_in, ib);
+  type = input_type_ref (data_in, ib);
   gcc_assert (type);
   
   if (is_var)
@@ -1266,7 +1271,7 @@ input_local_var (struct input_block *ib,
   data_in->local_decls[i] = result;
   
   if (!is_var)
-    DECL_ARG_TYPE (result) = get_type_ref (data_in, ib);
+    DECL_ARG_TYPE (result) = input_type_ref (data_in, ib);
 
   flags = input_tree_flags (ib, 0, true);
   input_line_info (ib, data_in, flags);
Index: tree-cfg.c
===================================================================
--- tree-cfg.c	(revision 130142)
+++ tree-cfg.c	(working copy)
@@ -6043,6 +6043,9 @@ dump_function_to_file (tree fn, FILE *fi
     }
   fprintf (file, ")\n");
 
+  if (flags && TDF_VERBOSE)
+    print_node (file, "", fn, 2);
+
   dsf = DECL_STRUCT_FUNCTION (fn);
   if (dsf && (flags & TDF_DETAILS))
     dump_eh_tree (file, dsf);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-13 20:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-13 21:33 [Fwd: [lto]: Get SSA_NAME_DEF_STMT correct and fix VECTOR_CST.] Kenneth Zadeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).