From 54e4624372cd6130754173145945add6fd73595b Mon Sep 17 00:00:00 2001 From: aldyh Date: Sat, 13 Jun 2009 13:51:53 +0000 Subject: [PATCH] * config/alpha/alpha.c (alpha_build_builtin_va_list): Pass location to build_decl. * config/s390/s390.c (s390_build_builtin_va_list): Same. (s390_gimplify_va_arg): Pass location to create_artificial_label. * config/spu/spu-protos.h: Add location to spu_resolve_overloaded_builtin. * config/spu/spu.c (spu_build_builtin_va_list): Pass location to spu_build_builtin_va_list. * config/spu/spu-c.c (spu_resolve_overloaded_builtin): Add location argument. Pass location to build_function_call_vec. * config/sh/sh.c (sh_build_builtin_va_list): Pass location to build_decl. (emit_fpu_switch): Same. (sh_gimplify_va_arg_expr): Pass location to create_artificial_label. * config/xtensa/xtensa.c (xtensa_build_builtin_va_list): Pass location to build_decl and create_artificial_label. (xtensa_gimplify_va_arg_expr): Same. * config/stormy16/stormy16.c (xstormy16_build_builtin_va_list): Same. (xstormy16_gimplify_va_arg_expr): Same. * config/iq2000/iq2000.c (iq2000_expand_prologue): Same. * config/arm/arm.c (arm_build_builtin_va_list): Same. * config/mips/mips.c (mips_build_builtin_va_list): Same. (mips16_build_function_stub): Same. (mips16_build_call_stub): Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148453 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 27 +++++++++++++++++++++++++++ gcc/config/alpha/alpha.c | 12 ++++++++---- gcc/config/arm/arm.c | 6 ++++-- gcc/config/iq2000/iq2000.c | 3 ++- gcc/config/mips/mips.c | 30 ++++++++++++++++++++---------- gcc/config/s390/s390.c | 19 ++++++++++++------- gcc/config/sh/sh.c | 22 ++++++++++++++-------- gcc/config/spu/spu-c.c | 4 ++-- gcc/config/spu/spu-protos.h | 3 ++- gcc/config/spu/spu.c | 9 ++++++--- gcc/config/stormy16/stormy16.c | 13 ++++++++----- gcc/config/xtensa/xtensa.c | 18 +++++++++++------- 12 files changed, 116 insertions(+), 50 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c2bdc07dee5..35be35e9321 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,30 @@ +2009-06-13 Aldy Hernandez + + * config/alpha/alpha.c (alpha_build_builtin_va_list): Pass location to + build_decl. + * config/s390/s390.c (s390_build_builtin_va_list): Same. + (s390_gimplify_va_arg): Pass location to create_artificial_label. + * config/spu/spu-protos.h: Add location to + spu_resolve_overloaded_builtin. + * config/spu/spu.c (spu_build_builtin_va_list): Pass location to + spu_build_builtin_va_list. + * config/spu/spu-c.c (spu_resolve_overloaded_builtin): Add location + argument. Pass location to build_function_call_vec. + * config/sh/sh.c (sh_build_builtin_va_list): Pass location to + build_decl. + (emit_fpu_switch): Same. + (sh_gimplify_va_arg_expr): Pass location to create_artificial_label. + * config/xtensa/xtensa.c (xtensa_build_builtin_va_list): Pass location + to build_decl and create_artificial_label. + (xtensa_gimplify_va_arg_expr): Same. + * config/stormy16/stormy16.c (xstormy16_build_builtin_va_list): Same. + (xstormy16_gimplify_va_arg_expr): Same. + * config/iq2000/iq2000.c (iq2000_expand_prologue): Same. + * config/arm/arm.c (arm_build_builtin_va_list): Same. + * config/mips/mips.c (mips_build_builtin_va_list): Same. + (mips16_build_function_stub): Same. + (mips16_build_call_stub): Same. + 2009-06-13 Richard Earnshaw PR target/40327 diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 635450276f7..1e7de8e7c24 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -5791,24 +5791,28 @@ alpha_build_builtin_va_list (void) return ptr_type_node; record = (*lang_hooks.types.make_type) (RECORD_TYPE); - type_decl = build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record); + type_decl = build_decl (BUILTINS_LOCATION, + TYPE_DECL, get_identifier ("__va_list_tag"), record); TREE_CHAIN (record) = type_decl; TYPE_NAME (record) = type_decl; /* C++? SET_IS_AGGR_TYPE (record, 1); */ /* Dummy field to prevent alignment warnings. */ - space = build_decl (FIELD_DECL, NULL_TREE, integer_type_node); + space = build_decl (BUILTINS_LOCATION, + FIELD_DECL, NULL_TREE, integer_type_node); DECL_FIELD_CONTEXT (space) = record; DECL_ARTIFICIAL (space) = 1; DECL_IGNORED_P (space) = 1; - ofs = build_decl (FIELD_DECL, get_identifier ("__offset"), + ofs = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__offset"), integer_type_node); DECL_FIELD_CONTEXT (ofs) = record; TREE_CHAIN (ofs) = space; - base = build_decl (FIELD_DECL, get_identifier ("__base"), + base = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__base"), ptr_type_node); DECL_FIELD_CONTEXT (base) = record; TREE_CHAIN (base) = ofs; diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 1f5c3ae9e8d..3809270b2c5 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -956,13 +956,15 @@ arm_build_builtin_va_list (void) /* Create the type. */ va_list_type = lang_hooks.types.make_type (RECORD_TYPE); /* Give it the required name. */ - va_list_name = build_decl (TYPE_DECL, + va_list_name = build_decl (BUILTINS_LOCATION, + TYPE_DECL, get_identifier ("__va_list"), va_list_type); DECL_ARTIFICIAL (va_list_name) = 1; TYPE_NAME (va_list_type) = va_list_name; /* Create the __ap field. */ - ap_field = build_decl (FIELD_DECL, + ap_field = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__ap"), ptr_type_node); DECL_ARTIFICIAL (ap_field) = 1; diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index 5ba18886778..b99043efa99 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -1860,7 +1860,8 @@ iq2000_expand_prologue (void) && targetm.calls.struct_value_rtx (TREE_TYPE (fndecl), 1) == 0) { tree type = build_pointer_type (fntype); - tree function_result_decl = build_decl (PARM_DECL, NULL_TREE, type); + tree function_result_decl = build_decl (BUILTINS_LOCATION, + PARM_DECL, NULL_TREE, type); DECL_ARG_TYPE (function_result_decl) = type; TREE_CHAIN (function_result_decl) = fnargs; diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 44dd4508ca6..62753a3fea7 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -5160,22 +5160,28 @@ mips_build_builtin_va_list (void) record = lang_hooks.types.make_type (RECORD_TYPE); - f_ovfl = build_decl (FIELD_DECL, get_identifier ("__overflow_argptr"), + f_ovfl = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__overflow_argptr"), ptr_type_node); - f_gtop = build_decl (FIELD_DECL, get_identifier ("__gpr_top"), + f_gtop = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__gpr_top"), ptr_type_node); - f_ftop = build_decl (FIELD_DECL, get_identifier ("__fpr_top"), + f_ftop = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__fpr_top"), ptr_type_node); - f_goff = build_decl (FIELD_DECL, get_identifier ("__gpr_offset"), + f_goff = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__gpr_offset"), unsigned_char_type_node); - f_foff = build_decl (FIELD_DECL, get_identifier ("__fpr_offset"), + f_foff = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__fpr_offset"), unsigned_char_type_node); /* Explicitly pad to the size of a pointer, so that -Wpadded won't warn on every user file. */ index = build_int_cst (NULL_TREE, GET_MODE_SIZE (ptr_mode) - 2 - 1); array = build_array_type (unsigned_char_type_node, build_index_type (index)); - f_res = build_decl (FIELD_DECL, get_identifier ("__reserved"), array); + f_res = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__reserved"), array); DECL_FIELD_CONTEXT (f_ovfl) = record; DECL_FIELD_CONTEXT (f_gtop) = record; @@ -5749,10 +5755,12 @@ mips16_build_function_stub (void) stubname = ACONCAT (("__fn_stub_", fnname, NULL)); /* Build a decl for the stub. */ - stubdecl = build_decl (FUNCTION_DECL, get_identifier (stubname), + stubdecl = build_decl (BUILTINS_LOCATION, + FUNCTION_DECL, get_identifier (stubname), build_function_type (void_type_node, NULL_TREE)); DECL_SECTION_NAME (stubdecl) = build_string (strlen (secname), secname); - DECL_RESULT (stubdecl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node); + DECL_RESULT (stubdecl) = build_decl (BUILTINS_LOCATION, + RESULT_DECL, NULL_TREE, void_type_node); /* Output a comment. */ fprintf (asm_out_file, "\t# Stub function for %s (", @@ -5993,10 +6001,12 @@ mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code) stubname = ACONCAT (("__call_stub_", fp_ret_p ? "fp_" : "", fnname, NULL)); stubid = get_identifier (stubname); - stubdecl = build_decl (FUNCTION_DECL, stubid, + stubdecl = build_decl (BUILTINS_LOCATION, + FUNCTION_DECL, stubid, build_function_type (void_type_node, NULL_TREE)); DECL_SECTION_NAME (stubdecl) = build_string (strlen (secname), secname); - DECL_RESULT (stubdecl) = build_decl (RESULT_DECL, NULL_TREE, + DECL_RESULT (stubdecl) = build_decl (BUILTINS_LOCATION, + RESULT_DECL, NULL_TREE, void_type_node); /* Output a comment. */ diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 6ec2b257b03..fd81bbac467 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -8384,15 +8384,20 @@ s390_build_builtin_va_list (void) record = lang_hooks.types.make_type (RECORD_TYPE); type_decl = - build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record); + build_decl (BUILTINS_LOCATION, + TYPE_DECL, get_identifier ("__va_list_tag"), record); - f_gpr = build_decl (FIELD_DECL, get_identifier ("__gpr"), + f_gpr = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__gpr"), long_integer_type_node); - f_fpr = build_decl (FIELD_DECL, get_identifier ("__fpr"), + f_fpr = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__fpr"), long_integer_type_node); - f_ovf = build_decl (FIELD_DECL, get_identifier ("__overflow_arg_area"), + f_ovf = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__overflow_arg_area"), ptr_type_node); - f_sav = build_decl (FIELD_DECL, get_identifier ("__reg_save_area"), + f_sav = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__reg_save_area"), ptr_type_node); va_list_gpr_counter_field = f_gpr; @@ -8616,8 +8621,8 @@ s390_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, /* Pull the value out of the saved registers ... */ - lab_false = create_artificial_label (); - lab_over = create_artificial_label (); + lab_false = create_artificial_label (UNKNOWN_LOCATION); + lab_over = create_artificial_label (UNKNOWN_LOCATION); addr = create_tmp_var (ptr_type_node, "addr"); DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set (); diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 7c8b82a7549..527cd7f791d 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -7501,17 +7501,22 @@ sh_build_builtin_va_list (void) record = (*lang_hooks.types.make_type) (RECORD_TYPE); - f_next_o = build_decl (FIELD_DECL, get_identifier ("__va_next_o"), + f_next_o = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__va_next_o"), ptr_type_node); - f_next_o_limit = build_decl (FIELD_DECL, + f_next_o_limit = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__va_next_o_limit"), ptr_type_node); - f_next_fp = build_decl (FIELD_DECL, get_identifier ("__va_next_fp"), + f_next_fp = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__va_next_fp"), ptr_type_node); - f_next_fp_limit = build_decl (FIELD_DECL, + f_next_fp_limit = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__va_next_fp_limit"), ptr_type_node); - f_next_stack = build_decl (FIELD_DECL, get_identifier ("__va_next_stack"), + f_next_stack = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__va_next_stack"), ptr_type_node); DECL_FIELD_CONTEXT (f_next_o) = record; @@ -7714,8 +7719,8 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, } addr = create_tmp_var (pptr_type_node, NULL); - lab_false = create_artificial_label (); - lab_over = create_artificial_label (); + lab_false = create_artificial_label (UNKNOWN_LOCATION); + lab_over = create_artificial_label (UNKNOWN_LOCATION); valist = build1 (INDIRECT_REF, ptr_type_node, addr); @@ -9041,7 +9046,8 @@ emit_fpu_switch (rtx scratch, int index) t = build_index_type (integer_one_node); t = build_array_type (integer_type_node, t); - t = build_decl (VAR_DECL, get_identifier ("__fpscr_values"), t); + t = build_decl (BUILTINS_LOCATION, + VAR_DECL, get_identifier ("__fpscr_values"), t); DECL_ARTIFICIAL (t) = 1; DECL_IGNORED_P (t) = 1; DECL_EXTERNAL (t) = 1; diff --git a/gcc/config/spu/spu-c.c b/gcc/config/spu/spu-c.c index a946b037cb7..fbbbf32e157 100644 --- a/gcc/config/spu/spu-c.c +++ b/gcc/config/spu/spu-c.c @@ -94,7 +94,7 @@ spu_macro_to_expand (cpp_reader *pfile, const cpp_token *tok) /* target hook for resolve_overloaded_builtin(). Returns a function call RTX if we can resolve the overloaded builtin */ tree -spu_resolve_overloaded_builtin (tree fndecl, void *passed_args) +spu_resolve_overloaded_builtin (location_t loc, tree fndecl, void *passed_args) { #define SCALAR_TYPE_P(t) (INTEGRAL_TYPE_P (t) \ || SCALAR_FLOAT_TYPE_P (t) \ @@ -187,7 +187,7 @@ spu_resolve_overloaded_builtin (tree fndecl, void *passed_args) return error_mark_node; } - return build_function_call_vec (match, fnargs, NULL); + return build_function_call_vec (loc, match, fnargs, NULL); #undef SCALAR_TYPE_P } diff --git a/gcc/config/spu/spu-protos.h b/gcc/config/spu/spu-protos.h index 2dbc6460750..65cdd07264e 100644 --- a/gcc/config/spu/spu-protos.h +++ b/gcc/config/spu/spu-protos.h @@ -88,7 +88,8 @@ extern void spu_init_expanders (void); extern void spu_split_convert (rtx *); /* spu-c.c */ -extern tree spu_resolve_overloaded_builtin (tree fndecl, void *fnargs); +extern tree spu_resolve_overloaded_builtin (location_t, tree fndecl, + void *fnargs); extern rtx spu_expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, int ignore); extern rtx spu_expand_builtin (tree, rtx, rtx, enum machine_mode, int); diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index a97bf24941f..8a40550f807 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -3952,10 +3952,13 @@ spu_build_builtin_va_list (void) record = (*lang_hooks.types.make_type) (RECORD_TYPE); type_decl = - build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record); + build_decl (BUILTINS_LOCATION, + TYPE_DECL, get_identifier ("__va_list_tag"), record); - f_args = build_decl (FIELD_DECL, get_identifier ("__args"), ptr_type_node); - f_skip = build_decl (FIELD_DECL, get_identifier ("__skip"), ptr_type_node); + f_args = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__args"), ptr_type_node); + f_skip = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__skip"), ptr_type_node); DECL_FIELD_CONTEXT (f_args) = record; DECL_ALIGN (f_args) = 128; diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index 16814ab4e7d..2e646f98d4c 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -1291,11 +1291,14 @@ xstormy16_build_builtin_va_list (void) tree f_1, f_2, record, type_decl; record = (*lang_hooks.types.make_type) (RECORD_TYPE); - type_decl = build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record); + type_decl = build_decl (BUILTINS_LOCATION, + TYPE_DECL, get_identifier ("__va_list_tag"), record); - f_1 = build_decl (FIELD_DECL, get_identifier ("base"), + f_1 = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("base"), ptr_type_node); - f_2 = build_decl (FIELD_DECL, get_identifier ("count"), + f_2 = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("count"), unsigned_type_node); DECL_FIELD_CONTEXT (f_1) = record; @@ -1377,8 +1380,8 @@ xstormy16_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, size_of_reg_args = NUM_ARGUMENT_REGISTERS * UNITS_PER_WORD; count_tmp = get_initialized_tmp_var (count, pre_p, NULL); - lab_gotaddr = create_artificial_label (); - lab_fromstack = create_artificial_label (); + lab_gotaddr = create_artificial_label (UNKNOWN_LOCATION); + lab_fromstack = create_artificial_label (UNKNOWN_LOCATION); addr = create_tmp_var (ptr_type_node, NULL); if (!must_stack) diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 9bdedc1814d..773223b2f35 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -2651,13 +2651,17 @@ xtensa_build_builtin_va_list (void) tree f_stk, f_reg, f_ndx, record, type_decl; record = (*lang_hooks.types.make_type) (RECORD_TYPE); - type_decl = build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record); + type_decl = build_decl (BUILTINS_LOCATION, + TYPE_DECL, get_identifier ("__va_list_tag"), record); - f_stk = build_decl (FIELD_DECL, get_identifier ("__va_stk"), + f_stk = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__va_stk"), ptr_type_node); - f_reg = build_decl (FIELD_DECL, get_identifier ("__va_reg"), + f_reg = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__va_reg"), ptr_type_node); - f_ndx = build_decl (FIELD_DECL, get_identifier ("__va_ndx"), + f_ndx = build_decl (BUILTINS_LOCATION, + FIELD_DECL, get_identifier ("__va_ndx"), integer_type_node); DECL_FIELD_CONTEXT (f_stk) = record; @@ -2848,8 +2852,8 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, lab_over = NULL; if (!targetm.calls.must_pass_in_stack (TYPE_MODE (type), type)) { - lab_false = create_artificial_label (); - lab_over = create_artificial_label (); + lab_false = create_artificial_label (UNKNOWN_LOCATION); + lab_over = create_artificial_label (UNKNOWN_LOCATION); t = build2 (GT_EXPR, boolean_type_node, unshare_expr (ndx), build_int_cst (integer_type_node, @@ -2879,7 +2883,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, __array = (AP).__va_stk; } */ - lab_false2 = create_artificial_label (); + lab_false2 = create_artificial_label (UNKNOWN_LOCATION); t = build2 (GT_EXPR, boolean_type_node, unshare_expr (orig_ndx), build_int_cst (integer_type_node, -- 2.11.4.GIT