diff options
author | Kenneth Zadeck <zadeck@naturalbridge.com> | 2014-05-06 16:25:05 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 2014-05-06 16:25:05 +0000 |
commit | 807e902eea17f3132488c256c963823976b2348c (patch) | |
tree | e5e1af94eb1502ba893bd6ce4a11f68877ff62a9 /gcc/tree-streamer-out.c | |
parent | 6122336c832dc4dfedc49279549caddce86306ff (diff) | |
download | gcc-807e902eea17f3132488c256c963823976b2348c.zip gcc-807e902eea17f3132488c256c963823976b2348c.tar.gz gcc-807e902eea17f3132488c256c963823976b2348c.tar.bz2 |
Merge in wide-int.
From-SVN: r210113
Diffstat (limited to 'gcc/tree-streamer-out.c')
-rw-r--r-- | gcc/tree-streamer-out.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index 90dec0a..5858047 100644 --- a/gcc/tree-streamer-out.c +++ b/gcc/tree-streamer-out.c @@ -127,8 +127,11 @@ pack_ts_base_value_fields (struct bitpack_d *bp, tree expr) static void pack_ts_int_cst_value_fields (struct bitpack_d *bp, tree expr) { - bp_pack_var_len_unsigned (bp, TREE_INT_CST_LOW (expr)); - bp_pack_var_len_int (bp, TREE_INT_CST_HIGH (expr)); + int i; + /* Note that the number of elements has already been written out in + streamer_write_tree_header. */ + for (i = 0; i < TREE_INT_CST_EXT_NUNITS (expr); i++) + bp_pack_var_len_int (bp, TREE_INT_CST_ELT (expr, i)); } @@ -1008,6 +1011,12 @@ streamer_write_tree_header (struct output_block *ob, tree expr) streamer_write_uhwi (ob, call_expr_nargs (expr)); else if (TREE_CODE (expr) == OMP_CLAUSE) streamer_write_uhwi (ob, OMP_CLAUSE_CODE (expr)); + else if (CODE_CONTAINS_STRUCT (code, TS_INT_CST)) + { + gcc_checking_assert (TREE_INT_CST_NUNITS (expr)); + streamer_write_uhwi (ob, TREE_INT_CST_NUNITS (expr)); + streamer_write_uhwi (ob, TREE_INT_CST_EXT_NUNITS (expr)); + } } @@ -1017,9 +1026,16 @@ streamer_write_tree_header (struct output_block *ob, tree expr) void streamer_write_integer_cst (struct output_block *ob, tree cst, bool ref_p) { + int i; + int len = TREE_INT_CST_NUNITS (cst); gcc_assert (!TREE_OVERFLOW (cst)); streamer_write_record_start (ob, LTO_integer_cst); stream_write_tree (ob, TREE_TYPE (cst), ref_p); - streamer_write_uhwi (ob, TREE_INT_CST_LOW (cst)); - streamer_write_hwi (ob, TREE_INT_CST_HIGH (cst)); + /* We're effectively streaming a non-sign-extended wide_int here, + so there's no need to stream TREE_INT_CST_EXT_NUNITS or any + array members beyond LEN. We'll recreate the tree from the + wide_int and the type. */ + streamer_write_uhwi (ob, len); + for (i = 0; i < len; i++) + streamer_write_hwi (ob, TREE_INT_CST_ELT (cst, i)); } |