On 08/21/2015 08:36 AM, Richard Sandiford wrote:
Richard Sandiford <richard.sandif...@arm.com> writes:
Claudiu reported that I'd botched the definition of LAST_INSN_CODE
in my recent patches to reduce the size of insn_data.  I'd defined
it as the last valid insn code, whereas it's supposed to be the
last valid code +1.

This patch replaces LAST_INSN_CODE with a separate NUM_INSN_CODES
count, outside the enum.

Tested on x86_64-linux-gnu and aarch64-linux-gnu.  OK to install?

Sorry, I realised later that this patch triggers a warning with older
host compilers about a trailing "," on the last enum value.  This patch
updates the gencodes.c part to fix that.  The other parts are unchanged.

I think the #defines for removed codes are a hold-over from the days
when CODE_FOR_nothing was the final enum value rather than the first,
amd so was only defined later in the file.  These days we can make them
proper enum aliases instead.

Tested on x86_64-linux-gnu and aarch64-linux-gnu.  OK to install?

Thanks,
Richard

gcc/
        * gencodes.c (gencodes): Print the comma for the preceding
        enum value rather than the current one.  Use aliased enum values
        rather than #defines for compiled-out patterns.
        (main): Update accordingly.  Replace LAST_INSN_CODE with
        NUM_INSN_CODES.
        * lra.c (insn_code_data): Update accordingly.
        (finish_insn_code_data_once, get_static_insn_data): Likewise.
        * recog.h (target_recog): Likewise.
        (preprocess_insn_constraints): Change parameter to unsigned int.
        * recog.c (preprocess_insn_constraints): Likewise.
        (recog_init): Replace LAST_INSN_CODE with NUM_INSN_CODES.
        * tree-vect-stmts.c (vectorizable_operation): Simplify.
OK.  Thanks for taking care of this.

Jeff

Reply via email to