Commit 0dc7d7cc by Jakub Jelinek Committed by Jakub Jelinek

ira-costs.c (find_costs_and_classes): Initialize cost_classes later to make sure…

ira-costs.c (find_costs_and_classes): Initialize cost_classes later to make sure not to dereference a NULL...

	* ira-costs.c (find_costs_and_classes): Initialize cost_classes later
	to make sure not to dereference a NULL cost_classes_ptr pointer.

From-SVN: r249426
parent 8a259e30
2017-06-20 Jakub Jelinek <jakub@redhat.com>
* ira-costs.c (find_costs_and_classes): Initialize cost_classes later
to make sure not to dereference a NULL cost_classes_ptr pointer.
2017-06-20 Carl Love <cel@us.ibm.com> 2017-06-20 Carl Love <cel@us.ibm.com>
* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add
......
...@@ -1744,7 +1744,7 @@ find_costs_and_classes (FILE *dump_file) ...@@ -1744,7 +1744,7 @@ find_costs_and_classes (FILE *dump_file)
int best_cost, allocno_cost; int best_cost, allocno_cost;
enum reg_class best, alt_class; enum reg_class best, alt_class;
cost_classes_t cost_classes_ptr = regno_cost_classes[i]; cost_classes_t cost_classes_ptr = regno_cost_classes[i];
enum reg_class *cost_classes = cost_classes_ptr->classes; enum reg_class *cost_classes;
int *i_costs = temp_costs->cost; int *i_costs = temp_costs->cost;
int i_mem_cost; int i_mem_cost;
int equiv_savings = regno_equiv_gains[i]; int equiv_savings = regno_equiv_gains[i];
...@@ -1755,6 +1755,7 @@ find_costs_and_classes (FILE *dump_file) ...@@ -1755,6 +1755,7 @@ find_costs_and_classes (FILE *dump_file)
continue; continue;
memcpy (temp_costs, COSTS (costs, i), struct_costs_size); memcpy (temp_costs, COSTS (costs, i), struct_costs_size);
i_mem_cost = temp_costs->mem_cost; i_mem_cost = temp_costs->mem_cost;
cost_classes = cost_classes_ptr->classes;
} }
else else
{ {
...@@ -1762,6 +1763,7 @@ find_costs_and_classes (FILE *dump_file) ...@@ -1762,6 +1763,7 @@ find_costs_and_classes (FILE *dump_file)
continue; continue;
memset (temp_costs, 0, struct_costs_size); memset (temp_costs, 0, struct_costs_size);
i_mem_cost = 0; i_mem_cost = 0;
cost_classes = cost_classes_ptr->classes;
/* Find cost of all allocnos with the same regno. */ /* Find cost of all allocnos with the same regno. */
for (a = ira_regno_allocno_map[i]; for (a = ira_regno_allocno_map[i];
a != NULL; a != NULL;
......
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