Commit 4ad9a9de by Eric Botcazou

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
parent 03eee7f7
2011-12-13 Eric Botcazou <ebotcazou@adacore.com>
* 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.
2011-12-13 Aldy Hernandez <aldyh@redhat.com> 2011-12-13 Aldy Hernandez <aldyh@redhat.com>
* trans-mem.c (ipa_tm_create_version_alias): Set DECL_CONTEXT and * trans-mem.c (ipa_tm_create_version_alias): Set DECL_CONTEXT and
...@@ -14,7 +26,7 @@ ...@@ -14,7 +26,7 @@
* config/mips/mips-cpus.def: Add Octeon2. * config/mips/mips-cpus.def: Add Octeon2.
* config/mips/mips-tables.opt: Regenerate. * config/mips/mips-tables.opt: Regenerate.
* config/mips/mips.md (define_attr "cpu"): Add Octeon2. * config/mips/mips.md (define_attr "cpu"): Add Octeon2.
* config/mips/driver-native.c (host_detect_local_cpu): Support Octeon2 also. * config/mips/driver-native.c (host_detect_local_cpu): Support Octeon2.
* config/mips/octeon.md (octeon_arith): Add Octeon2. * config/mips/octeon.md (octeon_arith): Add Octeon2.
(octeon_condmove): Likewise. (octeon_condmove): Likewise.
(octeon_load): Rename to .. (octeon_load): Rename to ..
...@@ -58,7 +70,7 @@ ...@@ -58,7 +70,7 @@
2011-12-13 Aldy Hernandez <aldyh@redhat.com> 2011-12-13 Aldy Hernandez <aldyh@redhat.com>
PR/51443 PR middle-end/51443
* trans-mem.c (struct diagnose_tm): Remove saw_unsafe. * trans-mem.c (struct diagnose_tm): Remove saw_unsafe.
(diagnose_tm_1): Same. (diagnose_tm_1): Same.
(ipa_tm_execute): Do not test tm_may_enter_irr before we set it. (ipa_tm_execute): Do not test tm_may_enter_irr before we set it.
...@@ -53,7 +53,7 @@ union df_ref_d; ...@@ -53,7 +53,7 @@ union df_ref_d;
#define DF_RD 3 /* Reaching Defs. */ #define DF_RD 3 /* Reaching Defs. */
#define DF_CHAIN 4 /* Def-Use and/or Use-Def Chains. */ #define DF_CHAIN 4 /* Def-Use and/or Use-Def Chains. */
#define DF_WORD_LR 5 /* Subreg tracking lr. */ #define DF_WORD_LR 5 /* Subreg tracking lr. */
#define DF_NOTE 6 /* REG_DEF and REG_UNUSED notes. */ #define DF_NOTE 6 /* REG_DEAD and REG_UNUSED notes. */
#define DF_MD 7 /* Multiple Definitions. */ #define DF_MD 7 /* Multiple Definitions. */
#define DF_LAST_PROBLEM_PLUS1 (DF_MD + 1) #define DF_LAST_PROBLEM_PLUS1 (DF_MD + 1)
......
...@@ -3019,9 +3019,9 @@ inline_read_section (struct lto_file_decl_data *file_data, const char *data, ...@@ -3019,9 +3019,9 @@ inline_read_section (struct lto_file_decl_data *file_data, const char *data,
{ {
const struct lto_function_header *header = const struct lto_function_header *header =
(const struct lto_function_header *) data; (const struct lto_function_header *) data;
const int32_t cfg_offset = sizeof (struct lto_function_header); const int cfg_offset = sizeof (struct lto_function_header);
const int32_t main_offset = cfg_offset + header->cfg_size; const int main_offset = cfg_offset + header->cfg_size;
const int32_t string_offset = main_offset + header->main_size; const int string_offset = main_offset + header->main_size;
struct data_in *data_in; struct data_in *data_in;
struct lto_input_block ib; struct lto_input_block ib;
unsigned int i, count2, j; unsigned int i, count2, j;
......
...@@ -3003,9 +3003,9 @@ ipa_prop_read_section (struct lto_file_decl_data *file_data, const char *data, ...@@ -3003,9 +3003,9 @@ ipa_prop_read_section (struct lto_file_decl_data *file_data, const char *data,
{ {
const struct lto_function_header *header = const struct lto_function_header *header =
(const struct lto_function_header *) data; (const struct lto_function_header *) data;
const int32_t cfg_offset = sizeof (struct lto_function_header); const int cfg_offset = sizeof (struct lto_function_header);
const int32_t main_offset = cfg_offset + header->cfg_size; const int main_offset = cfg_offset + header->cfg_size;
const int32_t string_offset = main_offset + header->main_size; const int string_offset = main_offset + header->main_size;
struct data_in *data_in; struct data_in *data_in;
struct lto_input_block ib_main; struct lto_input_block ib_main;
unsigned int i; unsigned int i;
......
...@@ -1689,9 +1689,9 @@ input_cgraph_opt_section (struct lto_file_decl_data *file_data, ...@@ -1689,9 +1689,9 @@ input_cgraph_opt_section (struct lto_file_decl_data *file_data,
{ {
const struct lto_function_header *header = const struct lto_function_header *header =
(const struct lto_function_header *) data; (const struct lto_function_header *) data;
const int32_t cfg_offset = sizeof (struct lto_function_header); const int cfg_offset = sizeof (struct lto_function_header);
const int32_t main_offset = cfg_offset + header->cfg_size; const int main_offset = cfg_offset + header->cfg_size;
const int32_t string_offset = main_offset + header->main_size; const int string_offset = main_offset + header->main_size;
struct data_in *data_in; struct data_in *data_in;
struct lto_input_block ib_main; struct lto_input_block ib_main;
unsigned int i; unsigned int i;
......
...@@ -224,7 +224,7 @@ lto_create_simple_input_block (struct lto_file_decl_data *file_data, ...@@ -224,7 +224,7 @@ lto_create_simple_input_block (struct lto_file_decl_data *file_data,
= (const struct lto_simple_header *) data; = (const struct lto_simple_header *) data;
struct lto_input_block* ib_main; struct lto_input_block* ib_main;
int32_t main_offset = sizeof (struct lto_simple_header); int main_offset = sizeof (struct lto_simple_header);
if (!data) if (!data)
return NULL; return NULL;
......
...@@ -979,9 +979,9 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl, ...@@ -979,9 +979,9 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
{ {
const struct lto_function_header *header; const struct lto_function_header *header;
struct data_in *data_in; struct data_in *data_in;
int32_t cfg_offset; int cfg_offset;
int32_t main_offset; int main_offset;
int32_t string_offset; int string_offset;
struct lto_input_block ib_cfg; struct lto_input_block ib_cfg;
struct lto_input_block ib_main; struct lto_input_block ib_main;
...@@ -1172,7 +1172,7 @@ lto_input_toplevel_asms (struct lto_file_decl_data *file_data, int order_base) ...@@ -1172,7 +1172,7 @@ lto_input_toplevel_asms (struct lto_file_decl_data *file_data, int order_base)
const char *data = lto_get_section_data (file_data, LTO_section_asm, const char *data = lto_get_section_data (file_data, LTO_section_asm,
NULL, &len); NULL, &len);
const struct lto_asm_header *header = (const struct lto_asm_header *) data; const struct lto_asm_header *header = (const struct lto_asm_header *) data;
int32_t string_offset; int string_offset;
struct data_in *data_in; struct data_in *data_in;
struct lto_input_block ib; struct lto_input_block ib;
tree str; tree str;
......
...@@ -1290,7 +1290,7 @@ write_symbol (struct streamer_tree_cache_d *cache, ...@@ -1290,7 +1290,7 @@ write_symbol (struct streamer_tree_cache_d *cache,
enum gcc_plugin_symbol_kind kind; enum gcc_plugin_symbol_kind kind;
enum gcc_plugin_symbol_visibility visibility; enum gcc_plugin_symbol_visibility visibility;
unsigned slot_num; unsigned slot_num;
uint64_t size; unsigned HOST_WIDEST_INT size;
const char *comdat; const char *comdat;
unsigned char c; unsigned char c;
...@@ -1348,7 +1348,7 @@ write_symbol (struct streamer_tree_cache_d *cache, ...@@ -1348,7 +1348,7 @@ write_symbol (struct streamer_tree_cache_d *cache,
when symbol has attribute (visibility("hidden")) specified. when symbol has attribute (visibility("hidden")) specified.
targetm.binds_local_p check DECL_VISIBILITY_SPECIFIED and gets this targetm.binds_local_p check DECL_VISIBILITY_SPECIFIED and gets this
right. */ right. */
if (DECL_EXTERNAL (t) if (DECL_EXTERNAL (t)
&& !targetm.binds_local_p (t)) && !targetm.binds_local_p (t))
visibility = GCCPV_DEFAULT; visibility = GCCPV_DEFAULT;
...@@ -1370,14 +1370,9 @@ write_symbol (struct streamer_tree_cache_d *cache, ...@@ -1370,14 +1370,9 @@ write_symbol (struct streamer_tree_cache_d *cache,
} }
if (kind == GCCPK_COMMON if (kind == GCCPK_COMMON
&& DECL_SIZE (t) && DECL_SIZE_UNIT (t)
&& TREE_CODE (DECL_SIZE (t)) == INTEGER_CST) && TREE_CODE (DECL_SIZE_UNIT (t)) == INTEGER_CST)
{ size = TREE_INT_CST_LOW (DECL_SIZE_UNIT (t));
size = (HOST_BITS_PER_WIDE_INT >= 64)
? (uint64_t) int_size_in_bytes (TREE_TYPE (t))
: (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE_UNIT (t))) << 32)
| TREE_INT_CST_LOW (DECL_SIZE_UNIT (t));
}
else else
size = 0; size = 0;
......
2011-12-13 Eric Botcazou <ebotcazou@adacore.com>
* 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 <rguenther@suse.de> 2011-12-13 Richard Guenther <rguenther@suse.de>
PR lto/48354 PR lto/48354
......
...@@ -267,7 +267,7 @@ lto_read_in_decl_state (struct data_in *data_in, const uint32_t *data, ...@@ -267,7 +267,7 @@ lto_read_in_decl_state (struct data_in *data_in, const uint32_t *data,
uint32_t ix; uint32_t ix;
tree decl; tree decl;
uint32_t i, j; uint32_t i, j;
ix = *data++; ix = *data++;
decl = streamer_tree_cache_get (data_in->reader_cache, ix); decl = streamer_tree_cache_get (data_in->reader_cache, ix);
if (TREE_CODE (decl) != FUNCTION_DECL) if (TREE_CODE (decl) != FUNCTION_DECL)
...@@ -886,9 +886,9 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data, ...@@ -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) VEC(ld_plugin_symbol_resolution_t,heap) *resolutions)
{ {
const struct lto_decl_header *header = (const struct lto_decl_header *) data; const struct lto_decl_header *header = (const struct lto_decl_header *) data;
const int32_t decl_offset = sizeof (struct lto_decl_header); const int decl_offset = sizeof (struct lto_decl_header);
const int32_t main_offset = decl_offset + header->decl_state_size; const int main_offset = decl_offset + header->decl_state_size;
const int32_t string_offset = main_offset + header->main_size; const int string_offset = main_offset + header->main_size;
struct lto_input_block ib_main; struct lto_input_block ib_main;
struct data_in *data_in; struct data_in *data_in;
unsigned int i; unsigned int i;
...@@ -939,17 +939,20 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data, ...@@ -939,17 +939,20 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data,
if (data_ptr != data_end) if (data_ptr != data_end)
internal_error ("bytecode stream: garbage at the end of symbols section"); internal_error ("bytecode stream: garbage at the end of symbols section");
/* Set the current decl state to be the global state. */ /* Set the current decl state to be the global state. */
decl_data->current_decl_state = decl_data->global_decl_state; decl_data->current_decl_state = decl_data->global_decl_state;
lto_data_in_delete (data_in); lto_data_in_delete (data_in);
} }
/* strtoll is not portable. */ /* Custom version of strtoll, which is not portable. */
int64_t
lto_parse_hex (const char *p) { static HOST_WIDEST_INT
uint64_t ret = 0; lto_parse_hex (const char *p)
{
HOST_WIDEST_INT ret = 0;
for (; *p != '\0'; ++p) for (; *p != '\0'; ++p)
{ {
char c = *p; char c = *p;
...@@ -965,6 +968,7 @@ lto_parse_hex (const char *p) { ...@@ -965,6 +968,7 @@ lto_parse_hex (const char *p) {
internal_error ("could not parse hex number"); internal_error ("could not parse hex number");
ret |= part; ret |= part;
} }
return ret; return ret;
} }
...@@ -1000,7 +1004,7 @@ lto_resolution_read (splay_tree file_ids, FILE *resolution, lto_file *file) ...@@ -1000,7 +1004,7 @@ lto_resolution_read (splay_tree file_ids, FILE *resolution, lto_file *file)
{ {
int t; int t;
char offset_p[17]; char offset_p[17];
int64_t offset; HOST_WIDEST_INT offset;
t = fscanf (resolution, "@0x%16s", offset_p); t = fscanf (resolution, "@0x%16s", offset_p);
if (t != 1) if (t != 1)
internal_error ("could not parse file offset"); internal_error ("could not parse file offset");
......
...@@ -68,6 +68,4 @@ struct lto_section_list ...@@ -68,6 +68,4 @@ struct lto_section_list
struct lto_section_slot *first, *last; struct lto_section_slot *first, *last;
}; };
int64_t lto_parse_hex (const char *p);
#endif /* LTO_H */ #endif /* LTO_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment