This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Possible issue with using LAST_INSN_CODE
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Claudiu Zissulescu <claziss at gmail dot com>, Claudiu Zissulescu <Claudiu dot Zissulescu at synopsys dot com>, "gcc\ at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Francois Bedard <Francois dot Bedard at synopsys dot com>
- Date: Thu, 20 Aug 2015 20:00:18 +0100
- Subject: Re: Possible issue with using LAST_INSN_CODE
- Authentication-results: sourceware.org; auth=none
- References: <098ECE41A0A6114BB2A07F1EC238DE8965C6756D at de02wembxa dot internal dot synopsys dot com> <55D6064F dot 40505 at redhat dot com> <CAL0iMy3Sp=AVybZqCJCBTXnvWjX4+SNBCnzWhFNwHeUc0D_bYQ at mail dot gmail dot com> <55D60EA3 dot 6040708 at redhat dot com>
Jeff Law <law@redhat.com> writes:
> On 08/20/2015 11:28 AM, Claudiu Zissulescu wrote:
>> Hi Jeff,
>>
>> In the gencodes.c:89, it explicitly decrements by one the return
>> value of get_num_insn_codes(). While for the get_num_insn_codes is
>> stated this:
>>
>> /* Return the number of possible INSN_CODEs. Only meaningful once the
>> whole file has been processed. */
>>
>> I can provide an example for the ARC port where it crashes due to
>> LAST_INSN_CODE issue. Probably it can be reproduced with other more
>> popular port like ARM.
> Passing along a test, even for the ARC is useful.
>
> This is something Richard recently changed, it's probably just an
> oversight on his part.
Yeah :-( That's a mightly confusing name. I'm going to try changing
it to NUM_INSN_CODES and make it a const unsigned int (rather than
keeping it as part of the enum).
Thanks,
Richard