diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-10-30 09:35:42 +0000 |
---|---|---|
committer | <> | 2015-01-09 11:51:27 +0000 |
commit | c27a97d04853380f1e80525391b3f0d156ed4c84 (patch) | |
tree | 68ffaade7c605bc80cffa18360799c98a810976f /gcc/genpeep.c | |
parent | 6af3fdec2262dd94954acc5e426ef71cbd4521d3 (diff) | |
download | gcc-tarball-c27a97d04853380f1e80525391b3f0d156ed4c84.tar.gz |
Imported from /home/lorry/working-area/delta_gcc-tarball/gcc-4.9.2.tar.bz2.gcc-4.9.2
Diffstat (limited to 'gcc/genpeep.c')
-rw-r--r-- | gcc/genpeep.c | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/gcc/genpeep.c b/gcc/genpeep.c index ac08d80d55..a8afadbc80 100644 --- a/gcc/genpeep.c +++ b/gcc/genpeep.c @@ -1,6 +1,5 @@ /* Generate code from machine description to perform peephole optimizations. - Copyright (C) 1987, 1989, 1992, 1997, 1998, 1999, 2000, 2003, 2004, - 2007, 2010 Free Software Foundation, Inc. + Copyright (C) 1987-2014 Free Software Foundation, Inc. This file is part of GCC. @@ -47,18 +46,13 @@ static int max_opno; static int n_operands; -/* Peephole optimizations get insn codes just like insn patterns. - Count them so we know the code of the define_peephole we are handling. */ - -static int insn_code_number = 0; - -static void gen_peephole (rtx); +static void gen_peephole (rtx, int); static void match_rtx (rtx, struct link *, int); static void print_path (struct link *); static void print_code (RTX_CODE); static void -gen_peephole (rtx peep) +gen_peephole (rtx peep, int insn_code_number) { int ninsns = XVECLEN (peep, 0); int i; @@ -231,10 +225,6 @@ match_rtx (rtx x, struct link *path, int fail_label) } return; - case ADDRESS: - match_rtx (XEXP (x, 0), path, fail_label); - return; - default: break; } @@ -344,7 +334,7 @@ print_code (RTX_CODE code) { const char *p1; for (p1 = GET_RTX_NAME (code); *p1; p1++) - putchar (TOUPPER(*p1)); + putchar (TOUPPER (*p1)); } extern int main (int, char **); @@ -369,6 +359,10 @@ from the machine description file `md'. */\n\n"); printf ("#include \"coretypes.h\"\n"); printf ("#include \"tm.h\"\n"); printf ("#include \"insn-config.h\"\n"); + printf ("#include \"tree.h\"\n"); + printf ("#include \"varasm.h\"\n"); + printf ("#include \"stor-layout.h\"\n"); + printf ("#include \"calls.h\"\n"); printf ("#include \"rtl.h\"\n"); printf ("#include \"tm_p.h\"\n"); printf ("#include \"regs.h\"\n"); @@ -396,24 +390,15 @@ from the machine description file `md'. */\n\n"); while (1) { - int line_no, rtx_number = 0; + int line_no; + int insn_code_number; - desc = read_md_rtx (&line_no, &rtx_number); + desc = read_md_rtx (&line_no, &insn_code_number); if (desc == NULL) break; - if (GET_CODE (desc) == DEFINE_PEEPHOLE) - { - gen_peephole (desc); - insn_code_number++; - } - if (GET_CODE (desc) == DEFINE_INSN - || GET_CODE (desc) == DEFINE_EXPAND - || GET_CODE (desc) == DEFINE_SPLIT - || GET_CODE (desc) == DEFINE_PEEPHOLE2) - { - insn_code_number++; - } + if (GET_CODE (desc) == DEFINE_PEEPHOLE) + gen_peephole (desc, insn_code_number); } printf (" return 0;\n}\n\n"); |