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/lto-streamer-in.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/lto-streamer-in.c')
-rw-r--r-- | gcc/lto-streamer-in.c | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index 20835f7..d0c8662 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -596,6 +596,21 @@ make_new_block (struct function *fn, unsigned int index) } +/* Read a wide-int. */ + +static widest_int +streamer_read_wi (struct lto_input_block *ib) +{ + HOST_WIDE_INT a[WIDE_INT_MAX_ELTS]; + int i; + int prec ATTRIBUTE_UNUSED = streamer_read_uhwi (ib); + int len = streamer_read_uhwi (ib); + for (i = 0; i < len; i++) + a[i] = streamer_read_hwi (ib); + return widest_int::from_array (a, len); +} + + /* Read the CFG for function FN from input block IB. */ static void @@ -705,16 +720,10 @@ input_cfg (struct lto_input_block *ib, struct data_in *data_in, loop->estimate_state = streamer_read_enum (ib, loop_estimation, EST_LAST); loop->any_upper_bound = streamer_read_hwi (ib); if (loop->any_upper_bound) - { - loop->nb_iterations_upper_bound.low = streamer_read_uhwi (ib); - loop->nb_iterations_upper_bound.high = streamer_read_hwi (ib); - } + loop->nb_iterations_upper_bound = streamer_read_wi (ib); loop->any_estimate = streamer_read_hwi (ib); if (loop->any_estimate) - { - loop->nb_iterations_estimate.low = streamer_read_uhwi (ib); - loop->nb_iterations_estimate.high = streamer_read_hwi (ib); - } + loop->nb_iterations_estimate = streamer_read_wi (ib); /* Read OMP SIMD related info. */ loop->safelen = streamer_read_hwi (ib); @@ -1267,12 +1276,18 @@ lto_input_tree_1 (struct lto_input_block *ib, struct data_in *data_in, } else if (tag == LTO_integer_cst) { - /* For shared integer constants in singletons we can use the existing - tree integer constant merging code. */ + /* For shared integer constants in singletons we can use the + existing tree integer constant merging code. */ tree type = stream_read_tree (ib, data_in); - unsigned HOST_WIDE_INT low = streamer_read_uhwi (ib); - HOST_WIDE_INT high = streamer_read_hwi (ib); - result = build_int_cst_wide (type, low, high); + unsigned HOST_WIDE_INT len = streamer_read_uhwi (ib); + unsigned HOST_WIDE_INT i; + HOST_WIDE_INT a[WIDE_INT_MAX_ELTS]; + + for (i = 0; i < len; i++) + a[i] = streamer_read_hwi (ib); + gcc_assert (TYPE_PRECISION (type) <= MAX_BITSIZE_MODE_ANY_INT); + result = wide_int_to_tree (type, wide_int::from_array + (a, len, TYPE_PRECISION (type))); streamer_tree_cache_append (data_in->reader_cache, result, hash); } else if (tag == LTO_tree_scc) |