This is the mail archive of the
mailing list for the GCC project.
Re: out of bounds access in insn-automata.c
- From: Bernd Schmidt <bschmidt at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>, GCC Mailing List <gcc at gcc dot gnu dot org>
- Cc: "Vladimir N. Makarov" <vmakarov at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 24 Mar 2016 14:35:44 +0100
- Subject: Re: out of bounds access in insn-automata.c
- Authentication-results: sourceware.org; auth=none
- References: <56F23888 dot 5080506 at redhat dot com> <56F2B57E dot 6080300 at t-online dot de> <56F3BEA5 dot 1090007 at redhat dot com>
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.