From 9921417d94eb2b25ed60b1eafaaf5888164221a4 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Tue, 27 May 2014 10:05:55 +0000 Subject: [PATCH] gencodes.c (main): Make LAST_INSN_CODE higher than any insn code, rather than any named insn's code. gcc/ * gencodes.c (main): Make LAST_INSN_CODE higher than any insn code, rather than any named insn's code. From-SVN: r210963 --- gcc/ChangeLog | 5 +++++ gcc/gencodes.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fce255b1045..fd7b3309f42 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-05-27 Richard Sandiford + + * gencodes.c (main): Make LAST_INSN_CODE higher than any insn code, + rather than any named insn's code. + 2014-05-27 Georg-Johann Lay PR libgcc/61152 diff --git a/gcc/gencodes.c b/gcc/gencodes.c index b34381f9268..207b7eeb8f4 100644 --- a/gcc/gencodes.c +++ b/gcc/gencodes.c @@ -50,6 +50,7 @@ int main (int argc, char **argv) { rtx desc; + int last = 1; progname = "gencodes"; @@ -82,13 +83,16 @@ enum insn_code {\n\ break; if (GET_CODE (desc) == DEFINE_INSN || GET_CODE (desc) == DEFINE_EXPAND) - gen_insn (desc, insn_code_number); + { + gen_insn (desc, insn_code_number); + last = insn_code_number + 1; + } } - puts (" LAST_INSN_CODE\n\ + printf (" LAST_INSN_CODE = %d\n\ };\n\ \n\ -#endif /* GCC_INSN_CODES_H */"); +#endif /* GCC_INSN_CODES_H */\n", last); if (ferror (stdout) || fflush (stdout) || fclose (stdout)) return FATAL_EXIT_CODE;