Re: [PATCH] Fix UB in ira-costs.c (find_costs_and_classes)

2017-06-20 Thread Vladimir Makarov
On 06/20/2017 03:27 AM, Jakub Jelinek wrote: Hi! bootstrap-ubsan revealed many ../../gcc/ira-costs.c:1747:20: runtime error: member access within null pointer of type 'cost_classes *[107]' issues. The problem is that cost_classes_ptr is sometimes NULL, but in those cases we have early exit:

[PATCH] Fix UB in ira-costs.c (find_costs_and_classes)

2017-06-20 Thread Jakub Jelinek
Hi! bootstrap-ubsan revealed many ../../gcc/ira-costs.c:1747:20: runtime error: member access within null pointer of type 'cost_classes *[107]' issues. The problem is that cost_classes_ptr is sometimes NULL, but in those cases we have early exit: if (! allocno_p) {