[PR,target/85401] initialize the move cost table before using it
diff mbox series

Message ID 20190914151504.GA21805@SDF.ORG
State New
Headers show
Series
  • [PR,target/85401] initialize the move cost table before using it
Related show

Commit Message

Maya Rashish Sept. 14, 2019, 3:15 p.m. UTC
This seems to be the way the rest of ira-color.c does it.
I hope it's OK. It does fix the segfault.

2019-09-10	Maya Rashish <coypu@sdf.org>

	PR target/85401
	* ira-color.c: (allocno_copy_cost_saving) Call
	ira_init_register_move_cost_if_necessary

Patch
diff mbox series

diff --git a/gcc/ira-color.c b/gcc/ira-color.c
index 99236994d64..5d721102e19 100644
--- a/gcc/ira-color.c
+++ b/gcc/ira-color.c
@@ -2828,6 +2828,7 @@  allocno_copy_cost_saving (ira_allocno_t allocno, int hard_regno)
 	}
       else
 	gcc_unreachable ();
+      ira_init_register_move_cost_if_necessary(allocno_mode);
       cost += cp->freq * ira_register_move_cost[allocno_mode][rclass][rclass];
     }
   return cost;