out of bounds access in insn-automata.c

Bernd Schmidt bschmidt@redhat.com
Thu Mar 24 13:35:00 GMT 2016



On 03/24/2016 11:17 AM, Aldy Hernandez wrote:
> On 03/23/2016 10:25 AM, Bernd Schmidt wrote:
>> It looks like this block of code is written by a helper function that is
>> really intended for other purposes than for maximal_insn_latency. Might
>> be worth changing to
>>   int insn_code = dfa_insn_code (as_a <rtx_insn *> (insn));
>>   gcc_assert (insn_code <= DFA__ADVANCE_CYCLE);
>
> dfa_insn_code_* and friends can return > DFA__ADVANCE_CYCLE so I can't
> put that assert on the helper function.

So don't use the helper function? Just emit the block above directly.


Bernd



More information about the Gcc mailing list