diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2009-06-12 22:06:47 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2009-06-12 22:06:47 +0000 |
commit | c2255bc4884a7624b32185e188fdb94a4167a35c (patch) | |
tree | 67f495ddc3964a90084152e177995da72e7bce30 /gcc/fortran | |
parent | 312243969e3a0022c0eabe6f974c24abd4a2211b (diff) | |
download | gcc-c2255bc4884a7624b32185e188fdb94a4167a35c.zip gcc-c2255bc4884a7624b32185e188fdb94a4167a35c.tar.gz gcc-c2255bc4884a7624b32185e188fdb94a4167a35c.tar.bz2 |
java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt.
gcc/java/
* java-gimplify.c (java_gimplify_block): New argument to
build_empty_stmt.
* expr.c (force_evaluation_order): Same.
* typeck.c: Add location to build_decl or PUSH_FIELD calls.
* class.c: Same.
* decl.c: Same.
* jcf-parse.c: Same.
* constants.c: Same.
* resource.c: Same.
* except.c: Same.
* builtins.c: Same.
* expr.c: Same.
* java-tree.h (PUSH_FIELD): Add location field.
gcc/objc/
* objc-act.c (finish_var_decl): Pass location to finish_decl.
(objc_get_parm_info): Same.
(get_super_receiver): Same.
* objc-act.c (objc_build_component_ref): Pass location to
build_compound_ref.
(build_module_initializer_routine): Pass location to
c_end_compound_stmt.
(objc_generate_static_init_call): Pass location to build_stmt.
(build_typed_selector_reference): New location argument.
(build_selector_reference): Same.
(objc_substitute_decl): Pass location to build_array_ref.
(next_sjlj_build_try_catch_finally): Pass location to build_stmt.
(objc_begin_catch_clause): Same.
(objc_finish_try_stmt): Same.
(objc_finish_catch_clause): Pass location to c_end_compound_stmt.
(objc_build_throw_stmt): New argument.
(generate_shared_structures): Pass location to build_c_cast.
(objc_build_message_expr): Use local location.
(objc_finish_message_expr): Use input_location.
(build_objc_method_call): New argument.
(objc_build_selector_expr): Same.
(get_super_receiver): Pass location to build_c_cast,
build_modify_expr, build_compound_expr.
* objc-act.c: Add location to all calls to start_struct, build_decl,
finish_struct.
gcc/
* tree-pretty-print.c (dump_generic_node): Dump column numbers.
* gimple-pretty-print.c (dump_gimple_stmt): Same.
* gimplify.c (gimplify_modify_expr): Set location for GIMPLE_ASSIGNs
created.
* c-parser.c (c_parser_binary_expression): Use current column while
building binary operations.
* common.opt (fshow-column): Enable by default.
* tree-vrp.c (check_array_ref): Use warning_at.
(check_array_bounds): Use location from call back if expr has no
location.
* tree.h: Add location argument to maybe_fold_*.
* tree-ssa-ccp.c (ccp_fold): Pass location to maybe_fold_*.
(maybe_fold_offset_to_array_ref): Add location argument and use it.
(maybe_fold_offset_to_component_ref): Same.
(maybe_fold_offset_to_reference): Same.
(maybe_fold_offset_to_address): Same.
(maybe_fold_stmt_indirect): Same.
(maybe_fold_stmt_addition): Same.
(fold_stmt_r): Pass location to maybe_fold_*.
(fold_gimple_assign): Same.
* c-tree.h: Add location argument to finish_decl,
default_function_array_conversion, store_init_value.
* c-decl.c (define_label): Use error_at.
(c_make_fname_decl): Pass location to finish_decl.
(finish_decl): New location argument.
(build_compound_literal): Pass location to store_init_value.
(grokdeclarator): Pass location to finish_decl.
(grokfield): Same.
* c-typeck.c (array_to_pointer_conversion): New location argument.
(function_to_pointer_conversion): Same.
(default_function_array_conversion): Same.
(parser_build_unary_op): Pass location to overflow_warning.
(parser_build_binary_op): Same. Use warning_at.
(build_unary_op): Pass location to array_to_pointer_conversion.
(build_c_cast): Pass location to digest_init.
(build_modify_expr): New location argument.
(convert_for_assignment): Same.
(store_init_value): Same.
(digest_init): Same.
(output_init_element): Pass location to digest_init and
array_to_pointer_conversion.
(c_finish_return): Pass location to convert_for_assignment.
* gimplify.c (gimplify_conversion): Pass location to
maybe_fold_offset_to_address.
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Pass location
to maybe_fold_stmt_addition.
* c-omp.c (c_finish_omp_atomic): Pass new location to
build_modify_expr.
(c_finish_omp_for): Same.
* c-common.c (overflow_warning): New argument.
* c-common.h: New argument to build_modify_expr, overflow_warning.
* c-parser.c (c_parser_declaration_or_fndef): Pass location to
finish_decl.
(c_parser_initializer): Pass location to
default_function_array_conversion.
(c_parser_initelt): Same.
(c_parser_initval): Same.
(c_parser_asm_operands): Same.
(c_parser_expr_no_commas): Same. Pass location to build_modify_expr.
(c_parser_conditional_expression): Same.
(c_parser_binary_expression): Add location info to stack. Use it.
(c_parser_unary_expression): Pass location to
default_function_array_conversion, parser_build_unary_op,
build_indirect_ref, c_parser_postfix_expression_after_primary.
(c_parser_postfix_expression_after_primary): New location argument.
Use it.
(c_parser_expression_conv): Pass location to
default_function_array_conversion.
(c_parser_expr_list): Same.
(c_parser_omp_atomic): Same.
(c_parser_omp_for_loop): Same.
* c-tree.h: (struct c_declarator): Add comment to id_loc.
(build_array_declarator): New argument.
* c-decl.c (build_array_declarator): Add location argument.
(grokdeclarator): Set id_loc for cdk_array.
* c-parser.c (c_parser_direct_declarator_inner): Pass location to
build_array_declarator.
* tree.c (build_omp_clause): Add location argument.
* tree.h (OMP_CLAUSE_HAS_LOCATION): New macro.
(OMP_CLAUSE_LOCATION): New macro.
(struct tree_omp_clause): Add location field.
(build_omp_clause): Add argument.
* testsuite/gcc.dg/gomp/for-1.c: Fix column.
* cp/pt.c (tsubst_omp_for_iterator): Pass location to
build_omp_clause.
* cp/parser.c (cp_parser_omp_var_list_no_open): Same.
(cp_parser_omp_clause_collapse): Same.
(cp_parser_omp_clause_default): Same.
(cp_parser_omp_clause_if): Same.
(cp_parser_omp_clause_nowait): Same.
(cp_parser_omp_clause_num_threads): Same.
(cp_parser_omp_clause_ordered): Same.
(cp_parser_omp_clause_schedule): Same.
(cp_parser_omp_clause_untied): Same.
(cp_parser_omp_for_loop): Same.
(cp_parser_omp_parallel): Pass location to c_split_parallel_clauses.
* c-tree.h (c_start_case): Add location argument.
(c_process_expr_stmt): Same.
(c_finish_goto_*): Same.
* tree-parloops.c (initialize_reductions): Pass location to
build_omp_clause.
(create_parallel_loop): Same.
* fortran/trans-openmp.c (gfc_trans_omp_variable_list): Same.
(gfc_trans_omp_reduction_list): Same.
(gfc_trans_omp_clauses): Same.
(gfc_trans_omp_do): Same.
* c-typeck.c (c_finish_goto_label): Same.
(c_finish_goto_ptr): New location argument.
(c_start_case): Same.
(emit_side_effect_warnings): Same.
(c_process_expr_stmt): Same.
(c_finish_stmt_expr): Same.
(c_finish_omp_clauses): Use error_at instead of error.
* gimplify.c (gimplify_adjust_omp_clauses_1): Pass location to
build_omp_clause.
* c-omp.c (c_split_parallel_clauses): New location argument.
* tree-nested.c (convert_nonlocal_reference_stmt): Pass location
to build_omp_clause.
(convert_local_reference_stmt): Same.
(convert_gimple_call): Same.
* c-common.h (c_split_parallel_clauses): New argument.
* c-parser.c (c_parser_statement_after_labels): Pass location to
c_finish_goto_label.
(c_parser_switch_statement): Pass location to c_start_case.
(c_parser_for_statement): Pass location to c_finish_expr_stmt,
and c_process_expr_stmt.
(c_parser_omp_variable_list): Add location argument.
(c_parser_omp_clause_collapse): Pass location to
build_omp_clause.
(c_parser_omp_clause_default): Same.
(c_parser_omp_clause_if): Same.
(c_parser_omp_clause_num_threads): Same.
(-c_parser_omp_clause_ordered): Same.
(c_parser_omp_clause_reduction): Pass location to
c_parser_omp_variable_list.
(c_parser_omp_clause_schedule): Pass location to build_omp_clause.
(c_parser_omp_clause_untied): Same.
(c_parser_omp_for_loop): Pass location to c_process_expr_stmt.
(c_parser_omp_parallel): Pass location to
c_split_parallel_clauses.
* c-tree.h (check_for_loop_decls, undeclared_variable,
build_component_ref, build_array_ref, build_external_ref,
c_expr_sizeof_expr, c_expr_sizeof_type, parser_build_unary_op,
build_conditional_expr, build_compound_expr, c_cast_expr,
build_c_cast, build_asm_expr, c_end_compound_stmt, c_finish_stmt_expr,
c_finish_return, c_finish_omp_parallel, c_finish_omp_task): New
argument.
* c-semantics.c (build_stmt): Same.
(build_case_label): Same.
* c-decl.c (c_finish_incomplete_decl): Pass location on down.
(undeclared_variable): New argument.
(make_label): Same.
(lookup_label): Pass location on down.
(define_label): Same.
(finish_decl): Same.
(build_compound_literal): Same.
(finish_struct): Same.
(finish_function): Do not set location here.
(check_for_loop_decls): New argument.
* tree.c (save_expr): Set location.
(build_empty_stmt): New argument.
* tree.h (build_empty_stmt): New argument to build_empty_stmt.
(CAN_HAVE_LOCATION_P): Make sure we have a non empty node.
* builtins.c (gimplify_va_arg_expr): Use locations.
(expand_builtin_sync_operation): Same.
* c-typeck.c (build_component_ref): New argument.
(build_array_ref): Same.
(build_external_ref): Same.
(c_expr_sizeof_expr): Same.
(c_expr_sizeof_type): Same.
(parser_build_unary_op): Same.
(build_conditional_expr): Same.
(build_compound_expr): Pass location on down.
(build_compound_expr): New argument.
(build_c_cast): Same.
(c_cast_expr): Same.
(build_asm_expr): Same.
(c_finish_return): Same.
(c_process_expr_stmt): Pass location on down.
(c_finish_stmt_expr): New argument.
(push_clenaup): Same.
(c_finish_omp_parallel): Same.
(c_finish_omp_task): Same.
* gimplify.c (gimplify_call_expr): Pass location on down.
* c-omp.c (c_finish_omp_master): New argument.
(c_finish_omp_critical): Same.
(c_finish_omp_ordered): Same.
(c_finish_omp_barrier): Same.
(-c_finish_omp_taskwait): Same.
(c_finish_omp_atomic): Same.
(c_finish_omp_flush): Same.
* tree-inline.c (copy_tree_body_r): Pass location on down.
(inline_forbidden_p): Remove use of input_location.
* c-gimplify.c (c_build_bind_expr): New argument.
* c-common.c (c_common_truthvalue_conversion): Pass location on down.
(c_sizeof_or_alignof_type): New argument.
(c_alignof_expr): Same.
(build_va_arg): Same.
(c_add_case_label): Same.
* c-common.h (c_sizeof_or_alignof_type, c_alignof_expr,
c_sizeof, c_alignof, build_va_arg, build_stmt, build_case_label,
c_build_bind_expr, objc_build_selector_expr, objc_build_throw_stmt,
c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered,
c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush,
c_finish_omp_taskwait, c_finish_omp_for, c_split_parallel_clauses):
New argument.
* stub-objc.c (objc_build_selector_expr): Same.
(objc_build_throw_stmt): Same.
* c-parser.c (c_parser_declaration_or_fndef): Pass location on down.
(c_parser_initelt): Same.
(c_parser_compound_statement): Same.
(c_parser_compound_statement_nostart): Same.
(c_parser_label): Same.
(c_parser_statement_after_labels): Same.
(c_parser_if_body): Same.
(c_parser_else_body): Same.
(c_parser_if_statement): Same.
(c_parser_switch_statement): Same.
(c_parser_while_statement): Same.
(c_parser_do_statement): Same.
(c_parser_for_statement): Same.
(c_parser_asm_statement): Same.
(c_parser_conditional_expression): Same.
(c_parser_binary_expression): Same.
(c_parser_cast_expression): Same.
(c_parser_unary_expression): Same.
(c_parser_sizeof_expression): Same.
(c_parser_alignof_expression): Same.
(c_parser_postfix_expression): Same.
(c_parser_expression): Same.
(c_parser_objc_receiver): Same.
(c_parser_omp_variable_list): Same.
(c_parser_omp_structured_block): Same.
(c_parser_omp_atomic): New argument.
(c_parser_omp_barrier): Same.
(c_parser_omp_critical): Same.
(c_parser_omp_flush): Pass location on down.
(c_parser_omp_for_loop): New argument.
(c_parser_omp_for): Same.
(c_parser_omp_master): Same.
(c_parser_omp_ordered): Same.
(c_parser_omp_sections_scope): Same.
(c_parser_omp_sections): Same.
(c_parser_omp_parallel): Same.
(c_parser_omp_single): Same.
(c_parser_omp_task): Same.
(c_parser_omp_taskwait): Pass location on down.
(c_parser_omp_construct): Same.
(c_parser_omp_threadprivate): Same.
* dwarf2asm.c, targhooks.c, optabs.c, tree.c, tree.h, target.h,
builtins.c, omp-low.c, cgraphunit.c, tree-call-cdce.c,
tree-ssa-alias.c, gimple-low.c, c-tree.h, expr.c, tree-parloops.c,
c-decl.c, tree-eh.c, langhooks.c, function.c, stor-layout.c,
c-typeck.c, gimplify.c, c-pragma.c, expmed.c, except.c, coverage.c,
emit-rtl.c, cfgexpand.c, tree-mudflap.c, varasm.c, tree-nested.c,
rtl.h, tree-inline.c, tree-profile.c, c-common.c, c-common.h,
tree-switch-conversion.c, tree-cfg.c, ipa-struct-reorg.c, c-parser.c,
config/i386/i386.c, stmt.c:
Add location argument to the following function definitions and/or
function calls: build_decl, objcp_start_struct, objcp_finish_struct,
start_struct, finish_struct, PUSH_FIELD, create_artificial_label,
cp_make_fname_decl, pushtag, implicitly_declare, c_make_fname_decl,
build_compound_literal, parser_xref_tag, resolve_overloaded_builtin,
do_case, c_finish_bc_stmt, build_compound_literal,
build_function_call.
* c-decl.c (build_compound_literal): Add location argument.
Make all diagnostic calls use location.
(start_struct): Same.
(finish_struct): Same.
(start_enum): Same.
(build_enumerator): Same.
(start_function): Same.
(grokdeclarator): Make all diagnostic calls use location.
(store_parm_decls_oldstyle): Same.
* c-typeck.c (build_function_call): Add location argument.
Make all diagnostic calls use location.
(do_case): Same.
(c_finish_bc_stmt): Same.
* tree-nested.c (get_trampoline_type): Add argument.
Pass location to build_decl.
(lookup_tramp_for_decl): Pass location to get_trampoline_type.
* rtl.h (RTL_LOCATION): New.
* c-common.c (c_add_case_label): Add location argument.
Make all diagnostic calls use location.
* c-common.h: Add location argument to make_fname_decl, do_case,
c_add_case_label, build_function_call, resolve_overloaded_builtin.
* c-parser.c (c_parser_enum_specifier): Rename ident_loc to enum_loc.
Set it appropriately for every case. Pass enum_loc to start_enum
call. Pass value_loc first to build_enumerator. Pass enum_loc to
parser_xref_tag.
(c_parser_struct_or_union_specifier): Save location. Use it for
start_struct, finish_struct, and parser_xref_tag.
gcc/testsuite/
* gcc.dg/old-style-prom-3.c: Add column info.
* gcc.dg/overflow-warn-1.c
* gcc.dg/gomp/pr27415.c
* gcc.dg/gomp/for-1.c: Same.
* gcc.dg/enum-compat-1.c: Same.
* gcc.dg/c99-tag-3.c: Same.
* gcc.dg/Wredundant-decls-2.c: Same.
* gcc.dg/func-ptr-conv-1.c: Same.
* gcc.dg/asm-wide-1.c: Same.
* gcc.dg/nofixed-point-2.c: Same.
* gcc.dg/cpp/line3.c: Same.
* gcc.dg/array-10.c: Same.
* gcc.dg/c99-vla-jump-1.c: Same.
* gcc.dg/pr20368-1.c: Same.
* gcc.dg/Wshadow-3.c: Same.
* gcc.dg/c90-const-expr-8.c: Same.
* gcc.dg/label-decl-2.c: Same.
* gcc.dg/dremf-type-compat-2.c: Same.
* gcc.dg/c90-const-expr-5.c: Same.
* gcc.dg/builtins-30.c: Same.
* gcc.dg/Warray-bounds.c: Same.
* gcc.dg/Wcxx-compat-2.c: Same.
* gcc.dg/tree-ssa/col-1.c: Same.
* gcc.dg/old-style-prom-2.c: Same.
* gcc.dg/cast-function-1.c: Same.
* gcc.dg/pr15698-1.c: Same.
* gcc.dg/dremf-type-compat-3.c: Same.
* gcc.dg/vla-8.c: Same.
* gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct
line.
* gcc.dg/label-decl-2.c: Move label diagnostic to correct line.
* gcc.dg/old-style-prom-3.c: Check for error on the correct line.
* gcc.dg/enum-compat-1.c: Same.
* gcc.dg/dremf-type-compat-2.c: Same.
* gcc.dg/old-style-prom-2.c: Same.
* gcc.dg/pr15698-1.c: Same.
* gcc.dg/pr20368-1.c: Same.
* gcc.dg/dremf-type-compat-3.c: Same.
* gcc.dg/builtins-30.c: Same. Test for columns.
gcc/objcp/
* objcp-decl.h (c_end_compound_stmt): New argument.
* objcp-decl.c (objcp_start_struct): Add argument.
(objcp_finish_struct): Same.
gcc/cp/
* typeck.c (cp_build_binary_op): Pass location to overflow_warning.
(build_modify_expr): New arg.
* semantics.c (finish_unary_op_expr): Pass location to
overflow_warning.
(handle_omp_for_class_iterator): Pass location to build_modify_expr.
* typeck.c (cxx_sizeof_or_alignof_type): Pass location to
c_sizeof_or_alignof_type.
(build_array_ref): New argument.
(build_compound_expr): Same.
(build_const_cast): Same.
(build_ptrmemfunc): Pass location to build_c_cast.
* init.c (avoid_placement_new_aliasing): Pass location to
build_stmt.
(build_vec_delete_1): Pass location to cp_build_modify_expr,
build_compound_expr.
* class.c (build_vtbl_ref_1): Pass location to build_array_ref.
* decl.c (poplevel): Pass location to c_build_bind_expr.
(finish_case_label): Pass location to build_case_label.
(finish_constructor_body): Same.
(finish_destructor_body): Pass location to build_stmt.
(cxx_maybe_build_cleanup): Same, but to build_compound_expr.
* call.c (build_new_op): Pass location to build_array_ref.
(build_x_va_arg): Pass location to build_va_arg.
* except.c (expand_end_catch_block): Pass location to
build_stmt.
* cp-tree.h (build_array_ref): New argument.
(build_compound_expr): Same.
(build_c_cast): Same.
* cp-gimplify.c (gimplify_if_stmt): Pass location on down.
(gimplify_switch_stmt): Same.
* typeck2.c (split_nonconstant_init_1): Same.
* pt.c (tsubst_copy): Same.
* semantics.c (add_decl_expr): Same.
(do_poplevel): Same.
(push_cleanup): Same.
(finish_goto_stmt): Same.
(finish_expr_stmt): Same.
(begin_if_stmt): Same.
(begin_while_stmt): Same.
(begin_do_stmt): Same.
(finish_return_stmt): Same.
(begin_for_stmt): Same.
(finish_break_stmt): Same.
(finish_continue_stmt): Same.
(begin_switch_stmt): Same.
(begin_try_block): Same.
(begin_handler): Same.
(finish_asm_stmt): Same.
(finish_label_stmt): Same.
(finish_stmt_expr_expr): Same.
(finalize_nrv_r): Same.
(finish_omp_atomic): Same.
* name-lookup.c (do_using_directive): Same.
* decl2.c (grok_array_decl): Same.
* parser.c (cp_parser_cast_expression): Same.
(cp_parser_selection_statement): Same.
(cp_parser_implicitly_scoped_statement): Same.
(cp_parser_objc_selector_expression): Same.
(cp_parser_objc_synchronized_statement): Same.
(cp_parser_objc_throw_statement): Same.
(cp_parser_omp_critical): Same.
(cp_parser_omp_master): Same.
* typeck.c (build_function_call): Add location argument.
* init.c: Add location argument to all build_decl calls.
* class.c: Same.
* method.c: Same.
* rtti.c: Same.
* tree.c: Same.
* pt.c: Same.
* semantics.c: Same.
* lex.c: Same.
* decl2.c: Same.
* cp-gimplify.c: Same.
* decl.c: Same.
(cp_make_fname_decl): Add location argument. Pass location ot
build_decl.
(finish_case_label): Same.
* cp-tree.h (finish_case_label): Add location argument.
* parser.c (cp_parser_label_for_labeled_statement): Pass location to
finish_case_label.
gcc/fortran/
* trans-array.c (gfc_trans_allocate_array_storage): Pass
location on down.
(gfc_trans_array_constructor_value): Same.
(gfc_trans_scalarized_loop_end): Same.
(gfc_conv_ss_startstride): Same.
(gfc_trans_g77_array): Same.
(gfc_trans_dummy_array_bias): Same.
(gfc_conv_array_parameter): Same.
(structure_alloc_comps): Same.
* trans-expr.c (gfc_conv_function_call): Same.
(fill_with_spaces): Same.
(gfc_trans_string_copy): Same.
(gfc_trans_scalar_assign): Same.
* trans-stmt.c (gfc_trans_goto): Same.
(gfc_trans_if_1): Same.
(gfc_trans_simple_do): Same.
(gfc_trans_do): Same.
(gfc_trans_do_while): Same.
(gfc_trans_logical_select): Same.
(gfc_trans_select): Same.
(gfc_trans_forall_loop): Same.
(gfc_trans_nested_forall_loop): Same.
(generate_loop_for_temp_to_lhs): Same.
(generate_loop_for_rhs_to_temp): Same.
(gfc_trans_forall_1): Same.
(gfc_trans_where_assign): Same.
(gfc_trans_where_3): Same.
(gfc_trans_allocate): Same.
* trans.c (gfc_finish_block): Same.
(gfc_trans_runtime_check): Same.
(gfc_call_malloc): Same.
(gfc_allocate_with_status): Same.
(gfc_call_free): Same.
(gfc_deallocate_with_status): Same.
(gfc_call_realloc): Same.
(gfc_trans_code): Same.
* trans-decl.c (gfc_init_default_dt): Same.
(gfc_generate_constructors): Same.
* trans-io.c (gfc_trans_io_runtime_check): Same.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same.
(gfc_conv_intrinsic_fdate): Same.
(gfc_conv_intrinsic_ttynam): Same.
(gfc_conv_intrinsic_minmax): Same.
(gfc_conv_intrinsic_minmax_char): Same.
(gfc_conv_intrinsic_anyall): Same.
(gfc_conv_intrinsic_count): Same.
(gfc_conv_intrinsic_arith): Same.
(gfc_conv_intrinsic_minmaxloc): Same.
(gfc_conv_intrinsic_minmaxval): Same.
(gfc_conv_intrinsic_rrspacing): Same.
(gfc_conv_intrinsic_array_transfer): Same.
(gfc_conv_intrinsic_trim): Same.
(gfc_conv_intrinsic_repeat): Same.
From-SVN: r148442
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 56 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 29 | ||||
-rw-r--r-- | gcc/fortran/trans-common.c | 18 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 101 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 15 | ||||
-rw-r--r-- | gcc/fortran/trans-intrinsic.c | 50 | ||||
-rw-r--r-- | gcc/fortran/trans-io.c | 2 | ||||
-rw-r--r-- | gcc/fortran/trans-openmp.c | 33 | ||||
-rw-r--r-- | gcc/fortran/trans-stmt.c | 51 | ||||
-rw-r--r-- | gcc/fortran/trans-types.c | 38 | ||||
-rw-r--r-- | gcc/fortran/trans.c | 31 |
11 files changed, 273 insertions, 151 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c9025f1..ea0de36 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,59 @@ +2009-06-12 Aldy Hernandez <aldyh@redhat.com> + + * trans-array.c (gfc_trans_allocate_array_storage): Pass + location on down. + (gfc_trans_array_constructor_value): Same. + (gfc_trans_scalarized_loop_end): Same. + (gfc_conv_ss_startstride): Same. + (gfc_trans_g77_array): Same. + (gfc_trans_dummy_array_bias): Same. + (gfc_conv_array_parameter): Same. + (structure_alloc_comps): Same. + * trans-expr.c (gfc_conv_function_call): Same. + (fill_with_spaces): Same. + (gfc_trans_string_copy): Same. + (gfc_trans_scalar_assign): Same. + * trans-stmt.c (gfc_trans_goto): Same. + (gfc_trans_if_1): Same. + (gfc_trans_simple_do): Same. + (gfc_trans_do): Same. + (gfc_trans_do_while): Same. + (gfc_trans_logical_select): Same. + (gfc_trans_select): Same. + (gfc_trans_forall_loop): Same. + (gfc_trans_nested_forall_loop): Same. + (generate_loop_for_temp_to_lhs): Same. + (generate_loop_for_rhs_to_temp): Same. + (gfc_trans_forall_1): Same. + (gfc_trans_where_assign): Same. + (gfc_trans_where_3): Same. + (gfc_trans_allocate): Same. + * trans.c (gfc_finish_block): Same. + (gfc_trans_runtime_check): Same. + (gfc_call_malloc): Same. + (gfc_allocate_with_status): Same. + (gfc_call_free): Same. + (gfc_deallocate_with_status): Same. + (gfc_call_realloc): Same. + (gfc_trans_code): Same. + * trans-decl.c (gfc_init_default_dt): Same. + (gfc_generate_constructors): Same. + * trans-io.c (gfc_trans_io_runtime_check): Same. + * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same. + (gfc_conv_intrinsic_fdate): Same. + (gfc_conv_intrinsic_ttynam): Same. + (gfc_conv_intrinsic_minmax): Same. + (gfc_conv_intrinsic_minmax_char): Same. + (gfc_conv_intrinsic_anyall): Same. + (gfc_conv_intrinsic_count): Same. + (gfc_conv_intrinsic_arith): Same. + (gfc_conv_intrinsic_minmaxloc): Same. + (gfc_conv_intrinsic_minmaxval): Same. + (gfc_conv_intrinsic_rrspacing): Same. + (gfc_conv_intrinsic_array_transfer): Same. + (gfc_conv_intrinsic_trim): Same. + (gfc_conv_intrinsic_repeat): Same. + 2009-06-12 Janus Weil <janus@gcc.gnu.org> PR fortran/40176 diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 5a371b8..cf38fc3 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -635,7 +635,8 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post, was_packed = fold_build2 (EQ_EXPR, boolean_type_node, packed, source_data); tmp = gfc_finish_block (&do_copying); - tmp = build3_v (COND_EXPR, was_packed, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, was_packed, tmp, + build_empty_stmt (input_location)); gfc_add_expr_to_block (pre, tmp); tmp = fold_convert (pvoid_type_node, packed); @@ -1442,7 +1443,8 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type, shadow_loopvar, end)); tmp = build1_v (GOTO_EXPR, exit_label); TREE_USED (exit_label) = 1; - tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, cond, tmp, + build_empty_stmt (input_location)); gfc_add_expr_to_block (&body, tmp); /* The main loop body. */ @@ -2776,12 +2778,13 @@ gfc_trans_scalarized_loop_end (gfc_loopinfo * loop, int n, TREE_TYPE (stmt) = void_type_node; OMP_FOR_BODY (stmt) = loopbody = gfc_finish_block (pbody); - OMP_FOR_CLAUSES (stmt) = build_omp_clause (OMP_CLAUSE_SCHEDULE); + OMP_FOR_CLAUSES (stmt) = build_omp_clause (input_location, + OMP_CLAUSE_SCHEDULE); OMP_CLAUSE_SCHEDULE_KIND (OMP_FOR_CLAUSES (stmt)) = OMP_CLAUSE_SCHEDULE_STATIC; if (ompws_flags & OMPWS_NOWAIT) OMP_CLAUSE_CHAIN (OMP_FOR_CLAUSES (stmt)) - = build_omp_clause (OMP_CLAUSE_NOWAIT); + = build_omp_clause (input_location, OMP_CLAUSE_NOWAIT); /* Initialize the loopvar. */ TREE_VEC_ELT (init, 0) = build2_v (MODIFY_EXPR, loop->loopvar[n], @@ -2818,7 +2821,7 @@ gfc_trans_scalarized_loop_end (gfc_loopinfo * loop, int n, loop->loopvar[n], loop->to[n]); tmp = build1_v (GOTO_EXPR, exit_label); TREE_USED (exit_label) = 1; - tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); /* The main body. */ @@ -3337,7 +3340,7 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop) || ss->expr->symtree->n.sym->attr.not_always_present) tmp = build3_v (COND_EXPR, gfc_conv_expr_present (ss->expr->symtree->n.sym), - tmp, build_empty_stmt ()); + tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); @@ -4391,7 +4394,7 @@ gfc_trans_g77_array (gfc_symbol * sym, tree body) if (sym->attr.optional || sym->attr.not_always_present) { tmp = gfc_conv_expr_present (sym); - stmt = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt ()); + stmt = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt (input_location)); } gfc_add_expr_to_block (&block, stmt); @@ -4675,7 +4678,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) if (optional_arg) { tmp = gfc_conv_expr_present (sym); - stmt = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt ()); + stmt = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt (input_location)); } gfc_add_expr_to_block (&block, stmt); @@ -4704,12 +4707,13 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) tmp = build_fold_indirect_ref (dumdesc); tmp = gfc_conv_descriptor_data_get (tmp); tmp = fold_build2 (NE_EXPR, boolean_type_node, tmp, tmpdesc); - stmt = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt ()); + stmt = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt (input_location)); if (optional_arg) { tmp = gfc_conv_expr_present (sym); - stmt = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt ()); + stmt = build3_v (COND_EXPR, tmp, stmt, + build_empty_stmt (input_location)); } gfc_add_expr_to_block (&block, stmt); } @@ -5603,7 +5607,7 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77, tmp = fold_build2 (TRUTH_AND_EXPR, boolean_type_node, gfc_conv_expr_present (sym), tmp); - tmp = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&block, &se->post); @@ -5807,7 +5811,8 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, tmp = gfc_finish_block (&fnblock); if (null_cond != NULL_TREE) - tmp = build3_v (COND_EXPR, null_cond, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, null_cond, tmp, + build_empty_stmt (input_location)); return tmp; } diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 6cf9d5b..f4bbb46 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -278,8 +278,8 @@ build_field (segment_info *h, tree union_type, record_layout_info rli) unsigned HOST_WIDE_INT desired_align, known_align; name = get_identifier (h->sym->name); - field = build_decl (FIELD_DECL, name, h->field); - gfc_set_decl_location (field, &h->sym->declared_at); + field = build_decl (h->sym->declared_at.lb->location, + FIELD_DECL, name, h->field); known_align = (offset & -offset) * BITS_PER_UNIT; if (known_align == 0 || known_align > BIGGEST_ALIGNMENT) known_align = BIGGEST_ALIGNMENT; @@ -349,7 +349,8 @@ build_equiv_decl (tree union_type, bool is_init, bool is_saved) } snprintf (name, sizeof (name), "equiv.%d", serial++); - decl = build_decl (VAR_DECL, get_identifier (name), union_type); + decl = build_decl (input_location, + VAR_DECL, get_identifier (name), union_type); DECL_ARTIFICIAL (decl) = 1; DECL_IGNORED_P (decl) = 1; @@ -412,7 +413,8 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init) /* If there is no backend_decl for the common block, build it. */ if (decl == NULL_TREE) { - decl = build_decl (VAR_DECL, get_identifier (com->name), union_type); + decl = build_decl (input_location, + VAR_DECL, get_identifier (com->name), union_type); SET_DECL_ASSEMBLER_NAME (decl, gfc_sym_mangled_common_id (com)); TREE_PUBLIC (decl) = 1; TREE_STATIC (decl) = 1; @@ -527,8 +529,8 @@ get_init_field (segment_info *head, tree union_type, tree *field_init, tmp = build_range_type (gfc_array_index_type, gfc_index_zero_node, tmp); tmp = build_array_type (type, tmp); - field = build_decl (FIELD_DECL, NULL_TREE, tmp); - gfc_set_decl_location (field, &gfc_current_locus); + field = build_decl (gfc_current_locus.lb->location, + FIELD_DECL, NULL_TREE, tmp); known_align = BIGGEST_ALIGNMENT; @@ -675,9 +677,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) { tree var_decl; - var_decl = build_decl (VAR_DECL, DECL_NAME (s->field), + var_decl = build_decl (s->sym->declared_at.lb->location, + VAR_DECL, DECL_NAME (s->field), TREE_TYPE (s->field)); - gfc_set_decl_location (var_decl, &s->sym->declared_at); TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl); TREE_STATIC (var_decl) = TREE_STATIC (decl); TREE_USED (var_decl) = TREE_USED (decl); diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index a491c0b..c647e92 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -203,7 +203,8 @@ gfc_build_label_decl (tree label_id) label_name = NULL; /* Build the LABEL_DECL node. Labels have no type. */ - label_decl = build_decl (LABEL_DECL, label_id, void_type_node); + label_decl = build_decl (input_location, + LABEL_DECL, label_id, void_type_node); DECL_CONTEXT (label_decl) = current_function_decl; DECL_MODE (label_decl) = VOIDmode; @@ -750,7 +751,8 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym) DECL_IGNORED_P (GFC_TYPE_ARRAY_UBOUND (type, dim)) = 0; } } - TYPE_NAME (type) = type_decl = build_decl (TYPE_DECL, NULL, gtype); + TYPE_NAME (type) = type_decl = build_decl (input_location, + TYPE_DECL, NULL, gtype); DECL_ORIGINAL_TYPE (type_decl) = gtype; } } @@ -842,7 +844,8 @@ gfc_build_dummy_array_decl (gfc_symbol * sym, tree dummy) } ASM_FORMAT_PRIVATE_NAME (name, IDENTIFIER_POINTER (DECL_NAME (dummy)), 0); - decl = build_decl (VAR_DECL, get_identifier (name), type); + decl = build_decl (input_location, + VAR_DECL, get_identifier (name), type); DECL_ARTIFICIAL (decl) = 1; TREE_PUBLIC (decl) = 0; @@ -892,7 +895,7 @@ gfc_nonlocal_dummy_array_decl (gfc_symbol *sym) return; dummy = GFC_DECL_SAVED_DESCRIPTOR (sym->backend_decl); - decl = build_decl (VAR_DECL, DECL_NAME (dummy), + decl = build_decl (input_location, VAR_DECL, DECL_NAME (dummy), TREE_TYPE (sym->backend_decl)); DECL_ARTIFICIAL (decl) = 0; TREE_USED (decl) = 1; @@ -926,7 +929,8 @@ gfc_create_string_length (gfc_symbol * sym) /* Also prefix the mangled name. */ strcpy (&name[1], sym->name); name[0] = '.'; - length = build_decl (VAR_DECL, get_identifier (name), + length = build_decl (input_location, + VAR_DECL, get_identifier (name), gfc_charlen_type_node); DECL_ARTIFICIAL (length) = 1; TREE_USED (length) = 1; @@ -955,9 +959,11 @@ gfc_add_assign_aux_vars (gfc_symbol * sym) decl = sym->backend_decl; gfc_allocate_lang_decl (decl); GFC_DECL_ASSIGN (decl) = 1; - length = build_decl (VAR_DECL, create_tmp_var_name (sym->name), + length = build_decl (input_location, + VAR_DECL, create_tmp_var_name (sym->name), gfc_charlen_type_node); - addr = build_decl (VAR_DECL, create_tmp_var_name (sym->name), + addr = build_decl (input_location, + VAR_DECL, create_tmp_var_name (sym->name), pvoid_type_node); gfc_finish_var_decl (length, sym); gfc_finish_var_decl (addr, sym); @@ -1079,9 +1085,8 @@ gfc_get_symbol_decl (gfc_symbol * sym) length = gfc_create_string_length (sym); /* Create the decl for the variable. */ - decl = build_decl (VAR_DECL, gfc_sym_identifier (sym), gfc_sym_type (sym)); - - gfc_set_decl_location (decl, &sym->declared_at); + decl = build_decl (sym->declared_at.lb->location, + VAR_DECL, gfc_sym_identifier (sym), gfc_sym_type (sym)); /* Symbols from modules should have their assembler names mangled. This is done here rather than in gfc_finish_var_decl because it @@ -1150,7 +1155,8 @@ gfc_get_symbol_decl (gfc_symbol * sym) { tree span; GFC_DECL_SUBREF_ARRAY_P (decl) = 1; - span = build_decl (VAR_DECL, create_tmp_var_name ("span"), + span = build_decl (input_location, + VAR_DECL, create_tmp_var_name ("span"), gfc_array_index_type); gfc_finish_var_decl (span, sym); TREE_STATIC (span) = TREE_STATIC (decl); @@ -1222,7 +1228,8 @@ get_proc_pointer_decl (gfc_symbol *sym) if (decl) return decl; - decl = build_decl (VAR_DECL, get_identifier (sym->name), + decl = build_decl (input_location, + VAR_DECL, get_identifier (sym->name), build_pointer_type (gfc_get_function_type (sym))); if ((sym->ns->proc_name @@ -1380,7 +1387,8 @@ gfc_get_extern_function_decl (gfc_symbol * sym) } type = gfc_get_function_type (sym); - fndecl = build_decl (FUNCTION_DECL, name, type); + fndecl = build_decl (input_location, + FUNCTION_DECL, name, type); SET_DECL_ASSEMBLER_NAME (fndecl, mangled_name); /* If the return type is a pointer, avoid alias issues by setting @@ -1461,7 +1469,8 @@ build_function_decl (gfc_symbol * sym) == NAMESPACE_DECL); type = gfc_get_function_type (sym); - fndecl = build_decl (FUNCTION_DECL, gfc_sym_identifier (sym), type); + fndecl = build_decl (input_location, + FUNCTION_DECL, gfc_sym_identifier (sym), type); /* Perform name mangling if this is a top level or module procedure. */ if (current_function_decl == NULL_TREE) @@ -1505,7 +1514,8 @@ build_function_decl (gfc_symbol * sym) type = void_type_node; } - result_decl = build_decl (RESULT_DECL, result_decl, type); + result_decl = build_decl (input_location, + RESULT_DECL, result_decl, type); DECL_ARTIFICIAL (result_decl) = 1; DECL_IGNORED_P (result_decl) = 1; DECL_CONTEXT (result_decl) = fndecl; @@ -1578,7 +1588,8 @@ create_function_arglist (gfc_symbol * sym) if (sym->attr.entry_master) { type = TREE_VALUE (typelist); - parm = build_decl (PARM_DECL, get_identifier ("__entry"), type); + parm = build_decl (input_location, + PARM_DECL, get_identifier ("__entry"), type); DECL_CONTEXT (parm) = fndecl; DECL_ARG_TYPE (parm) = type; @@ -1600,7 +1611,8 @@ create_function_arglist (gfc_symbol * sym) tree len_type = TREE_VALUE (TREE_CHAIN (typelist)); gcc_assert (len_type == gfc_charlen_type_node); - length = build_decl (PARM_DECL, + length = build_decl (input_location, + PARM_DECL, get_identifier (".__result"), len_type); if (!sym->ts.cl->length) @@ -1622,7 +1634,8 @@ create_function_arglist (gfc_symbol * sym) if (sym->ts.cl->backend_decl == NULL) { - tree len = build_decl (VAR_DECL, + tree len = build_decl (input_location, + VAR_DECL, get_identifier ("..__result"), gfc_charlen_type_node); DECL_ARTIFICIAL (len) = 1; @@ -1642,7 +1655,8 @@ create_function_arglist (gfc_symbol * sym) } } - parm = build_decl (PARM_DECL, get_identifier ("__result"), type); + parm = build_decl (input_location, + PARM_DECL, get_identifier ("__result"), type); DECL_CONTEXT (parm) = fndecl; DECL_ARG_TYPE (parm) = TREE_VALUE (typelist); @@ -1684,7 +1698,8 @@ create_function_arglist (gfc_symbol * sym) strcpy (&name[1], f->sym->name); name[0] = '_'; - length = build_decl (PARM_DECL, get_identifier (name), len_type); + length = build_decl (input_location, + PARM_DECL, get_identifier (name), len_type); hidden_arglist = chainon (hidden_arglist, length); DECL_CONTEXT (length) = fndecl; @@ -1739,7 +1754,8 @@ create_function_arglist (gfc_symbol * sym) type = build_pointer_type (type); /* Build the argument declaration. */ - parm = build_decl (PARM_DECL, gfc_sym_identifier (f->sym), type); + parm = build_decl (input_location, + PARM_DECL, gfc_sym_identifier (f->sym), type); /* Fill in arg stuff. */ DECL_CONTEXT (parm) = fndecl; @@ -1929,7 +1945,8 @@ build_entry_thunks (gfc_namespace * ns) tree union_decl, field; tree master_type = TREE_TYPE (ns->proc_name->backend_decl); - union_decl = build_decl (VAR_DECL, get_identifier ("__result"), + union_decl = build_decl (input_location, + VAR_DECL, get_identifier ("__result"), TREE_TYPE (master_type)); DECL_ARTIFICIAL (union_decl) = 1; DECL_EXTERNAL (union_decl) = 0; @@ -2144,10 +2161,12 @@ gfc_get_fake_result_decl (gfc_symbol * sym, int parent_flag) IDENTIFIER_POINTER (DECL_NAME (this_function_decl))); if (!sym->attr.mixed_entry_master && sym->attr.function) - decl = build_decl (VAR_DECL, get_identifier (name), + decl = build_decl (input_location, + VAR_DECL, get_identifier (name), gfc_sym_type (sym)); else - decl = build_decl (VAR_DECL, get_identifier (name), + decl = build_decl (input_location, + VAR_DECL, get_identifier (name), TREE_TYPE (TREE_TYPE (this_function_decl))); DECL_ARTIFICIAL (decl) = 1; DECL_EXTERNAL (decl) = 0; @@ -2207,7 +2226,8 @@ gfc_build_library_function_decl (tree name, tree rettype, int nargs, ...) /* Build the function type and decl. */ fntype = build_function_type (rettype, arglist); - fndecl = build_decl (FUNCTION_DECL, name, fntype); + fndecl = build_decl (input_location, + FUNCTION_DECL, name, fntype); /* Mark this decl as external. */ DECL_EXTERNAL (fndecl) = 1; @@ -2888,7 +2908,7 @@ gfc_init_default_dt (gfc_symbol * sym, tree body) { present = gfc_conv_expr_present (sym); tmp = build3 (COND_EXPR, TREE_TYPE (tmp), present, - tmp, build_empty_stmt ()); + tmp, build_empty_stmt (input_location)); } gfc_add_expr_to_block (&fnblock, tmp); gfc_free_expr (e); @@ -2923,7 +2943,7 @@ init_intent_out_dt (gfc_symbol * proc_sym, tree body) present = gfc_conv_expr_present (f->sym); tmp = build3 (COND_EXPR, TREE_TYPE (tmp), present, - tmp, build_empty_stmt ()); + tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&fnblock, tmp); } @@ -3311,7 +3331,8 @@ gfc_trans_use_stmts (gfc_namespace * ns) if (entry->namespace_decl == NULL) { entry->namespace_decl - = build_decl (NAMESPACE_DECL, + = build_decl (input_location, + NAMESPACE_DECL, get_identifier (use_stmt->module_name), void_type_node); DECL_EXTERNAL (entry->namespace_decl) = 1; @@ -3488,7 +3509,8 @@ gfc_emit_parameter_debug_info (gfc_symbol *sym) return; /* Create the decl for the variable or constant. */ - decl = build_decl (sym->attr.flavor == FL_PARAMETER ? CONST_DECL : VAR_DECL, + decl = build_decl (input_location, + sym->attr.flavor == FL_PARAMETER ? CONST_DECL : VAR_DECL, gfc_sym_identifier (sym), gfc_sym_type (sym)); if (sym->attr.flavor == FL_PARAMETER) TREE_READONLY (decl) = 1; @@ -3875,7 +3897,8 @@ create_main_function (tree fndecl) build_pointer_type (pchar_type_node), NULL_TREE); main_identifier_node = get_identifier ("main"); - ftn_main = build_decl (FUNCTION_DECL, main_identifier_node, tmp); + ftn_main = build_decl (input_location, FUNCTION_DECL, + main_identifier_node, tmp); DECL_EXTERNAL (ftn_main) = 0; TREE_PUBLIC (ftn_main) = 1; TREE_STATIC (ftn_main) = 1; @@ -3883,7 +3906,8 @@ create_main_function (tree fndecl) = tree_cons (get_identifier("externally_visible"), NULL_TREE, NULL_TREE); /* Setup the result declaration (for "return 0"). */ - result_decl = build_decl (RESULT_DECL, NULL_TREE, integer_type_node); + result_decl = build_decl (input_location, + RESULT_DECL, NULL_TREE, integer_type_node); DECL_ARTIFICIAL (result_decl) = 1; DECL_IGNORED_P (result_decl) = 1; DECL_CONTEXT (result_decl) = ftn_main; @@ -3897,7 +3921,7 @@ create_main_function (tree fndecl) typelist = TYPE_ARG_TYPES (TREE_TYPE (ftn_main)); tmp = TREE_VALUE (typelist); - argc = build_decl (PARM_DECL, get_identifier ("argc"), tmp); + argc = build_decl (input_location, PARM_DECL, get_identifier ("argc"), tmp); DECL_CONTEXT (argc) = ftn_main; DECL_ARG_TYPE (argc) = TREE_VALUE (typelist); TREE_READONLY (argc) = 1; @@ -3906,7 +3930,7 @@ create_main_function (tree fndecl) typelist = TREE_CHAIN (typelist); tmp = TREE_VALUE (typelist); - argv = build_decl (PARM_DECL, get_identifier ("argv"), tmp); + argv = build_decl (input_location, PARM_DECL, get_identifier ("argv"), tmp); DECL_CONTEXT (argv) = ftn_main; DECL_ARG_TYPE (argv) = TREE_VALUE (typelist); TREE_READONLY (argv) = 1; @@ -4354,10 +4378,12 @@ gfc_generate_constructors (void) type = build_function_type (void_type_node, gfc_chainon_list (NULL_TREE, void_type_node)); - fndecl = build_decl (FUNCTION_DECL, fnname, type); + fndecl = build_decl (input_location, + FUNCTION_DECL, fnname, type); TREE_PUBLIC (fndecl) = 1; - decl = build_decl (RESULT_DECL, NULL_TREE, void_type_node); + decl = build_decl (input_location, + RESULT_DECL, NULL_TREE, void_type_node); DECL_ARTIFICIAL (decl) = 1; DECL_IGNORED_P (decl) = 1; DECL_CONTEXT (decl) = fndecl; @@ -4378,7 +4404,7 @@ gfc_generate_constructors (void) for (; gfc_static_ctors; gfc_static_ctors = TREE_CHAIN (gfc_static_ctors)) { tmp = build_call_expr (TREE_VALUE (gfc_static_ctors), 0); - DECL_SAVED_TREE (fndecl) = build_stmt (EXPR_STMT, tmp); + DECL_SAVED_TREE (fndecl) = build_stmt (input_location, EXPR_STMT, tmp); } decl = getdecls (); @@ -4426,7 +4452,8 @@ gfc_generate_block_data (gfc_namespace * ns) else id = get_identifier ("__BLOCK_DATA__"); - decl = build_decl (VAR_DECL, id, gfc_array_index_type); + decl = build_decl (input_location, + VAR_DECL, id, gfc_array_index_type); TREE_PUBLIC (decl) = 1; TREE_STATIC (decl) = 1; DECL_IGNORED_P (decl) = 1; diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 29cbff3..a4d00df 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -3052,7 +3052,8 @@ fill_with_spaces (tree start, tree type, tree size) cond = fold_build2 (LE_EXPR, boolean_type_node, i, fold_convert (sizetype, integer_zero_node)); tmp = build1_v (GOTO_EXPR, exit_label); - tmp = fold_build3 (COND_EXPR, void_type_node, cond, tmp, build_empty_stmt ()); + tmp = fold_build3 (COND_EXPR, void_type_node, cond, tmp, + build_empty_stmt (input_location)); gfc_add_expr_to_block (&loop, tmp); /* Assignment. */ @@ -3205,7 +3206,8 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest, /* The whole copy_string function is there. */ tmp = fold_build3 (COND_EXPR, void_type_node, cond2, tmp2, tmp3); - tmp = fold_build3 (COND_EXPR, void_type_node, cond, tmp, build_empty_stmt ()); + tmp = fold_build3 (COND_EXPR, void_type_node, cond, tmp, + build_empty_stmt (input_location)); gfc_add_expr_to_block (block, tmp); } @@ -3999,7 +4001,8 @@ gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr) { tree tmp = se->expr; STRIP_TYPE_NOPS (tmp); - var = build_decl (CONST_DECL, NULL, TREE_TYPE (tmp)); + var = build_decl (input_location, + CONST_DECL, NULL, TREE_TYPE (tmp)); DECL_INITIAL (var) = tmp; TREE_STATIC (var) = 1; pushdecl (var); @@ -4246,7 +4249,8 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts, tmp = gfc_evaluate_now (lse->expr, &lse->pre); tmp = gfc_deallocate_alloc_comp (ts.derived, tmp, 0); if (r_is_var) - tmp = build3_v (COND_EXPR, cond, build_empty_stmt (), tmp); + tmp = build3_v (COND_EXPR, cond, build_empty_stmt (input_location), + tmp); gfc_add_expr_to_block (&lse->post, tmp); } @@ -4261,7 +4265,8 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts, if (r_is_var) { tmp = gfc_copy_alloc_comp (ts.derived, rse->expr, lse->expr, 0); - tmp = build3_v (COND_EXPR, cond, build_empty_stmt (), tmp); + tmp = build3_v (COND_EXPR, cond, build_empty_stmt (input_location), + tmp); gfc_add_expr_to_block (&block, tmp); } } diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index f448893..21694e4 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -693,7 +693,8 @@ gfc_get_intrinsic_lib_fndecl (gfc_intrinsic_map_t * m, gfc_expr * expr) } argtypes = gfc_chainon_list (argtypes, void_type_node); type = build_function_type (gfc_typenode_for_spec (ts), argtypes); - fndecl = build_decl (FUNCTION_DECL, get_identifier (name), type); + fndecl = build_decl (input_location, + FUNCTION_DECL, get_identifier (name), type); /* Mark the decl as external. */ DECL_EXTERNAL (fndecl) = 1; @@ -1388,7 +1389,7 @@ gfc_conv_intrinsic_ctime (gfc_se * se, gfc_expr * expr) cond = fold_build2 (GT_EXPR, boolean_type_node, len, build_int_cst (TREE_TYPE (len), 0)); tmp = gfc_call_free (var); - tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&se->post, tmp); se->expr = var; @@ -1426,7 +1427,7 @@ gfc_conv_intrinsic_fdate (gfc_se * se, gfc_expr * expr) cond = fold_build2 (GT_EXPR, boolean_type_node, len, build_int_cst (TREE_TYPE (len), 0)); tmp = gfc_call_free (var); - tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&se->post, tmp); se->expr = var; @@ -1466,7 +1467,7 @@ gfc_conv_intrinsic_ttynam (gfc_se * se, gfc_expr * expr) cond = fold_build2 (GT_EXPR, boolean_type_node, len, build_int_cst (TREE_TYPE (len), 0)); tmp = gfc_call_free (var); - tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&se->post, tmp); se->expr = var; @@ -1551,10 +1552,12 @@ gfc_conv_intrinsic_minmax (gfc_se * se, gfc_expr * expr, enum tree_code op) tmp = fold_build2 (TRUTH_OR_EXPR, boolean_type_node, tmp, fold_convert (boolean_type_node, isnan)); } - tmp = build3_v (COND_EXPR, tmp, thencase, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, tmp, thencase, + build_empty_stmt (input_location)); if (cond != NULL_TREE) - tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, cond, tmp, + build_empty_stmt (input_location)); gfc_add_expr_to_block (&se->pre, tmp); argexpr = argexpr->next; @@ -1601,7 +1604,7 @@ gfc_conv_intrinsic_minmax_char (gfc_se * se, gfc_expr * expr, int op) cond = fold_build2 (GT_EXPR, boolean_type_node, len, build_int_cst (TREE_TYPE (len), 0)); tmp = gfc_call_free (var); - tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&se->post, tmp); se->expr = var; @@ -1798,7 +1801,7 @@ gfc_conv_intrinsic_anyall (gfc_se * se, gfc_expr * expr, enum tree_code op) gfc_add_block_to_block (&body, &arrayse.pre); tmp = fold_build2 (op, boolean_type_node, arrayse.expr, build_int_cst (TREE_TYPE (arrayse.expr), 0)); - tmp = build3_v (COND_EXPR, tmp, found, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, tmp, found, build_empty_stmt (input_location)); gfc_add_expr_to_block (&body, tmp); gfc_add_block_to_block (&body, &arrayse.post); @@ -1865,7 +1868,8 @@ gfc_conv_intrinsic_count (gfc_se * se, gfc_expr * expr) gfc_copy_loopinfo_to_se (&arrayse, &loop); arrayse.ss = arrayss; gfc_conv_expr_val (&arrayse, actual->expr); - tmp = build3_v (COND_EXPR, arrayse.expr, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, arrayse.expr, tmp, + build_empty_stmt (input_location)); gfc_add_block_to_block (&body, &arrayse.pre); gfc_add_expr_to_block (&body, tmp); @@ -1977,7 +1981,8 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op) /* We enclose the above in if (mask) {...} . */ tmp = gfc_finish_block (&block); - tmp = build3_v (COND_EXPR, maskse.expr, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, maskse.expr, tmp, + build_empty_stmt (input_location)); } else tmp = gfc_finish_block (&block); @@ -1995,7 +2000,8 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op) gfc_add_block_to_block (&block, &loop.post); tmp = gfc_finish_block (&block); - tmp = build3_v (COND_EXPR, maskse.expr, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, maskse.expr, tmp, + build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&se->pre, &block); } @@ -2266,7 +2272,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) tmp = fold_build2 (TRUTH_OR_EXPR, boolean_type_node, fold_build2 (op, boolean_type_node, arrayse.expr, limit), tmp); - tmp = build3_v (COND_EXPR, tmp, ifbody, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, tmp, ifbody, build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); if (maskss) @@ -2274,7 +2280,8 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) /* We enclose the above in if (mask) {...}. */ tmp = gfc_finish_block (&block); - tmp = build3_v (COND_EXPR, maskse.expr, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, maskse.expr, tmp, + build_empty_stmt (input_location)); } else tmp = gfc_finish_block (&block); @@ -2428,14 +2435,15 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op) /* If it is a more extreme value. */ tmp = fold_build2 (op, boolean_type_node, arrayse.expr, limit); - tmp = build3_v (COND_EXPR, tmp, ifbody, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, tmp, ifbody, build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&block, &arrayse.post); tmp = gfc_finish_block (&block); if (maskss) /* We enclose the above in if (mask) {...}. */ - tmp = build3_v (COND_EXPR, maskse.expr, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, maskse.expr, tmp, + build_empty_stmt (input_location)); gfc_add_expr_to_block (&body, tmp); gfc_trans_scalarizing_loops (&loop, &body); @@ -2450,7 +2458,8 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op) gfc_add_block_to_block (&block, &loop.post); tmp = gfc_finish_block (&block); - tmp = build3_v (COND_EXPR, maskse.expr, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, maskse.expr, tmp, + build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&se->pre, &block); } @@ -3320,7 +3329,7 @@ gfc_conv_intrinsic_rrspacing (gfc_se * se, gfc_expr * expr) cond = fold_build2 (NE_EXPR, boolean_type_node, x, build_real_from_int_cst (type, integer_zero_node)); - tmp = build3_v (COND_EXPR, cond, stmt, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, cond, stmt, build_empty_stmt (input_location)); gfc_add_expr_to_block (&se->pre, tmp); se->expr = fold_convert (type, x); @@ -3730,7 +3739,8 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr) gfc_init_block (&block); tmp = gfc_conv_array_data (argse.expr); tmp = fold_build2 (NE_EXPR, boolean_type_node, source, tmp); - tmp = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, tmp, stmt, + build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&block, &se->post); gfc_init_block (&se->post); @@ -4221,7 +4231,7 @@ gfc_conv_intrinsic_trim (gfc_se * se, gfc_expr * expr) cond = fold_build2 (GT_EXPR, boolean_type_node, len, build_int_cst (TREE_TYPE (len), 0)); tmp = gfc_call_free (var); - tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&se->post, tmp); se->expr = var; @@ -4312,7 +4322,7 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr) tmp = build1_v (GOTO_EXPR, exit_label); TREE_USED (exit_label) = 1; tmp = fold_build3 (COND_EXPR, void_type_node, cond, tmp, - build_empty_stmt ()); + build_empty_stmt (input_location)); gfc_add_expr_to_block (&body, tmp); /* Call memmove (dest + (i*slen*size), src, slen*size). */ diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index bdd70f5..f8b943d 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -264,7 +264,7 @@ gfc_trans_io_runtime_check (tree cond, tree var, int error_code, cond = build_call_expr (built_in_decls[BUILT_IN_EXPECT], 2, cond, tmp); cond = fold_convert (boolean_type_node, cond); - tmp = build3_v (COND_EXPR, cond, body, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, cond, body, build_empty_stmt (input_location)); gfc_add_expr_to_block (pblock, tmp); } } diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 442290f..a476487 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -436,7 +436,7 @@ gfc_trans_omp_variable_list (enum omp_clause_code code, gfc_namelist *namelist, tree t = gfc_trans_omp_variable (namelist->sym); if (t != error_mark_node) { - tree node = build_omp_clause (code); + tree node = build_omp_clause (input_location, code); OMP_CLAUSE_DECL (node) = t; list = gfc_trans_add_clause (node, list); } @@ -682,7 +682,8 @@ gfc_trans_omp_reduction_list (gfc_namelist *namelist, tree list, tree t = gfc_trans_omp_variable (namelist->sym); if (t != error_mark_node) { - tree node = build_omp_clause (OMP_CLAUSE_REDUCTION); + tree node = build_omp_clause (where.lb->location, + OMP_CLAUSE_REDUCTION); OMP_CLAUSE_DECL (node) = t; OMP_CLAUSE_REDUCTION_CODE (node) = reduction_code; if (namelist->sym->attr.dimension) @@ -801,7 +802,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses, if_var = gfc_evaluate_now (se.expr, block); gfc_add_block_to_block (block, &se.post); - c = build_omp_clause (OMP_CLAUSE_IF); + c = build_omp_clause (where.lb->location, OMP_CLAUSE_IF); OMP_CLAUSE_IF_EXPR (c) = if_var; omp_clauses = gfc_trans_add_clause (c, omp_clauses); } @@ -816,7 +817,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses, num_threads = gfc_evaluate_now (se.expr, block); gfc_add_block_to_block (block, &se.post); - c = build_omp_clause (OMP_CLAUSE_NUM_THREADS); + c = build_omp_clause (where.lb->location, OMP_CLAUSE_NUM_THREADS); OMP_CLAUSE_NUM_THREADS_EXPR (c) = num_threads; omp_clauses = gfc_trans_add_clause (c, omp_clauses); } @@ -833,7 +834,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses, if (clauses->sched_kind != OMP_SCHED_NONE) { - c = build_omp_clause (OMP_CLAUSE_SCHEDULE); + c = build_omp_clause (where.lb->location, OMP_CLAUSE_SCHEDULE); OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (c) = chunk_size; switch (clauses->sched_kind) { @@ -860,7 +861,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses, if (clauses->default_sharing != OMP_DEFAULT_UNKNOWN) { - c = build_omp_clause (OMP_CLAUSE_DEFAULT); + c = build_omp_clause (where.lb->location, OMP_CLAUSE_DEFAULT); switch (clauses->default_sharing) { case OMP_DEFAULT_NONE: @@ -883,25 +884,25 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses, if (clauses->nowait) { - c = build_omp_clause (OMP_CLAUSE_NOWAIT); + c = build_omp_clause (where.lb->location, OMP_CLAUSE_NOWAIT); omp_clauses = gfc_trans_add_clause (c, omp_clauses); } if (clauses->ordered) { - c = build_omp_clause (OMP_CLAUSE_ORDERED); + c = build_omp_clause (where.lb->location, OMP_CLAUSE_ORDERED); omp_clauses = gfc_trans_add_clause (c, omp_clauses); } if (clauses->untied) { - c = build_omp_clause (OMP_CLAUSE_UNTIED); + c = build_omp_clause (where.lb->location, OMP_CLAUSE_UNTIED); omp_clauses = gfc_trans_add_clause (c, omp_clauses); } if (clauses->collapse) { - c = build_omp_clause (OMP_CLAUSE_COLLAPSE); + c = build_omp_clause (where.lb->location, OMP_CLAUSE_COLLAPSE); OMP_CLAUSE_COLLAPSE_EXPR (c) = build_int_cst (NULL, clauses->collapse); omp_clauses = gfc_trans_add_clause (c, omp_clauses); } @@ -1244,7 +1245,7 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock, if (!dovar_found) { - tmp = build_omp_clause (OMP_CLAUSE_PRIVATE); + tmp = build_omp_clause (input_location, OMP_CLAUSE_PRIVATE); OMP_CLAUSE_DECL (tmp) = dovar; omp_clauses = gfc_trans_add_clause (tmp, omp_clauses); } @@ -1277,7 +1278,8 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock, if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE && OMP_CLAUSE_DECL (c) == dovar) { - tree l = build_omp_clause (OMP_CLAUSE_LASTPRIVATE); + tree l = build_omp_clause (input_location, + OMP_CLAUSE_LASTPRIVATE); OMP_CLAUSE_DECL (l) = dovar; OMP_CLAUSE_CHAIN (l) = omp_clauses; OMP_CLAUSE_LASTPRIVATE_STMT (l) = tmp; @@ -1290,7 +1292,7 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock, } if (!simple) { - tmp = build_omp_clause (OMP_CLAUSE_PRIVATE); + tmp = build_omp_clause (input_location, OMP_CLAUSE_PRIVATE); OMP_CLAUSE_DECL (tmp) = count; omp_clauses = gfc_trans_add_clause (tmp, omp_clauses); } @@ -1558,7 +1560,7 @@ gfc_trans_omp_workshare (gfc_code *code, gfc_omp_clauses *clauses) pushlevel (0); if (!code) - return build_empty_stmt (); + return build_empty_stmt (input_location); gfc_start_block (&block); pblock = █ @@ -1681,7 +1683,8 @@ gfc_trans_omp_workshare (gfc_code *code, gfc_omp_clauses *clauses) tmp = gfc_finish_block (&singleblock); tmp = build2 (OMP_SINGLE, void_type_node, tmp, clauses->nowait - ? build_omp_clause (OMP_CLAUSE_NOWAIT) : NULL_TREE); + ? build_omp_clause (input_location, OMP_CLAUSE_NOWAIT) + : NULL_TREE); gfc_add_expr_to_block (pblock, tmp); } diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 596e95c..0e8ce67 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -175,7 +175,7 @@ gfc_trans_goto (gfc_code * code) tmp = fold_build2 (EQ_EXPR, boolean_type_node, tmp, assigned_goto); tmp = build3_v (COND_EXPR, tmp, fold_build1 (GOTO_EXPR, void_type_node, target), - build_empty_stmt ()); + build_empty_stmt (input_location)); gfc_add_expr_to_block (&se.pre, tmp); code = code->block; } @@ -453,7 +453,7 @@ gfc_trans_call (gfc_code * code, bool dependency_check, if (mask && count1) { tmp = build3_v (COND_EXPR, maskexpr, loopse.expr, - build_empty_stmt ()); + build_empty_stmt (input_location)); gfc_add_expr_to_block (&loopse.pre, tmp); tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, count1, gfc_index_one_node); @@ -655,7 +655,7 @@ gfc_trans_if_1 (gfc_code * code) if (code->block) elsestmt = gfc_trans_if_1 (code->block); else - elsestmt = build_empty_stmt (); + elsestmt = build_empty_stmt (input_location); /* Build the condition expression and add it to the condition block. */ stmt = fold_build3 (COND_EXPR, void_type_node, if_se.expr, stmt, elsestmt); @@ -849,7 +849,7 @@ gfc_trans_simple_do (gfc_code * code, stmtblock_t *pblock, tree dovar, tmp = build1_v (GOTO_EXPR, exit_label); TREE_USED (exit_label) = 1; tmp = fold_build3 (COND_EXPR, void_type_node, - cond, tmp, build_empty_stmt ()); + cond, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&body, tmp); /* Finish the loop body. */ @@ -862,7 +862,7 @@ gfc_trans_simple_do (gfc_code * code, stmtblock_t *pblock, tree dovar, else cond = fold_build2 (GE_EXPR, boolean_type_node, dovar, to); tmp = fold_build3 (COND_EXPR, void_type_node, - cond, tmp, build_empty_stmt ()); + cond, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (pblock, tmp); /* Add the exit label. */ @@ -1007,7 +1007,7 @@ gfc_trans_do (gfc_code * code) tmp = fold_build2 (LT_EXPR, boolean_type_node, to, from); pos = fold_build3 (COND_EXPR, void_type_node, tmp, build1_v (GOTO_EXPR, exit_label), - build_empty_stmt ()); + build_empty_stmt (input_location)); tmp = fold_build2 (MINUS_EXPR, type, to, from); tmp = fold_convert (utype, tmp); tmp = fold_build2 (TRUNC_DIV_EXPR, utype, tmp, @@ -1018,7 +1018,7 @@ gfc_trans_do (gfc_code * code) tmp = fold_build2 (GT_EXPR, boolean_type_node, to, from); neg = fold_build3 (COND_EXPR, void_type_node, tmp, build1_v (GOTO_EXPR, exit_label), - build_empty_stmt ()); + build_empty_stmt (input_location)); tmp = fold_build2 (MINUS_EXPR, type, from, to); tmp = fold_convert (utype, tmp); tmp = fold_build2 (TRUNC_DIV_EXPR, utype, tmp, @@ -1049,7 +1049,7 @@ gfc_trans_do (gfc_code * code) /* If the loop is empty, go directly to the exit label. */ tmp = fold_build3 (COND_EXPR, void_type_node, tmp, build1_v (GOTO_EXPR, exit_label), - build_empty_stmt ()); + build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); } @@ -1094,7 +1094,7 @@ gfc_trans_do (gfc_code * code) build_int_cst (utype, 0)); tmp = build1_v (GOTO_EXPR, exit_label); tmp = fold_build3 (COND_EXPR, void_type_node, - cond, tmp, build_empty_stmt ()); + cond, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&body, tmp); /* Decrement the loop count. */ @@ -1168,7 +1168,7 @@ gfc_trans_do_while (gfc_code * code) tmp = build1_v (GOTO_EXPR, exit_label); TREE_USED (exit_label) = 1; tmp = fold_build3 (COND_EXPR, void_type_node, - cond.expr, tmp, build_empty_stmt ()); + cond.expr, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); /* The main body of the loop. */ @@ -1413,8 +1413,8 @@ gfc_trans_logical_select (gfc_code * code) { tree true_tree, false_tree, stmt; - true_tree = build_empty_stmt (); - false_tree = build_empty_stmt (); + true_tree = build_empty_stmt (input_location); + false_tree = build_empty_stmt (input_location); /* If we have a case for .TRUE. and for .FALSE., discard the default case. Otherwise, if .TRUE. or .FALSE. is missing and there is a default case, @@ -1653,7 +1653,7 @@ gfc_trans_select (gfc_code * code) /* Empty SELECT constructs are legal. */ if (code->block == NULL) - return build_empty_stmt (); + return build_empty_stmt (input_location); /* Select the correct translation function. */ switch (code->expr1->ts.type) @@ -1928,7 +1928,7 @@ gfc_trans_forall_loop (forall_info *forall_tmp, tree body, count, build_int_cst (TREE_TYPE (count), 0)); tmp = build1_v (GOTO_EXPR, exit_label); tmp = fold_build3 (COND_EXPR, void_type_node, - cond, tmp, build_empty_stmt ()); + cond, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); /* The main loop body. */ @@ -2010,7 +2010,8 @@ gfc_trans_nested_forall_loop (forall_info * nested_forall_info, tree body, if (mask) { tmp = gfc_build_array_ref (mask, maskindex, NULL); - body = build3_v (COND_EXPR, tmp, body, build_empty_stmt ()); + body = build3_v (COND_EXPR, tmp, body, + build_empty_stmt (input_location)); } } body = gfc_trans_forall_loop (forall_tmp, body, mask_flag, &header); @@ -2146,7 +2147,8 @@ generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree count3, TREE_TYPE (wheremaskexpr), wheremaskexpr); tmp = fold_build3 (COND_EXPR, void_type_node, - wheremaskexpr, tmp, build_empty_stmt ()); + wheremaskexpr, tmp, + build_empty_stmt (input_location)); } gfc_add_expr_to_block (&body, tmp); @@ -2243,7 +2245,7 @@ generate_loop_for_rhs_to_temp (gfc_expr *expr2, tree tmp1, tree count3, TREE_TYPE (wheremaskexpr), wheremaskexpr); tmp = fold_build3 (COND_EXPR, void_type_node, - wheremaskexpr, tmp, build_empty_stmt ()); + wheremaskexpr, tmp, build_empty_stmt (input_location)); } gfc_add_expr_to_block (&body1, tmp); @@ -2815,7 +2817,7 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info) if (code->expr1 && code->expr1->expr_type == EXPR_CONSTANT && !code->expr1->value.logical) - return build_empty_stmt (); + return build_empty_stmt (input_location); n = 0; /* Count the FORALL index number. */ @@ -3372,7 +3374,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts, loop.temp_ss != NULL, false); - tmp = build3_v (COND_EXPR, maskexpr, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, maskexpr, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&body, tmp); @@ -3425,7 +3427,8 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, /* Use the scalar assignment as is. */ tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts, false, false); - tmp = build3_v (COND_EXPR, maskexpr, tmp, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, maskexpr, tmp, + build_empty_stmt (input_location)); gfc_add_expr_to_block (&body, tmp); /* Increment count2. */ @@ -3832,7 +3835,7 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock) tstmt = gfc_trans_scalar_assign (&tdse, &tsse, tdst->ts, false, false); estmt = eblock ? gfc_trans_scalar_assign (&edse, &esse, edst->ts, false, false) - : build_empty_stmt (); + : build_empty_stmt (input_location); tmp = build3_v (COND_EXPR, cexpr, tstmt, estmt); gfc_add_expr_to_block (&body, tmp); gfc_add_block_to_block (&body, &cse.post); @@ -4011,7 +4014,7 @@ gfc_trans_allocate (gfc_code * code) parm = fold_build2 (NE_EXPR, boolean_type_node, stat, build_int_cst (TREE_TYPE (stat), 0)); tmp = fold_build3 (COND_EXPR, void_type_node, - parm, tmp, build_empty_stmt ()); + parm, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&se.pre, tmp); } @@ -4066,7 +4069,7 @@ gfc_trans_allocate (gfc_code * code) tmp = fold_build2 (NE_EXPR, boolean_type_node, stat, build_int_cst (TREE_TYPE (stat), 0)); - tmp = build3_v (COND_EXPR, tmp, dlen, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, tmp, dlen, build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); } @@ -4200,7 +4203,7 @@ gfc_trans_deallocate (gfc_code *code) tmp = fold_build2 (NE_EXPR, boolean_type_node, astat, build_int_cst (TREE_TYPE (astat), 0)); - tmp = build3_v (COND_EXPR, tmp, dlen, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, tmp, dlen, build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); } diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 0b4be58..1785908 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -803,7 +803,8 @@ gfc_init_types (void) /* Create and name the types. */ #define PUSH_TYPE(name, node) \ - pushdecl (build_decl (TYPE_DECL, get_identifier (name), node)) + pushdecl (build_decl (input_location, \ + TYPE_DECL, get_identifier (name), node)) for (index = 0; gfc_integer_kinds[index].kind != 0; ++index) { @@ -1241,19 +1242,22 @@ gfc_get_desc_dim_type (void) TYPE_PACKED (type) = 1; /* Consists of the stride, lbound and ubound members. */ - decl = build_decl (FIELD_DECL, + decl = build_decl (input_location, + FIELD_DECL, get_identifier ("stride"), gfc_array_index_type); DECL_CONTEXT (decl) = type; TREE_NO_WARNING (decl) = 1; fieldlist = decl; - decl = build_decl (FIELD_DECL, + decl = build_decl (input_location, + FIELD_DECL, get_identifier ("lbound"), gfc_array_index_type); DECL_CONTEXT (decl) = type; TREE_NO_WARNING (decl) = 1; fieldlist = chainon (fieldlist, decl); - decl = build_decl (FIELD_DECL, + decl = build_decl (input_location, + FIELD_DECL, get_identifier ("ubound"), gfc_array_index_type); DECL_CONTEXT (decl) = type; TREE_NO_WARNING (decl) = 1; @@ -1505,7 +1509,8 @@ gfc_get_nodesc_array_type (tree etype, gfc_array_spec * as, gfc_packed packed) GFC_TYPE_ARRAY_UBOUND (type, n)); gtype = build_array_type (gtype, rtype); } - TYPE_NAME (type) = type_decl = build_decl (TYPE_DECL, NULL, gtype); + TYPE_NAME (type) = type_decl = build_decl (input_location, + TYPE_DECL, NULL, gtype); DECL_ORIGINAL_TYPE (type_decl) = gtype; } @@ -1539,20 +1544,23 @@ gfc_get_array_descriptor_base (int dimen) TYPE_NAME (fat_type) = get_identifier (name); /* Add the data member as the first element of the descriptor. */ - decl = build_decl (FIELD_DECL, get_identifier ("data"), ptr_type_node); + decl = build_decl (input_location, + FIELD_DECL, get_identifier ("data"), ptr_type_node); DECL_CONTEXT (decl) = fat_type; fieldlist = decl; /* Add the base component. */ - decl = build_decl (FIELD_DECL, get_identifier ("offset"), + decl = build_decl (input_location, + FIELD_DECL, get_identifier ("offset"), gfc_array_index_type); DECL_CONTEXT (decl) = fat_type; TREE_NO_WARNING (decl) = 1; fieldlist = chainon (fieldlist, decl); /* Add the dtype component. */ - decl = build_decl (FIELD_DECL, get_identifier ("dtype"), + decl = build_decl (input_location, + FIELD_DECL, get_identifier ("dtype"), gfc_array_index_type); DECL_CONTEXT (decl) = fat_type; TREE_NO_WARNING (decl) = 1; @@ -1565,7 +1573,8 @@ gfc_get_array_descriptor_base (int dimen) gfc_index_zero_node, gfc_rank_cst[dimen - 1])); - decl = build_decl (FIELD_DECL, get_identifier ("dim"), arraytype); + decl = build_decl (input_location, + FIELD_DECL, get_identifier ("dim"), arraytype); DECL_CONTEXT (decl) = fat_type; TREE_NO_WARNING (decl) = 1; fieldlist = chainon (fieldlist, decl); @@ -1803,7 +1812,8 @@ gfc_finish_type (tree type) { tree decl; - decl = build_decl (TYPE_DECL, NULL_TREE, type); + decl = build_decl (input_location, + TYPE_DECL, NULL_TREE, type); TYPE_STUB_DECL (type) = decl; layout_type (type); rest_of_type_compilation (type, 1); @@ -1822,7 +1832,8 @@ gfc_add_field_to_struct (tree *fieldlist, tree context, { tree decl; - decl = build_decl (FIELD_DECL, name, type); + decl = build_decl (input_location, + FIELD_DECL, name, type); DECL_CONTEXT (decl) = context; DECL_INITIAL (decl) = 0; @@ -2124,7 +2135,8 @@ gfc_get_mixed_entry_union (gfc_namespace *ns) if (el == el2) { - decl = build_decl (FIELD_DECL, + decl = build_decl (input_location, + FIELD_DECL, get_identifier (el->sym->result->name), gfc_sym_type (el->sym->result)); DECL_CONTEXT (decl) = type; @@ -2411,7 +2423,7 @@ gfc_get_array_descr_info (const_tree type, struct array_descr_info *info) base_decl = GFC_TYPE_ARRAY_BASE_DECL (type, indirect); if (!base_decl) { - base_decl = build_decl (VAR_DECL, NULL_TREE, + base_decl = build_decl (input_location, VAR_DECL, NULL_TREE, indirect ? build_pointer_type (ptype) : ptype); GFC_TYPE_ARRAY_BASE_DECL (type, indirect) = base_decl; } diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index c842ea8..319ae69 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -238,7 +238,7 @@ gfc_finish_block (stmtblock_t * stmtblock) expr = stmtblock->head; if (!expr) - expr = build_empty_stmt (); + expr = build_empty_stmt (input_location); stmtblock->head = NULL_TREE; @@ -485,7 +485,7 @@ gfc_trans_runtime_check (bool error, bool once, tree cond, stmtblock_t * pblock, cond = build_call_expr (built_in_decls[BUILT_IN_EXPECT], 2, cond, tmp); cond = fold_convert (boolean_type_node, cond); - tmp = build3_v (COND_EXPR, cond, body, build_empty_stmt ()); + tmp = build3_v (COND_EXPR, cond, body, build_empty_stmt (input_location)); gfc_add_expr_to_block (pblock, tmp); } } @@ -516,7 +516,7 @@ gfc_call_malloc (stmtblock_t * block, tree type, tree size) ("Attempt to allocate a negative amount of memory.")); tmp = fold_build3 (COND_EXPR, void_type_node, negative, build_call_expr (gfor_fndecl_runtime_error, 1, msg), - build_empty_stmt ()); + build_empty_stmt (input_location)); gfc_add_expr_to_block (block, tmp); /* Call malloc and check the result. */ @@ -534,7 +534,7 @@ gfc_call_malloc (stmtblock_t * block, tree type, tree size) ("Memory allocation failed")); tmp = fold_build3 (COND_EXPR, void_type_node, null_result, build_call_expr (gfor_fndecl_os_error, 1, msg), - build_empty_stmt ()); + build_empty_stmt (input_location)); gfc_add_expr_to_block (&block2, tmp); malloc_result = gfc_finish_block (&block2); @@ -607,7 +607,7 @@ gfc_allocate_with_status (stmtblock_t * block, tree size, tree status) tmp = fold_build3 (COND_EXPR, void_type_node, fold_build2 (NE_EXPR, boolean_type_node, status, build_int_cst (TREE_TYPE (status), 0)), - tmp, build_empty_stmt ()); + tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (block, tmp); } @@ -664,7 +664,7 @@ gfc_allocate_with_status (stmtblock_t * block, tree size, tree status) tmp = fold_build3 (COND_EXPR, void_type_node, fold_build2 (EQ_EXPR, boolean_type_node, res, build_int_cst (pvoid_type_node, 0)), - tmp, build_empty_stmt ()); + tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&alloc_block, tmp); cond = fold_build2 (LT_EXPR, boolean_type_node, size, @@ -790,7 +790,7 @@ gfc_call_free (tree var) build_int_cst (pvoid_type_node, 0)); call = build_call_expr (built_in_decls[BUILT_IN_FREE], 1, var); tmp = fold_build3 (COND_EXPR, void_type_node, cond, call, - build_empty_stmt ()); + build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, tmp); return gfc_finish_block (&block); @@ -854,7 +854,7 @@ gfc_deallocate_with_status (tree pointer, tree status, bool can_fail, varname); } else - error = build_empty_stmt (); + error = build_empty_stmt (input_location); if (status != NULL_TREE && !integer_zerop (status)) { @@ -889,7 +889,7 @@ gfc_deallocate_with_status (tree pointer, tree status, bool can_fail, fold_build1 (INDIRECT_REF, status_type, status), build_int_cst (status_type, 0)); tmp = fold_build3 (COND_EXPR, void_type_node, cond2, tmp, - build_empty_stmt ()); + build_empty_stmt (input_location)); gfc_add_expr_to_block (&non_null, tmp); } @@ -936,7 +936,7 @@ gfc_call_realloc (stmtblock_t * block, tree mem, tree size) ("Attempt to allocate a negative amount of memory.")); tmp = fold_build3 (COND_EXPR, void_type_node, negative, build_call_expr (gfor_fndecl_runtime_error, 1, msg), - build_empty_stmt ()); + build_empty_stmt (input_location)); gfc_add_expr_to_block (block, tmp); /* Call realloc and check the result. */ @@ -953,14 +953,14 @@ gfc_call_realloc (stmtblock_t * block, tree mem, tree size) ("Out of memory")); tmp = fold_build3 (COND_EXPR, void_type_node, null_result, build_call_expr (gfor_fndecl_os_error, 1, msg), - build_empty_stmt ()); + build_empty_stmt (input_location)); gfc_add_expr_to_block (block, tmp); /* if (size == 0) then the result is NULL. */ tmp = fold_build2 (MODIFY_EXPR, type, res, build_int_cst (type, 0)); zero = fold_build1 (TRUTH_NOT_EXPR, boolean_type_node, nonzero); tmp = fold_build3 (COND_EXPR, void_type_node, zero, tmp, - build_empty_stmt ()); + build_empty_stmt (input_location)); gfc_add_expr_to_block (block, tmp); return res; @@ -1038,7 +1038,7 @@ gfc_trans_code (gfc_code * code) tree res; if (!code) - return build_empty_stmt (); + return build_empty_stmt (input_location); gfc_start_block (&block); @@ -1289,10 +1289,9 @@ gfc_generate_module_code (gfc_namespace * ns) gcc_assert (ns->proc_name->backend_decl == NULL); ns->proc_name->backend_decl - = build_decl (NAMESPACE_DECL, get_identifier (ns->proc_name->name), + = build_decl (ns->proc_name->declared_at.lb->location, + NAMESPACE_DECL, get_identifier (ns->proc_name->name), void_type_node); - gfc_set_decl_location (ns->proc_name->backend_decl, - &ns->proc_name->declared_at); entry = gfc_find_module (ns->proc_name->name); if (entry->namespace_decl) /* Buggy sourcecode, using a module before defining it? */ |