1. 11 Jun, 2010 29 commits
  2. 10 Jun, 2010 11 commits
    • configure.ac: Set SYSTEMSPEC so that -allow_stack_execute is not passed to the linker for... · f8328d1d
      * configure.ac: Set SYSTEMSPEC so that -allow_stack_execute is not
      passed to the linker for -dynamiclib or -bundle on darwin.
      * configure: Regenerate.
      
      From-SVN: r160583
      Peter O'Gorman committed
    • md.texi: Document the "unspec" and "unspecv" enum names. · 0fe60a1b
      gcc/
      	* doc/md.texi: Document the "unspec" and "unspecv" enum names.
      	* Makefile.in (OBJS-common): Include insn-enums.o.
      	(insn-enums.o): New rule.
      	(simple_generated_c): Add insn-enums.c.
      	(build/genenums.o): New rule.
      	(genprogmd): Add "enums".
      	* genconstants.c (print_enum_type): Declare a C string array
      	for each enum.
      	* genenums.c: New file.
      	* print-rtl.c (print_rtx): If defined, use the "unspecv" enum
      	for UNSPEC_VOLATILE.  If defined, use the "unspec" enum for both
      	UNSPEC and (as a fallback) for UNSPEC_VOLATILE.
      
      From-SVN: r160582
      Richard Sandiford committed
    • md.texi (define_enum_attr): Document. · 8f4fe86c
      gcc/
      	* doc/md.texi (define_enum_attr): Document.
      	* rtl.def (DEFINE_ENUM_ATTR): New rtx.
      	* read-md.h (lookup_enum_type): Declare.
      	* read-md.c (lookup_enum_type): New function.
      	* genattr.c (gen_attr, main): Handle DEFINE_ENUM_ATTR.
      	* genattrtab.c (attr_desc): Add an enum_name field.
      	(evaluate_eq_attr): Take the associated attribute as argument.
      	Get the enum prefix from the enum_name field, if defined.
      	Use ACONCAT rather than a fixed-length buffer.  Update recursive calls.
      	(simplify_test_exp): Pass attr to evaluate_eq_attr.
      	(add_attr_value): New function, split out from...
      	(gen_attr): ...here.  Handle DEFINE_ENUM_ATTR.
      	(write_test_expr): Pass attr to evaluate_eq_attr.
      	(write_attr_get): Use the enum_name as the enum tag, if defined.
      	(write_attr_valueq): Use the enum_name as a prefix, if defined.
      	(find_attr): Initialize enum_name.
      	(main): Handle DEFINE_ENUM_ATTR.
      	* gensupport.c (process_rtx): Likewise.
      	* config/mips/mips.h (mips_tune_attr): Delete.
      	* config/mips/mips.md (cpu): Use define_attr_enum.
      
      From-SVN: r160581
      Richard Sandiford committed
    • md.texi (define_c_enum, [...]): Document. · 24609606
      gcc/
      	* doc/md.texi (define_c_enum, define_enum): Document.
      	* read-md.h (md_constant): Add a parent_enum field.
      	(enum_value, enum_type): New structures.
      	(upcase_string, traverse_enum_types): Declare.
      	* read-md.c (enum_types): New variable.
      	(upcase_string, add_constant): New functions.
      	(handle_constants): Don't create the hash table here.
      	Use add_constant.
      	(traverse_md_constants): Don't check for a null md_constants.
      	(decimal_string, handle_enum, traverse_enum_types): New functions.
      	(read_md_files): Initialize md_constants and md_enums.
      	* genconstants.c (print_md_constant): Ignore info argument.
      	Only print constants that belong to no enum.
      	(print_enum_type): New function.
      	(main): Don't pass stdout to print_md_constant.  Call print_enum_type
      	for each defined enum type.
      	* config/mips/mips.md (processor): New define_enum.
      	(unspec): New define_c_enum.
      	(UNSPEC_COMPARE_AND_SWAP, UNSPEC_COMPARE_AND_SWAP_12)
      	(UNSPEC_SYNC_OLD_OP, UNSPEC_SYNC_NEW_OP, UNSPEC_SYNC_NEW_OP_12)
      	(UNSPEC_SYNC_OLD_OP_12, UNSPEC_SYNC_EXCHANGE, UNSPEC_SYNC_EXCHANGE_12)
      	(UNSPEC_MEMORY_BARRIER): Moved to sync.md.
      	(UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ, UNSPEC_SUBQ_S, UNSPEC_ADDSC)
      	(UNSPEC_ADDWC, UNSPEC_MODSUB, UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S)
      	(UNSPEC_PRECRQ_QB_PH, UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W)
      	(UNSPEC_PRECRQU_S_QB_PH, UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR)
      	(UNSPEC_PRECEQU_PH_QBL, UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA)
      	(UNSPEC_PRECEQU_PH_QBRA, UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR)
      	(UNSPEC_PRECEU_PH_QBLA, UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL)
      	(UNSPEC_SHLL_S, UNSPEC_SHRL_QB, UNSPEC_SHRA_PH, UNSPEC_SHRA_R)
      	(UNSPEC_MULEU_S_PH_QBL, UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH)
      	(UNSPEC_MULEQ_S_W_PHL, UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL)
      	(UNSPEC_DPAU_H_QBR, UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR)
      	(UNSPEC_DPAQ_S_W_PH, UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH)
      	(UNSPEC_DPAQ_SA_L_W, UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL)
      	(UNSPEC_MAQ_S_W_PHR, UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR)
      	(UNSPEC_BITREV, UNSPEC_INSV, UNSPEC_REPL_QB, UNSPEC_REPL_PH)
      	(UNSPEC_CMP_EQ, UNSPEC_CMP_LT, UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB)
      	(UNSPEC_CMPGU_LT_QB, UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH)
      	(UNSPEC_EXTR_W, UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H)
      	(UNSPEC_EXTP, UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP)
      	(UNSPEC_RDDSP): Move to mips-dsp.md.
      	(UNSPEC_ABSQ_S_QB, UNSPEC_ADDU_PH, UNSPEC_ADDU_S_PH, UNSPEC_ADDUH_QB)
      	(UNSPEC_ADDUH_R_QB, UNSPEC_APPEND, UNSPEC_BALIGN, UNSPEC_CMPGDU_EQ_QB)
      	(UNSPEC_CMPGDU_LT_QB, UNSPEC_CMPGDU_LE_QB, UNSPEC_DPA_W_PH)
      	(UNSPEC_DPS_W_PH, UNSPEC_MADD, UNSPEC_MADDU, UNSPEC_MSUB, UNSPEC_MSUBU)
      	(UNSPEC_MUL_PH, UNSPEC_MUL_S_PH, UNSPEC_MULQ_RS_W, UNSPEC_MULQ_S_PH)
      	(UNSPEC_MULQ_S_W, UNSPEC_MULSA_W_PH, UNSPEC_MULT, UNSPEC_MULTU)
      	(UNSPEC_PRECR_QB_PH, UNSPEC_PRECR_SRA_PH_W, UNSPEC_PRECR_SRA_R_PH_W)
      	(UNSPEC_PREPEND, UNSPEC_SHRA_QB, UNSPEC_SHRA_R_QB, UNSPEC_SHRL_PH)
      	(UNSPEC_SUBU_PH, UNSPEC_SUBU_S_PH, UNSPEC_SUBUH_QB, UNSPEC_SUBUH_R_QB)
      	(UNSPEC_ADDQH_PH, UNSPEC_ADDQH_R_PH, UNSPEC_ADDQH_W, UNSPEC_ADDQH_R_W)
      	(UNSPEC_SUBQH_PH, UNSPEC_SUBQH_R_PH, UNSPEC_SUBQH_W, UNSPEC_SUBQH_R_W)
      	(UNSPEC_DPAX_W_PH, UNSPEC_DPSX_W_PH, UNSPEC_DPAQX_S_W_PH)
      	(UNSPEC_DPAQX_SA_W_PH, UNSPEC_DPSQX_S_W_PH, UNSPEC_DPSQX_SA_W_PH):
      	Moved to mips-dspr2.md.
      	(UNSPEC_MOVE_TF_PS, UNSPEC_C, UNSPEC_ALNV_PS, UNSPEC_CABS)
      	(UNSPEC_ADDR_PS, UNSPEC_CVT_PW_PS, UNSPEC_CVT_PS_PW, UNSPEC_MULR_PS)
      	(UNSPEC_ABS_PS, UNSPEC_RSQRT1, UNSPEC_RSQRT2, UNSPEC_RECIP1)
      	(UNSPEC_RECIP2, UNSPEC_SINGLE_CC, UNSPEC_SCC): Moved from mips-ps-3d.md.
      	(UNSPEC_LOONGSON_PAVG, UNSPEC_LOONGSON_PCMPEQ, UNSPEC_LOONGSON_PCMPGT)
      	(UNSPEC_LOONGSON_PEXTR, UNSPEC_LOONGSON_PINSR_0)
      	(UNSPEC_LOONGSON_PINSR_1, UNSPEC_LOONGSON_PINSR_2)
      	(UNSPEC_LOONGSON_PINSR_3, UNSPEC_LOONGSON_PMADD)
      	(UNSPEC_LOONGSON_PMOVMSK, UNSPEC_LOONGSON_PMULHU)
      	(UNSPEC_LOONGSON_PMULH, UNSPEC_LOONGSON_PMULL, UNSPEC_LOONGSON_PMULU)
      	(UNSPEC_LOONGSON_PASUBUB, UNSPEC_LOONGSON_BIADD, UNSPEC_LOONGSON_PSADBH)
      	(UNSPEC_LOONGSON_PSHUFH, UNSPEC_LOONGSON_PUNPCKH)
      	(UNSPEC_LOONGSON_PUNPCKL, UNSPEC_LOONGSON_PADDD)
      	(UNSPEC_LOONGSON_PSUBD): Move to mips-loongson.md.
      	(UNSPEC_LOONGSON_ALU1_TURN_ENABLED_INSN)
      	(UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN)
      	(UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN)
      	(UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN): Moved to mips-loongson2ef.md.
      	(cpu): Update comment.
      	* config/mips/sync.md (UNSPEC_COMPARE_AND_SWAP)
      	(UNSPEC_COMPARE_AND_SWAP_12, UNSPEC_SYNC_OLD_OP, UNSPEC_SYNC_NEW_OP)
      	(UNSPEC_SYNC_NEW_OP_12, UNSPEC_SYNC_OLD_OP_12, UNSPEC_SYNC_EXCHANGE)
      	(UNSPEC_SYNC_EXCHANGE_12, UNSPEC_MEMORY_BARRIER): Moved from mips.md.
      	* config/mips/loongson.md (UNSPEC_LOONGSON_PAVG, UNSPEC_LOONGSON_PCMPEQ)
      	(UNSPEC_LOONGSON_PCMPGT, UNSPEC_LOONGSON_PEXTR, UNSPEC_LOONGSON_PINSR_0)
      	(UNSPEC_LOONGSON_PINSR_1, UNSPEC_LOONGSON_PINSR_2)
      	(UNSPEC_LOONGSON_PINSR_3, UNSPEC_LOONGSON_PMADD)
      	(UNSPEC_LOONGSON_PMOVMSK, UNSPEC_LOONGSON_PMULHU)
      	(UNSPEC_LOONGSON_PMULH, UNSPEC_LOONGSON_PMULL, UNSPEC_LOONGSON_PMULU)
      	(UNSPEC_LOONGSON_PASUBUB, UNSPEC_LOONGSON_BIADD, UNSPEC_LOONGSON_PSADBH)
      	(UNSPEC_LOONGSON_PSHUFH, UNSPEC_LOONGSON_PUNPCKH)
      	(UNSPEC_LOONGSON_PUNPCKL, UNSPEC_LOONGSON_PADDD)
      	(UNSPEC_LOONGSON_PSUBD): Moved from mips.md
      	* config/mips/loongson2ef.md (UNSPEC_LOONGSON_ALU1_TURN_ENABLED_INSN)
      	(UNSPEC_LOONGSON_ALU2_TURN_ENABLED_INSN)
      	(UNSPEC_LOONGSON_FALU1_TURN_ENABLED_INSN)
      	(UNSPEC_LOONGSON_FALU2_TURN_ENABLED_INSN): Moved from mips.md
      	* config/mips/mips-dsp.md (UNSPEC_ADDQ, UNSPEC_ADDQ_S, UNSPEC_SUBQ)
      	(UNSPEC_SUBQ_S, UNSPEC_ADDSC, UNSPEC_ADDWC, UNSPEC_MODSUB)
      	(UNSPEC_RADDU_W_QB, UNSPEC_ABSQ_S, UNSPEC_PRECRQ_QB_PH)
      	(UNSPEC_PRECRQ_PH_W, UNSPEC_PRECRQ_RS_PH_W, UNSPEC_PRECRQU_S_QB_PH)
      	(UNSPEC_PRECEQ_W_PHL, UNSPEC_PRECEQ_W_PHR, UNSPEC_PRECEQU_PH_QBL)
      	(UNSPEC_PRECEQU_PH_QBR, UNSPEC_PRECEQU_PH_QBLA, UNSPEC_PRECEQU_PH_QBRA)
      	(UNSPEC_PRECEU_PH_QBL, UNSPEC_PRECEU_PH_QBR, UNSPEC_PRECEU_PH_QBLA)
      	(UNSPEC_PRECEU_PH_QBRA, UNSPEC_SHLL, UNSPEC_SHLL_S, UNSPEC_SHRL_QB)
      	(UNSPEC_SHRA_PH, UNSPEC_SHRA_R, UNSPEC_MULEU_S_PH_QBL)
      	(UNSPEC_MULEU_S_PH_QBR, UNSPEC_MULQ_RS_PH, UNSPEC_MULEQ_S_W_PHL)
      	(UNSPEC_MULEQ_S_W_PHR, UNSPEC_DPAU_H_QBL, UNSPEC_DPAU_H_QBR)
      	(UNSPEC_DPSU_H_QBL, UNSPEC_DPSU_H_QBR, UNSPEC_DPAQ_S_W_PH)
      	(UNSPEC_DPSQ_S_W_PH, UNSPEC_MULSAQ_S_W_PH, UNSPEC_DPAQ_SA_L_W)
      	(UNSPEC_DPSQ_SA_L_W, UNSPEC_MAQ_S_W_PHL, UNSPEC_MAQ_S_W_PHR)
      	(UNSPEC_MAQ_SA_W_PHL, UNSPEC_MAQ_SA_W_PHR, UNSPEC_BITREV, UNSPEC_INSV)
      	(UNSPEC_REPL_QB, UNSPEC_REPL_PH, UNSPEC_CMP_EQ, UNSPEC_CMP_LT)
      	(UNSPEC_CMP_LE, UNSPEC_CMPGU_EQ_QB, UNSPEC_CMPGU_LT_QB)
      	(UNSPEC_CMPGU_LE_QB, UNSPEC_PICK, UNSPEC_PACKRL_PH, UNSPEC_EXTR_W)
      	(UNSPEC_EXTR_R_W, UNSPEC_EXTR_RS_W, UNSPEC_EXTR_S_H, UNSPEC_EXTP)
      	(UNSPEC_EXTPDP, UNSPEC_SHILO, UNSPEC_MTHLIP, UNSPEC_WRDSP)
      	(UNSPEC_RDDSP): Moved from mips.md.
      	* config/mips/mips-dspr2.md (UNSPEC_ABSQ_S_QB, UNSPEC_ADDU_PH)
      	(UNSPEC_ADDU_S_PH, UNSPEC_ADDUH_QB, UNSPEC_ADDUH_R_QB, UNSPEC_APPEND)
      	(UNSPEC_BALIGN, UNSPEC_CMPGDU_EQ_QB, UNSPEC_CMPGDU_LT_QB)
      	(UNSPEC_CMPGDU_LE_QB, UNSPEC_DPA_W_PH, UNSPEC_DPS_W_PH, UNSPEC_MADD)
      	(UNSPEC_MADDU, UNSPEC_MSUB, UNSPEC_MSUBU, UNSPEC_MUL_PH)
      	(UNSPEC_MUL_S_PH, UNSPEC_MULQ_RS_W, UNSPEC_MULQ_S_PH, UNSPEC_MULQ_S_W)
      	(UNSPEC_MULSA_W_PH, UNSPEC_MULT, UNSPEC_MULTU, UNSPEC_PRECR_QB_PH)
      	(UNSPEC_PRECR_SRA_PH_W, UNSPEC_PRECR_SRA_R_PH_W, UNSPEC_PREPEND)
      	(UNSPEC_SHRA_QB, UNSPEC_SHRA_R_QB, UNSPEC_SHRL_PH, UNSPEC_SUBU_PH)
      	(UNSPEC_SUBU_S_PH, UNSPEC_SUBUH_QB, UNSPEC_SUBUH_R_QB, UNSPEC_ADDQH_PH)
      	(UNSPEC_ADDQH_R_PH, UNSPEC_ADDQH_W, UNSPEC_ADDQH_R_W, UNSPEC_SUBQH_PH)
      	(UNSPEC_SUBQH_R_PH, UNSPEC_SUBQH_W, UNSPEC_SUBQH_R_W, UNSPEC_DPAX_W_PH)
      	(UNSPEC_DPSX_W_PH, UNSPEC_DPAQX_S_W_PH, UNSPEC_DPAQX_SA_W_PH)
      	(UNSPEC_DPSQX_S_W_PH, UNSPEC_DPSQX_SA_W_PH): Moved from mips.md.
      	* config/mips/mips-ps-3d.md (UNSPEC_MOVE_TF_PS, UNSPEC_C)
      	(UNSPEC_ALNV_PS, UNSPEC_CABS, UNSPEC_ADDR_PS, UNSPEC_CVT_PW_PS)
      	(UNSPEC_CVT_PS_PW, UNSPEC_MULR_PS, UNSPEC_ABS_PS, UNSPEC_RSQRT1)
      	(UNSPEC_RSQRT2, UNSPEC_RECIP1, UNSPEC_RECIP2, UNSPEC_SINGLE_CC)
      	(UNSPEC_SCC): Moved from mips.md.
      	* config/mips/mips.c (mips_arch, mips_tune): Change enum from
      	"processor_type" to "processor".
      	(mips_rtx_cost_data): Replace PROCESSOR_MAX with NUM_PROCESSOR_VALUES.
      	* config/mips/mips.h (processor_type): Delete.
      	(mips_cpu_info.cpu, mips_arch, mips_tune): Change enum from
      	"processor_type" to "processor".
      
      From-SVN: r160580
      Richard Sandiford committed
    • configure.ac (tm_include_list): Add insn-constants.h. · c513ce77
      gcc/
      	* configure.ac (tm_include_list): Add insn-constants.h.
      	* configure: Regenerate.
      	* Makefile.in (GTM_H): Move insn-constants.h here from...
      	(TM_H): ...here.
      	* mkconfig.sh: Remove special handling for insn-constants.h.
      
      From-SVN: r160579
      Richard Sandiford committed
    • Makefile.in (BUILD_RTL): Move build/read-md.o to... · 9b68b6ea
      gcc/
      	* Makefile.in (BUILD_RTL): Move build/read-md.o to...
      	(BUILD_MD): ...this new variable.
      	(simple_generated_rtl_h, simple_generated_rtl_c): New variables
      	that include the old contents of simple_generated_h and
      	simple_generated_c.
      	(simple_generated_h, simple_generated_c): Include them.  Add
      	insn-constants.h.
      	(s-%): Make simple_generated_{h,c} stamps depend on $(MD_DEPS)
      	and simple_generated_rtl_{h,c} stamps depend on insn-conditions.md.
      	Remove these dependencies from the main rule and include
      	insn-conditions.md in the command line only if it appears
      	in the dependency list.
      	(insn-constants.h, s-constants): Delete.
      	(build/genconstants.o): Don't depend on $(RTL_BASE_H), $(GTM_H)
      	or gensupport.h.
      	(build/genmddeps.o): Likewise.
      	(genprogrtl): New variable that contains everything from genprogmd
      	except mddeps and constants.
      	(genprogmd): Redefine in terms of genprogrtl.  Make these programs
      	depend on $(BUILD_MD)
      	(genprog): New variable.  Make these programs depend on
      	$(BUILD_ERRORS).
      	* genmddeps.c: Don't include tm.h, rtl.h or gensupport.h.
      	(main): Use read_md_files instead of init_rtx_reader_args.
      	* genconstants.c: As for genmddeps.c.
      	* read-md.h (read_skip_construct): Declare.
      	* read-md.c (read_skip_construct): New function.
      	(handle_file): Allow a null handle_directive, skipping the
      	construct if so.
      	(parse_include): Update the comment accordingly.
      
      From-SVN: r160578
      Richard Sandiford committed
    • Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). · 600ab3fc
      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
      Richard Sandiford committed
    • read-md.h (read_char): Increment read_md_lineno after reading '\n'. · 7f7c467f
      gcc/
      	* read-md.h (read_char): Increment read_md_lineno after reading '\n'.
      	(unread_char): Decrement read_md_lineno after putting back '\n'.
      	* read-md.c (fatal_with_file_and_line): Push back any characters
      	that we decide not to add to the context.
      	(read_skip_spaces): Don't increment read_md_lineno here.  Avoid using
      	fatal_expected_char in cases where '/' ends a line (for example).
      	(read_name): Don't increment read_md_lineno here.
      	(read_escape): Likewise.
      	(read_quoted_string): Likewise.
      	(read_braced_string): Likewise.
      
      From-SVN: r160576
      Richard Sandiford committed
    • Makefile.in (READ_MD_H): Add $(HASHTAB_H). · 9f418533
      gcc/
      	* Makefile.in (READ_MD_H): Add $(HASHTAB_H).
      	(build/genconstants.o): Depend on $(READ_MD_H) gensupport.h.
      	* genconstants.c: Include read-md.h.
      	* read-rtl.c (md_constants): Move to read-md.c.
      	(md_name): Move to read-md.h.
      	(initialize_iterators): Use leading_string_hash instead of def_hash
      	and leading_string_eq_p instead of def_name_eq_p.
      	(read_name): Move to read-md.c.
      	(def_hash, def_name_eq_p): Delete.
      	(read_constants, traverse_md_constants): Move to read-md.c.
      	* rtl.h (md_constant, traverse_md_constants): Move to read-md.h.
      	* read-md.h: Include hashtab.h.
      	(md_name): Moved from read-rtl.c.
      	(md_constant): Moved from read-md.h.
      	(leading_string_hash, leading_string_eq_p, read_name)
      	(read_constants, traverse_md_constants): Declare.
      	* read-md.c (md_constants): Moved from read-rtl.c.
      	(leading_string_hash, leading_string_eq_p): New functions.
      	(read_name, read_constants, traverse_md_constants): Moved from
      	read-rtl.c.
      
      From-SVN: r160575
      Richard Sandiford committed
    • read-rtl.c (md_name): New structure. · 82f8e3fd
      gcc/
      	* read-rtl.c (md_name): New structure.
      	(read_name): Take an md_name instead of a buffer pointer.
      	Use the "string" field instead of strcpy when expanding constants.
      	(read_constants): Remove the tmp_char argument.  Update the calls
      	to read_name, using two local name buffers instead of the tmp_char
      	argument.  Merge the constant-creation code.
      	(read_conditions): Remove the tmp_char argument.  Update the calls
      	to read_name, using a local name buffer instead of the tmp_char
      	argument.
      	(read_mapping): Replace tmp_char variable with a local name buffer.
      	Update the calls to read_name.
      	(read_rtx_1): Likewise.  Update the calls to read_constants and
      	read_conditions.
      
      From-SVN: r160574
      Richard Sandiford committed
    • Makefile.in (build/read-md.o): Depend on errors.h. · bb933490
      gcc/
      	* Makefile.in (build/read-md.o): Depend on errors.h.
      	* read-md.h (error_with_line): Declare.
      	* read-md.c: Include errors.h.
      	(message_with_line_1): New function, extracted from...
      	(message_with_line): ...here.
      	(error_with_line): New function.
      	* genattrtab.c: If a call to message_with_line is followed by
      	"have_error = 1;", replace both statements with a call to
      	error_with_line.
      	* genoutput.c: Likewise.
      	* genpreds.c: Likewise.
      	* genrecog.c: If a call to message_with_line is followed by
      	"error_count++;", replace both statements with a call to
      	error_with_line.
      	(errorcount): Delete.
      	(main): Don't check it.
      	* gensupport.c: If a call to message_with_line is followed by
      	"errors = 1;", replace both statements with a call to error_with_line.
      	(errors): Delete.
      	(process_define_cond_exec): Check have_error instead of errors.
      	(init_md_reader_args_cb): Likewise.  Don't set errors.
      
      From-SVN: r160573
      Richard Sandiford committed