From 2bf7560bd3757dbd0d7ffbe8e61b3eb847cfc5f0 Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Mon, 15 Dec 2014 22:18:51 +0000 Subject: [PATCH] re PR rtl-optimization/63397 (signed integer overflows in ira.c) 2014-12-15 Vladimir Makarov PR rtl-optimization/63397 * ira-int.h (ira_overall_cost, ira_reg_cost, ira_mem_cost): Use int64_t. (ira_load_cost, ira_store_cost, ira_shuffle_cost): Ditto. * ira.c (ira_overall_cost, ira_overall_cost_before): Ditto. (ira_reg_cost, ira_mem_cost): Ditto. (ira_load_cost, ira_store_cost, ira_shuffle_cost): Ditto. (calculate_allocation_cost, do_reload): Use the right format for int64_t values. From-SVN: r218766 --- gcc/ChangeLog | 12 ++++++++++++ gcc/ira-int.h | 6 +++--- gcc/ira.c | 18 ++++++++++++------ 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e050f032757..29299724256 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2014-12-15 Vladimir Makarov + + PR rtl-optimization/63397 + * ira-int.h (ira_overall_cost, ira_reg_cost, ira_mem_cost): Use + int64_t. + (ira_load_cost, ira_store_cost, ira_shuffle_cost): Ditto. + * ira.c (ira_overall_cost, ira_overall_cost_before): Ditto. + (ira_reg_cost, ira_mem_cost): Ditto. + (ira_load_cost, ira_store_cost, ira_shuffle_cost): Ditto. + (calculate_allocation_cost, do_reload): Use the right + format for int64_t values. + 2014-12-15 Jan Hubicka * sreal.h (to_double): New method. diff --git a/gcc/ira-int.h b/gcc/ira-int.h index 0799b1e0fef..79b7b997d6d 100644 --- a/gcc/ira-int.h +++ b/gcc/ira-int.h @@ -620,9 +620,9 @@ extern struct ira_spilled_reg_stack_slot *ira_spilled_reg_stack_slots; allocnos assigned to hard-registers, cost of the allocnos assigned to memory, cost of loads, stores and register move insns generated for pseudo-register live range splitting (see ira-emit.c). */ -extern int ira_overall_cost; -extern int ira_reg_cost, ira_mem_cost; -extern int ira_load_cost, ira_store_cost, ira_shuffle_cost; +extern int64_t ira_overall_cost; +extern int64_t ira_reg_cost, ira_mem_cost; +extern int64_t ira_load_cost, ira_store_cost, ira_shuffle_cost; extern int ira_move_loops_num, ira_additional_jumps_num; diff --git a/gcc/ira.c b/gcc/ira.c index f08aa23e408..87ea86ddc1e 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -431,9 +431,9 @@ struct ira_spilled_reg_stack_slot *ira_spilled_reg_stack_slots; the allocnos assigned to memory, cost of loads, stores and register move insns generated for pseudo-register live range splitting (see ira-emit.c). */ -int ira_overall_cost, overall_cost_before; -int ira_reg_cost, ira_mem_cost; -int ira_load_cost, ira_store_cost, ira_shuffle_cost; +int64_t ira_overall_cost, overall_cost_before; +int64_t ira_reg_cost, ira_mem_cost; +int64_t ira_load_cost, ira_store_cost, ira_shuffle_cost; int ira_move_loops_num, ira_additional_jumps_num; /* All registers that can be eliminated. */ @@ -2489,10 +2489,15 @@ calculate_allocation_cost (void) if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL) { fprintf (ira_dump_file, - "+++Costs: overall %d, reg %d, mem %d, ld %d, st %d, move %d\n", + "+++Costs: overall %"PRId64 + ", reg %"PRId64 + ", mem %"PRId64 + ", ld %"PRId64 + ", st %"PRId64 + ", move %"PRId64, ira_overall_cost, ira_reg_cost, ira_mem_cost, ira_load_cost, ira_store_cost, ira_shuffle_cost); - fprintf (ira_dump_file, "+++ move loops %d, new jumps %d\n", + fprintf (ira_dump_file, "\n+++ move loops %d, new jumps %d\n", ira_move_loops_num, ira_additional_jumps_num); } @@ -5422,7 +5427,8 @@ do_reload (void) if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL && overall_cost_before != ira_overall_cost) - fprintf (ira_dump_file, "+++Overall after reload %d\n", ira_overall_cost); + fprintf (ira_dump_file, "+++Overall after reload %"PRId64 "\n", + ira_overall_cost); flag_ira_share_spill_slots = saved_flag_ira_share_spill_slots; -- 2.30.2