This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: *Patch Ping*: genautomata
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: David Edelsohn <dje at watson dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 14 Apr 2003 11:52:22 -0400
- Subject: Re: *Patch Ping*: genautomata
- References: <200304121448.KAA26032@makai.watson.ibm.com>
David Edelsohn wrote:
>
> http://gcc.gnu.org/ml/gcc-patches/2003-04/msg00469.html
David, sorry for missing your email.
> I tracked this down to the translate_vect being too small. It is
>not dynamic or dependent on the number of descriptions. The error I
>received was for index 261 out of bounds for size 250. Bumping the
>allocation size to 300 allowed things to proceed. Is there any particular
>reason for the choice of 250? I don't know if you want to make the
>allocator dynamic for this value or have it scale with some input.
>
250 is only initial length. The vector is expanded by
VLA_HWINT_EXPAND. The problem as I see is
in loop which has condition insn <= description->insn_num. It is a
typo. It should be <. I've commited a patch to fix it. So you
could try it.
http://gcc.gnu.org/ml/gcc-patches/2003-04/msg00987.html
Thanks for reporting the problem.
Vlad
> Is this okay for now?
>
> * genautomata.c (output_translate_vect): Increase allocation size
> to 300.
>
>Index: genautomata.c
>===================================================================
>RCS file: /cvs/gcc/gcc/gcc/genautomata.c,v
>retrieving revision 1.39
>diff -c -p -r1.39 genautomata.c
>*** genautomata.c 13 Mar 2003 03:48:27 -0000 1.39
>--- genautomata.c 7 Apr 2003 18:55:36 -0000
>*************** output_translate_vect (automaton)
>*** 7668,7674 ****
> int insn_value;
> vla_hwint_t translate_vect;
>
>! VLA_HWINT_CREATE (translate_vect, 250, "translate vector");
> VLA_HWINT_EXPAND (translate_vect, description->insns_num);
> for (insn_value = 0; insn_value <= description->insns_num; insn_value++)
> /* Undefined value */
>--- 7668,7674 ----
> int insn_value;
> vla_hwint_t translate_vect;
>
>! VLA_HWINT_CREATE (translate_vect, 300, "translate vector");
> VLA_HWINT_EXPAND (translate_vect, description->insns_num);
> for (insn_value = 0; insn_value <= description->insns_num; insn_value++)
> /* Undefined value */