1991-11-03 15:27:47 +01:00
|
|
|
/* Generate from machine description:
|
|
|
|
- some #define configuration flags.
|
2000-02-26 14:55:09 +01:00
|
|
|
Copyright (C) 1987, 1991, 1997, 1998,
|
|
|
|
1999, 2000 Free Software Foundation, Inc.
|
1991-11-03 15:27:47 +01:00
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
This file is part of GCC.
|
1991-11-03 15:27:47 +01:00
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free
|
|
|
|
Software Foundation; either version 2, or (at your option) any later
|
|
|
|
version.
|
1991-11-03 15:27:47 +01:00
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
for more details.
|
1991-11-03 15:27:47 +01:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
|
|
|
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
02111-1307, USA. */
|
1991-11-03 15:27:47 +01:00
|
|
|
|
|
|
|
|
1992-10-13 05:24:45 +01:00
|
|
|
#include "hconfig.h"
|
Cutover various gen*.c files to using system.h:
* Makefile.in (genconfig.o, genflags.o, gencodes.o, genemit.o,
genopinit.o, genrecog.o, genextract.o, genpeep.o, genattr.o,
genattrtab.o, genoutput.o): Depend on system.h.
* genattr.c: Include system.h. Add arguments to various function
prototypes. Remove redundant prototype of read_rtx().
* genattrtab.c: Likewise.
* gencodes.c: Likewise.
* genconfig.c: Likewise.
* genemit.c: Likewise.
* genextract.c: Likewise.
* genflags.c: Likewise.
* genopinit.c: Likewise.
* genoutput.c: Likewise.
* genpeep.c: Likewise.
* genrecog.c: Likewise.
From-SVN: r18794
1998-03-24 11:16:53 +01:00
|
|
|
#include "system.h"
|
1991-11-03 15:27:47 +01:00
|
|
|
#include "rtl.h"
|
errors.c: New file...
1999-08-27 00:27 -0700 Zack Weinberg <zack@bitmover.com>
* errors.c: New file; defines functions error, warning, and
fatal, variables have_error and progname.
* errors.h: New file; prototypes and decls for stuff in errors.c.
* Makefile: Add rules to build errors.o and
$(HOST_PREFIX)errors.o. Link genconfig, gencodes, genemit,
genopinit, genrecog, genextract, genpeep, genattr, and
genoutput with errors.o. Add errors.h to deps of genconfig.o,
gencodes.o, genemit.o, genopinit.o, genrecog.o, genextract.o,
genpeep.o, genattr.o, and genoutput.o.
* genconfig.c, gencodes.c, genemit.c, genopinit.c, genrecog.c,
genextract.c, genpeep.c, genattr.c: Include errors.h. Don't
define or prototype fatal. Set progname at beginning of main.
* genoutput.c: Likewise, and don't define or prototype error
either.
From-SVN: r28925
1999-08-27 09:47:17 +02:00
|
|
|
#include "errors.h"
|
2000-05-03 19:45:26 +02:00
|
|
|
#include "gensupport.h"
|
1991-11-03 15:27:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* flags to determine output of machine description dependent #define's. */
|
1992-05-23 20:15:06 +02:00
|
|
|
static int max_recog_operands; /* Largest operand number seen. */
|
|
|
|
static int max_dup_operands; /* Largest number of match_dup in any insn. */
|
1991-11-03 15:27:47 +01:00
|
|
|
static int max_clobbers_per_insn;
|
|
|
|
static int have_cc0_flag;
|
1992-08-20 03:32:51 +02:00
|
|
|
static int have_cmove_flag;
|
2000-04-07 11:24:45 +02:00
|
|
|
static int have_cond_exec_flag;
|
1991-11-03 15:27:47 +01:00
|
|
|
static int have_lo_sum_flag;
|
1999-08-31 22:37:09 +02:00
|
|
|
static int have_peephole_flag;
|
|
|
|
static int have_peephole2_flag;
|
1991-11-03 15:27:47 +01:00
|
|
|
|
|
|
|
/* Maximum number of insns seen in a split. */
|
|
|
|
static int max_insns_per_split = 1;
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
/* Maximum number of input insns for peephole2. */
|
|
|
|
static int max_insns_per_peep2;
|
|
|
|
|
1991-11-03 15:27:47 +01:00
|
|
|
static int clobbers_seen_this_insn;
|
|
|
|
static int dup_operands_seen_this_insn;
|
|
|
|
|
2000-01-17 16:17:38 +01:00
|
|
|
static void walk_insn_part PARAMS ((rtx, int, int));
|
|
|
|
static void gen_insn PARAMS ((rtx));
|
|
|
|
static void gen_expand PARAMS ((rtx));
|
|
|
|
static void gen_split PARAMS ((rtx));
|
|
|
|
static void gen_peephole PARAMS ((rtx));
|
2000-05-28 04:17:59 +02:00
|
|
|
static void gen_peephole2 PARAMS ((rtx));
|
c-lex.c (is_class_name): Delete declaration.
* c-lex.c (is_class_name): Delete declaration.
(whitespace_cr): Make static and add prototype.
* c-lex.h (make_pointer_declarator, reinit_parse_for_function,
yylex, get_directive_line): Turn declarations into prototypes.
(position_after_whitespace, check_newline, yyerror,, is_class_name,
forget_protocol_qualifiers, remember_protocol_qualifiers): Add
prototypes.
* genattr.c (extend_range, write_upcase, gen_attr, write_units): Add
prototypes.
* gencodes.c (gen_insn): Add prototype.
* genconfig.c (walk_insn, gen_insn, gen_expand, gen_split,
gen_peephole): Add prototypes.
* genflags.c (num_operands, gen_proto, gen_nonproto, gen_insn): Add
prototypes.
* gengenrtl.c (type_from_format, accessor_from_format, special_rtx,
special_format, find_formats, gendecl, genmacro, gendef, genlegend,
genheader, gencode): Add prototypes.
* genopinit.c (gen_insn): Add prototype.
* genoutput.c (output_prologue, output_epilogue, scan_operands,
process_template, validate_insn_alternatives, gen_insn, gen_peephole,
gen_expand, gen_split, n_occurrences): Add prototypes.
* genpeep.c (gen_peephole): Add prototype.
* loop.c (find_and_verify_loops, mark_loop_jump, prescan_loop,
reg_in_basic_block_p, consec_sets_invariant_p, libcall_other_reg,
labels_in_range_p, count_loop_regs_set, note_addr_stored,
loop_reg_used_before_p, scan_loop, replace_call_address,
skip_consec_insns, libcall_benefit, ignore_some_movables,
force_movables, combine_movables, rtx_equal_for_loop_p, move_movables,
strength_reduce, valid_initial_value_p, find_mem_givs, record_biv,
check_final_value, record_giv, update_giv_derive, basic_induction_var,
simplify_giv_expr, general_induction_var, consec_sets_giv,
check_dbra_loop, express_from, combine_givs_p, combine_givs,
product_cheap_p, maybe_eliminate_biv, maybe_eliminate_biv_1,
last_use_this_basic_block, record_initial, update_reg_last_use,
iteration_info, analyze_loop_iterations, insert_bct,
instrument_loop_bct, indirect_jump_in_function_p): Turn declarations
into prototypes.
From-SVN: r19038
1998-04-08 01:47:11 +02:00
|
|
|
|
1991-11-03 15:27:47 +01:00
|
|
|
/* RECOG_P will be non-zero if this pattern was seen in a context where it will
|
1992-08-20 03:32:51 +02:00
|
|
|
be used to recognize, rather than just generate an insn.
|
|
|
|
|
|
|
|
NON_PC_SET_SRC will be non-zero if this pattern was seen in a SET_SRC
|
|
|
|
of a SET whose destination is not (pc). */
|
1991-11-03 15:27:47 +01:00
|
|
|
|
|
|
|
static void
|
1992-08-20 03:32:51 +02:00
|
|
|
walk_insn_part (part, recog_p, non_pc_set_src)
|
1991-11-03 15:27:47 +01:00
|
|
|
rtx part;
|
1992-08-20 03:32:51 +02:00
|
|
|
int recog_p;
|
|
|
|
int non_pc_set_src;
|
1991-11-03 15:27:47 +01:00
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
int i, j;
|
|
|
|
RTX_CODE code;
|
|
|
|
const char *format_ptr;
|
1991-11-03 15:27:47 +01:00
|
|
|
|
|
|
|
if (part == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
code = GET_CODE (part);
|
|
|
|
switch (code)
|
|
|
|
{
|
|
|
|
case CLOBBER:
|
|
|
|
clobbers_seen_this_insn++;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MATCH_OPERAND:
|
|
|
|
if (XINT (part, 0) > max_recog_operands)
|
|
|
|
max_recog_operands = XINT (part, 0);
|
|
|
|
return;
|
|
|
|
|
|
|
|
case MATCH_OP_DUP:
|
1992-08-14 20:40:32 +02:00
|
|
|
case MATCH_PAR_DUP:
|
1991-11-03 15:27:47 +01:00
|
|
|
++dup_operands_seen_this_insn;
|
|
|
|
case MATCH_SCRATCH:
|
|
|
|
case MATCH_PARALLEL:
|
|
|
|
case MATCH_OPERATOR:
|
|
|
|
if (XINT (part, 0) > max_recog_operands)
|
|
|
|
max_recog_operands = XINT (part, 0);
|
|
|
|
/* Now scan the rtl's in the vector inside the MATCH_OPERATOR or
|
|
|
|
MATCH_PARALLEL. */
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LABEL_REF:
|
|
|
|
if (GET_CODE (XEXP (part, 0)) == MATCH_OPERAND)
|
|
|
|
break;
|
|
|
|
return;
|
|
|
|
|
|
|
|
case MATCH_DUP:
|
|
|
|
++dup_operands_seen_this_insn;
|
|
|
|
if (XINT (part, 0) > max_recog_operands)
|
|
|
|
max_recog_operands = XINT (part, 0);
|
|
|
|
return;
|
|
|
|
|
|
|
|
case CC0:
|
|
|
|
if (recog_p)
|
|
|
|
have_cc0_flag = 1;
|
|
|
|
return;
|
|
|
|
|
|
|
|
case LO_SUM:
|
|
|
|
if (recog_p)
|
|
|
|
have_lo_sum_flag = 1;
|
|
|
|
return;
|
|
|
|
|
1992-08-20 03:32:51 +02:00
|
|
|
case SET:
|
|
|
|
walk_insn_part (SET_DEST (part), 0, recog_p);
|
|
|
|
walk_insn_part (SET_SRC (part), recog_p,
|
|
|
|
GET_CODE (SET_DEST (part)) != PC);
|
|
|
|
return;
|
|
|
|
|
|
|
|
case IF_THEN_ELSE:
|
1992-09-19 21:55:22 +02:00
|
|
|
/* Only consider this machine as having a conditional move if the
|
|
|
|
two arms of the IF_THEN_ELSE are both MATCH_OPERAND. Otherwise,
|
|
|
|
we have some specific IF_THEN_ELSE construct (like the doz
|
|
|
|
instruction on the RS/6000) that can't be used in the general
|
2000-04-07 11:24:45 +02:00
|
|
|
context we want it for. */
|
1992-09-19 21:55:22 +02:00
|
|
|
|
|
|
|
if (recog_p && non_pc_set_src
|
|
|
|
&& GET_CODE (XEXP (part, 1)) == MATCH_OPERAND
|
|
|
|
&& GET_CODE (XEXP (part, 2)) == MATCH_OPERAND)
|
1992-08-20 03:32:51 +02:00
|
|
|
have_cmove_flag = 1;
|
2000-04-07 11:24:45 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case COND_EXEC:
|
|
|
|
if (recog_p)
|
|
|
|
have_cond_exec_flag = 1;
|
1992-08-20 03:32:51 +02:00
|
|
|
break;
|
|
|
|
|
1991-11-03 15:27:47 +01:00
|
|
|
case REG: case CONST_INT: case SYMBOL_REF:
|
|
|
|
case PC:
|
|
|
|
return;
|
c-common.c: Include <stdlib.h> and <string.h>/<strings.h>.
* c-common.c: Include <stdlib.h> and <string.h>/<strings.h>.
* calls.c (expand_call): Remove unused variables funtree,
n_regs, and tmpmode.
* dbxout.c, except.c: Include <string.h>/<strings.h>.
* explow.c: (plus_constant_for_output_wide) Removed unused
variable all_constant.
* c-decl.c, genattr.c, genattrtab.c, getconfig.c, genemit.c
genextract.c, genflags.c, genopinit.c genoutput.c, genpeep.c,
genrecog.c, global.c, integrate.c , stupid.c : Include
<stdlib.h>.
* genextract.c: (walk_rtx) Remove unused variable link.
* genrecog.c: (concat) Remove unreferenced static function.
* prefix.c: Include <string.h>/<strings.h>, <stdlib.h>
* stmt.c: Include <stdlib.h>.
(expand_asm_operands): Remove unused variable val1.
(expand_return): Remove unused variable block.
(pushcase): Remove unused variables l and n.
(pushcaserange): Likewise.
* unroll.c (unroll_loop): Remove unused variable temp.
From-SVN: r17766
1998-02-07 23:55:54 +01:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
1991-11-03 15:27:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
format_ptr = GET_RTX_FORMAT (GET_CODE (part));
|
|
|
|
|
|
|
|
for (i = 0; i < GET_RTX_LENGTH (GET_CODE (part)); i++)
|
|
|
|
switch (*format_ptr++)
|
|
|
|
{
|
|
|
|
case 'e':
|
|
|
|
case 'u':
|
1992-08-20 03:32:51 +02:00
|
|
|
walk_insn_part (XEXP (part, i), recog_p, non_pc_set_src);
|
1991-11-03 15:27:47 +01:00
|
|
|
break;
|
|
|
|
case 'E':
|
|
|
|
if (XVEC (part, i) != NULL)
|
|
|
|
for (j = 0; j < XVECLEN (part, i); j++)
|
1992-08-20 03:32:51 +02:00
|
|
|
walk_insn_part (XVECEXP (part, i, j), recog_p, non_pc_set_src);
|
1991-11-03 15:27:47 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gen_insn (insn)
|
|
|
|
rtx insn;
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Walk the insn pattern to gather the #define's status. */
|
|
|
|
clobbers_seen_this_insn = 0;
|
|
|
|
dup_operands_seen_this_insn = 0;
|
|
|
|
if (XVEC (insn, 1) != 0)
|
|
|
|
for (i = 0; i < XVECLEN (insn, 1); i++)
|
1992-08-20 03:32:51 +02:00
|
|
|
walk_insn_part (XVECEXP (insn, 1, i), 1, 0);
|
1991-11-03 15:27:47 +01:00
|
|
|
|
|
|
|
if (clobbers_seen_this_insn > max_clobbers_per_insn)
|
|
|
|
max_clobbers_per_insn = clobbers_seen_this_insn;
|
|
|
|
if (dup_operands_seen_this_insn > max_dup_operands)
|
|
|
|
max_dup_operands = dup_operands_seen_this_insn;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Similar but scan a define_expand. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
gen_expand (insn)
|
|
|
|
rtx insn;
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Walk the insn pattern to gather the #define's status. */
|
|
|
|
|
|
|
|
/* Note that we don't bother recording the number of MATCH_DUPs
|
|
|
|
that occur in a gen_expand, because only reload cares about that. */
|
|
|
|
if (XVEC (insn, 1) != 0)
|
|
|
|
for (i = 0; i < XVECLEN (insn, 1); i++)
|
|
|
|
{
|
|
|
|
/* Compute the maximum SETs and CLOBBERS
|
|
|
|
in any one of the sub-insns;
|
|
|
|
don't sum across all of them. */
|
|
|
|
clobbers_seen_this_insn = 0;
|
|
|
|
|
1992-08-20 03:32:51 +02:00
|
|
|
walk_insn_part (XVECEXP (insn, 1, i), 0, 0);
|
1991-11-03 15:27:47 +01:00
|
|
|
|
|
|
|
if (clobbers_seen_this_insn > max_clobbers_per_insn)
|
|
|
|
max_clobbers_per_insn = clobbers_seen_this_insn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Similar but scan a define_split. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
gen_split (split)
|
|
|
|
rtx split;
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Look through the patterns that are matched
|
|
|
|
to compute the maximum operand number. */
|
|
|
|
for (i = 0; i < XVECLEN (split, 0); i++)
|
1992-08-20 03:32:51 +02:00
|
|
|
walk_insn_part (XVECEXP (split, 0, i), 1, 0);
|
1991-11-03 15:27:47 +01:00
|
|
|
/* Look at the number of insns this insn could split into. */
|
|
|
|
if (XVECLEN (split, 2) > max_insns_per_split)
|
|
|
|
max_insns_per_split = XVECLEN (split, 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gen_peephole (peep)
|
|
|
|
rtx peep;
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Look through the patterns that are matched
|
|
|
|
to compute the maximum operand number. */
|
|
|
|
for (i = 0; i < XVECLEN (peep, 0); i++)
|
1992-08-20 03:32:51 +02:00
|
|
|
walk_insn_part (XVECEXP (peep, 0, i), 1, 0);
|
1991-11-03 15:27:47 +01:00
|
|
|
}
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
static void
|
|
|
|
gen_peephole2 (peep)
|
|
|
|
rtx peep;
|
|
|
|
{
|
|
|
|
int i, n;
|
|
|
|
|
|
|
|
/* Look through the patterns that are matched
|
|
|
|
to compute the maximum operand number. */
|
|
|
|
for (i = XVECLEN (peep, 0) - 1; i >= 0; --i)
|
|
|
|
walk_insn_part (XVECEXP (peep, 0, i), 1, 0);
|
|
|
|
|
|
|
|
/* Look at the number of insns this insn can be matched from. */
|
|
|
|
for (i = XVECLEN (peep, 0) - 1, n = 0; i >= 0; --i)
|
|
|
|
if (GET_CODE (XVECEXP (peep, 0, i)) != MATCH_DUP
|
|
|
|
&& GET_CODE (XVECEXP (peep, 0, i)) != MATCH_SCRATCH)
|
|
|
|
n++;
|
|
|
|
if (n > max_insns_per_peep2)
|
|
|
|
max_insns_per_peep2 = n;
|
|
|
|
}
|
|
|
|
|
2000-01-17 16:17:38 +01:00
|
|
|
extern int main PARAMS ((int, char **));
|
1999-09-15 16:13:50 +02:00
|
|
|
|
1991-11-03 15:27:47 +01:00
|
|
|
int
|
|
|
|
main (argc, argv)
|
|
|
|
int argc;
|
|
|
|
char **argv;
|
|
|
|
{
|
|
|
|
rtx desc;
|
|
|
|
|
errors.c: New file...
1999-08-27 00:27 -0700 Zack Weinberg <zack@bitmover.com>
* errors.c: New file; defines functions error, warning, and
fatal, variables have_error and progname.
* errors.h: New file; prototypes and decls for stuff in errors.c.
* Makefile: Add rules to build errors.o and
$(HOST_PREFIX)errors.o. Link genconfig, gencodes, genemit,
genopinit, genrecog, genextract, genpeep, genattr, and
genoutput with errors.o. Add errors.h to deps of genconfig.o,
gencodes.o, genemit.o, genopinit.o, genrecog.o, genextract.o,
genpeep.o, genattr.o, and genoutput.o.
* genconfig.c, gencodes.c, genemit.c, genopinit.c, genrecog.c,
genextract.c, genpeep.c, genattr.c: Include errors.h. Don't
define or prototype fatal. Set progname at beginning of main.
* genoutput.c: Likewise, and don't define or prototype error
either.
From-SVN: r28925
1999-08-27 09:47:17 +02:00
|
|
|
progname = "genconfig";
|
1991-11-03 15:27:47 +01:00
|
|
|
|
|
|
|
if (argc <= 1)
|
c-decl.c (duplicate_decls, [...]): Remove leading capital from diagnostics.
* c-decl.c (duplicate_decls, push_parm_decl): Remove leading
capital from diagnostics.
* c-lex.c (cb_file_change): Similarly.
* c-parse.in : Similarly.
* cfgrtl.c (verify_flow_info): Similarly.
* collect2.c: Similarly.
* cppfiles.c (find_include_file): Similarly.
* cppinit.c (cpp_handle_option): Similarly.
* cpplex.c (cpp_spell_token): Similarly.
* cppmain.c (do_preprocessing): Similarly.
* gcc.c (translate_options, process_command, do_spec1,
main, pfatal_execute): Similarly.
* genattr.c (main): Similarly.
* genattrtab.c (check_attr_test, operate_exp, simplify_test_exp,
write_test_expr, main): Similarly.
* gencodes.c (main): Similarly.
* genconfig.c (main): Similarly.
* genconstants.c (main): Similarly.
* genemit.c (main): Similarly.
* genextract.c (main): Similarly.
* genflags.c (main): Similarly.
* genopinit.c (main): Similarly.
* genoutput.c (process_template, main): Similarly.
* genpeep.c (main): Similarly.
* genrecog.c (main): Similarly.
* gensupport.c (is_predicable, identify_predicable_attribute,
alter_predicate_for_insn, init_md_reader_args, main): Similarly.
* ggc-page.c (alloc_anon): Similarly.
* mips-tfile.c (add_string, add_procedure, add_file, read_line,
parse_begin, parse_bend, parse_def, parse_end, parse_file,
parse_stabs_common, parse_stabs, write_varray, write_object,
read_seek, copy_object, main, error): Similarly.
* profile.c (compute_branch_probabilities): Similarly.
* reg-stack.c (check_asm_stack_operands): Similarly.
* reload.c (find_reloads): Similarly.
* reload1.c (spill_failure, failed_reload): Similarly.
* rtl-error.c (_fatal_insn_not_found): Similarly.
* toplev.c (read_integral_parameter, crash_signal,
decode_f_option, set_target_switch, parse_options_and_default_flags)
: Similarly.
* tradcif.y (parse_number, yylex): Similarly.
* tradcpp.c (main, fancy_abort): Similarly.
* tree.c (tree_check_failed): Similarly.
* varray.c (varray_check_failed): Similarly.
* xcoffout.c (xcoff_output_standard_types): Similarly.
cp:
* call.c (build_java_interface_fn_ref): Similarly.
* except.c (is_admissible_throw_operand): Similarly.
* init.c (build_java_class_ref): Similarly.
* xref.c (open_xref_file): Similarly.
objc:
* objc-act.c (get_object_ref, lookup_and_install_protocols,
build_objc_string_object, objc_declare_alias, build_ivar_chain,
finish_message_expr, build_protocol_expr, is_public,
start_class): Similarly.
testsuite:
* objc.dg/alias.m: Update.
* objc.dg/class-1.m: Update.
* objc.dg/const-str-1.m: Update.
* objc.dg/fwd-proto-1.m: Update.
* objc.dg/id-1.m: Update.
* objc.dg/super-class-1.m: Update.
From-SVN: r47518
2001-12-02 01:04:36 +01:00
|
|
|
fatal ("no input file name");
|
1991-11-03 15:27:47 +01:00
|
|
|
|
2001-11-14 21:17:08 +01:00
|
|
|
if (init_md_reader_args (argc, argv) != SUCCESS_EXIT_CODE)
|
2000-05-03 19:45:26 +02:00
|
|
|
return (FATAL_EXIT_CODE);
|
1991-11-03 15:27:47 +01:00
|
|
|
|
2001-04-02 18:29:32 +02:00
|
|
|
puts ("/* Generated automatically by the program `genconfig'");
|
|
|
|
puts (" from the machine description file `md'. */\n");
|
|
|
|
puts ("#ifndef GCC_INSN_CONFIG_H");
|
|
|
|
puts ("#define GCC_INSN_CONFIG_H\n");
|
1991-11-03 15:27:47 +01:00
|
|
|
|
2001-10-11 09:07:30 +02:00
|
|
|
/* Allow at least 30 operands for the sake of asm constructs. */
|
|
|
|
/* ??? We *really* ought to reorganize things such that there
|
|
|
|
is no fixed upper bound. */
|
|
|
|
max_recog_operands = 29; /* We will add 1 later. */
|
1991-11-03 15:27:47 +01:00
|
|
|
max_dup_operands = 1;
|
|
|
|
|
|
|
|
/* Read the machine description. */
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
{
|
2000-05-03 19:45:26 +02:00
|
|
|
int line_no, insn_code_number = 0;
|
|
|
|
|
|
|
|
desc = read_md_rtx (&line_no, &insn_code_number);
|
|
|
|
if (desc == NULL)
|
1991-11-03 15:27:47 +01:00
|
|
|
break;
|
2000-05-03 19:45:26 +02:00
|
|
|
|
|
|
|
switch (GET_CODE (desc))
|
1999-08-31 22:37:09 +02:00
|
|
|
{
|
2000-05-03 19:45:26 +02:00
|
|
|
case DEFINE_INSN:
|
|
|
|
gen_insn (desc);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DEFINE_EXPAND:
|
|
|
|
gen_expand (desc);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DEFINE_SPLIT:
|
|
|
|
gen_split (desc);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DEFINE_PEEPHOLE2:
|
|
|
|
have_peephole2_flag = 1;
|
2000-05-27 22:23:15 +02:00
|
|
|
gen_peephole2 (desc);
|
2000-05-03 19:45:26 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DEFINE_PEEPHOLE:
|
|
|
|
have_peephole_flag = 1;
|
|
|
|
gen_peephole (desc);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
1999-08-31 22:37:09 +02:00
|
|
|
}
|
1991-11-03 15:27:47 +01:00
|
|
|
}
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
printf ("#define MAX_RECOG_OPERANDS %d\n", max_recog_operands + 1);
|
|
|
|
printf ("#define MAX_DUP_OPERANDS %d\n", max_dup_operands);
|
1991-11-03 15:27:47 +01:00
|
|
|
|
|
|
|
/* This is conditionally defined, in case the user writes code which emits
|
|
|
|
more splits than we can readily see (and knows s/he does it). */
|
2000-04-07 11:24:45 +02:00
|
|
|
printf ("#ifndef MAX_INSNS_PER_SPLIT\n");
|
|
|
|
printf ("#define MAX_INSNS_PER_SPLIT %d\n", max_insns_per_split);
|
|
|
|
printf ("#endif\n");
|
1991-11-03 15:27:47 +01:00
|
|
|
|
|
|
|
if (have_cc0_flag)
|
2000-04-27 09:18:08 +02:00
|
|
|
printf ("#define HAVE_cc0 1\n");
|
1991-11-03 15:27:47 +01:00
|
|
|
|
1992-08-20 03:32:51 +02:00
|
|
|
if (have_cmove_flag)
|
2000-04-27 09:18:08 +02:00
|
|
|
printf ("#define HAVE_conditional_move 1\n");
|
1992-08-20 03:32:51 +02:00
|
|
|
|
2000-04-07 11:24:45 +02:00
|
|
|
if (have_cond_exec_flag)
|
2000-04-27 09:18:08 +02:00
|
|
|
printf ("#define HAVE_conditional_execution 1\n");
|
1999-09-07 07:49:18 +02:00
|
|
|
|
1991-11-03 15:27:47 +01:00
|
|
|
if (have_lo_sum_flag)
|
2000-04-27 09:18:08 +02:00
|
|
|
printf ("#define HAVE_lo_sum 1\n");
|
1991-11-03 15:27:47 +01:00
|
|
|
|
1999-08-31 22:37:09 +02:00
|
|
|
if (have_peephole_flag)
|
2000-04-27 09:18:08 +02:00
|
|
|
printf ("#define HAVE_peephole 1\n");
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
|
|
if (have_peephole2_flag)
|
2000-05-27 22:23:15 +02:00
|
|
|
{
|
|
|
|
printf ("#define HAVE_peephole2 1\n");
|
|
|
|
printf ("#define MAX_INSNS_PER_PEEP2 %d\n", max_insns_per_peep2);
|
|
|
|
}
|
1999-08-31 22:37:09 +02:00
|
|
|
|
2001-04-02 18:29:32 +02:00
|
|
|
puts("\n#endif /* GCC_INSN_CONFIG_H */");
|
|
|
|
|
|
|
|
if (ferror (stdout) || fflush (stdout) || fclose (stdout))
|
|
|
|
return FATAL_EXIT_CODE;
|
|
|
|
|
|
|
|
return SUCCESS_EXIT_CODE;
|
1991-11-03 15:27:47 +01:00
|
|
|
}
|
1999-09-12 14:46:08 +02:00
|
|
|
|
|
|
|
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
|
|
|
|
const char *
|
|
|
|
get_insn_name (code)
|
1999-09-15 16:13:50 +02:00
|
|
|
int code ATTRIBUTE_UNUSED;
|
1999-09-12 14:46:08 +02:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|