Commit Graph

8 Commits

Author SHA1 Message Date
David Malcolm 66b0fe8f4e Make argv const char ** in read_md_files etc
gcc/ChangeLog:
	* genattr-common.c (main): Convert argv from
	char ** to const char **.
	* genattr.c (main): Likewise.
	* genattrtab.c (main): Likewise.
	* genautomata.c (initiate_automaton_gen): Likewise.
	(main): Likewise.
	* gencodes.c (main): Likewise.
	* genconditions.c (main): Likewise.
	* genconfig.c (main): Likewise.
	* genconstants.c (main): Likewise.
	* genemit.c (main): Likewise.
	* genenums.c (main): Likewise.
	* genextract.c (main): Likewise.
	* genflags.c (main): Likewise.
	* genmddeps.c (main): Likewise.
	* genopinit.c (main): Likewise.
	* genoutput.c (main): Likewise.
	* genpeep.c (main): Likewise.
	* genpreds.c (main): Likewise.
	* genrecog.c (main): Likewise.
	* gensupport.c (init_rtx_reader_args_cb): Likewise.
	(init_rtx_reader_args): Likewise.
	* gensupport.h (init_rtx_reader_args_cb): Likewise.
	(init_rtx_reader_args): Likewise.
	* gentarget-def.c (main): Likewise.
	* read-md.c (read_md_files): Likewise.
	* read-md.h (read_md_files): Likewise.

From-SVN: r235976
2016-05-06 15:14:05 +00:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Richard Sandiford 58d745ec90 genflags.c (gen_macro): Delete.
gcc/
	* genflags.c (gen_macro): Delete.
	(gen_proto): Don't create GEN.*CALL.* macros.
	* gensupport.h (get_file_location): Declare.
	* gensupport.c (rtx_locs): New variable.
	(read_md_rtx): Record rtx locations.
	(get_file_location): New function.
	* target-insns.def (call, call_pop, call_value, call_value_pop)
	(sibcall, sibcall_value): New patterns.
	* gentarget-def.c (parse_argument): New function.
	(def_target_insn): Use it.  Handle optional operands.  Raise an
	error if an .md pattern has the wrong number of operands for the
	pattern name.  Remove the names of unused operands from the prototype.
	* builtins.c (expand_builtin_apply): Use targetm functions
	instead of HAVE_call_value and GEN_CALL_VALUE.
	* calls.c (emit_call_1): Likewise.  Remove support for sibcall_pop
	and sibcall_value_pop.
	* config/aarch64/aarch64.md (untyped_call): Use gen_call instead
	of GEN_CALL.
	* config/alpha/alpha.md (untyped_call): Likewise.
	* config/iq2000/iq2000.md (untyped_call): Likewise.
	* config/m68k/m68k.md (untyped_call): Likewise.
	* config/mips/mips.md (untyped_call): Likewise.
	* config/pa/pa.md (untyped_call): Likewise.
	* config/rs6000/rs6000.md (untyped_call): Likewise.
	* config/sparc/sparc.md (untyped_call): Likewise.
	* config/tilegx/tilegx.md (untyped_call): Likewise.
	* config/tilepro/tilepro.md (untyped_call): Likewise.
	* config/visium/visium.md (untyped_call): Likewise.
	* config/alpha/alpha.c (alpha_emit_xfloating_libcall): Use
	gen_call_value instead of GEN_CALL_VALUE.
	* config/arm/arm.md (untyped_call): Likewise.
	* config/cr16/cr16.c (cr16_function_arg): Remove reference to
	GEN_CALL.

From-SVN: r227143
2015-08-24 17:59:51 +00:00
Richard Sandiford 5d2d3e43b9 read-md.h (message_with_line, [...]): Delete.
gcc/
	* read-md.h (message_with_line, error_with_line): Delete.
	* read-md.c (message_with_line, error_with_line): Delete.
	* gensupport.h: Include read-md.h.
	(md_rtx_info): New structure.
	(read_md_rtx): Use it.  Return a bool success value.
	* gensupport.c (read_md_rtx): Likewise.
	* genattr-common.c (gen_attr): Take an md_rtx_info rather than an rtx.
	(main): Update after interface changes.
	* genattr.c (gen_attr): Take an md_rtx_info rather than an rtx.
	(main): Update after interface changes.
	* genattrtab.c (insn_code_number): Delete.
	(optimize_attrs): Add a max_insn_code parameter and use it instead
	of insn_code_number.
	(gen_attr): Take an md_rtx_info rather than an rtx and lineno.
	Use *_at rather than *_with_line functions.
	(gen_insn): Likewise.
	(gen_delay): Likewise.
	(gen_insn_reserv): Likewise.
	(gen_bypass): Take an md_rtx_info rather than an rtx.
	(main): Update after interface changes.  Use a local max_insn_code
	variable instead of insn_code_number.
	* genautomata.c (gen_cpu_unit): Take an md_rtx_info rather than
	an rtx.  Use fatal_at rather than fatal.
	(gen_query_cpu_unit, gen_bypass, gen_excl_set)
	(gen_presence_absence_set, gen_presence_set, gen_final_presence_set)
	(gen_absence_set, gen_final_absence_set, gen_automaton)
	(gen_automata_option, gen_reserv, gen_insn_reserv): Likewise.
	(main): Update after interface changes.
	* gencodes.c (gen_insn): Take an md_rtx_info rather than an rtx
	and code number.
	(main): Update after interface changes.
	* genconditions.c (main): Use new read_md_rtx interface.
	* genconfig.c (gen_insn): Take an md_rtx_info rather than an rtx.
	(gen_expand, gen_split, gen_peephole, gen_peephole2): Likewise.
	(main): Update after interface changes.
	* genemit.c (insn_code_number, insn_index_number): Delete.
	(gen_insn): Take an md_rtx_info rather than an rtx and lineno.
	Use fatal_at rather than fatal.
	(gen_expand): Take an md_rtx_info rather than an rtx.  Use fatal_at
	rather than fatal.
	(gen_split): Likewise.
	(main): Update after interface changes.
	* genextract.c (line_no): Delete.
	(gen_insn): Take an md_rtx_info rather than an rtx and lineno.
	Update call to walk_rtx.
	(VEC_safe_set_locstr): Add an md_rtx_info argument.  Use message_at
	rather than message_with_line.
	(walk_rtx): Add an md_rtx_info argument.  Update call to
	VEC_safe_set_locstr.
	(main): Update after interface changes.
	* genflags.c (gen_insn): Take an md_rtx_info rather than an rtx
	and lineno.  Use error_at rather than separate message_with_line
	calls and have_error assignments.
	(main): Update after interface changes.
	* genmddump.c (main): Use new read_md_rtx interface.
	* genopinit.c (insn): Take an md_rtx_info rather than an rtx.
	(main): Update after interface changes.
	* genoutput.c (next_code_number): Delete.
	(gen_insn): Take an md_rtx_info rather than an rtx and lineno.
	(gen_peephole, gen_expand, gen_split): Likewise.
	(note_constraint): Likewise.  Use *_at rather than *_with_line
	functions.
	(main): Update after interface changes.
	* genpeep.c (gen_peephole): Take an md_rtx_info rather than an
	rtx and lineno.
	(main): Update after interface changes.
	* genpreds.c (process_define_predicate): Take an md_rtx_info rather
	than an rtx and lineno.
	(process_define_constraint): Likewise.
	(process_define_register_constraint): Likewise.
	(main): Update after interface changes.
	* genrecog.c (next_insn_code, pattern_lineno): Delete.
	(validate_pattern): Replace top-level rtx with an md_rtx_info.
	Use *_at rather than *_with_line functions.
	(match_pattern_2): Likewise.
	(match_pattern_1, match_pattern): Add an md_rtx_info parameter.
	(get_peephole2_pattern): Take an md_rtx_info rather than an rtvec.
	Use *_at rather than *_with_line functions.
	* gentarget-def.c (add_insn): New function.
	(main): Use it.  Use new read_md_rtx interface.

From-SVN: r225883
2015-07-16 13:52:22 +00:00
Richard Sandiford 8684d89dea target.def: Add code_for_* hooks.
gcc/
	* target.def: Add code_for_* hooks.
	* gentarget-def.c (def_target_insn): Add TARGET_CODE_FOR_* macros.
	* defaults.h (HAVE_tablejump, gen_tablejump): Delete.
	* target-insns.def (casesi, tablejump): New targetm instruction
	patterns.
	* expr.c (try_casesi): Use them instead of HAVE_*/gen_* interface.
	(do_tablejump): Likewise.
	* stmt.c (expand_switch_as_decision_tree_p): Likewise.
	(expand_sjlj_dispatch_table): Likewise.
	* targhooks.c (default_case_values_threshold): Likewise.

From-SVN: r225421
2015-07-05 07:44:45 +00:00
Richard Sandiford 9d8895c934 rtl.h (emit): Add an optional boolean parameter to control whether barriers are emitted.
gcc/
	* rtl.h (emit): Add an optional boolean parameter to control
	whether barriers are emitted.
	* emit-rtl.c (emit): Likewise.
	* gensupport.c (get_emit_function): Return null rather than "emit".
	* genemit.c (gen_emit_seq): Handle the null return value.
	Don't emit barriers after the final instruction in the sequence.
	* gentarget-def.c (main): Don't emit barriers after the instruction.

From-SVN: r225000
2015-06-26 10:06:56 +00:00
H.J. Lu cf3e518646 Cast return of strtol to unsigned int
strtol returns long, which is compared against unsigned int.  On 32-bit
hosts, it leads to

gcc/gentarget-def.c: In function void def_target_insn(const char*, const char*):
gcc/gentarget-def.c:88:34: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]

This patch casts return of strtol to unsigned int to avoid the error.

	* gentarget-def.c (def_target_insn): Cast return of strtol to
	unsigned int.

From-SVN: r224993
2015-06-25 19:35:12 -07:00
Richard Sandiford 4bccb39eba Makefile.in (TARGET_DEF): Add target-insns.def.
gcc/
	* Makefile.in (TARGET_DEF): Add target-insns.def.
	(.PRECIOUS, simple_rtl_generated_h): Add insn-target-def.h.
	(build/gentarget-def.o): New rule.
	(genprogrtl): Add target-def.
	* target-insns.def, gentarget-def.c: New files.
	* target.def: Add targetm.have_* and targetm.gen_* hooks,
	based on the contents of target-insns.def.
	* defaults.h (HAVE_simple_return, gen_simple_return): Delete.
	(HAVE_return, gen_return): Delete.
	* target-def.h: Include insn-target-def.h.
	* cfgrtl.c (force_nonfallthru_and_redirect): Use targetm interface
	instead of direct calls.  Rely on them to do the appropriate assertions.
	* function.c (gen_return_pattern): Likewise.  Return an rtx_insn *.
	(convert_jumps_to_returns): Use targetm interface instead of
	direct calls.
	(thread_prologue_and_epilogue_insns): Likewise.
	* reorg.c (find_end_label, dbr_schedule): Likewise.
	* shrink-wrap.h (SHRINK_WRAPPING_ENABLED): Likewise.
	* shrink-wrap.c (convert_to_simple_return): Likewise.
	(try_shrink_wrapping): Use SHRINK_WRAPPING_ENABLED.

From-SVN: r224979
2015-06-25 17:18:12 +00:00