aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Zadeck <zadeck@naturalbridge.com>2007-11-13 13:16:52 +0000
committerKenneth Zadeck <zadeck@naturalbridge.com>2007-11-13 13:16:52 +0000
commitdcf826763b45cb5d44635e6766d1a41eb2f2a925 (patch)
tree907dd5111b54ebbc7479038ae4ea6ba9804cb20c
parent095a2bdd14d3ff0983b5e7eb33ff010920d7cfed (diff)
2007-11-13 Kenneth Zadeck <zadeck@naturalbridge.com>
* lto-function-out.c (output_constructor): Modified to output index field if it exists. (output_expr_operand): Removed incorrect assert about type names. Added RANGE_EXPR case. * lto-tree-flags.def (LTO_constructor_range): Removed. * lto-tags.h (LTO_constructor_range): Removed. 2007-11-13 Kenneth Zadeck <zadeck@naturalbridge.com> * lto-read.c (input_expr_operand): Added code to properly handle index filed. Added new RANGE_EXPR case. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto@130137 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.lto9
-rw-r--r--gcc/lto-function-out.c30
-rw-r--r--gcc/lto-tags.h7
-rw-r--r--gcc/lto-tree-tags.def1
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/lto-read.c42
6 files changed, 55 insertions, 39 deletions
diff --git a/gcc/ChangeLog.lto b/gcc/ChangeLog.lto
index 6e40544a968..ad73f818738 100644
--- a/gcc/ChangeLog.lto
+++ b/gcc/ChangeLog.lto
@@ -1,3 +1,12 @@
+2007-11-13 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-function-out.c (output_constructor): Modified to output
+ index field if it exists.
+ (output_expr_operand): Removed incorrect assert about type names.
+ Added RANGE_EXPR case.
+ * lto-tree-flags.def (LTO_constructor_range): Removed.
+ * lto-tags.h (LTO_constructor_range): Removed.
+
2007-11-11 Kenneth Zadeck <zadeck@naturalbridge.com>
* doc/invoke.text (-fdump-tree-*-verbose): New option.
diff --git a/gcc/lto-function-out.c b/gcc/lto-function-out.c
index d246f259234..718f1664242 100644
--- a/gcc/lto-function-out.c
+++ b/gcc/lto-function-out.c
@@ -1187,16 +1187,10 @@ output_constructor (struct output_block *ob, tree ctor)
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), idx, purpose, value)
{
- if (purpose && TREE_CODE (purpose) == RANGE_EXPR)
- {
- output_record_start (ob, NULL, NULL, LTO_constructor_range);
- /* Need the types here to reconstruct the ranges. */
- output_type_ref (ob, TREE_OPERAND (purpose, 0));
- output_integer (ob, TREE_OPERAND (purpose, 0));
- output_type_ref (ob, TREE_OPERAND (purpose, 1));
- output_integer (ob, TREE_OPERAND (purpose, 1));
- LTO_DEBUG_UNDENT ();
- }
+ if (purpose)
+ output_expr_operand (ob, purpose);
+ else
+ output_zero (ob);
if (TREE_CODE (value) == CONSTRUCTOR)
{
@@ -1382,10 +1376,7 @@ output_expr_operand (struct output_block *ob, tree expr)
new = output_decl_index (ob->main_stream, ob->type_decl_hash_table,
&ob->next_type_decl_index, expr);
if (new)
- {
- gcc_assert (!DECL_NAME (expr));
- VEC_safe_push (tree, heap, ob->type_decls, expr);
- }
+ VEC_safe_push (tree, heap, ob->type_decls, expr);
}
break;
@@ -1512,6 +1503,17 @@ output_expr_operand (struct output_block *ob, tree expr)
}
break;
+ case RANGE_EXPR:
+ {
+ output_record_start (ob, NULL, NULL, LTO_range_expr);
+ /* Need the types here to reconstruct the ranges. */
+ output_type_ref (ob, TREE_OPERAND (expr, 0));
+ output_integer (ob, TREE_OPERAND (expr, 0));
+ output_type_ref (ob, TREE_OPERAND (expr, 1));
+ output_integer (ob, TREE_OPERAND (expr, 1));
+ }
+ break;
+
case RESX_EXPR:
output_record_start (ob, expr, NULL, tag);
output_uleb128 (ob, TREE_INT_CST_LOW (TREE_OPERAND (expr, 0)));
diff --git a/gcc/lto-tags.h b/gcc/lto-tags.h
index 9cacc33c310..0868e543a6e 100644
--- a/gcc/lto-tags.h
+++ b/gcc/lto-tags.h
@@ -320,7 +320,6 @@ enum LTO_tags {
/* This form is terminated by a zero. */
LTO_constructor,
- LTO_constructor_range,
LTO_convert_expr,
LTO_dot_prod_expr,
LTO_eq_expr,
@@ -534,7 +533,11 @@ struct lto_debug_context
serialize the fact that the current node needs a line number.
Otherwise we end up putting line numbers on everything. This takes
4 bits on every node and are added to the flags that are serialized
- for the node.*/
+ for the node.
+
+ We waste a bit for the col even though we do not use the col except in
+ USE_MAPPED_LOCATION
+*/
#define LTO_SOURCE_FILE 0x1
#define LTO_SOURCE_LINE 0x2
#define LTO_SOURCE_COL 0x4
diff --git a/gcc/lto-tree-tags.def b/gcc/lto-tree-tags.def
index 1d9f585c779..d3b1a07cab9 100644
--- a/gcc/lto-tree-tags.def
+++ b/gcc/lto-tree-tags.def
@@ -207,7 +207,6 @@
SET_NAME (LTO_conj_expr, "conj_expr")
SET_NAME (LTO_const_decl, "const_decl")
SET_NAME (LTO_constructor, "constructor")
- SET_NAME (LTO_constructor_range, "constructor_range")
SET_NAME (LTO_convert_expr, "convert_expr")
SET_NAME (LTO_dot_prod_expr, "dot_prod_expr")
SET_NAME (LTO_eq_expr, "eq_expr")
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 628d33f2496..988c8fa0850 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-13 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * lto-read.c (input_expr_operand): Added code to properly handle
+ index filed. Added new RANGE_EXPR case.
+
2007-11-11 Kenneth Zadeck <zadeck@naturalbridge.com>
* lto-read.c (ADD_FUNC_FLAG): Deleted macro.
diff --git a/gcc/lto/lto-read.c b/gcc/lto/lto-read.c
index ef61e1d3268..39c8181dc11 100644
--- a/gcc/lto/lto-read.c
+++ b/gcc/lto/lto-read.c
@@ -690,32 +690,22 @@ input_expr_operand (struct input_block *ib, struct data_in *data_in,
if (len)
{
- tree purpose = NULL_TREE;
unsigned int i = 0;
vec = VEC_alloc (constructor_elt, gc, len);
- while (i < len)
+ for (i = 0; i < len; i++)
{
+ tree purpose = NULL_TREE;
+ tree value;
+ constructor_elt *elt;
enum LTO_tags ctag = input_record_start (ib);
- if (ctag == LTO_constructor_range)
- {
- tree op0 = input_integer (ib, get_type_ref (data_in, ib));
- tree op1 = input_integer (ib, get_type_ref (data_in, ib));
- purpose = build2 (RANGE_EXPR, sizetype, op0, op1);
- LTO_DEBUG_UNDENT();
- }
- else
- {
- tree value =
- input_expr_operand (ib, data_in, fn, ctag);
- constructor_elt *elt
- = VEC_quick_push (constructor_elt, vec, NULL);
- elt->index = purpose;
- elt->value = value;
-
- /* Only use the range once. */
- purpose = NULL_TREE;
- i++;
- }
+
+ if (ctag)
+ purpose = input_expr_operand (ib, data_in, fn, ctag);
+
+ value = input_expr_operand (ib, data_in, fn, input_record_start (ib));
+ elt = VEC_quick_push (constructor_elt, vec, NULL);
+ elt->index = purpose;
+ elt->value = value;
}
}
result = build_constructor (type, vec);
@@ -971,6 +961,14 @@ input_expr_operand (struct input_block *ib, struct data_in *data_in,
}
break;
+ 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));
+ result = build2 (RANGE_EXPR, sizetype, op0, op1);
+ }
+ break;
+
case GIMPLE_MODIFY_STMT:
{
tree op0 = input_expr_operand (ib, data_in, fn,