From 4ad9a9de2ddabf6186f32895e0b7a182ba8f2abb Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 13 Dec 2011 21:59:39 +0000 Subject: lto-streamer-out.c (write_symbol): Use proper 64-bit host type. * lto-streamer-out.c (write_symbol): Use proper 64-bit host type. * lto-cgraph.c (input_cgraph_opt_section): Use 'int' for offsets. * lto-streamer-in.c (lto_read_body): Likewise. (lto_input_toplevel_asms): Likewise. * lto-section-in.c (lto_create_simple_input_block): Likewise. * ipa-inline-analysis.c (inline_read_section): Likewise. * ipa-prop.c (ipa_prop_read_section): Likewise. * df.h (DF_NOTE): Fix typo in comment. lto/ * lto.h (lto_parse_hex): Delete. * lto.c (lto_read_decls): Use 'int' for offsets. (lto_parse_hex): Make static and return proper 64-bit host type. (lto_resolution_read): Use proper 64-bit host type. From-SVN: r182310 --- gcc/lto/ChangeLog | 7 +++++++ gcc/lto/lto.c | 24 ++++++++++++++---------- gcc/lto/lto.h | 2 -- 3 files changed, 21 insertions(+), 12 deletions(-) (limited to 'gcc/lto') diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 2c7d83b..73a9cba 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,10 @@ +2011-12-13 Eric Botcazou + + * lto.h (lto_parse_hex): Delete. + * lto.c (lto_read_decls): Use 'int' for offsets. + (lto_parse_hex): Make static and return proper 64-bit host type. + (lto_resolution_read): Use proper 64-bit host type. + 2011-12-13 Richard Guenther PR lto/48354 diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index accb807..d84dbfd 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -267,7 +267,7 @@ lto_read_in_decl_state (struct data_in *data_in, const uint32_t *data, uint32_t ix; tree decl; uint32_t i, j; - + ix = *data++; decl = streamer_tree_cache_get (data_in->reader_cache, ix); if (TREE_CODE (decl) != FUNCTION_DECL) @@ -886,9 +886,9 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data, VEC(ld_plugin_symbol_resolution_t,heap) *resolutions) { const struct lto_decl_header *header = (const struct lto_decl_header *) data; - const int32_t decl_offset = sizeof (struct lto_decl_header); - const int32_t main_offset = decl_offset + header->decl_state_size; - const int32_t string_offset = main_offset + header->main_size; + const int decl_offset = sizeof (struct lto_decl_header); + const int main_offset = decl_offset + header->decl_state_size; + const int string_offset = main_offset + header->main_size; struct lto_input_block ib_main; struct data_in *data_in; unsigned int i; @@ -939,17 +939,20 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data, if (data_ptr != data_end) internal_error ("bytecode stream: garbage at the end of symbols section"); - + /* Set the current decl state to be the global state. */ decl_data->current_decl_state = decl_data->global_decl_state; lto_data_in_delete (data_in); } -/* strtoll is not portable. */ -int64_t -lto_parse_hex (const char *p) { - uint64_t ret = 0; +/* Custom version of strtoll, which is not portable. */ + +static HOST_WIDEST_INT +lto_parse_hex (const char *p) +{ + HOST_WIDEST_INT ret = 0; + for (; *p != '\0'; ++p) { char c = *p; @@ -965,6 +968,7 @@ lto_parse_hex (const char *p) { internal_error ("could not parse hex number"); ret |= part; } + return ret; } @@ -1000,7 +1004,7 @@ lto_resolution_read (splay_tree file_ids, FILE *resolution, lto_file *file) { int t; char offset_p[17]; - int64_t offset; + HOST_WIDEST_INT offset; t = fscanf (resolution, "@0x%16s", offset_p); if (t != 1) internal_error ("could not parse file offset"); diff --git a/gcc/lto/lto.h b/gcc/lto/lto.h index 43fcca6..8fde159 100644 --- a/gcc/lto/lto.h +++ b/gcc/lto/lto.h @@ -68,6 +68,4 @@ struct lto_section_list struct lto_section_slot *first, *last; }; -int64_t lto_parse_hex (const char *p); - #endif /* LTO_H */ -- cgit v1.1