gcc/gcc/genrecog.c

2755 lines
72 KiB
C
Raw Normal View History

1991-11-24 20:57:16 +01:00
/* Generate code from machine description to recognize rtl as insns.
Copyright (C) 1987-2014 Free Software Foundation, Inc.
1991-11-24 20:57:16 +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.
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 3, or (at your option)
any later version.
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.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* This program is used to produce insn-recog.c, which contains a
function called `recog' plus its subroutines. These functions
contain a decision tree that recognizes whether an rtx, the
argument given to recog, is a valid instruction.
recog returns -1 if the rtx is not valid. If the rtx is valid,
recog returns a nonnegative number which is the insn code number
for the pattern that matched. This is the same as the order in the
machine description of the entry that matched. This number can be
used as an index into various insn_* tables, such as insn_template,
insn_outfun, and insn_n_operands (found in insn-output.c).
The third argument to recog is an optional pointer to an int. If
present, recog will accept a pattern if it matches except for
1991-11-24 20:57:16 +01:00
missing CLOBBER expressions at the end. In that case, the value
pointed to by the optional pointer will be set to the number of
CLOBBERs that need to be added (it should be initialized to zero by
the caller). If it is set nonzero, the caller should allocate a
PARALLEL of the appropriate size, copy the initial entries, and
call add_clobbers (found in insn-emit.c) to fill in the CLOBBERs.
1991-11-24 20:57:16 +01:00
This program also generates the function `split_insns', which
returns 0 if the rtl could not be split, or it returns the split
Delete SEQUENCE rtl usage outside of reorg and ssa passes. 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. * rtl.h (gen_sequence, emit_insns, emit_insns_before, emit_insns_before_scope, emit_insns_after, emit_insns_after_scope): Delete declaration. * ada/misc.c (insert_code_for): Use emit_insn* instead of emit_insns_foo. * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. (alpha_set_memflags): Fix comment. (set_frame_related_p): Use get_insns instead of gen_sequence. * config/alpha/alpha.md (setjmp receiver splitter): Avoid emitting no insns. * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of gen_sequence. (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/ia64/ia64.md (conditional move spliiter): Avoid emitting no insns. * config/m32r/m32r.c (gen_split_move_double): Use get_insns instead of gen_sequence. * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_need_epilogue): Likewise. * config/sparc/sparc.md (current_function_calls_alloca, flat): New attributes. (setjmp pattern and split): Use them to avoid splitter which emits no RTL. * genattrtab.c (main): Emit include of function.h * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use get_insns instead of gen_sequence. * config/cris/cris.c (cris_split_movdx): Likewise. * emit-rtl.c (emit_insns*): Kill. (try_split): Expect insn list instead of SEQUENCE. (make_jump_insn_raw, make_call_insn_raw): Fix comments. (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. Make them abort if a SEQUENCE is given and RTL checking is enabled. (emit_*_scope): Don't forget to set scope on final insn. (gen_sequence): Move from here... * ssa.c (gen_sequence): To here as private function. * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix comments. (expand_builtin_return, expand_builtin_mathfn): Likewise. (expand_builtin_strlen): Use get_insns instead of gen_sequence. (expand_builtin_saveregs): Use emit_insn_foo, fix comments. (expand_builtin_expect_jump): Use get_insns and fix comments. * calls.c (try_to_integrate): Use emit_insn_foo. (expand_call, emit_library_call_value_1): Likewise. * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. (emit_move_insn_1): Use get_insns instead of gen_sequence. (expand_expr): Use emit_insn_foo. * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. * except.c (build_post_landing_pads): Likewise. * flow.c (attempt_auto_inc): Likewise. * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, expand_nl_goto_receivers, expand_decl_cleanup): Likewise. * function.c (fixup_var_refs_insn): Use get_insns instead of gen_sequence. (fixup_var_refs_1): Likewise and expect insn list from gen_foo. (fixup_memory_subreg): Use get_insns instead of gen_sequence. (fixup_stack_1, purge_addressof_1, expand_main_function, get_arg_pointer_save_area): Likewise. (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, expand_function_end): Use emit_insn_foo. (record_insns, keep_stack_depressed): Work with insn list instead of SEQUENCE, fix comments. * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, noce_try_store_flag_constants, noce_try_store_flag_inc, noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Use emit_insn_foo. (noce_process_if_block): Use get_insns instead of gen_sequence. * optabs.c (add_equal_note): Work with insn list, fix comments. (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. (expand_unop, expand_complex_abs, expand_unop_insn, expand_no_conflict_block): Likewise. (gen_move_insn): Use get_insns instead of gen_sequence. (gen_cond_trap): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. (emit_initial_value_sets): Use emit_insn_foo. * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently now that RTL generators give insn lists. * sibcall.c (replace_call_placeholder): Use emit_insn_foo. * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns instead of gen_sequence. (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. * explow.c (emit_stack_save, emit_stack_restore): Use get_insns instead of gen_sequence. * loop.c (move_movables, emit_prefetch_instructions, gen_add_mult, check_dbra_loop, gen_load_of_final_value): Likewise. (loop_regs_update): Work with insn list instead of SEQUENCE rtl. (product_cheap_p): Likewise, and add commentary about RTL wastage here. * lcm.c (optimize_mode_switching): Use get_insns instead of gen_sequence. * profile.c (gen_edge_profiler): Likewise. * regmove.c (copy_src_to_dest): Likewise. * reg-stack.c (compensate_edge): Likewise and fix comment. * gcse.c (process_insert_insn): Likewise. (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. * jump.c (delete_prior_computation): Update comment. * genemit.c (gen_expand, gen_split, main): Use get_insns instead of gen_sequence, update comments to match. * recog.c (peephole2_optimize): Work with insn lists instead of SEQUENCE rtl. * sched-vis.c (print_pattern): Abort on SEQUENCE. * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): Use get_insns instead of gen_sequence. (copy_loop_body): Likewise and don't emit dummy NOTE. * genrecog.c: Don't mention SEQUENCE rtl in comments. * combine.c (try_combine): Expect insn lists from split generator. * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by hand. From-SVN: r54497
2002-06-11 14:22:48 +02:00
rtl as an INSN list.
This program also generates the function `peephole2_insns', which
returns 0 if the rtl could not be matched. If there was a match,
Delete SEQUENCE rtl usage outside of reorg and ssa passes. 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. * rtl.h (gen_sequence, emit_insns, emit_insns_before, emit_insns_before_scope, emit_insns_after, emit_insns_after_scope): Delete declaration. * ada/misc.c (insert_code_for): Use emit_insn* instead of emit_insns_foo. * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. (alpha_set_memflags): Fix comment. (set_frame_related_p): Use get_insns instead of gen_sequence. * config/alpha/alpha.md (setjmp receiver splitter): Avoid emitting no insns. * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of gen_sequence. (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/ia64/ia64.md (conditional move spliiter): Avoid emitting no insns. * config/m32r/m32r.c (gen_split_move_double): Use get_insns instead of gen_sequence. * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_need_epilogue): Likewise. * config/sparc/sparc.md (current_function_calls_alloca, flat): New attributes. (setjmp pattern and split): Use them to avoid splitter which emits no RTL. * genattrtab.c (main): Emit include of function.h * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use get_insns instead of gen_sequence. * config/cris/cris.c (cris_split_movdx): Likewise. * emit-rtl.c (emit_insns*): Kill. (try_split): Expect insn list instead of SEQUENCE. (make_jump_insn_raw, make_call_insn_raw): Fix comments. (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. Make them abort if a SEQUENCE is given and RTL checking is enabled. (emit_*_scope): Don't forget to set scope on final insn. (gen_sequence): Move from here... * ssa.c (gen_sequence): To here as private function. * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix comments. (expand_builtin_return, expand_builtin_mathfn): Likewise. (expand_builtin_strlen): Use get_insns instead of gen_sequence. (expand_builtin_saveregs): Use emit_insn_foo, fix comments. (expand_builtin_expect_jump): Use get_insns and fix comments. * calls.c (try_to_integrate): Use emit_insn_foo. (expand_call, emit_library_call_value_1): Likewise. * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. (emit_move_insn_1): Use get_insns instead of gen_sequence. (expand_expr): Use emit_insn_foo. * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. * except.c (build_post_landing_pads): Likewise. * flow.c (attempt_auto_inc): Likewise. * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, expand_nl_goto_receivers, expand_decl_cleanup): Likewise. * function.c (fixup_var_refs_insn): Use get_insns instead of gen_sequence. (fixup_var_refs_1): Likewise and expect insn list from gen_foo. (fixup_memory_subreg): Use get_insns instead of gen_sequence. (fixup_stack_1, purge_addressof_1, expand_main_function, get_arg_pointer_save_area): Likewise. (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, expand_function_end): Use emit_insn_foo. (record_insns, keep_stack_depressed): Work with insn list instead of SEQUENCE, fix comments. * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, noce_try_store_flag_constants, noce_try_store_flag_inc, noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Use emit_insn_foo. (noce_process_if_block): Use get_insns instead of gen_sequence. * optabs.c (add_equal_note): Work with insn list, fix comments. (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. (expand_unop, expand_complex_abs, expand_unop_insn, expand_no_conflict_block): Likewise. (gen_move_insn): Use get_insns instead of gen_sequence. (gen_cond_trap): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. (emit_initial_value_sets): Use emit_insn_foo. * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently now that RTL generators give insn lists. * sibcall.c (replace_call_placeholder): Use emit_insn_foo. * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns instead of gen_sequence. (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. * explow.c (emit_stack_save, emit_stack_restore): Use get_insns instead of gen_sequence. * loop.c (move_movables, emit_prefetch_instructions, gen_add_mult, check_dbra_loop, gen_load_of_final_value): Likewise. (loop_regs_update): Work with insn list instead of SEQUENCE rtl. (product_cheap_p): Likewise, and add commentary about RTL wastage here. * lcm.c (optimize_mode_switching): Use get_insns instead of gen_sequence. * profile.c (gen_edge_profiler): Likewise. * regmove.c (copy_src_to_dest): Likewise. * reg-stack.c (compensate_edge): Likewise and fix comment. * gcse.c (process_insert_insn): Likewise. (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. * jump.c (delete_prior_computation): Update comment. * genemit.c (gen_expand, gen_split, main): Use get_insns instead of gen_sequence, update comments to match. * recog.c (peephole2_optimize): Work with insn lists instead of SEQUENCE rtl. * sched-vis.c (print_pattern): Abort on SEQUENCE. * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): Use get_insns instead of gen_sequence. (copy_loop_body): Likewise and don't emit dummy NOTE. * genrecog.c: Don't mention SEQUENCE rtl in comments. * combine.c (try_combine): Expect insn lists from split generator. * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by hand. From-SVN: r54497
2002-06-11 14:22:48 +02:00
the new rtl is returned in an INSN list, and LAST_INSN will point
to the last recognized insn in the old sequence. */
1991-11-24 20:57:16 +01:00
#include "bconfig.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
1991-11-24 20:57:16 +01:00
#include "rtl.h"
#include "errors.h"
Makefile.in (READ_MD_H): New variable. gcc/ * Makefile.in (READ_MD_H): New variable. (BUILD_RTL): Add build/read-md.o. (lto-wrapper.o): Depend on coretypes.h instead of defaults.h. (build/gensupport.o, build/read-rtl.o, build/genattr.o) (build/genattrtab.o, build/genconditions.o build/genemit.o) (build/genextract.o, build/genflags.o, build/genoutput.o) (build/genpreds.o, build/genrecog.o): Depend on $(READ_MD_H). (build/read-md.o): New rule. * defaults.h (obstack_chunk_alloc, obstack_chunk_free) (OBSTACK_CHUNK_SIZE, gcc_obstack_init): Move to... * coretypes.h: ...here. * lto-wrapper.c: Include coretypes.h instead of defaults.h. * pretty-print.c (obstack_chunk_alloc, obstack_chunk_free): Delete. * genattr.c: Include read-md.h. * genattrtab.c: Likewise. * genconditions.c: Likewise. * genemit.c: Likewise. * genextract.c: Likewise. * genflags.c: Likewise. * genoutput.c: Likewise. * genpreds.c: Likewise. * genrecog.c: Likewise. * rtl.h (read_skip_spaces, copy_rtx_ptr_loc, print_rtx_ptr_loc) (join_c_conditions, print_c_condition, read_rtx_filename) (read_rtx_lineno): Move to read-md.h. * read-rtl.c: Include read-md.h. (ptr_loc, string_obstack, ptr_locs, ptr_loc_obstack) (joined_conditions, joined_conditions_obstack, read_rtx_lineno) (read_rtx_filename, fatal_with_file_and_line, fatal_expected_char) (leading_ptr_hash, leading_ptr_eq_p, set_rtx_ptr_loc, get_rtx_ptr_loc) (copy_rtx_ptr_loc, print_rtx_ptr_loc, join_c_conditions) (print_c_condition, read_skip_spaces, read_escape, read_quoted_string) (read_braced_string, read_string): Move to read-md.c. (read_rtx): Move some initialization to init_md_reader and call init_md_reader here. * gensupport.h (message_with_line, n_comma_elts, scan_comma_elt): Move to read-md.h. * gensupport.c: Include read-md.h. (message_with_line, n_comma_elts, scan_comma_elt): Move to read-md.c. * read-md.h, read-md.c: New files. From-SVN: r160570
2010-06-10 22:21:23 +02:00
#include "read-md.h"
#include "gensupport.h"
1991-11-24 20:57:16 +01:00
#define OUTPUT_LABEL(INDENT_STRING, LABEL_NUMBER) \
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
printf ("%sL%d: ATTRIBUTE_UNUSED_LABEL\n", (INDENT_STRING), (LABEL_NUMBER))
/* Ways of obtaining an rtx to be tested. */
enum position_type {
/* PATTERN (peep2_next_insn (ARG)). */
POS_PEEP2_INSN,
/* XEXP (BASE, ARG). */
POS_XEXP,
/* XVECEXP (BASE, 0, ARG). */
POS_XVECEXP0
};
/* The position of an rtx relative to X0. Each useful position is
represented by exactly one instance of this structure. */
struct position
{
/* The parent rtx. This is the root position for POS_PEEP2_INSNs. */
struct position *base;
/* A position with the same BASE and TYPE, but with the next value
of ARG. */
struct position *next;
/* A list of all POS_XEXP positions that use this one as their base,
chained by NEXT fields. The first entry represents XEXP (this, 0),
the second represents XEXP (this, 1), and so on. */
struct position *xexps;
/* A list of POS_XVECEXP0 positions that use this one as their base,
chained by NEXT fields. The first entry represents XVECEXP (this, 0, 0),
the second represents XVECEXP (this, 0, 1), and so on. */
struct position *xvecexp0s;
/* The type of position. */
enum position_type type;
/* The argument to TYPE (shown as ARG in the position_type comments). */
int arg;
/* The depth of this position, with 0 as the root. */
int depth;
};
/* A listhead of decision trees. The alternatives to a node are kept
in a doubly-linked list so we can easily add nodes to the proper
place when merging. */
struct decision_head
{
struct decision *first;
struct decision *last;
};
basic-block.h (enum profile_status): Break out of struct control_flow_graph. ./: * basic-block.h (enum profile_status): Break out of struct control_flow_graph. * cgraph.h (struct inline_summary): Break out of struct cgraph_local_info. * cgraphunit.c (enum cgraph_order_sort_kind): New enum, broken out of struct cgraph_order_sort. * combine.c (enum undo_kind): New enum, broken out of struct undo. * cse.c (struct branch_path): Break out of struct cse_basic_block_data. * except.h (enum eh_region_type): Break out of struct eh_region. * gcc.c (enum add_del): Break out of struct modify_target. * genrecog.c (enum decision_type): Break out of struct decision_test. * ggc-page.c (struct ggc_pch_ondisk): Break out of struct ggc_pch_data. * matrix-reorg.c (struct free_info): Break out of struct matrix_info. * regmove.c (enum match_use): New enum, broken out of struct match. * sched-int.h (enum post_call_group): New enum, broken out of struct deps. (struct deps_reg): Break out of struct deps. * target.h (struct asm_int_op): Break out of struct gcc_target. * tree-eh.c (struct goto_queue_node): Break out of struct leh_tf_state. * tree-inline.h (enum copy_body_cge_which): Break out of copy_body_data. * tree-pass.h (enum opt_pass_type): Break out of struct opt_pass. * c-decl.c (in_struct, struct_types): New static variables. (pushtag): Add loc parameter. Change all callers. (lookup_tag): Add ploc parameter. Change all callers. (check_compound_literal_type): New function. (parser_xref_tag): Add loc parameter. Change all callers. If -Wc++-compat, warn about struct/union/enum types defined within a struct or union. (start_struct): Add enclosing_in_struct, enclosing_struct_types, and loc parameters. Change all callers. Change error calls to error_at, using loc. For a redefinition, if the location of the original definition is known, report it. Set in_struct and struct_types. If -Wc++-compat warn if in sizeof, typeof, or alignof. (finish_struct): Add new parameters enclosing_in_struct and enclosing_struct_types. Change all callers. Set C_TYPE_DEFINED_IN_STRUCT for all struct/union/enum types defined in the struct. If in a struct, add this struct to struct_types. (start_enum): Add loc parameter. Change all callers. Use error_at for errors, using loc. For a redefinition, if the location of the original definition is known, report it. If in a struct, add this enum type to struct_types. If -Wc++-compat warn if in sizeof, typeof, or alignof. * c-parser.c (disable_extension_diagnostics): Disable -Wc++-compat. (enable_extension_diagnostics): Reenable -Wc++-compat if appropriate. (c_parser_enum_specifier): Get enum location for start_enum. (c_parser_struct_or_union_specifier): Get struct location for start_struct. Save in_struct and struct_types status between start_struct and finish_struct. (c_parser_cast_expression): Get location of cast. (c_parser_alignof_expression): Get location of type. (c_parser_postfix_expression): Likewise. (c_parser_postfix_expression_after_paren_type): Add type_loc parameter. Change all callers. Call check_compound_literal_type. Use type_loc for error about variable size type. * c-typeck.c (build_external_ref): If -Wc++-compat, warn about a use of an enum constant from an enum type defined in a struct or union. (c_cast_expr): Add loc parameter. Change all callers. If -Wc++-compat, warn about defining a type in a cast. * c-tree.h (C_TYPE_DEFINED_IN_STRUCT): Define. (start_enum, start_struct, finish_struct): Update declarations. (parser_xref_tag, c_cast_expr): Update declarations. (check_compound_literal_type): Declare. fortran/: * gfortran.h (enum gfc_omp_sched_kind): New enum, broken out of gfc_omp_clauses. (enum gfc_omp_default_sharing): Likewise. * module.c (enum gfc_rsym_state): New enum, broken out of pointer_info. (enum gfc_wsym_state): Likewise. * parse.c (enum state_order): New enum, broken out of st_state. objc/: * objc-act.c (objc_building_struct): New static variable. (objc_in_struct, objc_struct_types): New static variables. (objc_start_struct, objc_finish_struct): New static functions. (generate_struct_by_value_array): Call objc_start_struct instead of start_struct, and call objc_finish_struct instead of finish_struct. (objc_build_struct, build_objc_symtab_template): Likewise. (build_module_descriptor): Likewise. (build_next_objc_exception_stuff): Likewise. (build_protocol_template): Likewise. (build_method_prototype_list_template): Likewise. (build_method_prototype_template): Likewise. (build_category_template, build_selector_template): Likewise. (build_class_template, build_super_template): Likewise. (build_ivar_template, build_ivar_list_template): Likewise. (build_method_list_template): Likewise. (build_method_template): Likewise. objcp/: * objcp-decl.h (start_struct): Add three new, ignored, macro parameters. (finish_struct): Add two new, ignored, macro parameters. testsuite/: * gcc.dg/Wcxx-compat-7.c: New testcase. * gcc.dg/Wcxx-compat-8.c: New testcase. * gcc.dg/c99-tag-1.c: Recognize new "originally defined here" notes * gcc.dg/pr17188-1.c: Likewise. * gcc.dg/pr39084.c: Likewise. From-SVN: r147358
2009-05-11 03:02:40 +02:00
/* These types are roughly in the order in which we'd like to test them. */
enum decision_type
{
DT_num_insns,
DT_mode, DT_code, DT_veclen,
DT_elt_zero_int, DT_elt_one_int, DT_elt_zero_wide, DT_elt_zero_wide_safe,
DT_const_int,
DT_veclen_ge, DT_dup, DT_pred, DT_c_test,
DT_accept_op, DT_accept_insn
};
/* A single test. The two accept types aren't tests per-se, but
their equality (or lack thereof) does affect tree merging so
it is convenient to keep them here. */
struct decision_test
{
/* A linked list through the tests attached to a node. */
struct decision_test *next;
basic-block.h (enum profile_status): Break out of struct control_flow_graph. ./: * basic-block.h (enum profile_status): Break out of struct control_flow_graph. * cgraph.h (struct inline_summary): Break out of struct cgraph_local_info. * cgraphunit.c (enum cgraph_order_sort_kind): New enum, broken out of struct cgraph_order_sort. * combine.c (enum undo_kind): New enum, broken out of struct undo. * cse.c (struct branch_path): Break out of struct cse_basic_block_data. * except.h (enum eh_region_type): Break out of struct eh_region. * gcc.c (enum add_del): Break out of struct modify_target. * genrecog.c (enum decision_type): Break out of struct decision_test. * ggc-page.c (struct ggc_pch_ondisk): Break out of struct ggc_pch_data. * matrix-reorg.c (struct free_info): Break out of struct matrix_info. * regmove.c (enum match_use): New enum, broken out of struct match. * sched-int.h (enum post_call_group): New enum, broken out of struct deps. (struct deps_reg): Break out of struct deps. * target.h (struct asm_int_op): Break out of struct gcc_target. * tree-eh.c (struct goto_queue_node): Break out of struct leh_tf_state. * tree-inline.h (enum copy_body_cge_which): Break out of copy_body_data. * tree-pass.h (enum opt_pass_type): Break out of struct opt_pass. * c-decl.c (in_struct, struct_types): New static variables. (pushtag): Add loc parameter. Change all callers. (lookup_tag): Add ploc parameter. Change all callers. (check_compound_literal_type): New function. (parser_xref_tag): Add loc parameter. Change all callers. If -Wc++-compat, warn about struct/union/enum types defined within a struct or union. (start_struct): Add enclosing_in_struct, enclosing_struct_types, and loc parameters. Change all callers. Change error calls to error_at, using loc. For a redefinition, if the location of the original definition is known, report it. Set in_struct and struct_types. If -Wc++-compat warn if in sizeof, typeof, or alignof. (finish_struct): Add new parameters enclosing_in_struct and enclosing_struct_types. Change all callers. Set C_TYPE_DEFINED_IN_STRUCT for all struct/union/enum types defined in the struct. If in a struct, add this struct to struct_types. (start_enum): Add loc parameter. Change all callers. Use error_at for errors, using loc. For a redefinition, if the location of the original definition is known, report it. If in a struct, add this enum type to struct_types. If -Wc++-compat warn if in sizeof, typeof, or alignof. * c-parser.c (disable_extension_diagnostics): Disable -Wc++-compat. (enable_extension_diagnostics): Reenable -Wc++-compat if appropriate. (c_parser_enum_specifier): Get enum location for start_enum. (c_parser_struct_or_union_specifier): Get struct location for start_struct. Save in_struct and struct_types status between start_struct and finish_struct. (c_parser_cast_expression): Get location of cast. (c_parser_alignof_expression): Get location of type. (c_parser_postfix_expression): Likewise. (c_parser_postfix_expression_after_paren_type): Add type_loc parameter. Change all callers. Call check_compound_literal_type. Use type_loc for error about variable size type. * c-typeck.c (build_external_ref): If -Wc++-compat, warn about a use of an enum constant from an enum type defined in a struct or union. (c_cast_expr): Add loc parameter. Change all callers. If -Wc++-compat, warn about defining a type in a cast. * c-tree.h (C_TYPE_DEFINED_IN_STRUCT): Define. (start_enum, start_struct, finish_struct): Update declarations. (parser_xref_tag, c_cast_expr): Update declarations. (check_compound_literal_type): Declare. fortran/: * gfortran.h (enum gfc_omp_sched_kind): New enum, broken out of gfc_omp_clauses. (enum gfc_omp_default_sharing): Likewise. * module.c (enum gfc_rsym_state): New enum, broken out of pointer_info. (enum gfc_wsym_state): Likewise. * parse.c (enum state_order): New enum, broken out of st_state. objc/: * objc-act.c (objc_building_struct): New static variable. (objc_in_struct, objc_struct_types): New static variables. (objc_start_struct, objc_finish_struct): New static functions. (generate_struct_by_value_array): Call objc_start_struct instead of start_struct, and call objc_finish_struct instead of finish_struct. (objc_build_struct, build_objc_symtab_template): Likewise. (build_module_descriptor): Likewise. (build_next_objc_exception_stuff): Likewise. (build_protocol_template): Likewise. (build_method_prototype_list_template): Likewise. (build_method_prototype_template): Likewise. (build_category_template, build_selector_template): Likewise. (build_class_template, build_super_template): Likewise. (build_ivar_template, build_ivar_list_template): Likewise. (build_method_list_template): Likewise. (build_method_template): Likewise. objcp/: * objcp-decl.h (start_struct): Add three new, ignored, macro parameters. (finish_struct): Add two new, ignored, macro parameters. testsuite/: * gcc.dg/Wcxx-compat-7.c: New testcase. * gcc.dg/Wcxx-compat-8.c: New testcase. * gcc.dg/c99-tag-1.c: Recognize new "originally defined here" notes * gcc.dg/pr17188-1.c: Likewise. * gcc.dg/pr39084.c: Likewise. From-SVN: r147358
2009-05-11 03:02:40 +02:00
enum decision_type type;
union
{
int num_insns; /* Number if insn in a define_peephole2. */
enum machine_mode mode; /* Machine mode of node. */
RTX_CODE code; /* Code to test. */
struct
{
const char *name; /* Predicate to call. */
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
const struct pred_data *data;
/* Optimization hints for this predicate. */
enum machine_mode mode; /* Machine mode for node. */
} pred;
const char *c_test; /* Additional test to perform. */
int veclen; /* Length of vector. */
int dup; /* Number of operand to compare against. */
HOST_WIDE_INT intval; /* Value for XINT for XWINT. */
int opno; /* Operand number matched. */
struct {
int code_number; /* Insn number matched. */
int lineno; /* Line number of the insn. */
int num_clobbers_to_add; /* Number of CLOBBERs to be added. */
} insn;
} u;
};
/* Data structure for decision tree for recognizing legitimate insns. */
1991-11-24 20:57:16 +01:00
struct decision
{
struct decision_head success; /* Nodes to test on success. */
struct decision *next; /* Node to test on failure. */
struct decision *prev; /* Node whose failure tests us. */
struct decision *afterward; /* Node to test on success,
but failure of successor nodes. */
struct position *position; /* Position in pattern. */
struct decision_test *tests; /* The tests for this node. */
int number; /* Node number, used for labels */
int subroutine_number; /* Number of subroutine this node starts */
int need_label; /* Label needs to be output. */
1991-11-24 20:57:16 +01:00
};
#define SUBROUTINE_THRESHOLD 100
1991-11-24 20:57:16 +01:00
static int next_subroutine_number;
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
/* We can write three types of subroutines: One for insn recognition,
one to split insns, and one for peephole-type optimizations. This
defines which type is being written. */
1991-11-24 20:57:16 +01:00
enum routine_type {
RECOG, SPLIT, PEEPHOLE2
};
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
#define IS_SPLIT(X) ((X) != RECOG)
1991-11-24 20:57:16 +01:00
/* Next available node number for tree nodes. */
1991-11-24 20:57:16 +01:00
static int next_number;
1991-11-24 20:57:16 +01:00
/* Next number to use as an insn_code. */
1991-11-24 20:57:16 +01:00
static int next_insn_code;
1991-11-24 20:57:16 +01:00
/* Record the highest depth we ever have so we know how many variables to
allocate in each subroutine we make. */
1991-11-24 20:57:16 +01:00
static int max_depth;
/* The line number of the start of the pattern currently being processed. */
static int pattern_lineno;
/* The root position (x0). */
static struct position root_pos;
/* A list of all POS_PEEP2_INSNs. The entry for insn 0 is the root position,
since we are given that instruction's pattern as x0. */
static struct position *peep2_insn_pos_list = &root_pos;
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
extern void debug_decision
(struct decision *);
extern void debug_decision_list
(struct decision *);
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
/* Return a position with the given BASE, TYPE and ARG. NEXT_PTR
points to where the unique object that represents the position
should be stored. Create the object if it doesn't already exist,
otherwise reuse the object that is already there. */
static struct position *
next_position (struct position **next_ptr, struct position *base,
enum position_type type, int arg)
{
struct position *pos;
pos = *next_ptr;
if (!pos)
{
pos = XCNEW (struct position);
pos->base = base;
pos->type = type;
pos->arg = arg;
pos->depth = base->depth + 1;
*next_ptr = pos;
}
return pos;
}
/* Compare positions POS1 and POS2 lexicographically. */
static int
compare_positions (struct position *pos1, struct position *pos2)
{
int diff;
diff = pos1->depth - pos2->depth;
if (diff < 0)
do
pos2 = pos2->base;
while (pos1->depth != pos2->depth);
else if (diff > 0)
do
pos1 = pos1->base;
while (pos1->depth != pos2->depth);
while (pos1 != pos2)
{
diff = (int) pos1->type - (int) pos2->type;
if (diff == 0)
diff = pos1->arg - pos2->arg;
pos1 = pos1->base;
pos2 = pos2->base;
}
return diff;
}
/* Create a new node in sequence after LAST. */
static struct decision *
new_decision (struct position *pos, struct decision_head *last)
1991-11-24 20:57:16 +01:00
{
struct decision *new_decision = XCNEW (struct decision);
1991-11-24 20:57:16 +01:00
new_decision->success = *last;
new_decision->position = pos;
new_decision->number = next_number++;
1991-11-24 20:57:16 +01:00
last->first = last->last = new_decision;
return new_decision;
}
/* Create a new test and link it in at PLACE. */
1991-11-24 20:57:16 +01:00
static struct decision_test *
new_decision_test (enum decision_type type, struct decision_test ***pplace)
{
struct decision_test **place = *pplace;
struct decision_test *test;
1991-11-24 20:57:16 +01:00
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
test = XNEW (struct decision_test);
test->next = *place;
test->type = type;
*place = test;
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
place = &test->next;
*pplace = place;
1991-11-24 20:57:16 +01:00
return test;
}
/* Search for and return operand N, stop when reaching node STOP. */
static rtx
find_operand (rtx pattern, int n, rtx stop)
{
const char *fmt;
RTX_CODE code;
int i, j, len;
rtx r;
if (pattern == stop)
return stop;
code = GET_CODE (pattern);
if ((code == MATCH_SCRATCH
|| code == MATCH_OPERAND
|| code == MATCH_OPERATOR
|| code == MATCH_PARALLEL)
&& XINT (pattern, 0) == n)
return pattern;
fmt = GET_RTX_FORMAT (code);
len = GET_RTX_LENGTH (code);
for (i = 0; i < len; i++)
{
switch (fmt[i])
{
case 'e': case 'u':
if ((r = find_operand (XEXP (pattern, i), n, stop)) != NULL_RTX)
return r;
break;
case 'V':
if (! XVEC (pattern, i))
break;
/* Fall through. */
case 'E':
for (j = 0; j < XVECLEN (pattern, i); j++)
if ((r = find_operand (XVECEXP (pattern, i, j), n, stop))
!= NULL_RTX)
return r;
break;
case 'i': case 'w': case '0': case 's':
break;
default:
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_unreachable ();
}
}
return NULL;
}
/* Search for and return operand M, such that it has a matching
constraint for operand N. */
static rtx
find_matching_operand (rtx pattern, int n)
{
const char *fmt;
RTX_CODE code;
int i, j, len;
rtx r;
code = GET_CODE (pattern);
if (code == MATCH_OPERAND
&& (XSTR (pattern, 2)[0] == '0' + n
|| (XSTR (pattern, 2)[0] == '%'
&& XSTR (pattern, 2)[1] == '0' + n)))
return pattern;
fmt = GET_RTX_FORMAT (code);
len = GET_RTX_LENGTH (code);
for (i = 0; i < len; i++)
{
switch (fmt[i])
{
case 'e': case 'u':
if ((r = find_matching_operand (XEXP (pattern, i), n)))
return r;
break;
case 'V':
if (! XVEC (pattern, i))
break;
/* Fall through. */
case 'E':
for (j = 0; j < XVECLEN (pattern, i); j++)
if ((r = find_matching_operand (XVECEXP (pattern, i, j), n)))
return r;
break;
case 'i': case 'w': case '0': case 's':
break;
default:
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_unreachable ();
}
}
return NULL;
}
/* In DEFINE_EXPAND, DEFINE_SPLIT, and DEFINE_PEEPHOLE2, we
don't use the MATCH_OPERAND constraint, only the predicate.
This is confusing to folks doing new ports, so help them
not make the mistake. */
static bool
constraints_supported_in_insn_p (rtx insn)
{
return !(GET_CODE (insn) == DEFINE_EXPAND
|| GET_CODE (insn) == DEFINE_SPLIT
|| GET_CODE (insn) == DEFINE_PEEPHOLE2);
}
/* Check for various errors in patterns. SET is nonnull for a destination,
and is the complete set pattern. SET_CODE is '=' for normal sets, and
'+' within a context that requires in-out constraints. */
static void
validate_pattern (rtx pattern, rtx insn, rtx set, int set_code)
{
const char *fmt;
RTX_CODE code;
size_t i, len;
int j;
code = GET_CODE (pattern);
switch (code)
{
case MATCH_SCRATCH:
{
const char constraints0 = XSTR (pattern, 1)[0];
if (!constraints_supported_in_insn_p (insn))
{
if (constraints0)
{
error_with_line (pattern_lineno,
"constraints not supported in %s",
rtx_name[GET_CODE (insn)]);
}
return;
}
/* If a MATCH_SCRATCH is used in a context requiring an write-only
or read/write register, validate that. */
if (set_code == '='
&& constraints0
&& constraints0 != '='
&& constraints0 != '+')
{
error_with_line (pattern_lineno,
"operand %d missing output reload",
XINT (pattern, 0));
}
return;
}
case MATCH_DUP:
case MATCH_OP_DUP:
case MATCH_PAR_DUP:
if (find_operand (insn, XINT (pattern, 0), pattern) == pattern)
error_with_line (pattern_lineno,
"operand %i duplicated before defined",
XINT (pattern, 0));
break;
case MATCH_OPERAND:
case MATCH_OPERATOR:
{
const char *pred_name = XSTR (pattern, 1);
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
const struct pred_data *pred;
const char *c_test;
if (GET_CODE (insn) == DEFINE_INSN)
c_test = XSTR (insn, 2);
else
c_test = XSTR (insn, 1);
if (pred_name[0] != 0)
{
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
pred = lookup_predicate (pred_name);
if (!pred)
error_with_line (pattern_lineno, "unknown predicate '%s'",
pred_name);
}
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
else
pred = 0;
if (code == MATCH_OPERAND)
{
const char constraints0 = XSTR (pattern, 2)[0];
if (!constraints_supported_in_insn_p (insn))
{
if (constraints0)
{
error_with_line (pattern_lineno,
"constraints not supported in %s",
rtx_name[GET_CODE (insn)]);
}
}
/* A MATCH_OPERAND that is a SET should have an output reload. */
else if (set && constraints0)
{
if (set_code == '+')
{
if (constraints0 == '+')
;
/* If we've only got an output reload for this operand,
we'd better have a matching input operand. */
else if (constraints0 == '='
&& find_matching_operand (insn, XINT (pattern, 0)))
;
else
error_with_line (pattern_lineno,
"operand %d missing in-out reload",
XINT (pattern, 0));
}
else if (constraints0 != '=' && constraints0 != '+')
error_with_line (pattern_lineno,
"operand %d missing output reload",
XINT (pattern, 0));
}
}
/* Allowing non-lvalues in destinations -- particularly CONST_INT --
while not likely to occur at runtime, results in less efficient
code from insn-recog.c. */
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
if (set && pred && pred->allows_non_lvalue)
error_with_line (pattern_lineno,
"destination operand %d allows non-lvalue",
XINT (pattern, 0));
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
/* A modeless MATCH_OPERAND can be handy when we can check for
multiple modes in the c_test. In most other cases, it is a
mistake. Only DEFINE_INSN is eligible, since SPLIT and
PEEP2 can FAIL within the output pattern. Exclude special
predicates, which check the mode themselves. Also exclude
predicates that allow only constants. Exclude the SET_DEST
of a call instruction, as that is a common idiom. */
if (GET_MODE (pattern) == VOIDmode
&& code == MATCH_OPERAND
&& GET_CODE (insn) == DEFINE_INSN
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
&& pred
&& !pred->special
&& pred->allows_non_const
&& strstr (c_test, "operands") == NULL
&& ! (set
&& GET_CODE (set) == SET
&& GET_CODE (SET_SRC (set)) == CALL))
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
message_with_line (pattern_lineno,
"warning: operand %d missing mode?",
XINT (pattern, 0));
return;
}
case SET:
{
enum machine_mode dmode, smode;
rtx dest, src;
dest = SET_DEST (pattern);
src = SET_SRC (pattern);
/* STRICT_LOW_PART is a wrapper. Its argument is the real
destination, and it's mode should match the source. */
if (GET_CODE (dest) == STRICT_LOW_PART)
dest = XEXP (dest, 0);
/* Find the referent for a DUP. */
if (GET_CODE (dest) == MATCH_DUP
|| GET_CODE (dest) == MATCH_OP_DUP
|| GET_CODE (dest) == MATCH_PAR_DUP)
dest = find_operand (insn, XINT (dest, 0), NULL);
if (GET_CODE (src) == MATCH_DUP
|| GET_CODE (src) == MATCH_OP_DUP
|| GET_CODE (src) == MATCH_PAR_DUP)
src = find_operand (insn, XINT (src, 0), NULL);
dmode = GET_MODE (dest);
smode = GET_MODE (src);
/* The mode of an ADDRESS_OPERAND is the mode of the memory
reference, not the mode of the address. */
if (GET_CODE (src) == MATCH_OPERAND
&& ! strcmp (XSTR (src, 1), "address_operand"))
;
/* The operands of a SET must have the same mode unless one
is VOIDmode. */
else if (dmode != VOIDmode && smode != VOIDmode && dmode != smode)
error_with_line (pattern_lineno,
"mode mismatch in set: %smode vs %smode",
GET_MODE_NAME (dmode), GET_MODE_NAME (smode));
/* If only one of the operands is VOIDmode, and PC or CC0 is
not involved, it's probably a mistake. */
else if (dmode != smode
&& GET_CODE (dest) != PC
&& GET_CODE (dest) != CC0
&& GET_CODE (src) != PC
&& GET_CODE (src) != CC0
&& !CONST_INT_P (src)
2014-05-06 18:25:05 +02:00
&& !CONST_WIDE_INT_P (src)
&& GET_CODE (src) != CALL)
{
const char *which;
which = (dmode == VOIDmode ? "destination" : "source");
message_with_line (pattern_lineno,
"warning: %s missing a mode?", which);
}
if (dest != SET_DEST (pattern))
validate_pattern (dest, insn, pattern, '=');
validate_pattern (SET_DEST (pattern), insn, pattern, '=');
validate_pattern (SET_SRC (pattern), insn, NULL_RTX, 0);
return;
}
case CLOBBER:
validate_pattern (SET_DEST (pattern), insn, pattern, '=');
return;
case ZERO_EXTRACT:
validate_pattern (XEXP (pattern, 0), insn, set, set ? '+' : 0);
validate_pattern (XEXP (pattern, 1), insn, NULL_RTX, 0);
validate_pattern (XEXP (pattern, 2), insn, NULL_RTX, 0);
return;
case STRICT_LOW_PART:
validate_pattern (XEXP (pattern, 0), insn, set, set ? '+' : 0);
return;
case LABEL_REF:
Introduce LABEL_REF_LABEL gcc/ChangeLog: 2014-09-11 David Malcolm <dmalcolm@redhat.com> * rtl.h (LABEL_REF_LABEL): New macro. * alias.c (rtx_equal_for_memref_p): Use LABEL_REF_LABEL in place of XEXP (, 0), where we know that we have a LABEL_REF. * cfgbuild.c (make_edges): Likewise. (purge_dead_tablejump_edges): Likewise. * cfgexpand.c (convert_debug_memory_address): Likewise. * cfgrtl.c (patch_jump_insn): Likewise. * combine.c (distribute_notes): Likewise. * cse.c (hash_rtx_cb): Likewise. (exp_equiv_p): Likewise. (fold_rtx): Likewise. (check_for_label_ref): Likewise. * cselib.c (rtx_equal_for_cselib_1): Likewise. (cselib_hash_rtx): Likewise. * emit-rtl.c (mark_label_nuses): Likewise. * explow.c (convert_memory_address_addr_space): Likewise. * final.c (output_asm_label): Likewise. (output_addr_const): Likewise. * gcse.c (add_label_notes): Likewise. * genconfig.c (walk_insn_part): Likewise. * genrecog.c (validate_pattern): Likewise. * ifcvt.c (cond_exec_get_condition): Likewise. (noce_emit_store_flag): Likewise. (noce_get_alt_condition): Likewise. (noce_get_condition): Likewise. * jump.c (maybe_propagate_label_ref): Likewise. (mark_jump_label_1): Likewise. (redirect_exp_1): Likewise. (rtx_renumbered_equal_p): Likewise. * lra-constraints.c (operands_match_p): Likewise. * reload.c (operands_match_p): Likewise. (find_reloads): Likewise. * reload1.c (set_label_offsets): Likewise. * reorg.c (get_branch_condition): Likewise. * rtl.c (rtx_equal_p_cb): Likewise. (rtx_equal_p): Likewise. * rtlanal.c (reg_mentioned_p): Likewise. (rtx_referenced_p): Likewise. (get_condition): Likewise. * sched-vis.c (print_value): Likewise. * varasm.c (const_hash_1): Likewise. (compare_constant): Likewise. (const_rtx_hash_1): Likewise. (output_constant_pool_1): Likewise. From-SVN: r215190
2014-09-11 22:47:39 +02:00
if (GET_MODE (LABEL_REF_LABEL (pattern)) != VOIDmode)
error_with_line (pattern_lineno,
"operand to label_ref %smode not VOIDmode",
Introduce LABEL_REF_LABEL gcc/ChangeLog: 2014-09-11 David Malcolm <dmalcolm@redhat.com> * rtl.h (LABEL_REF_LABEL): New macro. * alias.c (rtx_equal_for_memref_p): Use LABEL_REF_LABEL in place of XEXP (, 0), where we know that we have a LABEL_REF. * cfgbuild.c (make_edges): Likewise. (purge_dead_tablejump_edges): Likewise. * cfgexpand.c (convert_debug_memory_address): Likewise. * cfgrtl.c (patch_jump_insn): Likewise. * combine.c (distribute_notes): Likewise. * cse.c (hash_rtx_cb): Likewise. (exp_equiv_p): Likewise. (fold_rtx): Likewise. (check_for_label_ref): Likewise. * cselib.c (rtx_equal_for_cselib_1): Likewise. (cselib_hash_rtx): Likewise. * emit-rtl.c (mark_label_nuses): Likewise. * explow.c (convert_memory_address_addr_space): Likewise. * final.c (output_asm_label): Likewise. (output_addr_const): Likewise. * gcse.c (add_label_notes): Likewise. * genconfig.c (walk_insn_part): Likewise. * genrecog.c (validate_pattern): Likewise. * ifcvt.c (cond_exec_get_condition): Likewise. (noce_emit_store_flag): Likewise. (noce_get_alt_condition): Likewise. (noce_get_condition): Likewise. * jump.c (maybe_propagate_label_ref): Likewise. (mark_jump_label_1): Likewise. (redirect_exp_1): Likewise. (rtx_renumbered_equal_p): Likewise. * lra-constraints.c (operands_match_p): Likewise. * reload.c (operands_match_p): Likewise. (find_reloads): Likewise. * reload1.c (set_label_offsets): Likewise. * reorg.c (get_branch_condition): Likewise. * rtl.c (rtx_equal_p_cb): Likewise. (rtx_equal_p): Likewise. * rtlanal.c (reg_mentioned_p): Likewise. (rtx_referenced_p): Likewise. (get_condition): Likewise. * sched-vis.c (print_value): Likewise. * varasm.c (const_hash_1): Likewise. (compare_constant): Likewise. (const_rtx_hash_1): Likewise. (output_constant_pool_1): Likewise. From-SVN: r215190
2014-09-11 22:47:39 +02:00
GET_MODE_NAME (GET_MODE (LABEL_REF_LABEL (pattern))));
break;
default:
break;
}
fmt = GET_RTX_FORMAT (code);
len = GET_RTX_LENGTH (code);
for (i = 0; i < len; i++)
{
switch (fmt[i])
{
case 'e': case 'u':
validate_pattern (XEXP (pattern, i), insn, NULL_RTX, 0);
break;
case 'E':
for (j = 0; j < XVECLEN (pattern, i); j++)
validate_pattern (XVECEXP (pattern, i, j), insn, NULL_RTX, 0);
break;
case 'i': case 'w': case '0': case 's':
break;
default:
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_unreachable ();
}
}
}
/* Create a chain of nodes to verify that an rtl expression matches
PATTERN.
1991-11-24 20:57:16 +01:00
LAST is a pointer to the listhead in the previous node in the chain (or
in the calling function, for the first node).
1991-11-24 20:57:16 +01:00
POSITION is the current position in the insn.
1991-11-24 20:57:16 +01:00
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
INSN_TYPE is the type of insn for which we are emitting code.
A pointer to the final node in the chain is returned. */
1991-11-24 20:57:16 +01:00
static struct decision *
add_to_sequence (rtx pattern, struct decision_head *last,
struct position *pos, enum routine_type insn_type, int top)
1991-11-24 20:57:16 +01:00
{
RTX_CODE code;
struct decision *this_decision, *sub;
struct decision_test *test;
struct decision_test **place;
struct position *subpos, **subpos_ptr;
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
size_t i;
const char *fmt;
1991-11-24 20:57:16 +01:00
int len;
enum machine_mode mode;
enum position_type pos_type;
1991-11-24 20:57:16 +01:00
if (pos->depth > max_depth)
max_depth = pos->depth;
1991-11-24 20:57:16 +01:00
sub = this_decision = new_decision (pos, last);
place = &this_decision->tests;
1991-11-24 20:57:16 +01:00
mode = GET_MODE (pattern);
code = GET_CODE (pattern);
1991-11-24 20:57:16 +01:00
switch (code)
{
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
case PARALLEL:
/* Toplevel peephole pattern. */
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
if (insn_type == PEEPHOLE2 && top)
{
int num_insns;
/* Check we have sufficient insns. This avoids complications
because we then know peep2_next_insn never fails. */
num_insns = XVECLEN (pattern, 0);
if (num_insns > 1)
{
test = new_decision_test (DT_num_insns, &place);
test->u.num_insns = num_insns;
last = &sub->success;
}
else
{
/* We don't need the node we just created -- unlink it. */
last->first = last->last = NULL;
}
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
subpos_ptr = &peep2_insn_pos_list;
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
for (i = 0; i < (size_t) XVECLEN (pattern, 0); i++)
{
subpos = next_position (subpos_ptr, &root_pos,
POS_PEEP2_INSN, i);
sub = add_to_sequence (XVECEXP (pattern, 0, i),
last, subpos, insn_type, 0);
last = &sub->success;
subpos_ptr = &subpos->next;
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
}
aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New. libiberty: * aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New. * configure.in: Replace all alloca logic with a simple use of the above new macro. * config.table: Kill *-*-beos* entry. * config/mh-beos: Delete. * configure, config.in: Regenerate. * Makefile.in (ALLOCA, HFILES): Kill. (REQUIRED_OFILES): Add alloca.o. (alloca.o): Depend on libiberty.h. (argv.o): Don't depend on alloca-conf.h. * alloca-conf.h: Delete. * alloca.c: Include libiberty.h. Kill all #ifdef emacs blocks. Provide the C alloca unconditionally. Use PTR where appropriate. Make i00afunc static. * argv.c: Don't include alloca-conf.h. include: * libiberty.h: Prototype C_alloca; define alloca to either __builtin_alloca or C_alloca as appropriate. gcc: * aclocal.m4 (AM_GNU_GETTEXT): Don't AC_REQUIRE AC_FUNC_ALLOCA. * configure, config.in: Regenerate. * config.gcc: Remove references to deleted files. * genattr.c, genattrtab.c, genextract.c, genoutput.c, genrecog.c, rtl.c: Do not use alloca anywhere. * Makefile.in, build-make, system.h, config/x-interix, config/x-svr4, config/xm-interix.h, config/xm-openbsd.h, config/alpha/xm-alpha.h, config/alpha/xm-vms.h, config/arc/xm-arc.h, config/arm/xm-arm.h, config/d30v/xm-d30v.h, config/dsp16xx/xm-dsp16xx.h, config/h8300/xm-h8300.h, config/i370/x-oe, config/i370/xm-linux.h, config/i386/x-aix, config/i386/x-beos, config/i386/x-ncr3000, config/i386/x-sco5, config/i386/xm-dgux.h, config/i860/x-sysv4, config/i960/xm-i960.h, config/m32r/xm-m32r.h, config/m68k/x-crds, config/m68k/x-dpx2, config/m68k/x-hp320, config/m68k/x-hp320g, config/m69k/x-mot3300, config/m68k/x-mot3300-gas, config/m68k/xm-amix.h, config/m68k/xm-hp320.h, config/m68k/xm-m68kv.h, config/m68k/xm-mot3300.h, config/m88k/x-dolph, config/m88k/x-sysv4, config/m88k/x-tekXD88, config/m88k/xm-m88k.h, config/mcore/xm-mcore.h, config/mips/x-iris, config/mips/x-iris3, config/mips/x-sni-svr4, config/mips/x-sysv, config/mips/xm-iris6.h, config/mips/xm-mips.h, config/mips/xm-nws3250v4.h, config/pa/x-hpux, config/pa/x-pa-mpeix, config/pa/xm-pa.h, config/pa/xm-pa64hpux.h, config/pa/xm-pahpux.h, config/pa/xm-papro.h, config/romp/xm-romp.h, config/rs6000/x-aix31, config/rs6000/x-aix41, config/rs6000/x-beos, config/rs6000/x-lynx, config/rs6000/x-mach, config/rs6000/x-rs6000, config/rs6000/x-sysv4, config/rs6000/xm-rs6000.h, config/rs6000/xm-sysv4.h, config/sh/xm-sh.h, config/sparc/x-sysv4, config/sparc/xm-linux.h, config/sparc/xm-pbd.h, config/sparc/xm-sparc.h, config/vax/xm-vms.h: Eradicate all references to alloca and related stuff. * config/xm-alloca.h, config/clipper/x-clix, config/i386/xm-sysv4.h, config/i860/x-fx2800, config/i860/x-sysv3, config/m88k/x-sysv3, config/sparc/xm-sol2.h, config/we32k/x-we32k: Delete (contained only alloca related hacks). * config/i386/xm-beos.h, config/rs6000/xm-beos.h: Just define USE_C_ALLOCA. From-SVN: r40259
2001-03-06 10:52:35 +01:00
goto ret;
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
}
/* Else nothing special. */
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
break;
case MATCH_PARALLEL:
/* The explicit patterns within a match_parallel enforce a minimum
length on the vector. The match_parallel predicate may allow
for more elements. We do need to check for this minimum here
or the code generated to match the internals may reference data
beyond the end of the vector. */
test = new_decision_test (DT_veclen_ge, &place);
test->u.veclen = XVECLEN (pattern, 2);
/* Fall through. */
1991-11-24 20:57:16 +01:00
case MATCH_OPERAND:
case MATCH_SCRATCH:
case MATCH_OPERATOR:
{
RTX_CODE was_code = code;
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
const char *pred_name;
bool allows_const_int = true;
if (code == MATCH_SCRATCH)
{
pred_name = "scratch_operand";
code = UNKNOWN;
}
else
{
pred_name = XSTR (pattern, 1);
if (code == MATCH_PARALLEL)
code = PARALLEL;
else
code = UNKNOWN;
}
if (pred_name[0] != 0)
{
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
const struct pred_data *pred;
test = new_decision_test (DT_pred, &place);
test->u.pred.name = pred_name;
test->u.pred.mode = mode;
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
/* See if we know about this predicate.
If we do, remember it for use below.
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
We can optimize the generated code a little if either
(a) the predicate only accepts one code, or (b) the
2014-05-06 18:25:05 +02:00
predicate does not allow CONST_INT or CONST_WIDE_INT,
in which case it can match only if the modes match. */
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
pred = lookup_predicate (pred_name);
if (pred)
{
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
test->u.pred.data = pred;
2014-05-06 18:25:05 +02:00
allows_const_int = (pred->codes[CONST_INT]
|| pred->codes[CONST_WIDE_INT]);
if (was_code == MATCH_PARALLEL
&& pred->singleton != PARALLEL)
error_with_line (pattern_lineno,
"predicate '%s' used in match_parallel "
"does not allow only PARALLEL", pred->name);
else
code = pred->singleton;
}
else
error_with_line (pattern_lineno,
"unknown predicate '%s' in '%s' expression",
pred_name, GET_RTX_NAME (was_code));
}
/* Can't enforce a mode if we allow const_int. */
if (allows_const_int)
mode = VOIDmode;
/* Accept the operand, i.e. record it in `operands'. */
test = new_decision_test (DT_accept_op, &place);
test->u.opno = XINT (pattern, 0);
if (was_code == MATCH_OPERATOR || was_code == MATCH_PARALLEL)
{
if (was_code == MATCH_OPERATOR)
{
pos_type = POS_XEXP;
subpos_ptr = &pos->xexps;
}
else
{
pos_type = POS_XVECEXP0;
subpos_ptr = &pos->xvecexp0s;
}
for (i = 0; i < (size_t) XVECLEN (pattern, 2); i++)
{
subpos = next_position (subpos_ptr, pos, pos_type, i);
sub = add_to_sequence (XVECEXP (pattern, 2, i),
&sub->success, subpos, insn_type, 0);
subpos_ptr = &subpos->next;
}
}
goto fini;
}
1991-11-24 20:57:16 +01:00
case MATCH_OP_DUP:
code = UNKNOWN;
test = new_decision_test (DT_dup, &place);
test->u.dup = XINT (pattern, 0);
test = new_decision_test (DT_accept_op, &place);
test->u.opno = XINT (pattern, 0);
subpos_ptr = &pos->xexps;
Warning fixes: * Makefile.in (sched.o): Depend on recog.h. * alias.c (REG_BASE_VALUE): Cast the result of REGNO() macro to (unsigned) when comparing against one. (find_base_value): Likewise. (record_base_value): Cast variable `regno' to (unsigned) when comparing against one. Cast the result of REGNO() macro to (unsigned) when comparing against one. (memrefs_conflict_p): Change type of variables `r_x' and `r_y' to unsigned. (init_alias_analysis): Add unsigned variable `ui'. Use it as loop variable where an unsigned index is needed. * caller-save.c (init_caller_save): Cast `-1' to (enum insn_code) before comparing against one. * collect2.c: Add prototypes for functions `error', `fatal' and `fatal_perror'. Make these functions take variable arguments instead of faking it with a fixed number of args. (write_c_file_stat): Cast the argument of ctype macro to (unsigned char). * combine.c (can_combine_p): Mark parameter `pred' with ATTRIBUTE_UNUSED. (find_split_point): Cast variable `src' to (unsigned HOST_WIDE_INT) when comparing against one. HOST_WIDE_INT) when comparing against one. (simplify_rtx): Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_logical): Likewise. (force_to_mode): Cast result of INTVAL() macro to (unsigned HOST_WIDE_INT) when comparing against one. Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_and_const_int): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (merge_outer_ops): Cast variable const0 to `unsigned HOST_WIDE_INT' when comparing against the result of GET_MODE_MASK() macro. (simplify_comparison): Likewise for variable `c0'. Cast variable `const_op' to `unsigned HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast the result of `GET_MODE_MASK()/2' to `HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (distribute_notes): Wrap variable `cc0_setter' in macro `HAVE_cc0'. config/mips/mips.c (gen_int_relational): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (output_block_move): Cast `sizeof' expression to (int) when comparing against one. (function_arg): Cast BITS_PER_WORD to `unsigned' when comparing against one. (save_restore_insns): Cast `base_offset' to `long' to match format specifier in fprintf. * config/mips/mips.h (Pmode): Cast the result of `Pmode' macro to `enum machine_mode'. * flow.c (life_analysis_1): Remove unused variable `insn'. * gcc.c (translate_options): Move variables `j' and `k' into the scope in which they are used. Change their types to `size_t'. (set_spec): Cast the argument of ctype macro to `unsigned char'. (read_specs): Likewise. (process_command): Cast `sizeof' to (int) when comparing against one. (do_spec_1): Cast the argument of ctype macro to `unsigned char'. (handle_braces): Cast both sides of `==' expression to `long' to ensure sign matching. (main): Cast variable `i' to `int' when comparing against one. * gcov-io.h (__fetch_long): Change type of parameter `bytes' from int to size_t. Cast variable `i' to size_t when comparing against one. * genattrtab.c (convert_set_attr_alternative): Remove unused parameter `insn_code'. All callers changed. (convert_set_attr): Likewise. * genrecog.c (add_to_sequence): Cast result of XVECLEN() macro to size_t when comparing against one. Likewise for variable `len'. * global.c (global_alloc): Cast variable `max_regno' to size_t when comparing against one. Likewise for variable `max_allocno'. * jump.c (sets_cc0_p): Mark parameter `x' with ATTRIBUTE_UNUSED. * local-alloc.c (validate_equiv_mem_from_store): Mark parameter `set' with ATTRIBUTE_UNUSED. (find_free_reg): Cast `sizeof' expression to (int) when comparing against one. * loop.c (count_loop_regs_set): Remove unused variable `dest'. (strength_reduce): Mark parameter `bct_p' with ATTRIBUTE_UNUSED. (get_condition): Cast variable `const_val' to `unsigned HOST_WIDE_INT' when comparing against one. Cast unsigned expression to HOST_WIDE_INT when comparing against one. (insert_loop_mem): Mark parameter `data' with ATTRIBUTE_UNUSED. (load_mems_and_recount_loop_regs_set): Cast variable `nregs' to `unsigned' when comparing against one. * protoize.c (is_id_char): Change type of parameter `ch' to unsigned char. (munge_compile_params): Cast argument of ctype macro to (const unsigned char). (process_aux_info_file): Cast variable `aux_info_size' to int when comparing against one. (forward_to_next_token_char): Cast argument of ctype macro to `const unsigned char'. (edit_formals_lists): Likewise. (find_rightmost_formals_list): Likewise. (add_local_decl): Likewise. (add_global_decls): Likewise. (edit_fn_definition): Likewise. (do_cleaning): Likewise. (scan_for_missed_items): Likewise. (edit_file): Cast variable `orig_size' to (int) when comparing against one. (main): Cast argument of ctype macro to `const unsigned char'. * recog.c (const_int_operand): Mark parameter `mode' with ATTRIBUTE_UNUSED. * regclass.c (record_reg_classes): Change type of variable `c' to `unsigned char'. Cast `char' array index to `unsigned char'. * reload.c (push_secondary_reload): Cast argument to REG_CLASS_FROM_LETTER() macro to `unsigned char'. * reload1.c (calculate_needs): Cast `char' array index to `unsigned char'. (set_label_offsets): Change type of variable `i' to unsigned int. Cast result of XVECLEN() macro to unsigned when comparing against one. (mark_not_eliminable): Change type of variable `i' to unsigned. (order_regs_for_reload): Likewise. Cast `max_regno' to unsigned when comparing against one. (reload_as_needed): Cast macro NUM_ELIMINABLE_REGS to (int) when comparing against one. (choose_reload_regs): Hide unused label `fail'. (reload_cse_simplify_operands): Cast `char' array index to `unsigned char'. (reload_combine_note_store): Mark parameter `set' with ATTRIBUTE_UNUSED. Cast UNITS_PER_WORD to unsigned when comparing against one. (reload_cse_move2add): Remove unused variable `src2'. * sched.c: Include recog.h. (sched_note_set): Remove unused parameter `b'. All callers changed. (split_hard_reg_notes): Likewise for parameter `orig_insn'. (blockage_range): Cast result of UNIT_BLOCKED() macro to (int) when comparing against one. * stupid.c (stupid_find_reg): Mark parameter `changes_size' with ATTRIBUTE_UNUSED. Cast `sizeof' expression to (int) when comparing against one. * unroll.c (precondition_loop_p): Remove unused parameter `loop_end'. All callers changed. From-SVN: r23079
1998-10-14 11:02:55 +02:00
for (i = 0; i < (size_t) XVECLEN (pattern, 1); i++)
1991-11-24 20:57:16 +01:00
{
subpos = next_position (subpos_ptr, pos, POS_XEXP, i);
sub = add_to_sequence (XVECEXP (pattern, 1, i),
&sub->success, subpos, insn_type, 0);
subpos_ptr = &subpos->next;
1991-11-24 20:57:16 +01:00
}
goto fini;
1991-11-24 20:57:16 +01:00
case MATCH_DUP:
case MATCH_PAR_DUP:
code = UNKNOWN;
test = new_decision_test (DT_dup, &place);
test->u.dup = XINT (pattern, 0);
goto fini;
1991-11-24 20:57:16 +01:00
default:
break;
1991-11-24 20:57:16 +01:00
}
fmt = GET_RTX_FORMAT (code);
len = GET_RTX_LENGTH (code);
/* Do tests against the current node first. */
Warning fixes: * Makefile.in (sched.o): Depend on recog.h. * alias.c (REG_BASE_VALUE): Cast the result of REGNO() macro to (unsigned) when comparing against one. (find_base_value): Likewise. (record_base_value): Cast variable `regno' to (unsigned) when comparing against one. Cast the result of REGNO() macro to (unsigned) when comparing against one. (memrefs_conflict_p): Change type of variables `r_x' and `r_y' to unsigned. (init_alias_analysis): Add unsigned variable `ui'. Use it as loop variable where an unsigned index is needed. * caller-save.c (init_caller_save): Cast `-1' to (enum insn_code) before comparing against one. * collect2.c: Add prototypes for functions `error', `fatal' and `fatal_perror'. Make these functions take variable arguments instead of faking it with a fixed number of args. (write_c_file_stat): Cast the argument of ctype macro to (unsigned char). * combine.c (can_combine_p): Mark parameter `pred' with ATTRIBUTE_UNUSED. (find_split_point): Cast variable `src' to (unsigned HOST_WIDE_INT) when comparing against one. HOST_WIDE_INT) when comparing against one. (simplify_rtx): Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_logical): Likewise. (force_to_mode): Cast result of INTVAL() macro to (unsigned HOST_WIDE_INT) when comparing against one. Cast 1 to (unsigned HOST_WIDE_INT) in shift. (simplify_and_const_int): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (merge_outer_ops): Cast variable const0 to `unsigned HOST_WIDE_INT' when comparing against the result of GET_MODE_MASK() macro. (simplify_comparison): Likewise for variable `c0'. Cast variable `const_op' to `unsigned HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast the result of `GET_MODE_MASK()/2' to `HOST_WIDE_INT' when comparing against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (distribute_notes): Wrap variable `cc0_setter' in macro `HAVE_cc0'. config/mips/mips.c (gen_int_relational): Cast result of INTVAL() macro to `unsigned HOST_WIDE_INT' when comparing against one. (output_block_move): Cast `sizeof' expression to (int) when comparing against one. (function_arg): Cast BITS_PER_WORD to `unsigned' when comparing against one. (save_restore_insns): Cast `base_offset' to `long' to match format specifier in fprintf. * config/mips/mips.h (Pmode): Cast the result of `Pmode' macro to `enum machine_mode'. * flow.c (life_analysis_1): Remove unused variable `insn'. * gcc.c (translate_options): Move variables `j' and `k' into the scope in which they are used. Change their types to `size_t'. (set_spec): Cast the argument of ctype macro to `unsigned char'. (read_specs): Likewise. (process_command): Cast `sizeof' to (int) when comparing against one. (do_spec_1): Cast the argument of ctype macro to `unsigned char'. (handle_braces): Cast both sides of `==' expression to `long' to ensure sign matching. (main): Cast variable `i' to `int' when comparing against one. * gcov-io.h (__fetch_long): Change type of parameter `bytes' from int to size_t. Cast variable `i' to size_t when comparing against one. * genattrtab.c (convert_set_attr_alternative): Remove unused parameter `insn_code'. All callers changed. (convert_set_attr): Likewise. * genrecog.c (add_to_sequence): Cast result of XVECLEN() macro to size_t when comparing against one. Likewise for variable `len'. * global.c (global_alloc): Cast variable `max_regno' to size_t when comparing against one. Likewise for variable `max_allocno'. * jump.c (sets_cc0_p): Mark parameter `x' with ATTRIBUTE_UNUSED. * local-alloc.c (validate_equiv_mem_from_store): Mark parameter `set' with ATTRIBUTE_UNUSED. (find_free_reg): Cast `sizeof' expression to (int) when comparing against one. * loop.c (count_loop_regs_set): Remove unused variable `dest'. (strength_reduce): Mark parameter `bct_p' with ATTRIBUTE_UNUSED. (get_condition): Cast variable `const_val' to `unsigned HOST_WIDE_INT' when comparing against one. Cast unsigned expression to HOST_WIDE_INT when comparing against one. (insert_loop_mem): Mark parameter `data' with ATTRIBUTE_UNUSED. (load_mems_and_recount_loop_regs_set): Cast variable `nregs' to `unsigned' when comparing against one. * protoize.c (is_id_char): Change type of parameter `ch' to unsigned char. (munge_compile_params): Cast argument of ctype macro to (const unsigned char). (process_aux_info_file): Cast variable `aux_info_size' to int when comparing against one. (forward_to_next_token_char): Cast argument of ctype macro to `const unsigned char'. (edit_formals_lists): Likewise. (find_rightmost_formals_list): Likewise. (add_local_decl): Likewise. (add_global_decls): Likewise. (edit_fn_definition): Likewise. (do_cleaning): Likewise. (scan_for_missed_items): Likewise. (edit_file): Cast variable `orig_size' to (int) when comparing against one. (main): Cast argument of ctype macro to `const unsigned char'. * recog.c (const_int_operand): Mark parameter `mode' with ATTRIBUTE_UNUSED. * regclass.c (record_reg_classes): Change type of variable `c' to `unsigned char'. Cast `char' array index to `unsigned char'. * reload.c (push_secondary_reload): Cast argument to REG_CLASS_FROM_LETTER() macro to `unsigned char'. * reload1.c (calculate_needs): Cast `char' array index to `unsigned char'. (set_label_offsets): Change type of variable `i' to unsigned int. Cast result of XVECLEN() macro to unsigned when comparing against one. (mark_not_eliminable): Change type of variable `i' to unsigned. (order_regs_for_reload): Likewise. Cast `max_regno' to unsigned when comparing against one. (reload_as_needed): Cast macro NUM_ELIMINABLE_REGS to (int) when comparing against one. (choose_reload_regs): Hide unused label `fail'. (reload_cse_simplify_operands): Cast `char' array index to `unsigned char'. (reload_combine_note_store): Mark parameter `set' with ATTRIBUTE_UNUSED. Cast UNITS_PER_WORD to unsigned when comparing against one. (reload_cse_move2add): Remove unused variable `src2'. * sched.c: Include recog.h. (sched_note_set): Remove unused parameter `b'. All callers changed. (split_hard_reg_notes): Likewise for parameter `orig_insn'. (blockage_range): Cast result of UNIT_BLOCKED() macro to (int) when comparing against one. * stupid.c (stupid_find_reg): Mark parameter `changes_size' with ATTRIBUTE_UNUSED. Cast `sizeof' expression to (int) when comparing against one. * unroll.c (precondition_loop_p): Remove unused parameter `loop_end'. All callers changed. From-SVN: r23079
1998-10-14 11:02:55 +02:00
for (i = 0; i < (size_t) len; i++)
1991-11-24 20:57:16 +01:00
{
if (fmt[i] == 'i')
1991-11-24 20:57:16 +01:00
{
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_assert (i < 2);
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
if (!i)
{
test = new_decision_test (DT_elt_zero_int, &place);
test->u.intval = XINT (pattern, i);
}
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
else
{
test = new_decision_test (DT_elt_one_int, &place);
test->u.intval = XINT (pattern, i);
}
1991-11-24 20:57:16 +01:00
}
else if (fmt[i] == 'w')
1992-07-06 22:02:55 +02:00
{
/* If this value actually fits in an int, we can use a switch
statement here, so indicate that. */
enum decision_type type
= ((int) XWINT (pattern, i) == XWINT (pattern, i))
? DT_elt_zero_wide_safe : DT_elt_zero_wide;
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_assert (!i);
test = new_decision_test (type, &place);
test->u.intval = XWINT (pattern, i);
1992-07-06 22:02:55 +02:00
}
1991-11-24 20:57:16 +01:00
else if (fmt[i] == 'E')
{
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_assert (!i);
test = new_decision_test (DT_veclen, &place);
test->u.veclen = XVECLEN (pattern, i);
}
}
/* Now test our sub-patterns. */
subpos_ptr = &pos->xexps;
for (i = 0; i < (size_t) len; i++)
{
subpos = next_position (subpos_ptr, pos, POS_XEXP, i);
switch (fmt[i])
{
case 'e': case 'u':
sub = add_to_sequence (XEXP (pattern, i), &sub->success,
subpos, insn_type, 0);
break;
case 'E':
{
struct position *subpos2, **subpos2_ptr;
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
int j;
subpos2_ptr = &pos->xvecexp0s;
for (j = 0; j < XVECLEN (pattern, i); j++)
{
subpos2 = next_position (subpos2_ptr, pos, POS_XVECEXP0, j);
sub = add_to_sequence (XVECEXP (pattern, i, j),
&sub->success, subpos2, insn_type, 0);
subpos2_ptr = &subpos2->next;
}
break;
}
case 'i': case 'w':
/* Handled above. */
break;
case '0':
break;
default:
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_unreachable ();
}
subpos_ptr = &subpos->next;
}
fini:
/* Insert nodes testing mode and code, if they're still relevant,
before any of the nodes we may have added above. */
if (code != UNKNOWN)
{
place = &this_decision->tests;
test = new_decision_test (DT_code, &place);
test->u.code = code;
}
if (mode != VOIDmode)
{
place = &this_decision->tests;
test = new_decision_test (DT_mode, &place);
test->u.mode = mode;
}
/* If we didn't insert any tests or accept nodes, hork. */
gcc_assert (this_decision->tests);
aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New. libiberty: * aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New. * configure.in: Replace all alloca logic with a simple use of the above new macro. * config.table: Kill *-*-beos* entry. * config/mh-beos: Delete. * configure, config.in: Regenerate. * Makefile.in (ALLOCA, HFILES): Kill. (REQUIRED_OFILES): Add alloca.o. (alloca.o): Depend on libiberty.h. (argv.o): Don't depend on alloca-conf.h. * alloca-conf.h: Delete. * alloca.c: Include libiberty.h. Kill all #ifdef emacs blocks. Provide the C alloca unconditionally. Use PTR where appropriate. Make i00afunc static. * argv.c: Don't include alloca-conf.h. include: * libiberty.h: Prototype C_alloca; define alloca to either __builtin_alloca or C_alloca as appropriate. gcc: * aclocal.m4 (AM_GNU_GETTEXT): Don't AC_REQUIRE AC_FUNC_ALLOCA. * configure, config.in: Regenerate. * config.gcc: Remove references to deleted files. * genattr.c, genattrtab.c, genextract.c, genoutput.c, genrecog.c, rtl.c: Do not use alloca anywhere. * Makefile.in, build-make, system.h, config/x-interix, config/x-svr4, config/xm-interix.h, config/xm-openbsd.h, config/alpha/xm-alpha.h, config/alpha/xm-vms.h, config/arc/xm-arc.h, config/arm/xm-arm.h, config/d30v/xm-d30v.h, config/dsp16xx/xm-dsp16xx.h, config/h8300/xm-h8300.h, config/i370/x-oe, config/i370/xm-linux.h, config/i386/x-aix, config/i386/x-beos, config/i386/x-ncr3000, config/i386/x-sco5, config/i386/xm-dgux.h, config/i860/x-sysv4, config/i960/xm-i960.h, config/m32r/xm-m32r.h, config/m68k/x-crds, config/m68k/x-dpx2, config/m68k/x-hp320, config/m68k/x-hp320g, config/m69k/x-mot3300, config/m68k/x-mot3300-gas, config/m68k/xm-amix.h, config/m68k/xm-hp320.h, config/m68k/xm-m68kv.h, config/m68k/xm-mot3300.h, config/m88k/x-dolph, config/m88k/x-sysv4, config/m88k/x-tekXD88, config/m88k/xm-m88k.h, config/mcore/xm-mcore.h, config/mips/x-iris, config/mips/x-iris3, config/mips/x-sni-svr4, config/mips/x-sysv, config/mips/xm-iris6.h, config/mips/xm-mips.h, config/mips/xm-nws3250v4.h, config/pa/x-hpux, config/pa/x-pa-mpeix, config/pa/xm-pa.h, config/pa/xm-pa64hpux.h, config/pa/xm-pahpux.h, config/pa/xm-papro.h, config/romp/xm-romp.h, config/rs6000/x-aix31, config/rs6000/x-aix41, config/rs6000/x-beos, config/rs6000/x-lynx, config/rs6000/x-mach, config/rs6000/x-rs6000, config/rs6000/x-sysv4, config/rs6000/xm-rs6000.h, config/rs6000/xm-sysv4.h, config/sh/xm-sh.h, config/sparc/x-sysv4, config/sparc/xm-linux.h, config/sparc/xm-pbd.h, config/sparc/xm-sparc.h, config/vax/xm-vms.h: Eradicate all references to alloca and related stuff. * config/xm-alloca.h, config/clipper/x-clix, config/i386/xm-sysv4.h, config/i860/x-fx2800, config/i860/x-sysv3, config/m88k/x-sysv3, config/sparc/xm-sol2.h, config/we32k/x-we32k: Delete (contained only alloca related hacks). * config/i386/xm-beos.h, config/rs6000/xm-beos.h: Just define USE_C_ALLOCA. From-SVN: r40259
2001-03-06 10:52:35 +01:00
ret:
return sub;
}
/* A subroutine of maybe_both_true; examines only one test.
Returns > 0 for "definitely both true" and < 0 for "maybe both true". */
static int
maybe_both_true_2 (struct decision_test *d1, struct decision_test *d2)
{
if (d1->type == d2->type)
{
switch (d1->type)
{
case DT_num_insns:
if (d1->u.num_insns == d2->u.num_insns)
return 1;
else
return -1;
case DT_mode:
return d1->u.mode == d2->u.mode;
case DT_code:
return d1->u.code == d2->u.code;
case DT_veclen:
return d1->u.veclen == d2->u.veclen;
case DT_elt_zero_int:
case DT_elt_one_int:
case DT_elt_zero_wide:
case DT_elt_zero_wide_safe:
return d1->u.intval == d2->u.intval;
default:
break;
}
}
/* If either has a predicate that we know something about, set
things up so that D1 is the one that always has a known
predicate. Then see if they have any codes in common. */
if (d1->type == DT_pred || d2->type == DT_pred)
{
if (d2->type == DT_pred)
{
struct decision_test *tmp;
tmp = d1, d1 = d2, d2 = tmp;
}
/* If D2 tests a mode, see if it matches D1. */
if (d1->u.pred.mode != VOIDmode)
{
if (d2->type == DT_mode)
{
if (d1->u.pred.mode != d2->u.mode
/* The mode of an address_operand predicate is the
mode of the memory, not the operand. It can only
be used for testing the predicate, so we must
ignore it here. */
&& strcmp (d1->u.pred.name, "address_operand") != 0)
return 0;
}
/* Don't check two predicate modes here, because if both predicates
accept CONST_INT, then both can still be true even if the modes
are different. If they don't accept CONST_INT, there will be a
separate DT_mode that will make maybe_both_true_1 return 0. */
}
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
if (d1->u.pred.data)
{
/* If D2 tests a code, see if it is in the list of valid
codes for D1's predicate. */
if (d2->type == DT_code)
{
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
if (!d1->u.pred.data->codes[d2->u.code])
return 0;
}
/* Otherwise see if the predicates have any codes in common. */
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
else if (d2->type == DT_pred && d2->u.pred.data)
1991-11-24 20:57:16 +01:00
{
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
bool common = false;
combine.c (record_value_for_reg): Change 0 to VOIDmode, twice. gcc/: * combine.c (record_value_for_reg): Change 0 to VOIDmode, twice. (record_dead_and_set_regs): Likewise. * df.h (struct df_mw_hardreg): Change flags field to int. (struct df_base_ref): Likewise. (struct df): Change changeable_flags field to int. * df-scan.c (df_defs_record): Change clobber_flags to int. * dwarf2.h (enum dwarf_tag): Make lo_user and hi_user values enum constants rather than #define macros. (enum dwarf_attribute, enum dwarf_location_atom): Likewise. (enum dwarf_type, enum dwarf_endianity_encoding): Likewise. (enum dwarf_calling_convention): Likewise. (enum dwarf_line_number_x_ops): Likewise. (enum dwarf_call_frame_info): Likewise. (enum dwarf_source_language): Likewise. * dwarf2out.c (int_loc_descriptor): Add cast to enum type. (add_calling_convention_attribute): Likewise. * fold-const.c (fold_undefer_overflow_warnings): Add cast to enum type. (combine_comparisons): Change compcode to int. Add cast to enum type. * genrecog.c (maybe_both_true_2): Change c to int. (write_switch): Likewise. Add cast to enum type. * gimplify.c (gimplify_omp_for): Handle return values from gimplify_expr using MIN rather than bitwise or. (gimplify_expr): Add cast to enum type. * ipa-prop.c (update_jump_functions_after_inlining): Change IPA_BOTTOM to IPA_JF_UNKNOWN. * ira.c (setup_class_subset_and_memory_move_costs): Change mode to int. Add casts to enum type. (setup_cover_and_important_classes): Change cl to int. Add casts to enum type. (setup_class_translate): Change cl and mode to int. (ira_init_once): Change mode to int. (free_register_move_costs): Likewise. (setup_prohibited_mode_move_regs): Add casts to enum type. * langhooks.c (add_builtin_function_common): Rework assertion that value fits bitfield. * mcf.c (add_fixup_edge): Change type parameter to edge_type. * omega.c (omega_do_elimination): Avoid math on enum types. * optabs.c (expand_vec_shift_expr): Remove casts to int. * opts.c (set_debug_level): Change 2 to enum constant. Use new int local to handle integral_argment value. * regmove.c (try_auto_increment): Change PUT_MODE to PUT_REG_NOTE_KIND. * reload.c (push_secondary_reload): Add casts to enum type. (secondary_reload_class, find_valid_class): Likewise. * reload1.c (emit_input_reload_insns): Likewise. * rtl.h (NOTE_VAR_LOCATION_STATUS): Likewise. * sel-sched.c (init_hard_regs_data): Change cur_mode to int. * sel-sched-ir.c (hash_with_unspec_callback): Change 0 to enum constant. * tree.c (build_common_builtin_nodes): Add casts to enum type. * tree-complex.c (complex_lattice_t): Typedef to int rather than enum type. (expand_complex_libcall): Add casts to enum type. * tree-into-ssa.c (get_ssa_name_ann): Change 0 to enum constant. * tree-vect-loop.c (vect_model_reduction_cost): Compare reduc_code with ERROR_MARK, not NUM_TREE_CODES. (vect_create_epilog_for_reduction): Likewise. (vectorizable_reduction): Don't initialize epiloc_reduc_code. When not using it, set it to ERROR_MARK rather than NUM_TREE_CODES. * tree-vect-patterns.c (vect_pattern_recog_1): Change vec_mode to enum machine_mode. * tree-vect-stmts.c (new_stmt_vec_info): Change 0 to vect_unused_in_loop. Change 0 to loop_vect. * tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum type. * var-tracking.c (get_init_value): Change return type to enum var_init_status. * vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T. * config/arm/arm.c (fp_model_for_fpu): Change to array to enum arm_fp_model. (arm_override_options): Add casts to enum type. (arm_emit_tls_decoration): Likewise. * config/i386/i386.c (ix86_function_specific_restore): Add casts to enum type. * config/i386/i386-c.c (ix86_pragma_target_parse): Likewise. * config/ia64/ia64.c (ia64_expand_compare): Change magic to int. * config/rs6000/rs6000.c (rs6000_override_options): Add casts to enum type. * config/s390/s390.c (code_for_builtin_64): Change to array of enum insn_code. (code_for_builtin_31): Likewise. (s390_expand_builtin): Change code_for_builtin to enum insn_code const *. * config/sparc/sparc.c (sparc_override_options): Change value field in struct code_model to enum cmodel. In initializer change 0 to NULL and add cast to enum type. * c-typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. Issue a -Wc++-compat warning using lhs_origtype if necessary. (convert_for_assignment): Issue -Wc++-compat warnings about invalid conversions to enum type on assignment. * c-common.h (build_modify_expr): Update declaration. gcc/cp/: * call.c (build_temp): Change 0 to enum constant. * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum type. * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type. * decl2.c (constrain_visibility): Likewise. * parser.c (cp_lexer_get_preprocessor_token): Likewise. (cp_parser_flags): Typedef to int rather than enum type. (cp_parser_expression_stack_entry): Change prec field to enum cp_parser_prec. * typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. gcc/fortran/: * gfortran.h (enum gfc_symbol_type): New named enum type, broken out of struct gfc_symbol. (struct gfc_symbol): Use enum gfc_symbol_type. (enum gfc_array_ref_dimen_type): New named enum type, broken out of struct gfc_array_ref). (struct gfc_array_ref): Use enum gfc_array_ref_dimen_type. (mod_pointee_as): Update declaration. * decl.c (add_global_entry): Change type to enum gfc_symbol_type. (gfc_mod_pointee_as): Change return type to "match". * module.c (mio_array_ref): Add cast to enum type. (mio_symbol): Likewise. * resolve.c (resolve_global_procedure): Change type to enum gfc_symbol_type. * trans-io.c (gfc_build_st_parameter): Change type to unsigned int. gcc/java/: * jcf-parse.c (handle_constant): Add cast to enum type. gcc/objc/: * objc-act.c (get_super_receiver): Update calls to build_modify_expr to pass new argument. gcc/testsuite/: * gcc.dg/Wcxx-compat-4.c: New testcase. From-SVN: r146735
2009-04-24 17:31:38 +02:00
int c;
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
for (c = 0; c < NUM_RTX_CODE; c++)
if (d1->u.pred.data->codes[c] && d2->u.pred.data->codes[c])
{
common = true;
break;
}
if (!common)
return 0;
1991-11-24 20:57:16 +01:00
}
}
}
/* Tests vs veclen may be known when strict equality is involved. */
if (d1->type == DT_veclen && d2->type == DT_veclen_ge)
return d1->u.veclen >= d2->u.veclen;
if (d1->type == DT_veclen_ge && d2->type == DT_veclen)
return d2->u.veclen >= d1->u.veclen;
return -1;
1991-11-24 20:57:16 +01:00
}
/* A subroutine of maybe_both_true; examines all the tests for a given node.
Returns > 0 for "definitely both true" and < 0 for "maybe both true". */
static int
maybe_both_true_1 (struct decision_test *d1, struct decision_test *d2)
{
struct decision_test *t1, *t2;
/* A match_operand with no predicate can match anything. Recognize
this by the existence of a lone DT_accept_op test. */
if (d1->type == DT_accept_op || d2->type == DT_accept_op)
return 1;
/* Eliminate pairs of tests while they can exactly match. */
while (d1 && d2 && d1->type == d2->type)
{
if (maybe_both_true_2 (d1, d2) == 0)
return 0;
d1 = d1->next, d2 = d2->next;
}
/* After that, consider all pairs. */
for (t1 = d1; t1 ; t1 = t1->next)
for (t2 = d2; t2 ; t2 = t2->next)
if (maybe_both_true_2 (t1, t2) == 0)
return 0;
return -1;
}
/* Return 0 if we can prove that there is no RTL that can match both
D1 and D2. Otherwise, return 1 (it may be that there is an RTL that
can match both or just that we couldn't prove there wasn't such an RTL).
1991-11-24 20:57:16 +01:00
TOPLEVEL is nonzero if we are to only look at the top level and not
recursively descend. */
1991-11-24 20:57:16 +01:00
static int
maybe_both_true (struct decision *d1, struct decision *d2,
int toplevel)
1991-11-24 20:57:16 +01:00
{
struct decision *p1, *p2;
int cmp;
/* Don't compare strings on the different positions in insn. Doing so
is incorrect and results in false matches from constructs like
[(set (subreg:HI (match_operand:SI "register_operand" "r") 0)
(subreg:HI (match_operand:SI "register_operand" "r") 0))]
vs
[(set (match_operand:HI "register_operand" "r")
(match_operand:HI "register_operand" "r"))]
If we are presented with such, we are recursing through the remainder
of a node's success nodes (from the loop at the end of this function).
Skip forward until we come to a position that matches.
Due to the way positions are constructed, we know that iterating
forward from the lexically lower position will run into the lexically
higher position and not the other way around. This saves a bit
of effort. */
cmp = compare_positions (d1->position, d2->position);
if (cmp != 0)
{
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_assert (!toplevel);
/* If the d2->position was lexically lower, swap. */
if (cmp > 0)
1999-09-22 08:53:35 +02:00
p1 = d1, d1 = d2, d2 = p1;
if (d1->success.first == 0)
return 1;
for (p1 = d1->success.first; p1; p1 = p1->next)
if (maybe_both_true (p1, d2, 0))
return 1;
return 0;
}
/* Test the current level. */
cmp = maybe_both_true_1 (d1->tests, d2->tests);
if (cmp >= 0)
return cmp;
/* We can't prove that D1 and D2 cannot both be true. If we are only
to check the top level, return 1. Otherwise, see if we can prove
that all choices in both successors are mutually exclusive. If
either does not have any successors, we can't prove they can't both
be true. */
if (toplevel || d1->success.first == 0 || d2->success.first == 0)
return 1;
for (p1 = d1->success.first; p1; p1 = p1->next)
for (p2 = d2->success.first; p2; p2 = p2->next)
if (maybe_both_true (p1, p2, 0))
return 1;
return 0;
}
1991-11-24 20:57:16 +01:00
/* A subroutine of nodes_identical. Examine two tests for equivalence. */
1991-11-24 20:57:16 +01:00
static int
nodes_identical_1 (struct decision_test *d1, struct decision_test *d2)
{
switch (d1->type)
1991-11-24 20:57:16 +01:00
{
case DT_num_insns:
return d1->u.num_insns == d2->u.num_insns;
case DT_mode:
return d1->u.mode == d2->u.mode;
case DT_code:
return d1->u.code == d2->u.code;
case DT_pred:
return (d1->u.pred.mode == d2->u.pred.mode
&& strcmp (d1->u.pred.name, d2->u.pred.name) == 0);
case DT_c_test:
return strcmp (d1->u.c_test, d2->u.c_test) == 0;
case DT_veclen:
case DT_veclen_ge:
return d1->u.veclen == d2->u.veclen;
case DT_dup:
return d1->u.dup == d2->u.dup;
case DT_elt_zero_int:
case DT_elt_one_int:
case DT_elt_zero_wide:
case DT_elt_zero_wide_safe:
return d1->u.intval == d2->u.intval;
case DT_accept_op:
return d1->u.opno == d2->u.opno;
case DT_accept_insn:
/* Differences will be handled in merge_accept_insn. */
return 1;
default:
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_unreachable ();
1991-11-24 20:57:16 +01:00
}
}
1991-11-24 20:57:16 +01:00
/* True iff the two nodes are identical (on one level only). Due
to the way these lists are constructed, we shouldn't have to
consider different orderings on the tests. */
1991-11-24 20:57:16 +01:00
static int
nodes_identical (struct decision *d1, struct decision *d2)
{
struct decision_test *t1, *t2;
for (t1 = d1->tests, t2 = d2->tests; t1 && t2; t1 = t1->next, t2 = t2->next)
{
if (t1->type != t2->type)
return 0;
if (! nodes_identical_1 (t1, t2))
return 0;
}
/* For success, they should now both be null. */
if (t1 != t2)
return 0;
/* Check that their subnodes are at the same position, as any one set
of sibling decisions must be at the same position. Allowing this
requires complications to find_afterward and when change_state is
invoked. */
if (d1->success.first
&& d2->success.first
&& d1->success.first->position != d2->success.first->position)
return 0;
return 1;
}
/* A subroutine of merge_trees; given two nodes that have been declared
identical, cope with two insn accept states. If they differ in the
number of clobbers, then the conflict was created by make_insn_sequence
and we can drop the with-clobbers version on the floor. If both
nodes have no additional clobbers, we have found an ambiguity in the
source machine description. */
static void
merge_accept_insn (struct decision *oldd, struct decision *addd)
1991-11-24 20:57:16 +01:00
{
struct decision_test *old, *add;
for (old = oldd->tests; old; old = old->next)
if (old->type == DT_accept_insn)
break;
if (old == NULL)
return;
for (add = addd->tests; add; add = add->next)
if (add->type == DT_accept_insn)
break;
if (add == NULL)
return;
/* If one node is for a normal insn and the second is for the base
insn with clobbers stripped off, the second node should be ignored. */
if (old->u.insn.num_clobbers_to_add == 0
&& add->u.insn.num_clobbers_to_add > 0)
{
/* Nothing to do here. */
}
else if (old->u.insn.num_clobbers_to_add > 0
&& add->u.insn.num_clobbers_to_add == 0)
{
/* In this case, replace OLD with ADD. */
old->u.insn = add->u.insn;
}
else
{
error_with_line (add->u.insn.lineno, "`%s' matches `%s'",
get_insn_name (add->u.insn.code_number),
get_insn_name (old->u.insn.code_number));
message_with_line (old->u.insn.lineno, "previous definition of `%s'",
get_insn_name (old->u.insn.code_number));
}
}
/* Merge two decision trees OLDH and ADDH, modifying OLDH destructively. */
static void
merge_trees (struct decision_head *oldh, struct decision_head *addh)
{
struct decision *next, *add;
if (addh->first == 0)
return;
if (oldh->first == 0)
{
*oldh = *addh;
return;
}
1991-11-24 20:57:16 +01:00
/* Trying to merge bits at different positions isn't possible. */
gcc_assert (oldh->first->position == addh->first->position);
for (add = addh->first; add ; add = next)
1991-11-24 20:57:16 +01:00
{
struct decision *old, *insert_before = NULL;
next = add->next;
/* The semantics of pattern matching state that the tests are
done in the order given in the MD file so that if an insn
matches two patterns, the first one will be used. However,
in practice, most, if not all, patterns are unambiguous so
that their order is independent. In that case, we can merge
identical tests and group all similar modes and codes together.
Scan starting from the end of OLDH until we reach a point
where we reach the head of the list or where we pass a
pattern that could also be true if NEW is true. If we find
an identical pattern, we can merge them. Also, record the
last node that tests the same code and mode and the last one
that tests just the same mode.
If we have no match, place NEW after the closest match we found. */
for (old = oldh->last; old; old = old->prev)
1991-11-24 20:57:16 +01:00
{
if (nodes_identical (old, add))
{
merge_accept_insn (old, add);
merge_trees (&old->success, &add->success);
goto merged_nodes;
}
if (maybe_both_true (old, add, 0))
break;
/* Insert the nodes in DT test type order, which is roughly
how expensive/important the test is. Given that the tests
are also ordered within the list, examining the first is
sufficient. */
print-rtl.c (print_rtx): Cast enums to int for comparison. * print-rtl.c (print_rtx): Cast enums to int for comparison. * c-decl.c (grokdeclarator): Cast enums to int for comparison and shifts. * c-format.c (C_STD_VER): Cast to int for comparisons. (check_function_format): Cast various enums to int for &. (maybe_read_dollar_number): Likewise. (check_format_info): Likewise. (check_format_info_main): Likewise. * expr.c (emit_move_insn_1): Cast enums to unsigned int for comparison. (safe_from_p): Likewise. * varasm.c (const_hash): Cast enum to int for %. * emit-rtl.c (init_emit_once): Use int loop variable to work around pcc enum problems with < and ++ operators. * regclass.c (init_reg_sets_1): Cast enums for comparison. (choose_hard_reg_mode): Use unsigned int to iterate over CCmodes. (regclass_init): Change enum class to int to iterate over reg_classes. * genrecog.c (merge_trees): Cast enums for comparison. * rtl.h (GET_CODE): Cast to enum rtx_code. (PUT_CODE): Cast to ENUM_BITFIELD(rtx_code). (GET_MODE): Cast to enum machine_mode. (PUT_MODE): Cast to ENUM_BITFIELD(machine_mode). (GET_NOTE_INSN_NAME): Cast enum to int. * tree.h (TREE_CODE): Cast to enum tree_code. (TREE_SET_CODE): Cast VALUE to ENUM_BITFIELD(tree_code). * timevar.c (timevar_print): Change loop variable id from enum to unsigned int. * fixinc/fixincl.c (VLEVEL): Cast enums in comparison to unsigned int. * config/i386/i386.md: Use PUT_MODE for mode assignment. * toplev.c (compile_file): Cast enum DFI to int. (decode_d_option): Likewise. From-SVN: r40193
2001-03-02 22:41:37 +01:00
if ((int) add->tests->type < (int) old->tests->type)
insert_before = old;
}
if (insert_before == NULL)
{
add->next = NULL;
add->prev = oldh->last;
oldh->last->next = add;
oldh->last = add;
}
else
{
if ((add->prev = insert_before->prev) != NULL)
add->prev->next = add;
else
oldh->first = add;
add->next = insert_before;
insert_before->prev = add;
}
merged_nodes:;
}
}
/* Walk the tree looking for sub-nodes that perform common tests.
Factor out the common test into a new node. This enables us
(depending on the test type) to emit switch statements later. */
static void
factor_tests (struct decision_head *head)
{
struct decision *first, *next;
for (first = head->first; first && first->next; first = next)
{
enum decision_type type;
struct decision *new_dec, *old_last;
type = first->tests->type;
next = first->next;
/* Want at least two compatible sequential nodes. */
if (next->tests->type != type)
continue;
1991-11-24 20:57:16 +01:00
/* Don't want all node types, just those we can turn into
switch statements. */
if (type != DT_mode
&& type != DT_code
&& type != DT_veclen
&& type != DT_elt_zero_int
&& type != DT_elt_one_int
&& type != DT_elt_zero_wide_safe)
continue;
1991-11-24 20:57:16 +01:00
/* If we'd been performing more than one test, create a new node
below our first test. */
if (first->tests->next != NULL)
{
new_dec = new_decision (first->position, &first->success);
new_dec->tests = first->tests->next;
first->tests->next = NULL;
}
/* Crop the node tree off after our first test. */
first->next = NULL;
old_last = head->last;
head->last = first;
/* For each compatible test, adjust to perform only one test in
the top level node, then merge the node back into the tree. */
do
{
struct decision_head h;
if (next->tests->next != NULL)
{
new_dec = new_decision (next->position, &next->success);
new_dec->tests = next->tests->next;
next->tests->next = NULL;
}
new_dec = next;
next = next->next;
new_dec->next = NULL;
h.first = h.last = new_dec;
1991-11-24 20:57:16 +01:00
merge_trees (head, &h);
}
while (next && next->tests->type == type);
1991-11-24 20:57:16 +01:00
/* After we run out of compatible tests, graft the remaining nodes
back onto the tree. */
if (next)
{
next->prev = head->last;
head->last->next = next;
head->last = old_last;
}
}
1991-11-24 20:57:16 +01:00
/* Recurse. */
for (first = head->first; first; first = first->next)
factor_tests (&first->success);
}
/* After factoring, try to simplify the tests on any one node.
Tests that are useful for switch statements are recognizable
by having only a single test on a node -- we'll be manipulating
nodes with multiple tests:
If we have mode tests or code tests that are redundant with
predicates, remove them. */
static void
simplify_tests (struct decision_head *head)
{
struct decision *tree;
for (tree = head->first; tree; tree = tree->next)
{
struct decision_test *a, *b;
a = tree->tests;
b = a->next;
if (b == NULL)
continue;
/* Find a predicate node. */
while (b && b->type != DT_pred)
b = b->next;
if (b)
{
/* Due to how these tests are constructed, we don't even need
to check that the mode and code are compatible -- they were
generated from the predicate in the first place. */
while (a->type == DT_mode || a->type == DT_code)
a = a->next;
tree->tests = a;
}
}
1991-11-24 20:57:16 +01:00
/* Recurse. */
for (tree = head->first; tree; tree = tree->next)
simplify_tests (&tree->success);
1991-11-24 20:57:16 +01:00
}
/* Count the number of subnodes of HEAD. If the number is high enough,
make the first node in HEAD start a separate subroutine in the C code
that is generated. */
1991-11-24 20:57:16 +01:00
static int
break_out_subroutines (struct decision_head *head, int initial)
1991-11-24 20:57:16 +01:00
{
int size = 0;
struct decision *sub;
for (sub = head->first; sub; sub = sub->next)
size += 1 + break_out_subroutines (&sub->success, 0);
if (size > SUBROUTINE_THRESHOLD && ! initial)
1991-11-24 20:57:16 +01:00
{
head->first->subroutine_number = ++next_subroutine_number;
1991-11-24 20:57:16 +01:00
size = 1;
}
return size;
}
/* For each node p, find the next alternative that might be true
when p is true. */
1991-11-24 20:57:16 +01:00
static void
find_afterward (struct decision_head *head, struct decision *real_afterward)
1991-11-24 20:57:16 +01:00
{
struct decision *p, *q, *afterward;
/* We can't propagate alternatives across subroutine boundaries.
This is not incorrect, merely a minor optimization loss. */
1991-11-24 20:57:16 +01:00
p = head->first;
afterward = (p->subroutine_number > 0 ? NULL : real_afterward);
for ( ; p ; p = p->next)
{
/* Find the next node that might be true if this one fails. */
for (q = p->next; q ; q = q->next)
if (maybe_both_true (p, q, 1))
break;
/* If we reached the end of the list without finding one,
use the incoming afterward position. */
if (!q)
q = afterward;
p->afterward = q;
if (q)
q->need_label = 1;
}
/* Recurse. */
for (p = head->first; p ; p = p->next)
if (p->success.first)
find_afterward (&p->success, p->afterward);
/* When we are generating a subroutine, record the real afterward
position in the first node where write_tree can find it, and we
can do the right thing at the subroutine call site. */
p = head->first;
if (p->subroutine_number > 0)
p->afterward = real_afterward;
}
/* Assuming that the state of argument is denoted by OLDPOS, take whatever
actions are necessary to move to NEWPOS. If we fail to move to the
new state, branch to node AFTERWARD if nonzero, otherwise return.
Failure to move to the new state can only occur if we are trying to
match multiple insns and we try to step past the end of the stream. */
static void
change_state (struct position *oldpos, struct position *newpos,
const char *indent)
{
while (oldpos->depth > newpos->depth)
oldpos = oldpos->base;
if (oldpos != newpos)
switch (newpos->type)
{
case POS_PEEP2_INSN:
printf ("%stem = peep2_next_insn (%d);\n", indent, newpos->arg);
printf ("%sx%d = PATTERN (tem);\n", indent, newpos->depth);
break;
case POS_XEXP:
change_state (oldpos, newpos->base, indent);
printf ("%sx%d = XEXP (x%d, %d);\n",
indent, newpos->depth, newpos->depth - 1, newpos->arg);
break;
case POS_XVECEXP0:
change_state (oldpos, newpos->base, indent);
printf ("%sx%d = XVECEXP (x%d, 0, %d);\n",
indent, newpos->depth, newpos->depth - 1, newpos->arg);
break;
}
}
/* Print the enumerator constant for CODE -- the upcase version of
the name. */
static void
print_code (enum rtx_code code)
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
const char *p;
for (p = GET_RTX_NAME (code); *p; p++)
putchar (TOUPPER (*p));
}
1991-11-24 20:57:16 +01:00
/* Emit code to cross an afterward link -- change state and branch. */
1991-11-24 20:57:16 +01:00
static void
write_afterward (struct decision *start, struct decision *afterward,
const char *indent)
{
if (!afterward || start->subroutine_number > 0)
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
printf ("%sgoto ret0;\n", indent);
else
{
change_state (start->position, afterward->position, indent);
printf ("%sgoto L%d;\n", indent, afterward->number);
}
}
/* Emit a HOST_WIDE_INT as an integer constant expression. We need to take
special care to avoid "decimal constant is so large that it is unsigned"
warnings in the resulting code. */
static void
print_host_wide_int (HOST_WIDE_INT val)
{
HOST_WIDE_INT min = (unsigned HOST_WIDE_INT)1 << (HOST_BITS_PER_WIDE_INT-1);
if (val == min)
printf ("(" HOST_WIDE_INT_PRINT_DEC_C "-1)", val + 1);
else
printf (HOST_WIDE_INT_PRINT_DEC_C, val);
}
/* Emit a switch statement, if possible, for an initial sequence of
nodes at START. Return the first node yet untested. */
static struct decision *
write_switch (struct decision *start, int depth)
{
struct decision *p = start;
enum decision_type type = p->tests->type;
struct decision *needs_label = NULL;
1991-11-24 20:57:16 +01:00
/* If we have two or more nodes in sequence that test the same one
thing, we may be able to use a switch statement. */
if (!p->next
|| p->tests->next
|| p->next->tests->type != type
|| p->next->tests->next
|| nodes_identical_1 (p->tests, p->next->tests))
return p;
/* DT_code is special in that we can do interesting things with
known predicates at the same time. */
if (type == DT_code)
{
char codemap[NUM_RTX_CODE];
struct decision *ret;
RTX_CODE code;
1991-11-24 20:57:16 +01:00
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
memset (codemap, 0, sizeof (codemap));
1991-11-24 20:57:16 +01:00
printf (" switch (GET_CODE (x%d))\n {\n", depth);
code = p->tests->u.code;
do
1991-11-24 20:57:16 +01:00
{
if (p != start && p->need_label && needs_label == NULL)
needs_label = p;
printf (" case ");
print_code (code);
printf (":\n goto L%d;\n", p->success.first->number);
p->success.first->need_label = 1;
codemap[code] = 1;
p = p->next;
}
while (p
&& ! p->tests->next
&& p->tests->type == DT_code
&& ! codemap[code = p->tests->u.code]);
/* If P is testing a predicate that we know about and we haven't
seen any of the codes that are valid for the predicate, we can
write a series of "case" statement, one for each possible code.
Since we are already in a switch, these redundant tests are very
cheap and will reduce the number of predicates called. */
/* Note that while we write out cases for these predicates here,
we don't actually write the test here, as it gets kinda messy.
It is trivial to leave this to later by telling our caller that
we only processed the CODE tests. */
if (needs_label != NULL)
ret = needs_label;
else
ret = p;
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
while (p && p->tests->type == DT_pred && p->tests->u.pred.data)
{
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
const struct pred_data *data = p->tests->u.pred.data;
combine.c (record_value_for_reg): Change 0 to VOIDmode, twice. gcc/: * combine.c (record_value_for_reg): Change 0 to VOIDmode, twice. (record_dead_and_set_regs): Likewise. * df.h (struct df_mw_hardreg): Change flags field to int. (struct df_base_ref): Likewise. (struct df): Change changeable_flags field to int. * df-scan.c (df_defs_record): Change clobber_flags to int. * dwarf2.h (enum dwarf_tag): Make lo_user and hi_user values enum constants rather than #define macros. (enum dwarf_attribute, enum dwarf_location_atom): Likewise. (enum dwarf_type, enum dwarf_endianity_encoding): Likewise. (enum dwarf_calling_convention): Likewise. (enum dwarf_line_number_x_ops): Likewise. (enum dwarf_call_frame_info): Likewise. (enum dwarf_source_language): Likewise. * dwarf2out.c (int_loc_descriptor): Add cast to enum type. (add_calling_convention_attribute): Likewise. * fold-const.c (fold_undefer_overflow_warnings): Add cast to enum type. (combine_comparisons): Change compcode to int. Add cast to enum type. * genrecog.c (maybe_both_true_2): Change c to int. (write_switch): Likewise. Add cast to enum type. * gimplify.c (gimplify_omp_for): Handle return values from gimplify_expr using MIN rather than bitwise or. (gimplify_expr): Add cast to enum type. * ipa-prop.c (update_jump_functions_after_inlining): Change IPA_BOTTOM to IPA_JF_UNKNOWN. * ira.c (setup_class_subset_and_memory_move_costs): Change mode to int. Add casts to enum type. (setup_cover_and_important_classes): Change cl to int. Add casts to enum type. (setup_class_translate): Change cl and mode to int. (ira_init_once): Change mode to int. (free_register_move_costs): Likewise. (setup_prohibited_mode_move_regs): Add casts to enum type. * langhooks.c (add_builtin_function_common): Rework assertion that value fits bitfield. * mcf.c (add_fixup_edge): Change type parameter to edge_type. * omega.c (omega_do_elimination): Avoid math on enum types. * optabs.c (expand_vec_shift_expr): Remove casts to int. * opts.c (set_debug_level): Change 2 to enum constant. Use new int local to handle integral_argment value. * regmove.c (try_auto_increment): Change PUT_MODE to PUT_REG_NOTE_KIND. * reload.c (push_secondary_reload): Add casts to enum type. (secondary_reload_class, find_valid_class): Likewise. * reload1.c (emit_input_reload_insns): Likewise. * rtl.h (NOTE_VAR_LOCATION_STATUS): Likewise. * sel-sched.c (init_hard_regs_data): Change cur_mode to int. * sel-sched-ir.c (hash_with_unspec_callback): Change 0 to enum constant. * tree.c (build_common_builtin_nodes): Add casts to enum type. * tree-complex.c (complex_lattice_t): Typedef to int rather than enum type. (expand_complex_libcall): Add casts to enum type. * tree-into-ssa.c (get_ssa_name_ann): Change 0 to enum constant. * tree-vect-loop.c (vect_model_reduction_cost): Compare reduc_code with ERROR_MARK, not NUM_TREE_CODES. (vect_create_epilog_for_reduction): Likewise. (vectorizable_reduction): Don't initialize epiloc_reduc_code. When not using it, set it to ERROR_MARK rather than NUM_TREE_CODES. * tree-vect-patterns.c (vect_pattern_recog_1): Change vec_mode to enum machine_mode. * tree-vect-stmts.c (new_stmt_vec_info): Change 0 to vect_unused_in_loop. Change 0 to loop_vect. * tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum type. * var-tracking.c (get_init_value): Change return type to enum var_init_status. * vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T. * config/arm/arm.c (fp_model_for_fpu): Change to array to enum arm_fp_model. (arm_override_options): Add casts to enum type. (arm_emit_tls_decoration): Likewise. * config/i386/i386.c (ix86_function_specific_restore): Add casts to enum type. * config/i386/i386-c.c (ix86_pragma_target_parse): Likewise. * config/ia64/ia64.c (ia64_expand_compare): Change magic to int. * config/rs6000/rs6000.c (rs6000_override_options): Add casts to enum type. * config/s390/s390.c (code_for_builtin_64): Change to array of enum insn_code. (code_for_builtin_31): Likewise. (s390_expand_builtin): Change code_for_builtin to enum insn_code const *. * config/sparc/sparc.c (sparc_override_options): Change value field in struct code_model to enum cmodel. In initializer change 0 to NULL and add cast to enum type. * c-typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. Issue a -Wc++-compat warning using lhs_origtype if necessary. (convert_for_assignment): Issue -Wc++-compat warnings about invalid conversions to enum type on assignment. * c-common.h (build_modify_expr): Update declaration. gcc/cp/: * call.c (build_temp): Change 0 to enum constant. * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum type. * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type. * decl2.c (constrain_visibility): Likewise. * parser.c (cp_lexer_get_preprocessor_token): Likewise. (cp_parser_flags): Typedef to int rather than enum type. (cp_parser_expression_stack_entry): Change prec field to enum cp_parser_prec. * typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. gcc/fortran/: * gfortran.h (enum gfc_symbol_type): New named enum type, broken out of struct gfc_symbol. (struct gfc_symbol): Use enum gfc_symbol_type. (enum gfc_array_ref_dimen_type): New named enum type, broken out of struct gfc_array_ref). (struct gfc_array_ref): Use enum gfc_array_ref_dimen_type. (mod_pointee_as): Update declaration. * decl.c (add_global_entry): Change type to enum gfc_symbol_type. (gfc_mod_pointee_as): Change return type to "match". * module.c (mio_array_ref): Add cast to enum type. (mio_symbol): Likewise. * resolve.c (resolve_global_procedure): Change type to enum gfc_symbol_type. * trans-io.c (gfc_build_st_parameter): Change type to unsigned int. gcc/java/: * jcf-parse.c (handle_constant): Add cast to enum type. gcc/objc/: * objc-act.c (get_super_receiver): Update calls to build_modify_expr to pass new argument. gcc/testsuite/: * gcc.dg/Wcxx-compat-4.c: New testcase. From-SVN: r146735
2009-04-24 17:31:38 +02:00
int c;
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
for (c = 0; c < NUM_RTX_CODE; c++)
if (codemap[c] && data->codes[c])
goto pred_done;
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
for (c = 0; c < NUM_RTX_CODE; c++)
if (data->codes[c])
{
fputs (" case ", stdout);
combine.c (record_value_for_reg): Change 0 to VOIDmode, twice. gcc/: * combine.c (record_value_for_reg): Change 0 to VOIDmode, twice. (record_dead_and_set_regs): Likewise. * df.h (struct df_mw_hardreg): Change flags field to int. (struct df_base_ref): Likewise. (struct df): Change changeable_flags field to int. * df-scan.c (df_defs_record): Change clobber_flags to int. * dwarf2.h (enum dwarf_tag): Make lo_user and hi_user values enum constants rather than #define macros. (enum dwarf_attribute, enum dwarf_location_atom): Likewise. (enum dwarf_type, enum dwarf_endianity_encoding): Likewise. (enum dwarf_calling_convention): Likewise. (enum dwarf_line_number_x_ops): Likewise. (enum dwarf_call_frame_info): Likewise. (enum dwarf_source_language): Likewise. * dwarf2out.c (int_loc_descriptor): Add cast to enum type. (add_calling_convention_attribute): Likewise. * fold-const.c (fold_undefer_overflow_warnings): Add cast to enum type. (combine_comparisons): Change compcode to int. Add cast to enum type. * genrecog.c (maybe_both_true_2): Change c to int. (write_switch): Likewise. Add cast to enum type. * gimplify.c (gimplify_omp_for): Handle return values from gimplify_expr using MIN rather than bitwise or. (gimplify_expr): Add cast to enum type. * ipa-prop.c (update_jump_functions_after_inlining): Change IPA_BOTTOM to IPA_JF_UNKNOWN. * ira.c (setup_class_subset_and_memory_move_costs): Change mode to int. Add casts to enum type. (setup_cover_and_important_classes): Change cl to int. Add casts to enum type. (setup_class_translate): Change cl and mode to int. (ira_init_once): Change mode to int. (free_register_move_costs): Likewise. (setup_prohibited_mode_move_regs): Add casts to enum type. * langhooks.c (add_builtin_function_common): Rework assertion that value fits bitfield. * mcf.c (add_fixup_edge): Change type parameter to edge_type. * omega.c (omega_do_elimination): Avoid math on enum types. * optabs.c (expand_vec_shift_expr): Remove casts to int. * opts.c (set_debug_level): Change 2 to enum constant. Use new int local to handle integral_argment value. * regmove.c (try_auto_increment): Change PUT_MODE to PUT_REG_NOTE_KIND. * reload.c (push_secondary_reload): Add casts to enum type. (secondary_reload_class, find_valid_class): Likewise. * reload1.c (emit_input_reload_insns): Likewise. * rtl.h (NOTE_VAR_LOCATION_STATUS): Likewise. * sel-sched.c (init_hard_regs_data): Change cur_mode to int. * sel-sched-ir.c (hash_with_unspec_callback): Change 0 to enum constant. * tree.c (build_common_builtin_nodes): Add casts to enum type. * tree-complex.c (complex_lattice_t): Typedef to int rather than enum type. (expand_complex_libcall): Add casts to enum type. * tree-into-ssa.c (get_ssa_name_ann): Change 0 to enum constant. * tree-vect-loop.c (vect_model_reduction_cost): Compare reduc_code with ERROR_MARK, not NUM_TREE_CODES. (vect_create_epilog_for_reduction): Likewise. (vectorizable_reduction): Don't initialize epiloc_reduc_code. When not using it, set it to ERROR_MARK rather than NUM_TREE_CODES. * tree-vect-patterns.c (vect_pattern_recog_1): Change vec_mode to enum machine_mode. * tree-vect-stmts.c (new_stmt_vec_info): Change 0 to vect_unused_in_loop. Change 0 to loop_vect. * tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum type. * var-tracking.c (get_init_value): Change return type to enum var_init_status. * vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T. * config/arm/arm.c (fp_model_for_fpu): Change to array to enum arm_fp_model. (arm_override_options): Add casts to enum type. (arm_emit_tls_decoration): Likewise. * config/i386/i386.c (ix86_function_specific_restore): Add casts to enum type. * config/i386/i386-c.c (ix86_pragma_target_parse): Likewise. * config/ia64/ia64.c (ia64_expand_compare): Change magic to int. * config/rs6000/rs6000.c (rs6000_override_options): Add casts to enum type. * config/s390/s390.c (code_for_builtin_64): Change to array of enum insn_code. (code_for_builtin_31): Likewise. (s390_expand_builtin): Change code_for_builtin to enum insn_code const *. * config/sparc/sparc.c (sparc_override_options): Change value field in struct code_model to enum cmodel. In initializer change 0 to NULL and add cast to enum type. * c-typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. Issue a -Wc++-compat warning using lhs_origtype if necessary. (convert_for_assignment): Issue -Wc++-compat warnings about invalid conversions to enum type on assignment. * c-common.h (build_modify_expr): Update declaration. gcc/cp/: * call.c (build_temp): Change 0 to enum constant. * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum type. * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type. * decl2.c (constrain_visibility): Likewise. * parser.c (cp_lexer_get_preprocessor_token): Likewise. (cp_parser_flags): Typedef to int rather than enum type. (cp_parser_expression_stack_entry): Change prec field to enum cp_parser_prec. * typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. gcc/fortran/: * gfortran.h (enum gfc_symbol_type): New named enum type, broken out of struct gfc_symbol. (struct gfc_symbol): Use enum gfc_symbol_type. (enum gfc_array_ref_dimen_type): New named enum type, broken out of struct gfc_array_ref). (struct gfc_array_ref): Use enum gfc_array_ref_dimen_type. (mod_pointee_as): Update declaration. * decl.c (add_global_entry): Change type to enum gfc_symbol_type. (gfc_mod_pointee_as): Change return type to "match". * module.c (mio_array_ref): Add cast to enum type. (mio_symbol): Likewise. * resolve.c (resolve_global_procedure): Change type to enum gfc_symbol_type. * trans-io.c (gfc_build_st_parameter): Change type to unsigned int. gcc/java/: * jcf-parse.c (handle_constant): Add cast to enum type. gcc/objc/: * objc-act.c (get_super_receiver): Update calls to build_modify_expr to pass new argument. gcc/testsuite/: * gcc.dg/Wcxx-compat-4.c: New testcase. From-SVN: r146735
2009-04-24 17:31:38 +02:00
print_code ((enum rtx_code) c);
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
fputs (":\n", stdout);
codemap[c] = 1;
}
printf (" goto L%d;\n", p->number);
p->need_label = 1;
p = p->next;
1991-11-24 20:57:16 +01:00
}
pred_done:
/* Make the default case skip the predicates we managed to match. */
printf (" default:\n");
if (p != ret)
1991-11-24 20:57:16 +01:00
{
if (p)
{
printf (" goto L%d;\n", p->number);
p->need_label = 1;
}
else
write_afterward (start, start->afterward, " ");
1991-11-24 20:57:16 +01:00
}
else
printf (" break;\n");
printf (" }\n");
return ret;
}
else if (type == DT_mode
|| type == DT_veclen
|| type == DT_elt_zero_int
|| type == DT_elt_one_int
|| type == DT_elt_zero_wide_safe)
{
const char *indent = "";
/* We cast switch parameter to integer, so we must ensure that the value
fits. */
if (type == DT_elt_zero_wide_safe)
{
indent = " ";
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
printf (" if ((int) XWINT (x%d, 0) == XWINT (x%d, 0))\n",
depth, depth);
}
printf ("%s switch (", indent);
switch (type)
{
case DT_mode:
printf ("GET_MODE (x%d)", depth);
break;
case DT_veclen:
printf ("XVECLEN (x%d, 0)", depth);
break;
case DT_elt_zero_int:
printf ("XINT (x%d, 0)", depth);
break;
case DT_elt_one_int:
printf ("XINT (x%d, 1)", depth);
break;
case DT_elt_zero_wide_safe:
/* Convert result of XWINT to int for portability since some C
compilers won't do it and some will. */
printf ("(int) XWINT (x%d, 0)", depth);
break;
default:
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_unreachable ();
}
printf (")\n%s {\n", indent);
do
{
/* Merge trees will not unify identical nodes if their
sub-nodes are at different levels. Thus we must check
for duplicate cases. */
struct decision *q;
for (q = start; q != p; q = q->next)
if (nodes_identical_1 (p->tests, q->tests))
goto case_done;
if (p != start && p->need_label && needs_label == NULL)
needs_label = p;
printf ("%s case ", indent);
switch (type)
{
case DT_mode:
printf ("%smode", GET_MODE_NAME (p->tests->u.mode));
break;
case DT_veclen:
printf ("%d", p->tests->u.veclen);
break;
case DT_elt_zero_int:
case DT_elt_one_int:
case DT_elt_zero_wide:
case DT_elt_zero_wide_safe:
print_host_wide_int (p->tests->u.intval);
break;
default:
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_unreachable ();
}
printf (":\n%s goto L%d;\n", indent, p->success.first->number);
p->success.first->need_label = 1;
p = p->next;
}
while (p && p->tests->type == type && !p->tests->next);
case_done:
printf ("%s default:\n%s break;\n%s }\n",
indent, indent, indent);
1991-11-24 20:57:16 +01:00
return needs_label != NULL ? needs_label : p;
}
else
{
/* None of the other tests are amenable. */
return p;
}
}
1991-11-24 20:57:16 +01:00
/* Emit code for one test. */
static void
write_cond (struct decision_test *p, int depth,
enum routine_type subroutine_type)
{
switch (p->type)
{
case DT_num_insns:
printf ("peep2_current_count >= %d", p->u.num_insns);
break;
case DT_mode:
printf ("GET_MODE (x%d) == %smode", depth, GET_MODE_NAME (p->u.mode));
break;
case DT_code:
printf ("GET_CODE (x%d) == ", depth);
print_code (p->u.code);
break;
case DT_veclen:
printf ("XVECLEN (x%d, 0) == %d", depth, p->u.veclen);
break;
case DT_elt_zero_int:
printf ("XINT (x%d, 0) == %d", depth, (int) p->u.intval);
break;
case DT_elt_one_int:
printf ("XINT (x%d, 1) == %d", depth, (int) p->u.intval);
break;
case DT_elt_zero_wide:
case DT_elt_zero_wide_safe:
printf ("XWINT (x%d, 0) == ", depth);
print_host_wide_int (p->u.intval);
break;
case DT_const_int:
printf ("x%d == const_int_rtx[MAX_SAVED_CONST_INT + (%d)]",
depth, (int) p->u.intval);
break;
case DT_veclen_ge:
printf ("XVECLEN (x%d, 0) >= %d", depth, p->u.veclen);
break;
case DT_dup:
printf ("rtx_equal_p (x%d, operands[%d])", depth, p->u.dup);
break;
case DT_pred:
printf ("%s (x%d, %smode)", p->u.pred.name, depth,
GET_MODE_NAME (p->u.pred.mode));
break;
case DT_c_test:
print_c_condition (p->u.c_test);
break;
case DT_accept_insn:
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_assert (subroutine_type == RECOG);
gcc_assert (p->u.insn.num_clobbers_to_add);
printf ("pnum_clobbers != NULL");
break;
1991-11-24 20:57:16 +01:00
default:
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_unreachable ();
}
}
1991-11-24 20:57:16 +01:00
/* Emit code for one action. The previous tests have succeeded;
TEST is the last of the chain. In the normal case we simply
perform a state change. For the `accept' tests we must do more work. */
1991-11-24 20:57:16 +01:00
static void
write_action (struct decision *p, struct decision_test *test,
int depth, int uncond, struct decision *success,
enum routine_type subroutine_type)
{
const char *indent;
int want_close = 0;
if (uncond)
indent = " ";
else if (test->type == DT_accept_op || test->type == DT_accept_insn)
{
fputs (" {\n", stdout);
indent = " ";
want_close = 1;
}
else
indent = " ";
1991-11-24 20:57:16 +01:00
if (test->type == DT_accept_op)
{
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
printf ("%soperands[%d] = x%d;\n", indent, test->u.opno, depth);
/* Only allow DT_accept_insn to follow. */
if (test->next)
{
test = test->next;
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_assert (test->type == DT_accept_insn);
}
1991-11-24 20:57:16 +01:00
}
/* Sanity check that we're now at the end of the list of tests. */
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_assert (!test->next);
1991-11-24 20:57:16 +01:00
if (test->type == DT_accept_insn)
1991-11-24 20:57:16 +01:00
{
switch (subroutine_type)
{
case RECOG:
if (test->u.insn.num_clobbers_to_add != 0)
printf ("%s*pnum_clobbers = %d;\n",
indent, test->u.insn.num_clobbers_to_add);
printf ("%sreturn %d; /* %s */\n", indent,
test->u.insn.code_number,
get_insn_name (test->u.insn.code_number));
break;
case SPLIT:
printf ("%sreturn gen_split_%d (insn, operands);\n",
indent, test->u.insn.code_number);
break;
case PEEPHOLE2:
{
int match_len = 0;
struct position *pos;
for (pos = p->position; pos; pos = pos->base)
if (pos->type == POS_PEEP2_INSN)
{
match_len = pos->arg;
break;
}
printf ("%s*_pmatch_len = %d;\n", indent, match_len);
printf ("%stem = gen_peephole2_%d (insn, operands);\n",
indent, test->u.insn.code_number);
printf ("%sif (tem != 0)\n%s return tem;\n", indent, indent);
}
break;
default:
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_unreachable ();
}
1991-11-24 20:57:16 +01:00
}
else
{
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
printf ("%sgoto L%d;\n", indent, success->number);
success->need_label = 1;
}
1991-11-24 20:57:16 +01:00
if (want_close)
fputs (" }\n", stdout);
1991-11-24 20:57:16 +01:00
}
/* Return 1 if the test is always true and has no fallthru path. Return -1
if the test does have a fallthru path, but requires that the condition be
terminated. Otherwise return 0 for a normal test. */
/* ??? is_unconditional is a stupid name for a tri-state function. */
1991-11-24 20:57:16 +01:00
static int
is_unconditional (struct decision_test *t, enum routine_type subroutine_type)
1991-11-24 20:57:16 +01:00
{
if (t->type == DT_accept_op)
return 1;
1991-11-24 20:57:16 +01:00
if (t->type == DT_accept_insn)
{
switch (subroutine_type)
{
case RECOG:
return (t->u.insn.num_clobbers_to_add == 0);
case SPLIT:
return 1;
case PEEPHOLE2:
return -1;
default:
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_unreachable ();
}
}
1991-11-24 20:57:16 +01:00
return 0;
1991-11-24 20:57:16 +01:00
}
/* Emit code for one node -- the conditional and the accompanying action.
Return true if there is no fallthru path. */
1991-11-24 20:57:16 +01:00
static int
write_node (struct decision *p, int depth,
enum routine_type subroutine_type)
1991-11-24 20:57:16 +01:00
{
struct decision_test *test, *last_test;
int uncond;
1991-11-24 20:57:16 +01:00
/* Scan the tests and simplify comparisons against small
constants. */
for (test = p->tests; test; test = test->next)
{
if (test->type == DT_code
&& test->u.code == CONST_INT
&& test->next
&& test->next->type == DT_elt_zero_wide_safe
&& -MAX_SAVED_CONST_INT <= test->next->u.intval
&& test->next->u.intval <= MAX_SAVED_CONST_INT)
{
test->type = DT_const_int;
test->u.intval = test->next->u.intval;
test->next = test->next->next;
}
}
last_test = test = p->tests;
uncond = is_unconditional (test, subroutine_type);
if (uncond == 0)
{
printf (" if (");
write_cond (test, depth, subroutine_type);
while ((test = test->next) != NULL)
{
last_test = test;
if (is_unconditional (test, subroutine_type))
break;
printf ("\n && ");
write_cond (test, depth, subroutine_type);
}
printf (")\n");
}
write_action (p, last_test, depth, uncond, p->success.first, subroutine_type);
return uncond > 0;
1991-11-24 20:57:16 +01:00
}
/* Emit code for all of the sibling nodes of HEAD. */
1991-11-24 20:57:16 +01:00
static void
write_tree_1 (struct decision_head *head, int depth,
enum routine_type subroutine_type)
1991-11-24 20:57:16 +01:00
{
struct decision *p, *next;
int uncond = 0;
for (p = head->first; p ; p = next)
{
/* The label for the first element was printed in write_tree. */
if (p != head->first && p->need_label)
OUTPUT_LABEL (" ", p->number);
/* Attempt to write a switch statement for a whole sequence. */
next = write_switch (p, depth);
if (p != next)
uncond = 0;
else
{
/* Failed -- fall back and write one node. */
uncond = write_node (p, depth, subroutine_type);
next = p->next;
}
}
/* Finished with this chain. Close a fallthru path by branching
to the afterward node. */
if (! uncond)
write_afterward (head->last, head->last->afterward, " ");
}
/* Write out the decision tree starting at HEAD. PREVPOS is the
position at the node that branched to this node. */
static void
write_tree (struct decision_head *head, struct position *prevpos,
enum routine_type type, int initial)
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
struct decision *p = head->first;
putchar ('\n');
if (p->need_label)
OUTPUT_LABEL (" ", p->number);
if (! initial && p->subroutine_number > 0)
{
static const char * const name_prefix[] = {
"recog", "split", "peephole2"
};
static const char * const call_suffix[] = {
", pnum_clobbers", "", ", _pmatch_len"
};
/* This node has been broken out into a separate subroutine.
Call it, test the result, and branch accordingly. */
if (p->afterward)
{
printf (" tem = %s_%d (x0, insn%s);\n",
name_prefix[type], p->subroutine_number, call_suffix[type]);
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
if (IS_SPLIT (type))
printf (" if (tem != 0)\n return tem;\n");
else
printf (" if (tem >= 0)\n return tem;\n");
change_state (p->position, p->afterward->position, " ");
printf (" goto L%d;\n", p->afterward->number);
}
else
{
printf (" return %s_%d (x0, insn%s);\n",
name_prefix[type], p->subroutine_number, call_suffix[type]);
}
}
else
{
change_state (prevpos, p->position, " ");
write_tree_1 (head, p->position->depth, type);
for (p = head->first; p; p = p->next)
if (p->success.first)
write_tree (&p->success, p->position, type, 0);
}
}
/* Write out a subroutine of type TYPE to do comparisons starting at
node TREE. */
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
static void
write_subroutine (struct decision_head *head, enum routine_type type)
{
int subfunction = head->first ? head->first->subroutine_number : 0;
const char *s_or_e;
char extension[32];
int i;
Use rtx_insn internally within generated functions 2014-08-21 David Malcolm <dmalcolm@redhat.com> * recog.h (insn_output_fn): Update this function typedef to match the changes below to the generated output functions, strengthening the 2nd param from rtx to rtx_insn *. * final.c (get_insn_template): Add a checked cast to rtx_insn * on insn when invoking an output function, to match the new signature of insn_output_fn with a stronger second param. * genconditions.c (write_header): In the generated code for gencondmd.c, strengthen the global "insn" from rtx to rtx_insn * to match the other changes in this patch. * genemit.c (gen_split): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their implementations. * genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of the subfunctions within the generated "recog_", "split", "peephole2" function trees from rtx to rtx_insn *. For now, the top-level generated functions ("recog", "split", "peephole2") continue to take a plain rtx for "insn", to avoid introducing dependencies on other patches. Rename this 2nd param from "insn" to "uncast_insn", and reintroduce "insn" as a local variable of type rtx_insn *, initialized at the top of the generated function with a checked cast on "uncast_insn". (make_insn_sequence): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their prototypes. * genoutput.c (process_template): Strengthen the 2nd param within the generated "output_" functions "insn" from rtx to rtx_insn *. From-SVN: r214257
2014-08-21 09:49:28 +02:00
const char *insn_param;
s_or_e = subfunction ? "static " : "";
if (subfunction)
sprintf (extension, "_%d", subfunction);
else if (type == RECOG)
extension[0] = '\0';
else
strcpy (extension, "_insns");
Use rtx_insn internally within generated functions 2014-08-21 David Malcolm <dmalcolm@redhat.com> * recog.h (insn_output_fn): Update this function typedef to match the changes below to the generated output functions, strengthening the 2nd param from rtx to rtx_insn *. * final.c (get_insn_template): Add a checked cast to rtx_insn * on insn when invoking an output function, to match the new signature of insn_output_fn with a stronger second param. * genconditions.c (write_header): In the generated code for gencondmd.c, strengthen the global "insn" from rtx to rtx_insn * to match the other changes in this patch. * genemit.c (gen_split): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their implementations. * genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of the subfunctions within the generated "recog_", "split", "peephole2" function trees from rtx to rtx_insn *. For now, the top-level generated functions ("recog", "split", "peephole2") continue to take a plain rtx for "insn", to avoid introducing dependencies on other patches. Rename this 2nd param from "insn" to "uncast_insn", and reintroduce "insn" as a local variable of type rtx_insn *, initialized at the top of the generated function with a checked cast on "uncast_insn". (make_insn_sequence): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their prototypes. * genoutput.c (process_template): Strengthen the 2nd param within the generated "output_" functions "insn" from rtx to rtx_insn *. From-SVN: r214257
2014-08-21 09:49:28 +02:00
/* For now, the top-level functions take a plain "rtx", and perform a
checked cast to "rtx_insn *" for use throughout the rest of the
function and the code it calls. */
insn_param = subfunction ? "rtx_insn *insn" : "rtx uncast_insn";
switch (type)
{
case RECOG:
printf ("%sint\n\
Use rtx_insn internally within generated functions 2014-08-21 David Malcolm <dmalcolm@redhat.com> * recog.h (insn_output_fn): Update this function typedef to match the changes below to the generated output functions, strengthening the 2nd param from rtx to rtx_insn *. * final.c (get_insn_template): Add a checked cast to rtx_insn * on insn when invoking an output function, to match the new signature of insn_output_fn with a stronger second param. * genconditions.c (write_header): In the generated code for gencondmd.c, strengthen the global "insn" from rtx to rtx_insn * to match the other changes in this patch. * genemit.c (gen_split): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their implementations. * genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of the subfunctions within the generated "recog_", "split", "peephole2" function trees from rtx to rtx_insn *. For now, the top-level generated functions ("recog", "split", "peephole2") continue to take a plain rtx for "insn", to avoid introducing dependencies on other patches. Rename this 2nd param from "insn" to "uncast_insn", and reintroduce "insn" as a local variable of type rtx_insn *, initialized at the top of the generated function with a checked cast on "uncast_insn". (make_insn_sequence): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their prototypes. * genoutput.c (process_template): Strengthen the 2nd param within the generated "output_" functions "insn" from rtx to rtx_insn *. From-SVN: r214257
2014-08-21 09:49:28 +02:00
recog%s (rtx x0 ATTRIBUTE_UNUSED,\n\t%s ATTRIBUTE_UNUSED,\n\tint *pnum_clobbers ATTRIBUTE_UNUSED)\n",
s_or_e, extension, insn_param);
break;
case SPLIT:
printf ("%srtx\n\
Use rtx_insn internally within generated functions 2014-08-21 David Malcolm <dmalcolm@redhat.com> * recog.h (insn_output_fn): Update this function typedef to match the changes below to the generated output functions, strengthening the 2nd param from rtx to rtx_insn *. * final.c (get_insn_template): Add a checked cast to rtx_insn * on insn when invoking an output function, to match the new signature of insn_output_fn with a stronger second param. * genconditions.c (write_header): In the generated code for gencondmd.c, strengthen the global "insn" from rtx to rtx_insn * to match the other changes in this patch. * genemit.c (gen_split): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their implementations. * genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of the subfunctions within the generated "recog_", "split", "peephole2" function trees from rtx to rtx_insn *. For now, the top-level generated functions ("recog", "split", "peephole2") continue to take a plain rtx for "insn", to avoid introducing dependencies on other patches. Rename this 2nd param from "insn" to "uncast_insn", and reintroduce "insn" as a local variable of type rtx_insn *, initialized at the top of the generated function with a checked cast on "uncast_insn". (make_insn_sequence): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their prototypes. * genoutput.c (process_template): Strengthen the 2nd param within the generated "output_" functions "insn" from rtx to rtx_insn *. From-SVN: r214257
2014-08-21 09:49:28 +02:00
split%s (rtx x0 ATTRIBUTE_UNUSED, %s ATTRIBUTE_UNUSED)\n",
s_or_e, extension, insn_param);
break;
case PEEPHOLE2:
printf ("%srtx\n\
Use rtx_insn internally within generated functions 2014-08-21 David Malcolm <dmalcolm@redhat.com> * recog.h (insn_output_fn): Update this function typedef to match the changes below to the generated output functions, strengthening the 2nd param from rtx to rtx_insn *. * final.c (get_insn_template): Add a checked cast to rtx_insn * on insn when invoking an output function, to match the new signature of insn_output_fn with a stronger second param. * genconditions.c (write_header): In the generated code for gencondmd.c, strengthen the global "insn" from rtx to rtx_insn * to match the other changes in this patch. * genemit.c (gen_split): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their implementations. * genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of the subfunctions within the generated "recog_", "split", "peephole2" function trees from rtx to rtx_insn *. For now, the top-level generated functions ("recog", "split", "peephole2") continue to take a plain rtx for "insn", to avoid introducing dependencies on other patches. Rename this 2nd param from "insn" to "uncast_insn", and reintroduce "insn" as a local variable of type rtx_insn *, initialized at the top of the generated function with a checked cast on "uncast_insn". (make_insn_sequence): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their prototypes. * genoutput.c (process_template): Strengthen the 2nd param within the generated "output_" functions "insn" from rtx to rtx_insn *. From-SVN: r214257
2014-08-21 09:49:28 +02:00
peephole2%s (rtx x0 ATTRIBUTE_UNUSED,\n\t%s ATTRIBUTE_UNUSED,\n\tint *_pmatch_len ATTRIBUTE_UNUSED)\n",
s_or_e, extension, insn_param);
break;
}
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
printf ("{\n rtx * const operands ATTRIBUTE_UNUSED = &recog_data.operand[0];\n");
for (i = 1; i <= max_depth; i++)
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
printf (" rtx x%d ATTRIBUTE_UNUSED;\n", i);
printf (" %s tem ATTRIBUTE_UNUSED;\n", IS_SPLIT (type) ? "rtx" : "int");
if (!subfunction)
printf (" recog_data.insn = NULL_RTX;\n");
Use rtx_insn internally within generated functions 2014-08-21 David Malcolm <dmalcolm@redhat.com> * recog.h (insn_output_fn): Update this function typedef to match the changes below to the generated output functions, strengthening the 2nd param from rtx to rtx_insn *. * final.c (get_insn_template): Add a checked cast to rtx_insn * on insn when invoking an output function, to match the new signature of insn_output_fn with a stronger second param. * genconditions.c (write_header): In the generated code for gencondmd.c, strengthen the global "insn" from rtx to rtx_insn * to match the other changes in this patch. * genemit.c (gen_split): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their implementations. * genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of the subfunctions within the generated "recog_", "split", "peephole2" function trees from rtx to rtx_insn *. For now, the top-level generated functions ("recog", "split", "peephole2") continue to take a plain rtx for "insn", to avoid introducing dependencies on other patches. Rename this 2nd param from "insn" to "uncast_insn", and reintroduce "insn" as a local variable of type rtx_insn *, initialized at the top of the generated function with a checked cast on "uncast_insn". (make_insn_sequence): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their prototypes. * genoutput.c (process_template): Strengthen the 2nd param within the generated "output_" functions "insn" from rtx to rtx_insn *. From-SVN: r214257
2014-08-21 09:49:28 +02:00
/* For now add the downcast to rtx_insn *, at the top of each top-level
function. */
if (!subfunction)
{
printf (" rtx_insn *insn ATTRIBUTE_UNUSED;\n");
printf (" insn = safe_as_a <rtx_insn *> (uncast_insn);\n");
}
if (head->first)
write_tree (head, &root_pos, type, 1);
else
printf (" goto ret0;\n");
printf (" ret0:\n return %d;\n}\n\n", IS_SPLIT (type) ? 0 : -1);
}
/* In break_out_subroutines, we discovered the boundaries for the
subroutines, but did not write them out. Do so now. */
1991-11-24 20:57:16 +01:00
static void
write_subroutines (struct decision_head *head, enum routine_type type)
1991-11-24 20:57:16 +01:00
{
struct decision *p;
1991-11-24 20:57:16 +01:00
for (p = head->first; p ; p = p->next)
if (p->success.first)
write_subroutines (&p->success, type);
1991-11-24 20:57:16 +01:00
if (head->first->subroutine_number > 0)
write_subroutine (head, type);
}
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
/* Begin the output file. */
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
static void
write_header (void)
{
puts ("\
/* Generated automatically by the program `genrecog' from the target\n\
machine description file. */\n\
\n\
#include \"config.h\"\n\
#include \"system.h\"\n\
#include \"coretypes.h\"\n\
#include \"tm.h\"\n\
#include \"rtl.h\"\n\
#include \"tm_p.h\"\n\
function.h: Flatten file. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * function.h: Flatten file. Remove includes, adjust prototypes to reflect only what is in function.h. (enum direction, struct args_size, struct locate_and_pad_arg_data, ADD_PARM_SIZE, SUB_PARM_SIZE, ARGS_SIZE_TREE, ARGS_SIZE_RTX): Relocate from expr.h. (ASLK_REDUCE_ALIGN, ASLK_RECORD_PAD): Relocate from rtl.h. (optimize_function_for_size_p, optimize_function_for_speed_p): Move prototypes to predict.h. (init_varasm_status): Move prototype to varasm.h. * expr.h: Adjust include files. (enum direction, struct args_size, struct locate_and_pad_arg_data, ADD_PARM_SIZE, SUB_PARM_SIZE, ARGS_SIZE_TREE, ARGS_SIZE_RTX): Move to function.h. (locate_and_pad_parm): Move prototype to function.h. * rtl.h: (assign_stack_local, ASLK_REDUCE_ALIGN, ASLK_RECORD_PAD, assign_stack_local_1, assign_stack_temp, assign_stack_temp_for_type, assign_temp, reposition_prologue_and_epilogue_notes, prologue_epilogue_contains, sibcall_epilogue_contains, update_temp_slot_address, maybe_copy_prologue_epilogue_insn, set_return_jump_label): Move prototypes to function.h. * predict.h (optimize_function_for_size_p, optimize_function_for_speed_p): Relocate prototypes from function.h. * shrink-wrap.h (emit_return_into_block, active_insn_between, convert_jumps_to_returns, emit_return_for_exit): Move prototypes to function.h. * varasm.h (init_varasm_status): Relocate prototype from function.h. * genattrtab.c (write_header): Add predict.h to include list. * genconditions.c (write_header): Add predict.h to include list. * genemit.c (main): Adjust header file includes. * gengtype.c (ifiles): Add flattened function.h header files. * genoutput.c (output_prologue): Add predict.h to include list. * genpreds.c (write_insn_preds_c): Adjust header file includes. * genrecog.c (write_header): Add flattened function.h header files. * alias.c: Adjust include files. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgrtl.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbxout.c: Likewise. * ddg.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dojump.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-streamer.h: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lcm.c: Likewise. * loop-invariant.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * passes.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtlanal.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * statistics.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * symtab.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-tailcall.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * valtrack.c: Likewise. * varasm.c: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * testsuite/g++.dg/plugin/pragma_plugin.c: Adjust include files. * config/aarch64/aarch64.c: Add flattened includes from function.h. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr-log.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/epiphany/mode-switch-use.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-cost.c: Likewise. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/score/score.c: Likewise. * config/sh/sh.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/xtensa/xtensa.c: Likewise. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * ada/gcc-interface/misc.c: Adjust include files. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * c/c-decl.c: Adjust include files. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * c-family/c-pragma.c: Adjust include files. * c-family/c-semantics.c: Likewise. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * cp/cp-tree.h: Adjust include files. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * fortran/f95-lang.c: Adjust include files. * fortran/trans-decl.c: Likewise. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * java/class.c: Adjust include files. * java/resource.c: Likewise. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * objc/objc-act.c: Adjust include files. From-SVN: r216337
2014-10-16 18:37:19 +02:00
#include \"hashtab.h\"\n\
#include \"hash-set.h\"\n\
#include \"vec.h\"\n\
#include \"machmode.h\"\n\
#include \"hard-reg-set.h\"\n\
#include \"input.h\"\n\
#include \"function.h\"\n\
#include \"insn-config.h\"\n\
#include \"recog.h\"\n\
#include \"output.h\"\n\
#include \"flags.h\"\n\
#include \"hard-reg-set.h\"\n\
ggcplug.c: Shuffle includes to include gcc-plugin.h earlier. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * testsuite/gcc.dg/plugin/ggcplug.c: Shuffle includes to include gcc-plugin.h earlier. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * c/c-typeck.c: Adjust include files. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * c-family/c-gimplify.c: Adjust include files. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * cp/cp-gimplify.c: Adjust include files. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * go/go-gcc.cc: Adjust include files. * go/go-lang.c: Ditto. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * java/java-gimplify.c: Adjust include files. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * lto/lto-lang.c: Adjust include files. * lto/lto-object.c: Ditto. * lto/lto-partition.c: Ditto. * lto/lto-symtab.c: Ditto. * lto/lto.c: Ditto. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * basic-block.h: Remove all includes. (enum profile_status_d, struct control_flow_graph): Move to cfg.h * cfg.h (profile_status_d, struct control_flow_graph): Relocate here. * Makefile.in (GTFILES): Add cfg.h to list. * cgraph.h (symbol_table::create_empty): Move to cgraph.c. * cgraph.c (symbol_table::create_empty): Relocate from cgraph.h. * genconditions.c (write_header): Add predict.h and basic-block.h to lits of includes. * genemit.c (main): Ditto. * genpreds.c (write_insn_preds_c): Ditto. * genrecog.c (write_header): Ditto. * gengtype.c (open_base_files): Add predict.h, basic-block.h, and cfg.h to list of includes. * alias.c: Adjust include files. * asan.c: Ditto. * auto-inc-dec.c: Ditto. * auto-profile.c: Ditto. * bb-reorder.c: Ditto. * bt-load.c: Ditto. * builtins.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfganal.c: Ditto. * cfgbuild.c: Ditto. * cfgcleanup.c: Ditto. * cfgexpand.c: Ditto. * cfghooks.c: Ditto. * cfgloop.c: Ditto. * cfgloopanal.c: Ditto. * cfgloopmanip.c: Ditto. * cfgrtl.c: Ditto. * cgraphbuild.c: Ditto. * cgraphclones.c: Ditto. * cgraphunit.c: Ditto. * combine-stack-adj.c: Ditto. * combine.c: Ditto. * compare-elim.c: Ditto. * coverage.c: Ditto. * cprop.c: Ditto. * cse.c: Ditto. * cselib.c: Ditto. * data-streamer-in.c: Ditto. * data-streamer-out.c: Ditto. * data-streamer.c: Ditto. * dce.c: Ditto. * ddg.c: Ditto. * ddg.h: Ditto. * df-core.c: Ditto. * df-problems.c: Ditto. * df-scan.c: Ditto. * df.h: Ditto. * dojump.c: Ditto. * dominance.c: Ditto. * domwalk.c: Ditto. * dse.c: Ditto. * dwarf2cfi.c: Ditto. * emit-rtl.c: Ditto. * et-forest.c: Ditto. * except.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * fwprop.c: Ditto. * gcc-plugin.h: Ditto. * gcse.c: Ditto. * generic-match-head.c: Ditto. * ggc-page.c: Ditto. * gimple-builder.c: Ditto. * gimple-expr.c: Ditto. * gimple-fold.c: Ditto. * gimple-iterator.c: Ditto. * gimple-low.c: Ditto. * gimple-match-head.c: Ditto. * gimple-pretty-print.c: Ditto. * gimple-ssa-isolate-paths.c: Ditto. * gimple-ssa-strength-reduction.c: Ditto. * gimple-streamer-in.c: Ditto. * gimple-streamer-out.c: Ditto. * gimple-streamer.h: Ditto. * gimple-walk.c: Ditto. * gimple.c: Ditto. * gimplify-me.c: Ditto. * gimplify.c: Ditto. * graph.c: Ditto. * graphite-blocking.c: Ditto. * graphite-clast-to-gimple.c: Ditto. * graphite-dependences.c: Ditto. * graphite-interchange.c: Ditto. * graphite-isl-ast-to-gimple.c: Ditto. * graphite-optimize-isl.c: Ditto. * graphite-poly.c: Ditto. * graphite-scop-detection.c: Ditto. * graphite-sese-to-poly.c: Ditto. * graphite.c: Ditto. * haifa-sched.c: Ditto. * hw-doloop.c: Ditto. * ifcvt.c: Ditto. * init-regs.c: Ditto. * internal-fn.c: Ditto. * ipa-cp.c: Ditto. * ipa-devirt.c: Ditto. * ipa-icf-gimple.c: Ditto. * ipa-icf.c: Ditto. * ipa-inline-analysis.c: Ditto. * ipa-inline.c: Ditto. * ipa-polymorphic-call.c: Ditto. * ipa-profile.c: Ditto. * ipa-prop.c: Ditto. * ipa-pure-const.c: Ditto. * ipa-reference.c: Ditto. * ipa-split.c: Ditto. * ipa-utils.c: Ditto. * ipa.c: Ditto. * ira-build.c: Ditto. * ira-color.c: Ditto. * ira-conflicts.c: Ditto. * ira-costs.c: Ditto. * ira-emit.c: Ditto. * ira-lives.c: Ditto. * ira.c: Ditto. * jump.c: Ditto. * lcm.c: Ditto. * loop-doloop.c: Ditto. * loop-init.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * loop-unroll.c: Ditto. * lower-subreg.c: Ditto. * lra-assigns.c: Ditto. * lra-coalesce.c: Ditto. * lra-constraints.c: Ditto. * lra-eliminations.c: Ditto. * lra-lives.c: Ditto. * lra-spills.c: Ditto. * lra.c: Ditto. * lto-cgraph.c: Ditto. * lto-compress.c: Ditto. * lto-opts.c: Ditto. * lto-section-in.c: Ditto. * lto-section-out.c: Ditto. * lto-streamer-in.c: Ditto. * lto-streamer-out.c: Ditto. * lto-streamer.c: Ditto. * mcf.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * omp-low.c: Ditto. * optabs.c: Ditto. * opts-global.c: Ditto. * passes.c: Ditto. * postreload-gcse.c: Ditto. * postreload.c: Ditto. * predict.c: Ditto. * print-rtl.c: Ditto. * profile.c: Ditto. * recog.c: Ditto. * ree.c: Ditto. * reg-stack.c: Ditto. * regcprop.c: Ditto. * regcprop.h: Ditto. * reginfo.c: Ditto. * regrename.c: Ditto. * regstat.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtlanal.c: Ditto. * sched-deps.c: Ditto. * sched-ebb.c: Ditto. * sched-int.h: Ditto. * sched-rgn.c: Ditto. * sched-vis.c: Ditto. * sel-sched-dump.c: Ditto. * sel-sched-ir.c: Ditto. * sel-sched-ir.h: Ditto. * sel-sched.c: Ditto. * sese.c: Ditto. * shrink-wrap.c: Ditto. * stack-ptr-mod.c: Ditto. * stmt.c: Ditto. * store-motion.c: Ditto. * symtab.c: Ditto. * toplev.c: Ditto. * tracer.c: Ditto. * trans-mem.c: Ditto. * tree-affine.c: Ditto. * tree-call-cdce.c: Ditto. * tree-cfg.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-chrec.c: Ditto. * tree-complex.c: Ditto. * tree-data-ref.c: Ditto. * tree-dfa.c: Ditto. * tree-eh.c: Ditto. * tree-emutls.c: Ditto. * tree-if-conv.c: Ditto. * tree-inline.c: Ditto. * tree-into-ssa.c: Ditto. * tree-loop-distribution.c: Ditto. * tree-nested.c: Ditto. * tree-nrv.c: Ditto. * tree-object-size.c: Ditto. * tree-outof-ssa.c: Ditto. * tree-parloops.c: Ditto. * tree-phinodes.c: Ditto. * tree-predcom.c: Ditto. * tree-pretty-print.c: Ditto. * tree-profile.c: Ditto. * tree-scalar-evolution.c: Ditto. * tree-sra.c: Ditto. * tree-ssa-address.c: Ditto. * tree-ssa-alias.c: Ditto. * tree-ssa-ccp.c: Ditto. * tree-ssa-coalesce.c: Ditto. * tree-ssa-copy.c: Ditto. * tree-ssa-copyrename.c: Ditto. * tree-ssa-dce.c: Ditto. * tree-ssa-dom.c: Ditto. * tree-ssa-dse.c: Ditto. * tree-ssa-forwprop.c: Ditto. * tree-ssa-ifcombine.c: Ditto. * tree-ssa-live.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * tree-ssa-loop-niter.c: Ditto. * tree-ssa-loop-prefetch.c: Ditto. * tree-ssa-loop-unswitch.c: Ditto. * tree-ssa-loop.c: Ditto. * tree-ssa-math-opts.c: Ditto. * tree-ssa-operands.c: Ditto. * tree-ssa-phiopt.c: Ditto. * tree-ssa-phiprop.c: Ditto. * tree-ssa-pre.c: Ditto. * tree-ssa-propagate.c: Ditto. * tree-ssa-reassoc.c: Ditto. * tree-ssa-sccvn.c: Ditto. * tree-ssa-sink.c: Ditto. * tree-ssa-strlen.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-tail-merge.c: Ditto. * tree-ssa-ter.c: Ditto. * tree-ssa-threadedge.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tree-ssa-uncprop.c: Ditto. * tree-ssa-uninit.c: Ditto. * tree-ssa.c: Ditto. * tree-ssanames.c: Ditto. * tree-stdarg.c: Ditto. * tree-streamer-in.c: Ditto. * tree-streamer-out.c: Ditto. * tree-streamer.c: Ditto. * tree-switch-conversion.c: Ditto. * tree-tailcall.c: Ditto. * tree-vect-data-refs.c: Ditto. * tree-vect-generic.c: Ditto. * tree-vect-loop-manip.c: Ditto. * tree-vect-loop.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vectorizer.c: Ditto. * tree-vrp.c: Ditto. * tree.c: Ditto. * tsan.c: Ditto. * ubsan.c: Ditto. * valtrack.c: Ditto. * valtrack.h: Ditto. * value-prof.c: Ditto. * var-tracking.c: Ditto. * varasm.c: Ditto. * varpool.c: Ditto. * vtable-verify.c: Ditto. * web.c: Ditto. * config/aarch64/aarch64-builtins.c: Ditto. * config/aarch64/aarch64.c: Ditto. * config/alpha/alpha.c: Ditto. * config/arc/arc.c: Ditto. * config/arm/arm.c: Ditto. * config/avr/avr.c: Ditto. * config/bfin/bfin.c: Ditto. * config/c6x/c6x.c: Ditto. * config/cr16/cr16.c: Ditto. * config/cris/cris.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/epiphany/epiphany.c: Ditto. * config/epiphany/mode-switch-use.c: Ditto. * config/epiphany/resolve-sw-modes.c: Ditto. * config/fr30/fr30.c: Ditto. * config/frv/frv.c: Ditto. * config/h8300/h8300.c: Ditto. * config/i386/i386.c: Ditto. * config/i386/winnt.c: Ditto. * config/ia64/ia64.c: Ditto. * config/iq2000/iq2000.c: Ditto. * config/lm32/lm32.c: Ditto. * config/m32c/m32c.c: Ditto. * config/m32r/m32r.c: Ditto. * config/m68k/m68k.c: Ditto. * config/mcore/mcore.c: Ditto. * config/mep/mep.c: Ditto. * config/microblaze/microblaze.c: Ditto. * config/mips/mips.c: Ditto. * config/mmix/mmix.c: Ditto. * config/mn10300/mn10300.c: Ditto. * config/moxie/moxie.c: Ditto. * config/msp430/msp430.c: Ditto. * config/nds32/nds32-cost.c: Ditto. * config/nds32/nds32-fp-as-gp.c: Ditto. * config/nds32/nds32-intrinsic.c: Ditto. * config/nds32/nds32-isr.c: Ditto. * config/nds32/nds32-md-auxiliary.c: Ditto. * config/nds32/nds32-memory-manipulation.c: Ditto. * config/nds32/nds32-pipelines-auxiliary.c: Ditto. * config/nds32/nds32-predicates.c: Ditto. * config/nds32/nds32.c: Ditto. * config/nios2/nios2.c: Ditto. * config/pa/pa.c: Ditto. * config/pdp11/pdp11.c: Ditto. * config/rl78/rl78.c: Ditto. * config/rs6000/rs6000.c: Ditto. * config/rx/rx.c: Ditto. * config/s390/s390.c: Ditto. * config/sh/sh-mem.cc: Ditto. * config/sh/sh.c: Ditto. * config/sh/sh_optimize_sett_clrt.cc: Ditto. * config/sh/sh_treg_combine.cc: Ditto. * config/sparc/sparc.c: Ditto. * config/spu/spu.c: Ditto. * config/stormy16/stormy16.c: Ditto. * config/tilegx/tilegx.c: Ditto. * config/tilepro/tilepro.c: Ditto. * config/v850/v850.c: Ditto. * config/vax/vax.c: Ditto. * config/xtensa/xtensa.c: Ditto. From-SVN: r216735
2014-10-27 13:41:01 +01:00
#include \"predict.h\"\n\
#include \"basic-block.h\"\n\
#include \"resource.h\"\n\
#include \"diagnostic-core.h\"\n\
#include \"reload.h\"\n\
#include \"regs.h\"\n\
genemit.c (main): Add tm-constrs.h to included headers. * genemit.c (main): Add tm-constrs.h to included headers. * genoutput.c (output_prologue): Add tm-constrs.h to included headers. * genpeep.c (main): Add tm-constrs.h to included headers. * genpreds.c (write_satisfies_constraint_fns): Rename to ... (write_tm_constrs_h): this and write complete file. (write_tm_preds_h): Do not emit satisfies_constraint fns. (write_insn_preds_c): Add tm-constrs.h to included headers. (gen_constrs): New variable. (parse_option): Parse "-c". (main): Invoke write_tm_constrs_h. * genrecog.c (write_header): Add tm-constrs.h to included headers. * Makefile.in (STAGECOPYSTUFF): Add tm-constrs.h. (object_out_file): Add tm-constrs.h dependency. (insn-emit.o): Same. (insn-output.o): Same. (insn-peep.o): Same. (insn-preds.o): Same. (insn-recog.o): Same. (tm-constsr.h): New target. (s-constrs-h): New target. * config/rs6000/constraints.md: New file. * config/rs6000/rs6000.c: Include tm-constrs.h. (num_insn_constant_wide): Convert to satisfies_constraint. (rs6000_rtx_costs): Convert to satisfies_constraint. * config/rs6000/rs6000.h (REG_CLASS_FROM_LETTER): Delete. (CONST_OK_FOR_LETTER_P): Delete. (CONST_DOUBLE_OK_FOR_LETTER_P): Delete. (EXTRA_CONSTRAINT): Delete. (EXTRA_MEMORY_CONSTRAINT): Delete. (EXTRA_ADDRESS_CONSTRAINT): Delete. * config/rs6000/predicates.md: Convert to satisfies_constraint. * config/rs6000/rs6000.md: Include constraints.md. Convert to satisfies_constraint. * config/i386/i386.c: Include tm-constrs.h. From-SVN: r112508
2006-03-29 23:07:12 +02:00
#include \"tm-constrs.h\"\n\
function.h: Flatten file. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * function.h: Flatten file. Remove includes, adjust prototypes to reflect only what is in function.h. (enum direction, struct args_size, struct locate_and_pad_arg_data, ADD_PARM_SIZE, SUB_PARM_SIZE, ARGS_SIZE_TREE, ARGS_SIZE_RTX): Relocate from expr.h. (ASLK_REDUCE_ALIGN, ASLK_RECORD_PAD): Relocate from rtl.h. (optimize_function_for_size_p, optimize_function_for_speed_p): Move prototypes to predict.h. (init_varasm_status): Move prototype to varasm.h. * expr.h: Adjust include files. (enum direction, struct args_size, struct locate_and_pad_arg_data, ADD_PARM_SIZE, SUB_PARM_SIZE, ARGS_SIZE_TREE, ARGS_SIZE_RTX): Move to function.h. (locate_and_pad_parm): Move prototype to function.h. * rtl.h: (assign_stack_local, ASLK_REDUCE_ALIGN, ASLK_RECORD_PAD, assign_stack_local_1, assign_stack_temp, assign_stack_temp_for_type, assign_temp, reposition_prologue_and_epilogue_notes, prologue_epilogue_contains, sibcall_epilogue_contains, update_temp_slot_address, maybe_copy_prologue_epilogue_insn, set_return_jump_label): Move prototypes to function.h. * predict.h (optimize_function_for_size_p, optimize_function_for_speed_p): Relocate prototypes from function.h. * shrink-wrap.h (emit_return_into_block, active_insn_between, convert_jumps_to_returns, emit_return_for_exit): Move prototypes to function.h. * varasm.h (init_varasm_status): Relocate prototype from function.h. * genattrtab.c (write_header): Add predict.h to include list. * genconditions.c (write_header): Add predict.h to include list. * genemit.c (main): Adjust header file includes. * gengtype.c (ifiles): Add flattened function.h header files. * genoutput.c (output_prologue): Add predict.h to include list. * genpreds.c (write_insn_preds_c): Adjust header file includes. * genrecog.c (write_header): Add flattened function.h header files. * alias.c: Adjust include files. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgrtl.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbxout.c: Likewise. * ddg.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dojump.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-streamer.h: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lcm.c: Likewise. * loop-invariant.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * passes.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtlanal.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * statistics.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * symtab.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-tailcall.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * valtrack.c: Likewise. * varasm.c: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * testsuite/g++.dg/plugin/pragma_plugin.c: Adjust include files. * config/aarch64/aarch64.c: Add flattened includes from function.h. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr-log.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/epiphany/mode-switch-use.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-cost.c: Likewise. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/score/score.c: Likewise. * config/sh/sh.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/xtensa/xtensa.c: Likewise. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * ada/gcc-interface/misc.c: Adjust include files. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * c/c-decl.c: Adjust include files. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * c-family/c-pragma.c: Adjust include files. * c-family/c-semantics.c: Likewise. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * cp/cp-tree.h: Adjust include files. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * fortran/f95-lang.c: Adjust include files. * fortran/trans-decl.c: Likewise. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * java/class.c: Adjust include files. * java/resource.c: Likewise. 2014-10-16 Andrew MacLeod <amacleod@redhat.com> * objc/objc-act.c: Adjust include files. From-SVN: r216337
2014-10-16 18:37:19 +02:00
#include \"predict.h\"\n\
\n");
puts ("\n\
/* `recog' contains a decision tree that recognizes whether the rtx\n\
X0 is a valid instruction.\n\
\n\
recog returns -1 if the rtx is not valid. If the rtx is valid, recog\n\
returns a nonnegative number which is the insn code number for the\n\
pattern that matched. This is the same as the order in the machine\n\
description of the entry that matched. This number can be used as an\n\
index into `insn_data' and other tables.\n");
puts ("\
The third argument to recog is an optional pointer to an int. If\n\
present, recog will accept a pattern if it matches except for missing\n\
CLOBBER expressions at the end. In that case, the value pointed to by\n\
the optional pointer will be set to the number of CLOBBERs that need\n\
to be added (it should be initialized to zero by the caller). If it");
puts ("\
is set nonzero, the caller should allocate a PARALLEL of the\n\
appropriate size, copy the initial entries, and call add_clobbers\n\
(found in insn-emit.c) to fill in the CLOBBERs.\n\
");
puts ("\n\
The function split_insns returns 0 if the rtl could not\n\
Delete SEQUENCE rtl usage outside of reorg and ssa passes. 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. * rtl.h (gen_sequence, emit_insns, emit_insns_before, emit_insns_before_scope, emit_insns_after, emit_insns_after_scope): Delete declaration. * ada/misc.c (insert_code_for): Use emit_insn* instead of emit_insns_foo. * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. (alpha_set_memflags): Fix comment. (set_frame_related_p): Use get_insns instead of gen_sequence. * config/alpha/alpha.md (setjmp receiver splitter): Avoid emitting no insns. * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of gen_sequence. (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/ia64/ia64.md (conditional move spliiter): Avoid emitting no insns. * config/m32r/m32r.c (gen_split_move_double): Use get_insns instead of gen_sequence. * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_need_epilogue): Likewise. * config/sparc/sparc.md (current_function_calls_alloca, flat): New attributes. (setjmp pattern and split): Use them to avoid splitter which emits no RTL. * genattrtab.c (main): Emit include of function.h * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use get_insns instead of gen_sequence. * config/cris/cris.c (cris_split_movdx): Likewise. * emit-rtl.c (emit_insns*): Kill. (try_split): Expect insn list instead of SEQUENCE. (make_jump_insn_raw, make_call_insn_raw): Fix comments. (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. Make them abort if a SEQUENCE is given and RTL checking is enabled. (emit_*_scope): Don't forget to set scope on final insn. (gen_sequence): Move from here... * ssa.c (gen_sequence): To here as private function. * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix comments. (expand_builtin_return, expand_builtin_mathfn): Likewise. (expand_builtin_strlen): Use get_insns instead of gen_sequence. (expand_builtin_saveregs): Use emit_insn_foo, fix comments. (expand_builtin_expect_jump): Use get_insns and fix comments. * calls.c (try_to_integrate): Use emit_insn_foo. (expand_call, emit_library_call_value_1): Likewise. * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. (emit_move_insn_1): Use get_insns instead of gen_sequence. (expand_expr): Use emit_insn_foo. * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. * except.c (build_post_landing_pads): Likewise. * flow.c (attempt_auto_inc): Likewise. * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, expand_nl_goto_receivers, expand_decl_cleanup): Likewise. * function.c (fixup_var_refs_insn): Use get_insns instead of gen_sequence. (fixup_var_refs_1): Likewise and expect insn list from gen_foo. (fixup_memory_subreg): Use get_insns instead of gen_sequence. (fixup_stack_1, purge_addressof_1, expand_main_function, get_arg_pointer_save_area): Likewise. (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, expand_function_end): Use emit_insn_foo. (record_insns, keep_stack_depressed): Work with insn list instead of SEQUENCE, fix comments. * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, noce_try_store_flag_constants, noce_try_store_flag_inc, noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Use emit_insn_foo. (noce_process_if_block): Use get_insns instead of gen_sequence. * optabs.c (add_equal_note): Work with insn list, fix comments. (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. (expand_unop, expand_complex_abs, expand_unop_insn, expand_no_conflict_block): Likewise. (gen_move_insn): Use get_insns instead of gen_sequence. (gen_cond_trap): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. (emit_initial_value_sets): Use emit_insn_foo. * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently now that RTL generators give insn lists. * sibcall.c (replace_call_placeholder): Use emit_insn_foo. * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns instead of gen_sequence. (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. * explow.c (emit_stack_save, emit_stack_restore): Use get_insns instead of gen_sequence. * loop.c (move_movables, emit_prefetch_instructions, gen_add_mult, check_dbra_loop, gen_load_of_final_value): Likewise. (loop_regs_update): Work with insn list instead of SEQUENCE rtl. (product_cheap_p): Likewise, and add commentary about RTL wastage here. * lcm.c (optimize_mode_switching): Use get_insns instead of gen_sequence. * profile.c (gen_edge_profiler): Likewise. * regmove.c (copy_src_to_dest): Likewise. * reg-stack.c (compensate_edge): Likewise and fix comment. * gcse.c (process_insert_insn): Likewise. (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. * jump.c (delete_prior_computation): Update comment. * genemit.c (gen_expand, gen_split, main): Use get_insns instead of gen_sequence, update comments to match. * recog.c (peephole2_optimize): Work with insn lists instead of SEQUENCE rtl. * sched-vis.c (print_pattern): Abort on SEQUENCE. * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): Use get_insns instead of gen_sequence. (copy_loop_body): Likewise and don't emit dummy NOTE. * genrecog.c: Don't mention SEQUENCE rtl in comments. * combine.c (try_combine): Expect insn lists from split generator. * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by hand. From-SVN: r54497
2002-06-11 14:22:48 +02:00
be split or the split rtl as an INSN list if it can be.\n\
\n\
The function peephole2_insns returns 0 if the rtl could not\n\
Delete SEQUENCE rtl usage outside of reorg and ssa passes. 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. * rtl.h (gen_sequence, emit_insns, emit_insns_before, emit_insns_before_scope, emit_insns_after, emit_insns_after_scope): Delete declaration. * ada/misc.c (insert_code_for): Use emit_insn* instead of emit_insns_foo. * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. (alpha_set_memflags): Fix comment. (set_frame_related_p): Use get_insns instead of gen_sequence. * config/alpha/alpha.md (setjmp receiver splitter): Avoid emitting no insns. * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of gen_sequence. (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/ia64/ia64.md (conditional move spliiter): Avoid emitting no insns. * config/m32r/m32r.c (gen_split_move_double): Use get_insns instead of gen_sequence. * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_need_epilogue): Likewise. * config/sparc/sparc.md (current_function_calls_alloca, flat): New attributes. (setjmp pattern and split): Use them to avoid splitter which emits no RTL. * genattrtab.c (main): Emit include of function.h * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use get_insns instead of gen_sequence. * config/cris/cris.c (cris_split_movdx): Likewise. * emit-rtl.c (emit_insns*): Kill. (try_split): Expect insn list instead of SEQUENCE. (make_jump_insn_raw, make_call_insn_raw): Fix comments. (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. Make them abort if a SEQUENCE is given and RTL checking is enabled. (emit_*_scope): Don't forget to set scope on final insn. (gen_sequence): Move from here... * ssa.c (gen_sequence): To here as private function. * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix comments. (expand_builtin_return, expand_builtin_mathfn): Likewise. (expand_builtin_strlen): Use get_insns instead of gen_sequence. (expand_builtin_saveregs): Use emit_insn_foo, fix comments. (expand_builtin_expect_jump): Use get_insns and fix comments. * calls.c (try_to_integrate): Use emit_insn_foo. (expand_call, emit_library_call_value_1): Likewise. * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. (emit_move_insn_1): Use get_insns instead of gen_sequence. (expand_expr): Use emit_insn_foo. * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. * except.c (build_post_landing_pads): Likewise. * flow.c (attempt_auto_inc): Likewise. * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, expand_nl_goto_receivers, expand_decl_cleanup): Likewise. * function.c (fixup_var_refs_insn): Use get_insns instead of gen_sequence. (fixup_var_refs_1): Likewise and expect insn list from gen_foo. (fixup_memory_subreg): Use get_insns instead of gen_sequence. (fixup_stack_1, purge_addressof_1, expand_main_function, get_arg_pointer_save_area): Likewise. (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, expand_function_end): Use emit_insn_foo. (record_insns, keep_stack_depressed): Work with insn list instead of SEQUENCE, fix comments. * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, noce_try_store_flag_constants, noce_try_store_flag_inc, noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Use emit_insn_foo. (noce_process_if_block): Use get_insns instead of gen_sequence. * optabs.c (add_equal_note): Work with insn list, fix comments. (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. (expand_unop, expand_complex_abs, expand_unop_insn, expand_no_conflict_block): Likewise. (gen_move_insn): Use get_insns instead of gen_sequence. (gen_cond_trap): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. (emit_initial_value_sets): Use emit_insn_foo. * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently now that RTL generators give insn lists. * sibcall.c (replace_call_placeholder): Use emit_insn_foo. * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns instead of gen_sequence. (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. * explow.c (emit_stack_save, emit_stack_restore): Use get_insns instead of gen_sequence. * loop.c (move_movables, emit_prefetch_instructions, gen_add_mult, check_dbra_loop, gen_load_of_final_value): Likewise. (loop_regs_update): Work with insn list instead of SEQUENCE rtl. (product_cheap_p): Likewise, and add commentary about RTL wastage here. * lcm.c (optimize_mode_switching): Use get_insns instead of gen_sequence. * profile.c (gen_edge_profiler): Likewise. * regmove.c (copy_src_to_dest): Likewise. * reg-stack.c (compensate_edge): Likewise and fix comment. * gcse.c (process_insert_insn): Likewise. (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. * jump.c (delete_prior_computation): Update comment. * genemit.c (gen_expand, gen_split, main): Use get_insns instead of gen_sequence, update comments to match. * recog.c (peephole2_optimize): Work with insn lists instead of SEQUENCE rtl. * sched-vis.c (print_pattern): Abort on SEQUENCE. * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): Use get_insns instead of gen_sequence. (copy_loop_body): Likewise and don't emit dummy NOTE. * genrecog.c: Don't mention SEQUENCE rtl in comments. * combine.c (try_combine): Expect insn lists from split generator. * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by hand. From-SVN: r54497
2002-06-11 14:22:48 +02:00
be matched. If there was a match, the new rtl is returned in an INSN list,\n\
and LAST_INSN will point to the last recognized insn in the old sequence.\n\
*/\n\n");
}
1991-11-24 20:57:16 +01:00
/* Construct and return a sequence of decisions
that will recognize INSN.
1991-11-24 20:57:16 +01:00
TYPE says what type of routine we are recognizing (RECOG or SPLIT). */
static struct decision_head
make_insn_sequence (rtx insn, enum routine_type type)
{
rtx x;
const char *c_test = XSTR (insn, type == RECOG ? 2 : 1);
int truth = maybe_eval_c_test (c_test);
struct decision *last;
struct decision_test *test, **place;
struct decision_head head;
struct position *c_test_pos, **pos_ptr;
/* We should never see an insn whose C test is false at compile time. */
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_assert (truth);
c_test_pos = &root_pos;
if (type == PEEPHOLE2)
1991-11-24 20:57:16 +01:00
{
int i, j;
/* peephole2 gets special treatment:
- X always gets an outer parallel even if it's only one entry
- we remove all traces of outer-level match_scratch and match_dup
expressions here. */
x = rtx_alloc (PARALLEL);
PUT_MODE (x, VOIDmode);
XVEC (x, 0) = rtvec_alloc (XVECLEN (insn, 0));
pos_ptr = &peep2_insn_pos_list;
for (i = j = 0; i < XVECLEN (insn, 0); i++)
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
{
rtx tmp = XVECEXP (insn, 0, i);
if (GET_CODE (tmp) != MATCH_SCRATCH && GET_CODE (tmp) != MATCH_DUP)
{
c_test_pos = next_position (pos_ptr, &root_pos,
POS_PEEP2_INSN, j);
XVECEXP (x, 0, j) = tmp;
j++;
pos_ptr = &c_test_pos->next;
}
}
XVECLEN (x, 0) = j;
}
else if (XVECLEN (insn, type == RECOG) == 1)
x = XVECEXP (insn, type == RECOG, 0);
else
{
x = rtx_alloc (PARALLEL);
XVEC (x, 0) = XVEC (insn, type == RECOG);
PUT_MODE (x, VOIDmode);
}
validate_pattern (x, insn, NULL_RTX, 0);
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
memset (&head, 0, sizeof (head));
last = add_to_sequence (x, &head, &root_pos, type, 1);
/* Find the end of the test chain on the last node. */
for (test = last->tests; test->next; test = test->next)
continue;
place = &test->next;
/* Skip the C test if it's known to be true at compile time. */
if (truth == -1)
{
/* Need a new node if we have another test to add. */
if (test->type == DT_accept_op)
{
last = new_decision (c_test_pos, &last->success);
place = &last->tests;
}
test = new_decision_test (DT_c_test, &place);
test->u.c_test = c_test;
}
test = new_decision_test (DT_accept_insn, &place);
test->u.insn.code_number = next_insn_code;
test->u.insn.lineno = pattern_lineno;
test->u.insn.num_clobbers_to_add = 0;
switch (type)
{
case RECOG:
/* If this is a DEFINE_INSN and X is a PARALLEL, see if it ends
with a group of CLOBBERs of (hard) registers or MATCH_SCRATCHes.
If so, set up to recognize the pattern without these CLOBBERs. */
if (GET_CODE (x) == PARALLEL)
{
int i;
/* Find the last non-clobber in the parallel. */
for (i = XVECLEN (x, 0); i > 0; i--)
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
{
rtx y = XVECEXP (x, 0, i - 1);
if (GET_CODE (y) != CLOBBER
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
|| (!REG_P (XEXP (y, 0))
&& GET_CODE (XEXP (y, 0)) != MATCH_SCRATCH))
break;
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
}
if (i != XVECLEN (x, 0))
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
{
rtx new_rtx;
struct decision_head clobber_head;
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
/* Build a similar insn without the clobbers. */
if (i == 1)
new_rtx = XVECEXP (x, 0, 0);
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
else
{
int j;
new_rtx = rtx_alloc (PARALLEL);
XVEC (new_rtx, 0) = rtvec_alloc (i);
for (j = i - 1; j >= 0; j--)
XVECEXP (new_rtx, 0, j) = XVECEXP (x, 0, j);
}
/* Recognize it. */
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
memset (&clobber_head, 0, sizeof (clobber_head));
last = add_to_sequence (new_rtx, &clobber_head, &root_pos,
type, 1);
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
/* Find the end of the test chain on the last node. */
for (test = last->tests; test->next; test = test->next)
continue;
/* We definitely have a new test to add -- create a new
node if needed. */
place = &test->next;
if (test->type == DT_accept_op)
{
last = new_decision (&root_pos, &last->success);
place = &last->tests;
}
/* Skip the C test if it's known to be true at compile
time. */
if (truth == -1)
{
test = new_decision_test (DT_c_test, &place);
test->u.c_test = c_test;
}
test = new_decision_test (DT_accept_insn, &place);
test->u.insn.code_number = next_insn_code;
test->u.insn.lineno = pattern_lineno;
test->u.insn.num_clobbers_to_add = XVECLEN (x, 0) - i;
merge_trees (&head, &clobber_head);
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
}
}
break;
case SPLIT:
/* Define the subroutine we will call below and emit in genemit. */
Use rtx_insn internally within generated functions 2014-08-21 David Malcolm <dmalcolm@redhat.com> * recog.h (insn_output_fn): Update this function typedef to match the changes below to the generated output functions, strengthening the 2nd param from rtx to rtx_insn *. * final.c (get_insn_template): Add a checked cast to rtx_insn * on insn when invoking an output function, to match the new signature of insn_output_fn with a stronger second param. * genconditions.c (write_header): In the generated code for gencondmd.c, strengthen the global "insn" from rtx to rtx_insn * to match the other changes in this patch. * genemit.c (gen_split): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their implementations. * genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of the subfunctions within the generated "recog_", "split", "peephole2" function trees from rtx to rtx_insn *. For now, the top-level generated functions ("recog", "split", "peephole2") continue to take a plain rtx for "insn", to avoid introducing dependencies on other patches. Rename this 2nd param from "insn" to "uncast_insn", and reintroduce "insn" as a local variable of type rtx_insn *, initialized at the top of the generated function with a checked cast on "uncast_insn". (make_insn_sequence): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their prototypes. * genoutput.c (process_template): Strengthen the 2nd param within the generated "output_" functions "insn" from rtx to rtx_insn *. From-SVN: r214257
2014-08-21 09:49:28 +02:00
printf ("extern rtx gen_split_%d (rtx_insn *, rtx *);\n", next_insn_code);
break;
case PEEPHOLE2:
/* Define the subroutine we will call below and emit in genemit. */
Use rtx_insn internally within generated functions 2014-08-21 David Malcolm <dmalcolm@redhat.com> * recog.h (insn_output_fn): Update this function typedef to match the changes below to the generated output functions, strengthening the 2nd param from rtx to rtx_insn *. * final.c (get_insn_template): Add a checked cast to rtx_insn * on insn when invoking an output function, to match the new signature of insn_output_fn with a stronger second param. * genconditions.c (write_header): In the generated code for gencondmd.c, strengthen the global "insn" from rtx to rtx_insn * to match the other changes in this patch. * genemit.c (gen_split): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their implementations. * genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of the subfunctions within the generated "recog_", "split", "peephole2" function trees from rtx to rtx_insn *. For now, the top-level generated functions ("recog", "split", "peephole2") continue to take a plain rtx for "insn", to avoid introducing dependencies on other patches. Rename this 2nd param from "insn" to "uncast_insn", and reintroduce "insn" as a local variable of type rtx_insn *, initialized at the top of the generated function with a checked cast on "uncast_insn". (make_insn_sequence): Strengthen the 1st param "curr_insn" of the generated "gen_" functions from rtx to rtx_insn * within their prototypes. * genoutput.c (process_template): Strengthen the 2nd param within the generated "output_" functions "insn" from rtx to rtx_insn *. From-SVN: r214257
2014-08-21 09:49:28 +02:00
printf ("extern rtx gen_peephole2_%d (rtx_insn *, rtx *);\n",
next_insn_code);
break;
1991-11-24 20:57:16 +01:00
}
return head;
1991-11-24 20:57:16 +01:00
}
static void
process_tree (struct decision_head *head, enum routine_type subroutine_type)
1991-11-24 20:57:16 +01:00
{
if (head->first == NULL)
{
/* We can elide peephole2_insns, but not recog or split_insns. */
if (subroutine_type == PEEPHOLE2)
return;
}
else
{
factor_tests (head);
1991-11-24 20:57:16 +01:00
next_subroutine_number = 0;
break_out_subroutines (head, 1);
find_afterward (head, NULL);
/* We run this after find_afterward, because find_afterward needs
the redundant DT_mode tests on predicates to determine whether
two tests can both be true or not. */
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
simplify_tests (head);
write_subroutines (head, subroutine_type);
}
write_subroutine (head, subroutine_type);
}
extern int main (int, char **);
1991-11-24 20:57:16 +01:00
int
main (int argc, char **argv)
1991-11-24 20:57:16 +01:00
{
rtx desc;
struct decision_head recog_tree, split_tree, peephole2_tree, h;
1991-11-24 20:57:16 +01:00
progname = "genrecog";
memset (&recog_tree, 0, sizeof recog_tree);
memset (&split_tree, 0, sizeof split_tree);
memset (&peephole2_tree, 0, sizeof peephole2_tree);
1991-11-24 20:57:16 +01:00
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
if (!init_rtx_reader_args (argc, argv))
return (FATAL_EXIT_CODE);
1991-11-24 20:57:16 +01:00
next_insn_code = 0;
write_header ();
1991-11-24 20:57:16 +01:00
/* Read the machine description. */
while (1)
{
desc = read_md_rtx (&pattern_lineno, &next_insn_code);
if (desc == NULL)
1991-11-24 20:57:16 +01:00
break;
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
switch (GET_CODE (desc))
{
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
case DEFINE_INSN:
h = make_insn_sequence (desc, RECOG);
merge_trees (&recog_tree, &h);
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
break;
case DEFINE_SPLIT:
h = make_insn_sequence (desc, SPLIT);
merge_trees (&split_tree, &h);
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
break;
case DEFINE_PEEPHOLE2:
h = make_insn_sequence (desc, PEEPHOLE2);
merge_trees (&peephole2_tree, &h);
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
default:
/* do nothing */;
}
1991-11-24 20:57:16 +01:00
}
if (have_error)
return FATAL_EXIT_CODE;
puts ("\n\n");
1991-11-24 20:57:16 +01:00
process_tree (&recog_tree, RECOG);
process_tree (&split_tree, SPLIT);
process_tree (&peephole2_tree, PEEPHOLE2);
backport: Makefile.in (STAGESTUFF): Add *.peephole2. Merge peephole2 from new_ia32_branch: * Makefile.in (STAGESTUFF): Add *.peephole2. (mostlyclean): Likewise. (recog.o): Depend on resource.h. * final.c (peephole): Conditionalize decl on HAVE_peephole. (final_scan_insn): Likewise for the invocation of peephole. * genconfig.c (main): Look for peephole and peephole2 patterns. Emit HAVE_peephole* accordingly. * genpeep.c (main): Conditionalize entire output on HAVE_peephole. * flags.h (flag_peephole2): Declare. * toplev.c: New pass peephole2. New flag -fpeephole2. * genattrtab.c (main): Count DEFINE_PEEPHOLE2. * gencodes.c (main): Likewise. * genextract.c (main): Likewise. * genoutput.c (main): Likewise. * genemit.c (max_operand_1): Look for the max scratch operand. (gen_rtx_scratch): New. (gen_exp): Use it, and pass on new arg subroutine_type. (gen_expand): Take max scratch into account. (gen_split): Emit peephole2 functions. (output_peephole2_scratch): New. (main): Include hard-reg-set.h and resource.h. Handle peephole2. * genrecog.c (routine_type): Add PEEPHOLE2. (IS_SPLIT): New. (make_insn_sequence): Match outer parallel for peep2. Discard top level scratches and dups. (add_to_sequence): New args insn_type and top. Update all callers. Handle toplevel peep2 matching insns. (write_subroutine): Handle peep2. (write_tree_1): Likewise. (write_tree): Likewise. (main): Likewise. (change_state): New arg afterward. Update all callers. Handle matching separate insns. * recog.c (recog_next_insn): New. (peephole2_optimize): New. * rtl.def (DEFINE_PEEPHOLE2): New. * resource.c (find_free_register): New argument last_insn. Use it to find a register available through the entire span. * resource.h (find_free_register): Update prototype. From-SVN: r29015
1999-08-31 22:37:09 +02:00
1991-11-24 20:57:16 +01:00
fflush (stdout);
return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
1991-11-24 20:57:16 +01:00
}
static void
debug_decision_2 (struct decision_test *test)
{
switch (test->type)
{
case DT_num_insns:
fprintf (stderr, "num_insns=%d", test->u.num_insns);
break;
case DT_mode:
fprintf (stderr, "mode=%s", GET_MODE_NAME (test->u.mode));
break;
case DT_code:
fprintf (stderr, "code=%s", GET_RTX_NAME (test->u.code));
break;
case DT_veclen:
fprintf (stderr, "veclen=%d", test->u.veclen);
break;
case DT_elt_zero_int:
fprintf (stderr, "elt0_i=%d", (int) test->u.intval);
break;
case DT_elt_one_int:
fprintf (stderr, "elt1_i=%d", (int) test->u.intval);
break;
case DT_elt_zero_wide:
fprintf (stderr, "elt0_w=" HOST_WIDE_INT_PRINT_DEC, test->u.intval);
break;
case DT_elt_zero_wide_safe:
fprintf (stderr, "elt0_ws=" HOST_WIDE_INT_PRINT_DEC, test->u.intval);
break;
case DT_veclen_ge:
fprintf (stderr, "veclen>=%d", test->u.veclen);
break;
case DT_dup:
fprintf (stderr, "dup=%d", test->u.dup);
break;
case DT_pred:
fprintf (stderr, "pred=(%s,%s)",
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
test->u.pred.name, GET_MODE_NAME (test->u.pred.mode));
break;
case DT_c_test:
{
char sub[16+4];
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
strncpy (sub, test->u.c_test, sizeof (sub));
memcpy (sub+16, "...", 4);
fprintf (stderr, "c_test=\"%s\"", sub);
}
break;
case DT_accept_op:
fprintf (stderr, "A_op=%d", test->u.opno);
break;
case DT_accept_insn:
fprintf (stderr, "A_insn=(%d,%d)",
test->u.insn.code_number, test->u.insn.num_clobbers_to_add);
break;
default:
Makefile.in (gengtype): Use $(BUILD_ERRORS). * Makefile.in (gengtype): Use $(BUILD_ERRORS). (gengtype.o): Depend on errors.h. * genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable. (attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr, attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn, write_test_expr, write_attr_value, write_eligible_delay, make_internal_attr, make_numeric_value): Likewise. * genautomata.c (regexp_name, get_str_vect, gen_presence_absence_set, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps, process_regexp_cycles, reserv_sets_cmp, set_unit_reserv, test_unit_reserv, it_is_empty_reserv_sets, reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or, reserv_sets_and, output_cycle_reservs, get_free_state, intersected_state_reservs_p, states_union, remove_arc, copy_insn_regexp, transform_1, transform_2, transform_3, regexp_transform_func, store_alt_unit_usage, check_regexp_units_distribution, process_seq_for_forming_states, process_alts_for_forming_states, make_automaton, form_arcs_marked_by_insn, create_composed_state, set_out_arc_insns_equiv_num, partition_equiv_class, process_insn_equiv_class, set_insn_equiv_classes, units_to_automata_heuristic_distr, form_regexp, longest_path_length, output_dfa_max_issue_rate, add_vect, out_state_arcs_num, add_vect_el, output_trans_table, output_state_alts_table, output_dead_lock_vect, output_max_insn_queue_index_def, output_min_insn_conflict_delay_func, output_internal_insn_latency_func, output_print_reservation_func, output_cpu_unit_reservation_p, output_state_arcs, make_insn_alts_attr, make_internal_dfa_insn_code_attr, make_default_insn_latency_attr, form_important_insn_automata_lists): Likewise. * genemit.c (gen_exp, output_add_clobbers, output_added_clobbers_hard_reg_p): Likewise. * genextract.c (print_path, main): Likewise. * genflags.c (gen_macro): Likewise. * gengenrtl.c: Include errors.h (type_from_format, accessor_from_format): Likewise. * gengtype.c (get_file_basename, output_mangled_typename, walk_type, write_types_process_field, write_types_local_process_field): Likewise. * genmodes.c (complete_mode): Likewise. * genopinit.c (gen_insn): Likewise. * genoutput.c (output_insn_data, check_constraint_len, constraint_len): Likewise. * genpreds.c (add_mode_tests):Likewise. * gen-protos.c (add_hash): Likewise. * genrecog.c (find_operand, find_matching_operand, validate_pattern, add_to_sequence, maybe_both_true, nodes_identical_1, merge_trees, write_switch, write_cond, write_action, is_unconditional, make_insn_sequence, debug_decision_2): Likewise. * gensupport.c (is_predicable, collect_insn_data, alter_predicate_for_insn, maybe_eval_c_test): Likewise. From-SVN: r87236
2004-09-09 15:22:38 +02:00
gcc_unreachable ();
}
}
static void
debug_decision_1 (struct decision *d, int indent)
{
int i;
struct decision_test *test;
if (d == NULL)
{
for (i = 0; i < indent; ++i)
putc (' ', stderr);
fputs ("(nil)\n", stderr);
return;
}
for (i = 0; i < indent; ++i)
putc (' ', stderr);
putc ('{', stderr);
test = d->tests;
if (test)
{
debug_decision_2 (test);
while ((test = test->next) != NULL)
{
fputs (" + ", stderr);
debug_decision_2 (test);
}
}
fprintf (stderr, "} %d n %d a %d\n", d->number,
(d->next ? d->next->number : -1),
(d->afterward ? d->afterward->number : -1));
}
static void
debug_decision_0 (struct decision *d, int indent, int maxdepth)
{
struct decision *n;
int i;
if (maxdepth < 0)
return;
if (d == NULL)
{
for (i = 0; i < indent; ++i)
putc (' ', stderr);
fputs ("(nil)\n", stderr);
return;
}
debug_decision_1 (d, indent);
for (n = d->success.first; n ; n = n->next)
debug_decision_0 (n, indent + 2, maxdepth - 1);
}
tree-vrp.c (debug_value_range, [...]): Annotate with DEBUG_FUNCTION. * tree-vrp.c (debug_value_range, debug_all_value_ranges, debug_asserts_for, debug_all_asserts): Annotate with DEBUG_FUNCTION. * tree-into-ssa.c (debug_decl_set, debug_defs_stack, debug_currdefs, debug_tree_ssa, debug_tree_ssa_stats, debug_def_blocks, debug_names_replaced_by, debug_update_ssa): Likewise. * sbitmap.c (debug_sbitmap): Likewise. * genrecog.c (debug_decision, debug_decision_list): Likewise. * tree-pretty-print.c (debug_generic_expr, debug_generic_stmt, debug_tree_chain): Likewise. * tree-loop-distribution.c (debug_rdg_partitions): Likewise. * cgraph.c (debug_cgraph_node, debug_cgraph): Likewise. * optabs.c (debug_optab_libfuncs): Likewise. (verify_loop_closed_ssa): Likewise. * value-prof.c (verify_histograms): Likewise. * reload.c (debug_reload_to_stream, debug_reload): Likewise. * bitmap.c (debug_bitmap_file, debug_bitmap, bitmap_print): Likewise. * cfghooks.c (verify_flow_info): Likewise. * fold-const.c (debug_fold_checksum): Likewise. * omp-low.c (debug_omp_region, debug_all_omp_regions): Likewise. * cfg.c (debug_regset, debug_flow_info, debug_bb, debug_bb_n): Likewise. * omega.c (debug_omega_problem): Likewise. * cgraphunit.c (verify_cgraph_node, verify_cgraph): Likewise. * tree-ssa-ccp.c (debug_lattice_value): Likewise. * dominance.c (verify_dominators, debug_dominance_info, debug_dominance_tree): Likewise. * df-core.c (df_insn_uid_debug, df_insn_debug, df_insn_debug_regno, * df_regno_debug, df_ref_debug, debug_df_insn, debug_df_reg, debug_df_regno, debug_df_ref, debug_df_defno, debug_df_useno, debug_df_chain): Likewise. * tree-ssa-dom.c (debug_dominator_optimization_stats): Likewise. * sel-sched.c (debug_state): Likewise. * tree-ssa-alias.c (debug_alias_info, debug_points_to_info_for): Likewise. * cfganal.c (print_edge_list, verify_edge_list): Likewise. * dwarf2out.c (debug_dwarf_die, debug_dwarf): Likewise. * tree-eh.c (verify_eh_edges, verify_eh_dispatch_edge): Likewise. * gimple-pretty-print.c (debug_gimple_stmt, debug_gimple_seq): Likewise. * c-pretty-print.c (debug_c_tree): Likewise. * sel-sched-dump.c (debug_insn_rtx, debug_vinsn, debug_expr, debug_insn debug_av_set, debug_lv_set, debug_ilist, debug_blist, debug_insn_vector, debug_hard_reg_set, debug_mem_addr_value): Likewise. * ebitmap.c (debug_ebitmap): Likewise. * function.c (debug_find_var_in_block_tree): Likewise. * print-rtl.c (debug_rtx): Likewise. (debug_rtx_count): Likewise. (debug_rtx_list, debug_rtx_range, debug_rtx_find): Likewise. * stor-layout.c (debug_rli): Likewise. * ipa.c (debug_cgraph_node_set, debug_varpool_node_set): Likewise. * tree-data-ref.c (debug_data_references, debug_data_dependence_relations, debug_data_reference, debug_data_dependence_relation, debug_rdg_vertex, debug_rdg_component, debug_rdg): Likewise. * tree-affine.c (debug_aff): Likewise. * tree-dfa.c (debug_referenced_vars, debug_variable, debug_dfa_stats): Likewise. * except.c (debug_eh_tree, verify_eh_tree): Likewise. * emit-rtl.c (verify_rtl_sharing): Likewise. * tree-ssa-pre.c (debug_pre_expr, debug_bitmap_set, debug_value_expressions): Likewise. * tree-ssa-live.c (debug_scope_block, debug_scope_blocks): Likewise. * sese.c (debug_rename_map, debug_ivtype_map): Likewise. * print-tree.c (debug_tree, debug_vec_tree): Likewise. * cfglayout.c (verify_insn_chain): Likewise. * graphite-clast-to-gimple.c (debug_clast_name_indexes, debug_clast_stmt, debug_generated_program): Likewise. * ggc-page.c (debug_print_page_list): Likewise. * tree-ssa-ter.c (debug_ter): Likewise. * graphite-dependences.c (debug_pddr): Likewise. * sched-deps.c (debug_ds): Likewise. * tree-ssa.c (verify_ssa): Likewise. * graphite-poly.c (debug_scattering_function, debug_iteration_domain, debug_scattering_functions, debug_iteration_domains, debug_pdr, debug_pdrs, debug_pbb_domain, debug_pbb, debug_scop_context, debug_scop, debug_cloog, debug_scop_params, debug_lst): Likewise. * tree-inline.c (debug_find_tree): Likewise. * graphite-ppl.c (debug_ppl_linear_expr, debug_ppl_polyhedron_matrix, debug_ppl_powerset_matrix): Likewise. * var-tracking.c (debug_dv): Likewise. * system.h (DEBUG_FUNCTION, DEBUG_VARIABLE): Define. * cfgloop.c (verify_loop_structure): Likewise. * plugin.c (dump_active_plugins, debug_active_plugins): Likewise. * c-common.c (verify_sequence_points): Likewise. * sched-rgn.c (debug_regions, debug_region, debug_candidate, debug_candidates, debug_rgn_dependencies): Likewise. * tree-ssa-structalias.c (debug_constraint, debug_constraints, * debug_constraint_graph, debug_solution_for_var, debug_sa_points_to_info): Likewise. * sched-vis.c (debug_insn_slim, debug_bb_slim, debug_bb_n_slim): Likewie. * tree-cfg.c (debug_cfg_stats, verify_stmts, debug_function, debug_loops, debug_loop, debug_loop_num): Likewise. * passes.c (debug_pass): Likewise. (dump_properties): Likewise; add cfglayout property. (debug_properties): Likewise. * tree-ssa-reassoc.c (debug_ops_vector): Likewise. * varpool.c (debug_varpool): Likewise. * regcprop.c (debug_value_data): Likewise. * tree-ssa-operands.c (verify_imm_links, debug_immediate_uses, debug_immediate_uses_for): Likewise. From-SVN: r160036
2010-05-29 22:31:45 +02:00
DEBUG_FUNCTION void
debug_decision (struct decision *d)
{
debug_decision_0 (d, 0, 1000000);
}
tree-vrp.c (debug_value_range, [...]): Annotate with DEBUG_FUNCTION. * tree-vrp.c (debug_value_range, debug_all_value_ranges, debug_asserts_for, debug_all_asserts): Annotate with DEBUG_FUNCTION. * tree-into-ssa.c (debug_decl_set, debug_defs_stack, debug_currdefs, debug_tree_ssa, debug_tree_ssa_stats, debug_def_blocks, debug_names_replaced_by, debug_update_ssa): Likewise. * sbitmap.c (debug_sbitmap): Likewise. * genrecog.c (debug_decision, debug_decision_list): Likewise. * tree-pretty-print.c (debug_generic_expr, debug_generic_stmt, debug_tree_chain): Likewise. * tree-loop-distribution.c (debug_rdg_partitions): Likewise. * cgraph.c (debug_cgraph_node, debug_cgraph): Likewise. * optabs.c (debug_optab_libfuncs): Likewise. (verify_loop_closed_ssa): Likewise. * value-prof.c (verify_histograms): Likewise. * reload.c (debug_reload_to_stream, debug_reload): Likewise. * bitmap.c (debug_bitmap_file, debug_bitmap, bitmap_print): Likewise. * cfghooks.c (verify_flow_info): Likewise. * fold-const.c (debug_fold_checksum): Likewise. * omp-low.c (debug_omp_region, debug_all_omp_regions): Likewise. * cfg.c (debug_regset, debug_flow_info, debug_bb, debug_bb_n): Likewise. * omega.c (debug_omega_problem): Likewise. * cgraphunit.c (verify_cgraph_node, verify_cgraph): Likewise. * tree-ssa-ccp.c (debug_lattice_value): Likewise. * dominance.c (verify_dominators, debug_dominance_info, debug_dominance_tree): Likewise. * df-core.c (df_insn_uid_debug, df_insn_debug, df_insn_debug_regno, * df_regno_debug, df_ref_debug, debug_df_insn, debug_df_reg, debug_df_regno, debug_df_ref, debug_df_defno, debug_df_useno, debug_df_chain): Likewise. * tree-ssa-dom.c (debug_dominator_optimization_stats): Likewise. * sel-sched.c (debug_state): Likewise. * tree-ssa-alias.c (debug_alias_info, debug_points_to_info_for): Likewise. * cfganal.c (print_edge_list, verify_edge_list): Likewise. * dwarf2out.c (debug_dwarf_die, debug_dwarf): Likewise. * tree-eh.c (verify_eh_edges, verify_eh_dispatch_edge): Likewise. * gimple-pretty-print.c (debug_gimple_stmt, debug_gimple_seq): Likewise. * c-pretty-print.c (debug_c_tree): Likewise. * sel-sched-dump.c (debug_insn_rtx, debug_vinsn, debug_expr, debug_insn debug_av_set, debug_lv_set, debug_ilist, debug_blist, debug_insn_vector, debug_hard_reg_set, debug_mem_addr_value): Likewise. * ebitmap.c (debug_ebitmap): Likewise. * function.c (debug_find_var_in_block_tree): Likewise. * print-rtl.c (debug_rtx): Likewise. (debug_rtx_count): Likewise. (debug_rtx_list, debug_rtx_range, debug_rtx_find): Likewise. * stor-layout.c (debug_rli): Likewise. * ipa.c (debug_cgraph_node_set, debug_varpool_node_set): Likewise. * tree-data-ref.c (debug_data_references, debug_data_dependence_relations, debug_data_reference, debug_data_dependence_relation, debug_rdg_vertex, debug_rdg_component, debug_rdg): Likewise. * tree-affine.c (debug_aff): Likewise. * tree-dfa.c (debug_referenced_vars, debug_variable, debug_dfa_stats): Likewise. * except.c (debug_eh_tree, verify_eh_tree): Likewise. * emit-rtl.c (verify_rtl_sharing): Likewise. * tree-ssa-pre.c (debug_pre_expr, debug_bitmap_set, debug_value_expressions): Likewise. * tree-ssa-live.c (debug_scope_block, debug_scope_blocks): Likewise. * sese.c (debug_rename_map, debug_ivtype_map): Likewise. * print-tree.c (debug_tree, debug_vec_tree): Likewise. * cfglayout.c (verify_insn_chain): Likewise. * graphite-clast-to-gimple.c (debug_clast_name_indexes, debug_clast_stmt, debug_generated_program): Likewise. * ggc-page.c (debug_print_page_list): Likewise. * tree-ssa-ter.c (debug_ter): Likewise. * graphite-dependences.c (debug_pddr): Likewise. * sched-deps.c (debug_ds): Likewise. * tree-ssa.c (verify_ssa): Likewise. * graphite-poly.c (debug_scattering_function, debug_iteration_domain, debug_scattering_functions, debug_iteration_domains, debug_pdr, debug_pdrs, debug_pbb_domain, debug_pbb, debug_scop_context, debug_scop, debug_cloog, debug_scop_params, debug_lst): Likewise. * tree-inline.c (debug_find_tree): Likewise. * graphite-ppl.c (debug_ppl_linear_expr, debug_ppl_polyhedron_matrix, debug_ppl_powerset_matrix): Likewise. * var-tracking.c (debug_dv): Likewise. * system.h (DEBUG_FUNCTION, DEBUG_VARIABLE): Define. * cfgloop.c (verify_loop_structure): Likewise. * plugin.c (dump_active_plugins, debug_active_plugins): Likewise. * c-common.c (verify_sequence_points): Likewise. * sched-rgn.c (debug_regions, debug_region, debug_candidate, debug_candidates, debug_rgn_dependencies): Likewise. * tree-ssa-structalias.c (debug_constraint, debug_constraints, * debug_constraint_graph, debug_solution_for_var, debug_sa_points_to_info): Likewise. * sched-vis.c (debug_insn_slim, debug_bb_slim, debug_bb_n_slim): Likewie. * tree-cfg.c (debug_cfg_stats, verify_stmts, debug_function, debug_loops, debug_loop, debug_loop_num): Likewise. * passes.c (debug_pass): Likewise. (dump_properties): Likewise; add cfglayout property. (debug_properties): Likewise. * tree-ssa-reassoc.c (debug_ops_vector): Likewise. * varpool.c (debug_varpool): Likewise. * regcprop.c (debug_value_data): Likewise. * tree-ssa-operands.c (verify_imm_links, debug_immediate_uses, debug_immediate_uses_for): Likewise. From-SVN: r160036
2010-05-29 22:31:45 +02:00
DEBUG_FUNCTION void
debug_decision_list (struct decision *d)
{
while (d)
{
debug_decision_0 (d, 0, 0);
d = d->next;
}
}