[PATCH] clean up insn-automata.c (was: Re: out of bounds access in insn-automata.c)

2016-05-10 Thread Alexander Monakov
On Wed, 30 Mar 2016, Bernd Schmidt wrote: > On 03/25/2016 04:43 AM, Aldy Hernandez wrote: > > If Bernd is fine with this, I'm happy to retract my patch and any > > possible followups. I'm just interested in having no path causing a > > possible out of bounds access. If your patch will do that, I'

Re: out of bounds access in insn-automata.c

2016-03-30 Thread Bernd Schmidt
On 03/25/2016 04:43 AM, Aldy Hernandez wrote: If Bernd is fine with this, I'm happy to retract my patch and any possible followups. I'm just interested in having no path causing a possible out of bounds access. If your patch will do that, I'm cool. I'll need to see that patch first to comment

Re: out of bounds access in insn-automata.c

2016-03-24 Thread Aldy Hernandez
On 03/24/2016 10:02 AM, Alexander Monakov wrote: Hi, On Thu, 24 Mar 2016, Bernd Schmidt wrote: 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

Re: out of bounds access in insn-automata.c

2016-03-24 Thread Alexander Monakov
Hi, On Thu, 24 Mar 2016, Bernd Schmidt wrote: > 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. Migh

Re: out of bounds access in insn-automata.c

2016-03-24 Thread Bernd Schmidt
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

Re: out of bounds access in insn-automata.c

2016-03-24 Thread Aldy Hernandez
On 03/23/2016 10:25 AM, Bernd Schmidt wrote: On 03/23/2016 07:32 AM, Aldy Hernandez wrote: int maximal_insn_latency (rtx insn) { int insn_code; if (insn == 0) insn_code = DFA__ADVANCE_CYCLE; else { insn_code = dfa_insn_code (as_a (insn)); if (insn_code > DFA