2004-05-13 08:41:07 +02:00
|
|
|
|
/* Exception handling semantics and decomposition for trees.
|
2011-01-19 00:16:16 +01:00
|
|
|
|
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
|
2009-02-20 16:20:38 +01:00
|
|
|
|
Free Software Foundation, Inc.
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
This file is part of GCC.
|
|
|
|
|
|
|
|
|
|
GCC is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-07-26 10:37:01 +02:00
|
|
|
|
the Free Software Foundation; either version 3, or (at your option)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
|
|
GCC is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-07-26 10:37:01 +02:00
|
|
|
|
along with GCC; see the file COPYING3. If not see
|
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
#include "system.h"
|
|
|
|
|
#include "coretypes.h"
|
|
|
|
|
#include "tm.h"
|
|
|
|
|
#include "tree.h"
|
|
|
|
|
#include "flags.h"
|
|
|
|
|
#include "function.h"
|
|
|
|
|
#include "except.h"
|
2010-03-10 12:08:48 +01:00
|
|
|
|
#include "pointer-set.h"
|
2004-05-13 08:41:07 +02:00
|
|
|
|
#include "tree-flow.h"
|
|
|
|
|
#include "tree-dump.h"
|
|
|
|
|
#include "tree-inline.h"
|
|
|
|
|
#include "tree-iterator.h"
|
|
|
|
|
#include "tree-pass.h"
|
|
|
|
|
#include "timevar.h"
|
|
|
|
|
#include "langhooks.h"
|
|
|
|
|
#include "ggc.h"
|
2010-07-08 06:22:54 +02:00
|
|
|
|
#include "diagnostic-core.h"
|
2008-07-28 16:33:56 +02:00
|
|
|
|
#include "gimple.h"
|
2009-09-14 21:18:58 +02:00
|
|
|
|
#include "target.h"
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
|
|
/* In some instances a tree and a gimple need to be stored in a same table,
|
|
|
|
|
i.e. in hash tables. This is a structure to do this. */
|
|
|
|
|
typedef union {tree *tp; tree t; gimple g;} treemple;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
cfgcleanup.c (try_simplify_condjump): Don't remove line notes to avoid unreachable code warnings.
* cfgcleanup.c (try_simplify_condjump): Don't remove line
notes to avoid unreachable code warnings.
* toplev.c (backend_init): Don't emit line notes for
unreachable code warnings.
* combine.c (distribute_notes): Don't distribute a
REG_VTABLE_REF note.
* final.c (final_scan_insn): Don't handle it.
* rtl.c (reg_note_name): Remove it.
* rtl.h (enum reg_node): Dito.
* emit-rtl.c (force_line_numbers, restore_line_number_status):
Remove.
* rtl.h (force_line_numbers, restore_line_number_status):
Remove prototypes.
* stmt.c (using_eh_for_cleanups_p, using_eh_for_cleanups): Move...
* tree-eh.c (using_eh_for_cleanups_p): ...here. Make static.
(using_eh_for_cleanups): Also moved here.
* expr.c (expand_expr_real_1) <CASE_LABEL_EXPR>: Die if we see one.
<SWITCH_EXPR>: Die if we have a non-NULL SWITCH_BODY. Update calls
to expand_start_case and add_case_node.
* stmt.c (struct nesting): Cleanup unused fields condition_code,
last_unconditional_cleanup, nominal_type, printname, and
line_number_status.
(struct fixup_goto): Remove.
(struct stmt_status): Remove x_goto_fixup_chain field.
(goto_fixup_chain): Remove.
(strip_default_case_nodes, group_case_nodes, emit_jump_if_reachable,
pushcase, pushcase_range): Remove.
(expand_start_bindings_and_block): Don't set unused fields in
the nesting stack.
(expand_start_case, add_case_node): Cleanup unused formal arguments.
(expand_end_case_type): Don't simplify the case-list. Use emit_jump
instead of emit_jump_if_reachable.
(emit_case_nodes): Likewise.
* tree-cfg.c (group_case_labels, cleanup_dead_labels): No longer
static.
(update_eh_label): Work around left-over exception handing regions.
* tree-flow.h (group_case_labels, cleanup_dead_labels): Add protos.
* tree-optimize.c (execute_cleanup_cfg_post_optimizing): New function.
(pass_cleanup_cfg_post_optimizing): New pass.
(init_tree_optimization_passes): Run the new pass after all
optimizations.
* tree.h (pushcase, pushcase_range): Remove prototypes.
(expand_start_case, add_case_node): Update prototypes.
cp/
* cp-tree.h (struct lang_type): Don't have three GTY options on a
single bit GTY desc.
java/
* parse.y (java_complete_expand_methods, java_expand_classes): Don't
abuse restore_line_number_status.
From-SVN: r84849
2004-07-17 02:31:15 +02:00
|
|
|
|
/* Nonzero if we are using EH to handle cleanups. */
|
|
|
|
|
static int using_eh_for_cleanups_p = 0;
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
using_eh_for_cleanups (void)
|
|
|
|
|
{
|
|
|
|
|
using_eh_for_cleanups_p = 1;
|
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
/* Misc functions used in this file. */
|
|
|
|
|
|
|
|
|
|
/* Compare and hash for any structure which begins with a canonical
|
cgraphunit.c, [...]: Fix comment typos.
* cgraphunit.c, dbxout.c, flow.c, gcse.c, gimplify.c,
lambda-code.c, loop.c, machmode.def, mips-tfile.c,
modulo-sched.c, passes.c, postreload-gcse.c, tree-eh.c,
tree-ssa-ccp.c, varasm.c, config/frv/frv.c, config/frv/frv.h,
config/frv/frv.md, config/i386/i386.c, config/i386/i386.h,
config/i386/i386.md, config/rs6000/predicates.md,
config/rs6000/rs6000.c, config/s390/fixdfdi.h,
config/s390/s390.c, config/stormy16/stormy16.c,
config/stormy16/stormy16.md, config/vax/vax.md: Fix comment
typos.
From-SVN: r97362
2005-04-01 05:42:55 +02:00
|
|
|
|
pointer. Assumes all pointers are interchangeable, which is sort
|
2004-05-13 08:41:07 +02:00
|
|
|
|
of already assumed by gcc elsewhere IIRC. */
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
struct_ptr_eq (const void *a, const void *b)
|
|
|
|
|
{
|
2005-12-18 02:19:20 +01:00
|
|
|
|
const void * const * x = (const void * const *) a;
|
|
|
|
|
const void * const * y = (const void * const *) b;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
return *x == *y;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static hashval_t
|
|
|
|
|
struct_ptr_hash (const void *a)
|
|
|
|
|
{
|
2005-12-18 02:19:20 +01:00
|
|
|
|
const void * const * x = (const void * const *) a;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
return (size_t)*x >> 4;
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Remember and lookup EH landing pad data for arbitrary statements.
|
2004-05-13 08:41:07 +02:00
|
|
|
|
Really this means any statement that could_throw_p. We could
|
|
|
|
|
stuff this information into the stmt_ann data structure, but:
|
|
|
|
|
|
|
|
|
|
(1) We absolutely rely on this information being kept until
|
|
|
|
|
we get to rtl. Once we're done with lowering here, if we lose
|
|
|
|
|
the information there's no way to recover it!
|
|
|
|
|
|
2004-08-19 23:34:37 +02:00
|
|
|
|
(2) There are many more statements that *cannot* throw as
|
2004-05-13 08:41:07 +02:00
|
|
|
|
compared to those that can. We should be saving some amount
|
|
|
|
|
of space by only allocating memory for those that can throw. */
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Add statement T in function IFUN to landing pad NUM. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
void
|
2009-09-14 21:18:58 +02:00
|
|
|
|
add_stmt_to_eh_lp_fn (struct function *ifun, gimple t, int num)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
|
|
|
|
struct throw_stmt_node *n;
|
|
|
|
|
void **slot;
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gcc_assert (num != 0);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
utils.c (init_gnat_to_gnu): Use typed GC allocation.
gcc/ada:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* gcc-interface/utils.c (init_gnat_to_gnu): Use typed GC
allocation.
(init_dummy_type): Likewise.
(gnat_pushlevel): Likewise.
* gcc-interface/trans.c (Attribute_to_gnu): Likewise.
(Subprogram_Body_to_gnu): Likewise.
(Compilation_Unit_to_gnu): Likewise.
(start_stmt_group): Likewise.
(extract_encoding): Likewise.
(decode_name): Likewise.
* gcc-interface/misc.c (gnat_printable_name): Likewise.
* gcc-interface/decl.c (annotate_value): Likewise.
* gcc-interface/ada-tree.h (struct lang_type): Add variable_size
GTY option.
(struct lang_decl): Likewise.
(SET_TYPE_LANG_SPECIFIC): Use typed GC allocation.
(SET_DECL_LANG_SPECIFIC): Likewise.
gcc/c-family:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* c-pragma.c (push_alignment): Use typed GC allocation.
(handle_pragma_push_options): Likewise.
* c-common.c (parse_optimize_options): Likewise.
* c-common.h (struct sorted_fields_type): Add variable_size GTY
option.
gcc/cp:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* typeck2.c (abstract_virtuals_error): Likewise.
* pt.c (maybe_process_partial_specialization): Likewise.
(register_specialization): Likewise.
(add_pending_template): Likewise.
(lookup_template_class): Likewise.
(push_tinst_level): Likewise.
* parser.c (cp_lexer_new_main): Likewise.
(cp_lexer_new_from_tokens): Likewise.
(cp_token_cache_new): Likewise.
(cp_parser_context_new): Likewise.
(cp_parser_new): Likewise.
(cp_parser_nested_name_specifier_opt): Likewise.
(cp_parser_template_id): Likewise.
* name-lookup.c (binding_entry_make): Likewise.
(binding_table_construct): Likewise.
(binding_table_new): Likewise.
(cxx_binding_make): Likewise.
(pushdecl_maybe_friend): Likewise.
(begin_scope): Likewise.
(push_to_top_level): Likewise.
* lex.c (init_reswords): Likewise.
(retrofit_lang_decl): Likewise.
(cxx_dup_lang_specific_decl): Likewise.
(copy_lang_type): Likewise.
(cxx_make_type): Likewise.
* decl.c (make_label_decl): Likewise.
(check_goto): Likewise.
(start_preparsed_function): Likewise.
(save_function_data): Likewise.
* cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
* cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
* class.c (finish_struct_1): Likewise.
* cp-tree.h (struct lang_type): Add variable_size GTY option.
(struct lang_decl): Likewise.
* parser.c (cp_parser_new): Update comment to not reference
ggc_alloc.
gcc/fortran:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* trans-types.c (gfc_get_nodesc_array_type): Use typed GC
allocation.
(gfc_get_array_type_bounds): Likewise.
* trans-decl.c (gfc_allocate_lang_decl): Likewise.
(gfc_find_module): Likewise.
* f95-lang.c (pushlevel): Likewise.
* trans.h (struct lang_type): Add variable_size GTY option.
(struct lang_decl): Likewise.
gcc/java:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* jcf-reader.c (jcf_parse_constant_pool): Use typed GC allocation.
* jcf-parse.c (java_parse_file): Likewise.
(process_zip_dir): Likewise.
* java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise.
(MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise.
* expr.c (add_type_assertion): Likewise.
* decl.c (make_binding_level): Likewise.
(java_dup_lang_specific_decl): Likewise.
* constants.c (set_constant_entry): Likewise.
(cpool_for_class): Likewise.
* class.c (add_method_1): Likewise.
(java_treetreehash_new): Likewise.
* java-tree.h (struct lang_type): Add variable_size GTY option.
(struct lang_decl): Likewise.
* jch.h (struct cpool_entry): Likewise.
* java-tree.h (java_treetreehash_create): Remove parameter ggc.
* except.c (prepare_eh_table_type): Update
java_treetreehash_create call.
* class.c (add_method_1): Update java_treetreehash_create call.
(java_treetreehash_create): Remove parameter gc. Use
htab_create_ggc.
gcc/lto:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* lto.c (lto_read_in_decl_state): Use typed GC allocation.
(lto_file_read): Likewise.
(new_partition): Likewise.
(read_cgraph_and_symbols): Likewise.
gcc/objc:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC
allocation.
* objc-act.c (objc_volatilize_decl): Likewise.
(objc_build_string_object): Likewise.
(hash_init): Likewise.
(hash_enter): Likewise.
(hash_add_attr): Likewise.
(add_class): Likewise.
(start_class): Likewise.
gcc/objcp:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* objcp-decl.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC
allocation.
gcc:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* doc/tm.texi (Per-Function Data): Do not reference ggc_alloc.
* doc/gty.texi (GTY Options): Document typed GC allocation and
variable_size GTY option.
* ggc-internal.h: New.
* ggc.h: Update copyright year.
(digit_string): Move to stringpool.c.
(ggc_mark_stringpool, ggc_purge_stringpool, ggc_mark_roots)
(gt_pch_save_stringpool, gt_pch_fixup_stringpool)
(gt_pach_restore_stringpool, gt_pch_p_S, gt_pch_note_object)
(init_ggc_pch, ggc_pch_count_object, ggc_pch_total_size)
(ggc_pch_this_base, ggc_pch_alloc_object, ggc_pch_prepare_write)
(ggc_pch_write_object, ggc_pch_finish, ggc_pch_read)
(ggc_force_collect, ggc_get_size, ggc_statistics)
(ggc_print_common_statistics): Move to ggc-internal.h.
(digit_vector, new_ggc_zone, destroy_ggc_zone, ggc_alloc_stat)
(ggc_alloc, ggc_alloc_cleared, ggc_realloc, ggc_calloc, GGC_NEW)
(GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, ggc_alloc_rtvec)
(ggc_alloc_tree, gt_pch_save, ggc_min_expand_heuristic)
(ggc_min_heapsize_heuristic, ggc_alloc_zone)
(ggc_alloc_zone_pass_stat): Remove.
(ggc_internal_alloc_stat, ggc_internal_alloc)
(ggc_internal_cleared_alloc_stat): New.
(GGC_RESIZEVEC, GGC_RESIZEVAR): Redefine.
(ggc_internal_vec_alloc_stat)
(ggc_internal_cleared_vec_alloc_stat)
(ggc_internal_vec_alloc_stat, ggc_internal_cleared_vec_alloc)
(ggc_alloc_atomic_stat, ggc_alloc_atomic)
(ggc_alloc_cleared_atomic, ggc_cleared_alloc_htab_ignore_args)
(ggc_cleared_alloc_ptr_array_two_args): New.
(htab_create_ggc, splay_tree_new_ggc): Redefine.
(ggc_splay_alloc): Change the type of the first argument to
enum gt_types_enum.
(ggc_alloc_string): Make macro.
(ggc_alloc_string_stat): New.
(ggc_strdup): Redefine.
(rtl_zone, tree_zone, tree_id_zone): Declare unconditionally.
(ggc_alloc_rtvec_sized): New.
(ggc_alloc_zone_stat): Rename to ggc_internal_alloc_zone_stat.
(ggc_internal_alloc_zone_pass_stat, ggc_internal_alloc_zone_stat)
(ggc_internal_cleared_alloc_zone_stat)
(ggc_internal_zone_alloc_stat)
(ggc_internal_zone_cleared_alloc_stat)
(ggc_internal_zone_vec_alloc_stat)
(ggc_alloc_zone_rtx_def_stat)
(ggc_alloc_zone_tree_node_stat)
(ggc_alloc_zone_cleared_tree_node_stat)
(ggc_alloc_cleared_gimple_statement_d_stat): New.
* ggc-common.c: Include ggc-internal.h.
(ggc_internal_cleared_alloc_stat): Rename from
ggc_alloc_cleared_stat.
(ggc_realloc_stat): Use ggc_internal_alloc_stat.
(ggc_calloc): Remove.
(ggc_cleared_alloc_htab_ignore_args): New.
(ggc_cleared_alloc_ptr_array_two_args): New.
(ggc_splay_alloc): Add obj_type parameter.
(init_ggc_heuristics): Formatting fixes.
* ggc-none.c: Update copyright year.
(ggc_alloc_stat): Rename to ggc_alloc_stat.
(ggc_alloc_cleared_stat): Rename to
ggc_internal_cleared_alloc_stat.
(struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New.
* ggc-page.c: Update copyright year. Include ggc-internal.h.
Remove references to ggc_alloc in comments.
(ggc_alloc_typed_stat): Call ggc_internal_alloc_stat.
(ggc_alloc_stat): Rename to ggc_internal_alloc_stat.
(new_ggc_zone, destroy_ggc_zone): Remove.
(struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New.
* ggc-zone.c: Include ggc-internal.h. Remove references to
ggc_alloc in comments.
(ggc_alloc_zone_stat): ggc_internal_alloc_zone_stat.
(ggc_internal_alloc_zone_pass_stat): New.
(ggc_internal_cleared_alloc_zone_stat): New.
(ggc_alloc_typed_stat): Use ggc_internal_alloc_zone_pass_stat.
(ggc_alloc_stat): Rename ggc_internal_alloc_stat.
(new_ggc_zone, destroy_ggc_zone): Remove.
* stringpool.c: Update copyright year. Include ggc-internal.h
(digit_vector): Make static.
(digit_string): Moved from ggc.h.
(stringpool_ggc_alloc): Use ggc_alloc_atomic.
(ggc_alloc_string): Rename to ggc_alloc_string_stat.
* Makefile.in (GGC_INTERNAL_H): New.
(ggc_common.o, ggc-page.o, ggc-zone.o, stringpool.o): Add
$(GGC_INTERNAL_H) to dependencies.
* gentype.c: Update copyright year.
(walk_type): Accept variable_size GTY option.
(USED_BY_TYPED_GC_P): New macro.
(write_enum_defn): Use USED_BY_TYPED_GC_P. Do not output
whitespace at the end of strings.
(get_type_specifier, variable_size_p): New functions.
(alloc_quantity, alloc_zone): New enums.
(write_typed_alloc_def): New function.
(write_typed_struct_alloc_def): Likewise.
(write_typed_typed_typedef_alloc_def): Likewise.
(write_typed_alloc_defns): Likewise.
(output_typename, write_splay_tree_allocator_def): Likewise.
(write_splay_tree_allocators): Likewise.
(main): Call write_typed_alloc_defns and
write_splay_tree_allocators.
* lto-streamer.h (lto_file_decl_data_ptr): New.
* passes.c (order): Define using cgraph_node_ptr.
* strinpool.c (struct string_pool_data): Declare nested_ptr using
ht_identifier_ptr.
* gimple.h (union gimple_statement_d): Likewise.
* rtl.h (struct rtx_def): Likewise.
(struct rtvec_def): Likewise.
* tree.h (union tree_node): Likewise.
* tree-ssa-operands.h (struct ssa_operand_memory_d): Likewise.
* cfgloop.c (record_loop_exits): Use htab_create_ggc.
* tree-scalar-evolution.c (scev_initialize): Likewise.
* alias.c (record_alias_subset): Update splay_tree_new_ggc call.
* dwarf2asm.c (dw2_force_const_mem): Likewise.
* omp-low.c (lower_omp_critical): Likewise.
* bitmap.h (struct bitmap_head_def): Update comment to not
reference ggc_alloc.
* config/pa/pa.c (get_deferred_label): Use GGC_RESIZEVEC.
* ira.c (fix_reg_equiv_init): Use GGC_RESIZEVEC.
* ipa-prop.c (duplicate_ggc_array): Rename to
duplicate_ipa_jump_func_array. Use typed GC allocation.
(ipa_edge_duplication_hook): Call duplicate_ipa_jump_func_array.
* gimple.c (gimple_alloc_stat): Use
ggc_alloc_cleared_gimple_statement_d_stat.
* varasm.c (create_block_symbol): Use ggc_alloc_zone_rtx_def.
* tree.c (make_node_stat): Use
ggc_alloc_zone_cleared_tree_node_stat.
(make_tree_vec_stat): Likewise.
(build_vl_exp_stat): Likewise.
(copy_node_stat): Use ggc_alloc_zone_tree_node_stat.
(make_tree_binfo_stat): Likewise.
(tree_cons_stat): Likewise.
* rtl.c (rtx_alloc_stat): Use ggc_alloc_zone_rtx_def_stat.
(shallow_copy_rtx_stat): Likewise.
(make_node_stat): Likewise.
* lto-symtab.c: Fix comment.
* tree-cfg.c (create_bb): Update comment to not reference
ggc_alloc_cleared.
* tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is
value.
* varpool.c (varpool_node): Use typed GC allocation.
(varpool_extra_name_alias): Likewise.
* varasm.c (emutls_decl): Likewise.
(get_unnamed_section): Likewise.
(get_noswitch_section): Likewise.
(get_section): Likewise.
(get_block_for_section): Likewise.
(build_constant_desc): Likewise.
(create_constant_pool): Likewise.
(force_const_mem): Likewise.
* tree.c (build_vl_exp_stat): Likewise.
(build_real): Likewise.
(build_string): Likewise.
(decl_debug_expr_insert): Likewise.
(decl_value_expr_insert): Likewise.
(type_hash_add): Likewise.
(build_omp_clause): Likewise.
* tree-ssanames.c (duplicate_ssa_name_ptr_info): Likewise.
* tree-ssa.c (init_tree_ssa): Likewise.
* tree-ssa-structalias.c (heapvar_insert): Likewise.
* tree-ssa-operands.c (ssa_operand_alloc): Likewise.
* tree-ssa-loop-niter.c (record_estimate): Likewise.
* tree-ssa-alias.c (get_ptr_info): Likewise.
* tree-scalar-evolution.c (new_scev_info_str): Likewise.
* tree-phinodes.c (allocate_phi_node): Likewise.
* tree-iterator.c (tsi_link_before): Likewise.
(tsi_link_after): Likewise.
* tree-eh.c (add_stmt_to_eh_lp_fn): Likewise.
* tree-dfa.c (create_var_ann): Likewise.
* tree-cfg.c (create_bb): Likewise.
* toplev.c (alloc_for_identifier_to_locale): Likewise.
(general_init): Likewise.
* stringpool.c (stringpool_ggc_alloc): Likewise.
(gt_pch_save_stringpool): Likewise.
* sese.c (if_region_set_false_region): Likewise.
* passes.c (do_per_function_toporder): Likewise.
* optabs.c (set_optab_libfunc): Likewise.
(set_conv_libfunc): Likewise.
* lto-symtab.c (lto_symtab_register_decl): Likewise.
* lto-streamer-in.c (lto_input_eh_catch_list): Likewise.
(input_eh_region): Likewise.
(input_eh_lp): Likewise.
(make_new_block): Likewise.
(unpack_ts_real_cst_value_fields): Likewise.
* lto-section-in.c (lto_new_in_decl_state): Likewise.
* lto-cgraph.c (input_node_opt_summary): Likewise.
* loop-init.c (loop_optimizer_init): Likewise.
* lambda.h (lambda_vector_new): Likewise.
* lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise.
* ira.c (update_equiv_regs): Likewise.
* ipa.c (cgraph_node_set_new): Likewise.
(cgraph_node_set_add): Likewise.
(varpool_node_set_new): Likewise.
(varpool_node_set_add): Likewise.
* ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise.
(duplicate_ipa_jump_func_array): Likewise.
(ipa_read_node_info): Likewise.
* ipa-cp.c (ipcp_create_replace_map): Likewise.
* integrate.c (get_hard_reg_initial_val): Likewise.
* gimple.c (gimple_alloc_stat): Likewise.
(gimple_build_omp_for): Likewise.
(gimple_seq_alloc): Likewise.
(gimple_copy): Likewise.
* gimple-iterator.c (gsi_insert_before_without_update): Likewise.
(gsi_insert_after_without_update): Likewise.
* function.c (add_frame_space): Likewise.
(insert_temp_slot_address): Likewise.
(assign_stack_temp_for_type): Likewise.
(allocate_struct_function): Likewise.
(types_used_by_var_decl_insert): Likewise.
* except.c (init_eh_for_function): Likewise.
(gen_eh_region): Likewise.
(gen_eh_region_catch): Likewise.
(gen_eh_landing_pad): Likewise.
(add_call_site): Likewise.
* emit-rtl.c (get_mem_attrs): Likewise.
(get_reg_attrs): Likewise.
(start_sequence): Likewise.
(init_emit): Likewise.
* dwarf2out.c (new_cfi): Likewise.
(queue_reg_save): Likewise.
(dwarf2out_frame_init): Likewise.
(new_loc_descr): Likewise.
(find_AT_string): Likewise.
(new_die): Likewise.
(add_var_loc_to_decl): Likewise.
(clone_die): Likewise.
(clone_as_declaration): Likewise.
(break_out_comdat_types): Likewise.
(new_loc_list): Likewise.
(loc_descriptor): Likewise.
(add_loc_descr_to_each): Likewise.
(add_const_value_attribute): Likewise.
(tree_add_const_value_attribute): Likewise.
(add_comp_dir_attribute): Likewise.
(add_name_and_src_coords_attributes): Likewise.
(lookup_filename): Likewise.
(store_vcall_insn): Likewise.
(dwarf2out_init): Likewise.
* dbxout.c (dbxout_init): Likewise.
* config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.
* config/sparc/sparc.c (sparc_init_machine_status): Likewise.
* config/score/score7.c (score7_output_external): Likewise.
* config/score/score3.c (score3_output_external): Likewise.
* config/s390/s390.c (s390_init_machine_status): Likewise.
* config/rs6000/rs6000.c (builtin_function_type): Likewise.
(rs6000_init_machine_status): Likewise.
(output_toc): Likewise.
* config/pa/pa.c (pa_init_machine_status): Likewise.
(get_deferred_plabel): Likewise.
* config/moxie/moxie.c (moxie_init_machine_status): Likewise.
* config/mmix/mmix.c (mmix_init_machine_status): Likewise.
* config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise.
* config/mep/mep.c (mep_init_machine_status): Likewise.
(mep_note_pragma_flag): Likewise.
* config/m32c/m32c.c (m32c_init_machine_status): Likewise.
* config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise.
* config/ia64/ia64.c (ia64_init_machine_status): Likewise.
* config/i386/winnt.c (i386_pe_record_external_function): Likewise.
(i386_pe_maybe_record_exported_symbol): Likewise.
* config/i386/i386.c (get_dllimport_decl): Likewise.
(ix86_init_machine_status): Likewise.
(assign_386_stack_local): Likewise.
* config/frv/frv.c (frv_init_machine_status): Likewise.
* config/darwin.c (machopic_indirection_name): Likewise.
* config/cris/cris.c (cris_init_machine_status): Likewise.
* config/bfin/bfin.c (bfin_init_machine_status): Likewise.
* config/avr/avr.c (avr_init_machine_status): Likewise.
* config/arm/arm.c (arm_init_machine_status): Likewise.
* config/alpha/alpha.c (alpha_init_machine_status): Likewise.
(alpha_need_linkage): Likewise.
(alpha_use_linkage): Likewise.
* cgraph.c (cgraph_allocate_node): Likewise.
(cgraph_create_edge_1): Likewise.
(cgraph_create_indirect_edge): Likewise.
(cgraph_add_asm_node): Likewise.
* cfgrtl.c (init_rtl_bb_info): Likewise.
* cfgloop.c (alloc_loop): Likewise.
(rescan_loop_exit): Likewise.
* cfg.c (init_flow): Likewise.
(alloc_block): Likewise.
(unchecked_make_edge): Likewise.
* c-parser.c (c_parse_init): Likewise.
(c_parse_file): Likewise.
* c-decl.c (bind): Likewise.
(record_inline_static): Likewise.
(push_scope): Likewise.
(make_label): Likewise.
(lookup_label_for_goto): Likewise.
(finish_struct): Likewise.
(finish_enum): Likewise.
(c_push_function_context): Likewise.
* bitmap.c (bitmap_element_allocate): Likewise.
(bitmap_gc_alloc_stat): Likewise.
* alias.c (record_alias_subset): Likewise.
(init_alias_analysis): Likewise.
include:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* splay-tree.h: Update copyright years.
(splay_tree_s): Document fields.
(splay_tree_new_typed_alloc): New.
* hashtab.h: Update copyright years.
(htab_create_typed_alloc): New.
libcpp:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* include/symtab.h (ht_identifier_ptr): New.
libiberty:
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* splay-tree.c: Update copyright years.
(splay_tree_new_typed_alloc): New.
(splay_tree_new_with_allocator): Use it.
* hashtab.c: Update copyright years.
(htab_create_typed_alloc): New.
(htab_create_alloc): Use it.
* functions.texi: Regenerate.
From-SVN: r160425
2010-06-08 09:25:24 +02:00
|
|
|
|
n = ggc_alloc_throw_stmt_node ();
|
2004-05-13 08:41:07 +02:00
|
|
|
|
n->stmt = t;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
n->lp_nr = num;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2005-05-12 21:29:21 +02:00
|
|
|
|
if (!get_eh_throw_stmt_table (ifun))
|
|
|
|
|
set_eh_throw_stmt_table (ifun, htab_create_ggc (31, struct_ptr_hash,
|
|
|
|
|
struct_ptr_eq,
|
|
|
|
|
ggc_free));
|
|
|
|
|
|
2005-05-11 18:25:30 +02:00
|
|
|
|
slot = htab_find_slot (get_eh_throw_stmt_table (ifun), n, INSERT);
|
targhooks.c (default_unwind_emit, [...]): Use gcc_assert, gcc_unreachable & internal_error instead of abort.
* targhooks.c (default_unwind_emit, default_scalar_mode_supported_p):
Use gcc_assert, gcc_unreachable & internal_error instead of abort.
* timevar.c (timevar_push, timevar_pop, timevar_start,
timevar_stop): Likewise.
* toplev.c (default_pch_valid_p): Likewise.
* tracer.c (tail_duplicate): Likewise.
* tree-alias-common.c (get_alias_var_decl,
get_values_from_constructor, create_alias_var, delete_alias_vars,
empty_points_to_set, same_points_to_set, ptr_may_alias_var):
Likewise.
* tree.c (tree_size, make_node_stat, copy_node_stat,
build_int_cst_wide, integer_all_onesp, list_length, chainon,
tree_node_structure, type_contains_placeholder_p, substitute_in_expr,
substitute_placeholder_in_expr, tabilize_reference_1, build0_stat,
build1_stat, build2_stat, build3_stat, build4_stat, is_attribute_p,
lookup_attribute, type_hash_canon, host_integerp, iterative_hash_expr,
build_method_type_directly, decl_type_context, get_callee_fndecl,
get_set_constructor_bits, build_vector_type_for_mode, int_cst_value,
tree_fold_gcd): Likewise.
* tree-cfg.c (create_bb, make_ctrl_stmt_edges, make_exit_edges,
make_cond_expr_edges, group_case_labels, tree_merge_blocks,
cleanup_control_expr_graph, find_taken_edge,
find_taken_edge_switch_expr, phi_alternatives_equal,
is_ctrl_altering_stmt, disband_implicit_edges, set_bb_for_stmt,
stmt_for_bsi, tree_find_edge_insert_loc, bsi_insert_on_edge_immediate,
tree_split_edge, tree_verify_flow_info, thread_jumps,
tree_redirect_edge_and_branch, tree_flow_call_edges_add): Likewise.
* tree-chrec.c (chrec_fold_poly_cst, chrec_fold_plus_poly_poly,
chrec_fold_multiply_poly_poly): Likewise.
* tree-complex.c (extract_component, expand_complex_division,
expand_complex_comparison, expand_complex_operations_1,
build_replicated_const, expand_vector_operations_1): Likewise.
* tree-data-ref.c (tree_fold_bezout, build_classic_dist_vector,
build_classic_dir_vector): Likewise.
* tree-dfa.c (compute_immediate_uses_for_phi,
compute_immediate_uses_for_stmt, create_var_ann, create_stmt_ann,
create_tree_ann, collect_dfa_stats, get_virtual_var): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-eh.c (record_stmt_eh_region, add_stmt_to_eh_region,
record_in_finally_tree, replace_goto_queue_1,
maybe_record_in_goto_queue, verify_norecord_switch_expr,
do_return_redirection): Likewise.
* tree-if-conv.c (tree_if_convert_stmt, tree_if_convert_cond_expr,
add_to_dst_predicate_list, find_phi_replacement_condition,
replace_phi_with_cond_modify_expr, get_loop_body_in_if_conv_order):
Likewise.
* tree-inline.c (remap_decl, remap_type, remap_decls, copy_body_r,
initialize_inlined_parameters, declare_return_variable,
estimate_num_insns_1, expand_call_inline, expand_calls_inline,
optimize_inline_calls, copy_tree_r): Likewise.
* tree-into-ssa.c (rewrite_initialize_block_local_data, rewrite_stmt,
ssa_rewrite_stmt, rewrite_into_ssa): Likewise.
* tree-iterator.c (alloc_stmt_list, tsi_link_before, tsi_link_after,
tsi_split_statement_list_after, tsi_split_statement_list_before):
Likewise.
* tree-mudflap.c (mf_varname_tree): Likewise.
* tree-nested.c (create_tmp_var_for, lookup_field_for_decl,
lookup_tramp_for_decl, convert_all_function_calls): Likewise.
* tree-optimize.c (tree_rest_of_compilation): Likewise.
* tree-outof-ssa.c (create_temp, eliminate_build, eliminate_phi,
coalesce_abnormal_edges, coalesce_ssa_name, eliminate_virtual_phis,
free_temp_expr_table, add_dependance, finish_expr, rewrite_trees):
Likewise.
* tree-phinodes.c (resize_phi_node, add_phi_arg,
remove_all_phi_nodes_for): Likewise.
* tree-pretty-print.c (op_prio, print_call_name): Likewise.
* tree-profile.c (tree_gen_interval_profiler, tree_gen_pow2_profiler,
tree_gen_one_value_profiler, tree_gen_const_delta_profiler): Likewise.
* tree-sra.c (type_can_instantiate_all_elements, sra_hash_tree,
sra_elt_eq, sra_walk_expr, instantiate_missing_elements,
generate_one_element_ref, generate_element_copy,
generate_element_zero, scalarize_copy, scalarize_init,
scalarize_ldst): Likewise.
* tree-ssa-alias.c (delete_alias_info, group_aliases, may_alias_p,
add_may_alias, add_pointed_to_expr, add_pointed_to_var,
collect_points_to_info_r, get_tmt_for, get_ptr_info): Likewise.
* tree-ssa.c (walk_use_def_chains, check_phi_redundancy): Likewise.
* tree-ssa-ccp.c (dump_lattice_value, get_default_value, get_value,
set_lattice_value, likely_value, ccp_visit_phi_node, visit_assignment,
widen_bitfield, ccp_fold_builtin): Likewise.
* tree-ssa-copy.c (may_propagate_copy, merge_alias_info,
replace_exp_1, propagate_tree_value): Likewise.
* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise.
* tree-ssa-dce.c (set_control_dependence_map_bit,
find_control_dependence, find_pdom, mark_operand_necessary,
mark_stmt_if_obviously_necessary,
mark_control_dependent_edges_necessary, remove_dead_stmt): Likewise.
* tree-ssa-dom.c (dom_opt_initialize_block_local_data,
simplify_switch_and_lookup_avail_expr, cprop_into_successor_phis,
eliminate_redundant_computations, avail_expr_eq): Likewise.
* tree-ssa-dse.c (fix_stmt_v_may_defs): Likewise.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p,
duplicate_blocks): Likewise.
* tree-ssa-loop-im.c (for_each_index, set_level,
is_call_clobbered_ref): Likewise.
* tree-ssa-loop-ivopts.c (dump_use, divide, stmt_after_ip_normal_pos,
stmt_after_increment, set_iv, contains_abnormal_ssa_name_p,
find_interesting_uses_outer_or_nonlin, add_derived_ivs_candidates,
peel_address, ptr_difference_cost, may_replace_final_value,
determine_use_iv_cost, rewrite_use_nonlinear_expr, rewrite_use_outer,
rewrite_use, rewrite_uses): Likewise.
* tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa,
check_loop_closed_ssa_use): Likewise.
* tree-ssanames.c (make_ssa_name): Likewise.
* tree-ssa-operands.c (finalize_ssa_defs, finalize_ssa_uses,
finalize_ssa_v_must_defs, finalize_ssa_stmt_operands,
get_stmt_operands, get_expr_operands, get_asm_expr_operands,
get_indirect_ref_operands, add_stmt_operand): Likewise.
* tree-ssa-pre.c (value_exists_in_set_bitmap,
value_remove_from_set_bitmap, bitmap_insert_into_set, insert_into_set,
phi_translate, valid_in_set, compute_antic,
find_or_generate_expression, create_expression_by_pieces, insert_aux,
create_value_expr_from, eliminate): Likewise.
* tree-ssa-propagate.c (cfg_blocks_get): Likewise.
* tree-ssa-threadupdate.c (remove_last_stmt_and_useless_edges):
Likewise.
* tree-tailcall.c (independent_of_stmt_p, adjust_return_value,
eliminate_tail_call): Likewise.
* tree-vectorizer.c (vect_create_index_for_array_ref,
vect_align_data_ref, vect_create_data_ref,
vect_create_destination_var, vect_get_vec_def_for_operand,
vect_finish_stmt_generation, vect_transform_stmt,
vect_transform_loop_bound, vect_transform_loop,
vect_analyze_operations): Likewise.
* tree-vn.c (vn_compute, set_value_handle, get_value_handle):
Likewise.
* tree-flow-inline.h (var_ann, get_var_ann, get_def_from_ptr,
get_use_op_ptr, immediate_use, phi_ssa_name_p, bsi_start,
bsi_after_labels, bsi_last): Likewise.
* tree-ssa-live.c (var_union, change_partition_var,
create_ssa_var_map, calculate_live_on_entry, root_var_init,
type_var_init, add_coalesce, sort_coalesce_list, pop_best_coalesce):
Likewise.
* tree-ssa-live.h (partition_is_global, live_entry_blocks,
tpa_find_tree): Likewise.
(register_ssa_partition_check): Declare.
(register_ssa_partition): use it.
* tree-ssa-live.c: Include errors.h.
(register_ssa_partition_check): New.
* tree-ssa-operands.c: Include errors.h.
* Makefile.in (tree-ssa-operands.o): Depend on errors.h.
Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>
From-SVN: r87223
2004-09-09 09:54:12 +02:00
|
|
|
|
gcc_assert (!*slot);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
*slot = n;
|
|
|
|
|
}
|
2004-06-29 08:59:35 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Add statement T in the current function (cfun) to EH landing pad NUM. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2005-05-11 18:25:30 +02:00
|
|
|
|
void
|
2009-09-14 21:18:58 +02:00
|
|
|
|
add_stmt_to_eh_lp (gimple t, int num)
|
2005-05-11 18:25:30 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
add_stmt_to_eh_lp_fn (cfun, t, num);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Add statement T to the single EH landing pad in REGION. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
record_stmt_eh_region (eh_region region, gimple t)
|
|
|
|
|
{
|
|
|
|
|
if (region == NULL)
|
|
|
|
|
return;
|
|
|
|
|
if (region->type == ERT_MUST_NOT_THROW)
|
|
|
|
|
add_stmt_to_eh_lp_fn (cfun, t, -region->index);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
eh_landing_pad lp = region->landing_pads;
|
|
|
|
|
if (lp == NULL)
|
|
|
|
|
lp = gen_eh_landing_pad (region);
|
|
|
|
|
else
|
|
|
|
|
gcc_assert (lp->next_lp == NULL);
|
|
|
|
|
add_stmt_to_eh_lp_fn (cfun, t, lp->index);
|
|
|
|
|
}
|
2005-05-11 18:25:30 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Remove statement T in function IFUN from its EH landing pad. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2004-06-29 08:59:35 +02:00
|
|
|
|
bool
|
2009-09-14 21:18:58 +02:00
|
|
|
|
remove_stmt_from_eh_lp_fn (struct function *ifun, gimple t)
|
2004-06-29 08:59:35 +02:00
|
|
|
|
{
|
|
|
|
|
struct throw_stmt_node dummy;
|
|
|
|
|
void **slot;
|
|
|
|
|
|
2005-05-11 18:25:30 +02:00
|
|
|
|
if (!get_eh_throw_stmt_table (ifun))
|
2004-06-29 08:59:35 +02:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
dummy.stmt = t;
|
2005-05-11 18:25:30 +02:00
|
|
|
|
slot = htab_find_slot (get_eh_throw_stmt_table (ifun), &dummy,
|
|
|
|
|
NO_INSERT);
|
2004-06-29 08:59:35 +02:00
|
|
|
|
if (slot)
|
|
|
|
|
{
|
2005-05-11 18:25:30 +02:00
|
|
|
|
htab_clear_slot (get_eh_throw_stmt_table (ifun), slot);
|
2004-06-29 08:59:35 +02:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Remove statement T in the current function (cfun) from its
|
|
|
|
|
EH landing pad. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2005-05-11 18:25:30 +02:00
|
|
|
|
bool
|
2009-09-14 21:18:58 +02:00
|
|
|
|
remove_stmt_from_eh_lp (gimple t)
|
2005-05-11 18:25:30 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return remove_stmt_from_eh_lp_fn (cfun, t);
|
2005-05-11 18:25:30 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* Determine if statement T is inside an EH region in function IFUN.
|
2009-09-14 21:18:58 +02:00
|
|
|
|
Positive numbers indicate a landing pad index; negative numbers
|
|
|
|
|
indicate a MUST_NOT_THROW region index; zero indicates that the
|
|
|
|
|
statement is not recorded in the region table. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
int
|
2009-09-14 21:18:58 +02:00
|
|
|
|
lookup_stmt_eh_lp_fn (struct function *ifun, gimple t)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
|
|
|
|
struct throw_stmt_node *p, n;
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (ifun->eh->throw_stmt_table == NULL)
|
|
|
|
|
return 0;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
n.stmt = t;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
p = (struct throw_stmt_node *) htab_find (ifun->eh->throw_stmt_table, &n);
|
|
|
|
|
return p ? p->lp_nr : 0;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Likewise, but always use the current function. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2005-05-11 18:25:30 +02:00
|
|
|
|
int
|
2009-09-14 21:18:58 +02:00
|
|
|
|
lookup_stmt_eh_lp (gimple t)
|
2005-05-11 18:25:30 +02:00
|
|
|
|
{
|
|
|
|
|
/* We can get called from initialized data when -fnon-call-exceptions
|
|
|
|
|
is on; prevent crash. */
|
|
|
|
|
if (!cfun)
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return 0;
|
|
|
|
|
return lookup_stmt_eh_lp_fn (cfun, t);
|
2005-05-11 18:25:30 +02:00
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* First pass of EH node decomposition. Build up a tree of GIMPLE_TRY_FINALLY
|
2004-05-13 08:41:07 +02:00
|
|
|
|
nodes and LABEL_DECL nodes. We will use this during the second phase to
|
|
|
|
|
determine if a goto leaves the body of a TRY_FINALLY_EXPR node. */
|
|
|
|
|
|
|
|
|
|
struct finally_tree_node
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* When storing a GIMPLE_TRY, we have to record a gimple. However
|
|
|
|
|
when deciding whether a GOTO to a certain LABEL_DECL (which is a
|
|
|
|
|
tree) leaves the TRY block, its necessary to record a tree in
|
|
|
|
|
this field. Thus a treemple is used. */
|
2009-09-14 21:18:58 +02:00
|
|
|
|
treemple child;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple parent;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Note that this table is *not* marked GTY. It is short-lived. */
|
|
|
|
|
static htab_t finally_tree;
|
|
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
record_in_finally_tree (treemple child, gimple parent)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
|
|
|
|
struct finally_tree_node *n;
|
|
|
|
|
void **slot;
|
|
|
|
|
|
2005-12-18 02:19:20 +01:00
|
|
|
|
n = XNEW (struct finally_tree_node);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
n->child = child;
|
|
|
|
|
n->parent = parent;
|
|
|
|
|
|
|
|
|
|
slot = htab_find_slot (finally_tree, n, INSERT);
|
targhooks.c (default_unwind_emit, [...]): Use gcc_assert, gcc_unreachable & internal_error instead of abort.
* targhooks.c (default_unwind_emit, default_scalar_mode_supported_p):
Use gcc_assert, gcc_unreachable & internal_error instead of abort.
* timevar.c (timevar_push, timevar_pop, timevar_start,
timevar_stop): Likewise.
* toplev.c (default_pch_valid_p): Likewise.
* tracer.c (tail_duplicate): Likewise.
* tree-alias-common.c (get_alias_var_decl,
get_values_from_constructor, create_alias_var, delete_alias_vars,
empty_points_to_set, same_points_to_set, ptr_may_alias_var):
Likewise.
* tree.c (tree_size, make_node_stat, copy_node_stat,
build_int_cst_wide, integer_all_onesp, list_length, chainon,
tree_node_structure, type_contains_placeholder_p, substitute_in_expr,
substitute_placeholder_in_expr, tabilize_reference_1, build0_stat,
build1_stat, build2_stat, build3_stat, build4_stat, is_attribute_p,
lookup_attribute, type_hash_canon, host_integerp, iterative_hash_expr,
build_method_type_directly, decl_type_context, get_callee_fndecl,
get_set_constructor_bits, build_vector_type_for_mode, int_cst_value,
tree_fold_gcd): Likewise.
* tree-cfg.c (create_bb, make_ctrl_stmt_edges, make_exit_edges,
make_cond_expr_edges, group_case_labels, tree_merge_blocks,
cleanup_control_expr_graph, find_taken_edge,
find_taken_edge_switch_expr, phi_alternatives_equal,
is_ctrl_altering_stmt, disband_implicit_edges, set_bb_for_stmt,
stmt_for_bsi, tree_find_edge_insert_loc, bsi_insert_on_edge_immediate,
tree_split_edge, tree_verify_flow_info, thread_jumps,
tree_redirect_edge_and_branch, tree_flow_call_edges_add): Likewise.
* tree-chrec.c (chrec_fold_poly_cst, chrec_fold_plus_poly_poly,
chrec_fold_multiply_poly_poly): Likewise.
* tree-complex.c (extract_component, expand_complex_division,
expand_complex_comparison, expand_complex_operations_1,
build_replicated_const, expand_vector_operations_1): Likewise.
* tree-data-ref.c (tree_fold_bezout, build_classic_dist_vector,
build_classic_dir_vector): Likewise.
* tree-dfa.c (compute_immediate_uses_for_phi,
compute_immediate_uses_for_stmt, create_var_ann, create_stmt_ann,
create_tree_ann, collect_dfa_stats, get_virtual_var): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-eh.c (record_stmt_eh_region, add_stmt_to_eh_region,
record_in_finally_tree, replace_goto_queue_1,
maybe_record_in_goto_queue, verify_norecord_switch_expr,
do_return_redirection): Likewise.
* tree-if-conv.c (tree_if_convert_stmt, tree_if_convert_cond_expr,
add_to_dst_predicate_list, find_phi_replacement_condition,
replace_phi_with_cond_modify_expr, get_loop_body_in_if_conv_order):
Likewise.
* tree-inline.c (remap_decl, remap_type, remap_decls, copy_body_r,
initialize_inlined_parameters, declare_return_variable,
estimate_num_insns_1, expand_call_inline, expand_calls_inline,
optimize_inline_calls, copy_tree_r): Likewise.
* tree-into-ssa.c (rewrite_initialize_block_local_data, rewrite_stmt,
ssa_rewrite_stmt, rewrite_into_ssa): Likewise.
* tree-iterator.c (alloc_stmt_list, tsi_link_before, tsi_link_after,
tsi_split_statement_list_after, tsi_split_statement_list_before):
Likewise.
* tree-mudflap.c (mf_varname_tree): Likewise.
* tree-nested.c (create_tmp_var_for, lookup_field_for_decl,
lookup_tramp_for_decl, convert_all_function_calls): Likewise.
* tree-optimize.c (tree_rest_of_compilation): Likewise.
* tree-outof-ssa.c (create_temp, eliminate_build, eliminate_phi,
coalesce_abnormal_edges, coalesce_ssa_name, eliminate_virtual_phis,
free_temp_expr_table, add_dependance, finish_expr, rewrite_trees):
Likewise.
* tree-phinodes.c (resize_phi_node, add_phi_arg,
remove_all_phi_nodes_for): Likewise.
* tree-pretty-print.c (op_prio, print_call_name): Likewise.
* tree-profile.c (tree_gen_interval_profiler, tree_gen_pow2_profiler,
tree_gen_one_value_profiler, tree_gen_const_delta_profiler): Likewise.
* tree-sra.c (type_can_instantiate_all_elements, sra_hash_tree,
sra_elt_eq, sra_walk_expr, instantiate_missing_elements,
generate_one_element_ref, generate_element_copy,
generate_element_zero, scalarize_copy, scalarize_init,
scalarize_ldst): Likewise.
* tree-ssa-alias.c (delete_alias_info, group_aliases, may_alias_p,
add_may_alias, add_pointed_to_expr, add_pointed_to_var,
collect_points_to_info_r, get_tmt_for, get_ptr_info): Likewise.
* tree-ssa.c (walk_use_def_chains, check_phi_redundancy): Likewise.
* tree-ssa-ccp.c (dump_lattice_value, get_default_value, get_value,
set_lattice_value, likely_value, ccp_visit_phi_node, visit_assignment,
widen_bitfield, ccp_fold_builtin): Likewise.
* tree-ssa-copy.c (may_propagate_copy, merge_alias_info,
replace_exp_1, propagate_tree_value): Likewise.
* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise.
* tree-ssa-dce.c (set_control_dependence_map_bit,
find_control_dependence, find_pdom, mark_operand_necessary,
mark_stmt_if_obviously_necessary,
mark_control_dependent_edges_necessary, remove_dead_stmt): Likewise.
* tree-ssa-dom.c (dom_opt_initialize_block_local_data,
simplify_switch_and_lookup_avail_expr, cprop_into_successor_phis,
eliminate_redundant_computations, avail_expr_eq): Likewise.
* tree-ssa-dse.c (fix_stmt_v_may_defs): Likewise.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p,
duplicate_blocks): Likewise.
* tree-ssa-loop-im.c (for_each_index, set_level,
is_call_clobbered_ref): Likewise.
* tree-ssa-loop-ivopts.c (dump_use, divide, stmt_after_ip_normal_pos,
stmt_after_increment, set_iv, contains_abnormal_ssa_name_p,
find_interesting_uses_outer_or_nonlin, add_derived_ivs_candidates,
peel_address, ptr_difference_cost, may_replace_final_value,
determine_use_iv_cost, rewrite_use_nonlinear_expr, rewrite_use_outer,
rewrite_use, rewrite_uses): Likewise.
* tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa,
check_loop_closed_ssa_use): Likewise.
* tree-ssanames.c (make_ssa_name): Likewise.
* tree-ssa-operands.c (finalize_ssa_defs, finalize_ssa_uses,
finalize_ssa_v_must_defs, finalize_ssa_stmt_operands,
get_stmt_operands, get_expr_operands, get_asm_expr_operands,
get_indirect_ref_operands, add_stmt_operand): Likewise.
* tree-ssa-pre.c (value_exists_in_set_bitmap,
value_remove_from_set_bitmap, bitmap_insert_into_set, insert_into_set,
phi_translate, valid_in_set, compute_antic,
find_or_generate_expression, create_expression_by_pieces, insert_aux,
create_value_expr_from, eliminate): Likewise.
* tree-ssa-propagate.c (cfg_blocks_get): Likewise.
* tree-ssa-threadupdate.c (remove_last_stmt_and_useless_edges):
Likewise.
* tree-tailcall.c (independent_of_stmt_p, adjust_return_value,
eliminate_tail_call): Likewise.
* tree-vectorizer.c (vect_create_index_for_array_ref,
vect_align_data_ref, vect_create_data_ref,
vect_create_destination_var, vect_get_vec_def_for_operand,
vect_finish_stmt_generation, vect_transform_stmt,
vect_transform_loop_bound, vect_transform_loop,
vect_analyze_operations): Likewise.
* tree-vn.c (vn_compute, set_value_handle, get_value_handle):
Likewise.
* tree-flow-inline.h (var_ann, get_var_ann, get_def_from_ptr,
get_use_op_ptr, immediate_use, phi_ssa_name_p, bsi_start,
bsi_after_labels, bsi_last): Likewise.
* tree-ssa-live.c (var_union, change_partition_var,
create_ssa_var_map, calculate_live_on_entry, root_var_init,
type_var_init, add_coalesce, sort_coalesce_list, pop_best_coalesce):
Likewise.
* tree-ssa-live.h (partition_is_global, live_entry_blocks,
tpa_find_tree): Likewise.
(register_ssa_partition_check): Declare.
(register_ssa_partition): use it.
* tree-ssa-live.c: Include errors.h.
(register_ssa_partition_check): New.
* tree-ssa-operands.c: Include errors.h.
* Makefile.in (tree-ssa-operands.o): Depend on errors.h.
Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>
From-SVN: r87223
2004-09-09 09:54:12 +02:00
|
|
|
|
gcc_assert (!*slot);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
*slot = n;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
collect_finally_tree (gimple stmt, gimple region);
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Go through the gimple sequence. Works with collect_finally_tree to
|
2008-07-28 16:33:56 +02:00
|
|
|
|
record all GIMPLE_LABEL and GIMPLE_TRY statements. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
collect_finally_tree_1 (gimple_seq seq, gimple region)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_stmt_iterator gsi;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
for (gsi = gsi_start (seq); !gsi_end_p (gsi); gsi_next (&gsi))
|
|
|
|
|
collect_finally_tree (gsi_stmt (gsi), region);
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
static void
|
|
|
|
|
collect_finally_tree (gimple stmt, gimple region)
|
|
|
|
|
{
|
|
|
|
|
treemple temp;
|
|
|
|
|
|
|
|
|
|
switch (gimple_code (stmt))
|
|
|
|
|
{
|
|
|
|
|
case GIMPLE_LABEL:
|
|
|
|
|
temp.t = gimple_label_label (stmt);
|
|
|
|
|
record_in_finally_tree (temp, region);
|
|
|
|
|
break;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_TRY:
|
|
|
|
|
if (gimple_try_kind (stmt) == GIMPLE_TRY_FINALLY)
|
|
|
|
|
{
|
|
|
|
|
temp.g = stmt;
|
|
|
|
|
record_in_finally_tree (temp, region);
|
|
|
|
|
collect_finally_tree_1 (gimple_try_eval (stmt), stmt);
|
|
|
|
|
collect_finally_tree_1 (gimple_try_cleanup (stmt), region);
|
|
|
|
|
}
|
|
|
|
|
else if (gimple_try_kind (stmt) == GIMPLE_TRY_CATCH)
|
|
|
|
|
{
|
|
|
|
|
collect_finally_tree_1 (gimple_try_eval (stmt), region);
|
|
|
|
|
collect_finally_tree_1 (gimple_try_cleanup (stmt), region);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_CATCH:
|
|
|
|
|
collect_finally_tree_1 (gimple_catch_handler (stmt), region);
|
|
|
|
|
break;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_EH_FILTER:
|
|
|
|
|
collect_finally_tree_1 (gimple_eh_filter_failure (stmt), region);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
/* A type, a decl, or some kind of statement that we're not
|
|
|
|
|
interested in. Don't walk them. */
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
/* Use the finally tree to determine if a jump from START to TARGET
|
|
|
|
|
would leave the try_finally node that START lives in. */
|
|
|
|
|
|
|
|
|
|
static bool
|
2008-07-28 16:33:56 +02:00
|
|
|
|
outside_finally_tree (treemple start, gimple target)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
|
|
|
|
struct finally_tree_node n, *p;
|
|
|
|
|
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
n.child = start;
|
2005-12-18 02:19:20 +01:00
|
|
|
|
p = (struct finally_tree_node *) htab_find (finally_tree, &n);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
if (!p)
|
|
|
|
|
return true;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
start.g = p->parent;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
while (start.g != target);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
|
|
/* Second pass of EH node decomposition. Actually transform the GIMPLE_TRY
|
|
|
|
|
nodes into a set of gotos, magic labels, and eh regions.
|
2004-05-13 08:41:07 +02:00
|
|
|
|
The eh region creation is straight-forward, but frobbing all the gotos
|
|
|
|
|
and such into shape isn't. */
|
|
|
|
|
|
2009-11-25 11:55:54 +01:00
|
|
|
|
/* The sequence into which we record all EH stuff. This will be
|
2009-09-14 21:18:58 +02:00
|
|
|
|
placed at the end of the function when we're all done. */
|
|
|
|
|
static gimple_seq eh_seq;
|
|
|
|
|
|
|
|
|
|
/* Record whether an EH region contains something that can throw,
|
|
|
|
|
indexed by EH region number. */
|
2009-10-27 21:09:07 +01:00
|
|
|
|
static bitmap eh_region_may_contain_throw_map;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
basic-block.h (enum profile_status): Break out of struct control_flow_graph.
./: * basic-block.h (enum profile_status): Break out of struct
control_flow_graph.
* cgraph.h (struct inline_summary): Break out of struct
cgraph_local_info.
* cgraphunit.c (enum cgraph_order_sort_kind): New enum, broken out
of struct cgraph_order_sort.
* combine.c (enum undo_kind): New enum, broken out of struct
undo.
* cse.c (struct branch_path): Break out of struct
cse_basic_block_data.
* except.h (enum eh_region_type): Break out of struct eh_region.
* gcc.c (enum add_del): Break out of struct modify_target.
* genrecog.c (enum decision_type): Break out of struct
decision_test.
* ggc-page.c (struct ggc_pch_ondisk): Break out of struct
ggc_pch_data.
* matrix-reorg.c (struct free_info): Break out of struct
matrix_info.
* regmove.c (enum match_use): New enum, broken out of struct
match.
* sched-int.h (enum post_call_group): New enum, broken out of
struct deps.
(struct deps_reg): Break out of struct deps.
* target.h (struct asm_int_op): Break out of struct gcc_target.
* tree-eh.c (struct goto_queue_node): Break out of struct
leh_tf_state.
* tree-inline.h (enum copy_body_cge_which): Break out of
copy_body_data.
* tree-pass.h (enum opt_pass_type): Break out of struct opt_pass.
* c-decl.c (in_struct, struct_types): New static variables.
(pushtag): Add loc parameter. Change all callers.
(lookup_tag): Add ploc parameter. Change all callers.
(check_compound_literal_type): New function.
(parser_xref_tag): Add loc parameter. Change all callers. If
-Wc++-compat, warn about struct/union/enum types defined within a
struct or union.
(start_struct): Add enclosing_in_struct, enclosing_struct_types,
and loc parameters. Change all callers. Change error calls to
error_at, using loc. For a redefinition, if the location of the
original definition is known, report it. Set in_struct and
struct_types. If -Wc++-compat warn if in sizeof, typeof, or
alignof.
(finish_struct): Add new parameters enclosing_in_struct and
enclosing_struct_types. Change all callers. Set
C_TYPE_DEFINED_IN_STRUCT for all struct/union/enum types defined
in the struct. If in a struct, add this struct to struct_types.
(start_enum): Add loc parameter. Change all callers. Use
error_at for errors, using loc. For a redefinition, if the
location of the original definition is known, report it. If in a
struct, add this enum type to struct_types. If -Wc++-compat warn
if in sizeof, typeof, or alignof.
* c-parser.c (disable_extension_diagnostics): Disable
-Wc++-compat.
(enable_extension_diagnostics): Reenable -Wc++-compat if
appropriate.
(c_parser_enum_specifier): Get enum location for start_enum.
(c_parser_struct_or_union_specifier): Get struct location for
start_struct. Save in_struct and struct_types status between
start_struct and finish_struct.
(c_parser_cast_expression): Get location of cast.
(c_parser_alignof_expression): Get location of type.
(c_parser_postfix_expression): Likewise.
(c_parser_postfix_expression_after_paren_type): Add type_loc
parameter. Change all callers. Call
check_compound_literal_type. Use type_loc for error about
variable size type.
* c-typeck.c (build_external_ref): If -Wc++-compat, warn about a
use of an enum constant from an enum type defined in a struct or
union.
(c_cast_expr): Add loc parameter. Change all callers. If
-Wc++-compat, warn about defining a type in a cast.
* c-tree.h (C_TYPE_DEFINED_IN_STRUCT): Define.
(start_enum, start_struct, finish_struct): Update declarations.
(parser_xref_tag, c_cast_expr): Update declarations.
(check_compound_literal_type): Declare.
fortran/:
* gfortran.h (enum gfc_omp_sched_kind): New enum, broken out of
gfc_omp_clauses.
(enum gfc_omp_default_sharing): Likewise.
* module.c (enum gfc_rsym_state): New enum, broken out of
pointer_info.
(enum gfc_wsym_state): Likewise.
* parse.c (enum state_order): New enum, broken out of st_state.
objc/:
* objc-act.c (objc_building_struct): New static variable.
(objc_in_struct, objc_struct_types): New static variables.
(objc_start_struct, objc_finish_struct): New static functions.
(generate_struct_by_value_array): Call objc_start_struct instead
of start_struct, and call objc_finish_struct instead of
finish_struct.
(objc_build_struct, build_objc_symtab_template): Likewise.
(build_module_descriptor): Likewise.
(build_next_objc_exception_stuff): Likewise.
(build_protocol_template): Likewise.
(build_method_prototype_list_template): Likewise.
(build_method_prototype_template): Likewise.
(build_category_template, build_selector_template): Likewise.
(build_class_template, build_super_template): Likewise.
(build_ivar_template, build_ivar_list_template): Likewise.
(build_method_list_template): Likewise.
(build_method_template): Likewise.
objcp/:
* objcp-decl.h (start_struct): Add three new, ignored, macro
parameters.
(finish_struct): Add two new, ignored, macro parameters.
testsuite/:
* gcc.dg/Wcxx-compat-7.c: New testcase.
* gcc.dg/Wcxx-compat-8.c: New testcase.
* gcc.dg/c99-tag-1.c: Recognize new "originally defined here"
notes
* gcc.dg/pr17188-1.c: Likewise.
* gcc.dg/pr39084.c: Likewise.
From-SVN: r147358
2009-05-11 03:02:40 +02:00
|
|
|
|
/* The GOTO_QUEUE is is an array of GIMPLE_GOTO and GIMPLE_RETURN
|
|
|
|
|
statements that are seen to escape this GIMPLE_TRY_FINALLY node.
|
|
|
|
|
The idea is to record a gimple statement for everything except for
|
|
|
|
|
the conditionals, which get their labels recorded. Since labels are
|
|
|
|
|
of type 'tree', we need this node to store both gimple and tree
|
|
|
|
|
objects. REPL_STMT is the sequence used to replace the goto/return
|
|
|
|
|
statement. CONT_STMT is used to store the statement that allows
|
|
|
|
|
the return/goto to jump to the original destination. */
|
|
|
|
|
|
|
|
|
|
struct goto_queue_node
|
|
|
|
|
{
|
|
|
|
|
treemple stmt;
|
|
|
|
|
gimple_seq repl_stmt;
|
|
|
|
|
gimple cont_stmt;
|
|
|
|
|
int index;
|
|
|
|
|
/* This is used when index >= 0 to indicate that stmt is a label (as
|
|
|
|
|
opposed to a goto stmt). */
|
|
|
|
|
int is_label;
|
|
|
|
|
};
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
/* State of the world while lowering. */
|
|
|
|
|
|
|
|
|
|
struct leh_state
|
|
|
|
|
{
|
2004-08-19 23:34:37 +02:00
|
|
|
|
/* What's "current" while constructing the eh region tree. These
|
2004-05-13 08:41:07 +02:00
|
|
|
|
correspond to variables of the same name in cfun->eh, which we
|
|
|
|
|
don't have easy access to. */
|
2009-09-14 21:18:58 +02:00
|
|
|
|
eh_region cur_region;
|
|
|
|
|
|
|
|
|
|
/* What's "current" for the purposes of __builtin_eh_pointer. For
|
|
|
|
|
a CATCH, this is the associated TRY. For an EH_FILTER, this is
|
|
|
|
|
the associated ALLOWED_EXCEPTIONS, etc. */
|
|
|
|
|
eh_region ehp_region;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* Processing of TRY_FINALLY requires a bit more state. This is
|
|
|
|
|
split out into a separate structure so that we don't have to
|
|
|
|
|
copy so much when processing other nodes. */
|
|
|
|
|
struct leh_tf_state *tf;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct leh_tf_state
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* Pointer to the GIMPLE_TRY_FINALLY node under discussion. The
|
|
|
|
|
try_finally_expr is the original GIMPLE_TRY_FINALLY. We need to retain
|
|
|
|
|
this so that outside_finally_tree can reliably reference the tree used
|
|
|
|
|
in the collect_finally_tree data structures. */
|
|
|
|
|
gimple try_finally_expr;
|
|
|
|
|
gimple top_p;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* While lowering a top_p usually it is expanded into multiple statements,
|
|
|
|
|
thus we need the following field to store them. */
|
|
|
|
|
gimple_seq top_p_seq;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* The state outside this try_finally node. */
|
|
|
|
|
struct leh_state *outer;
|
|
|
|
|
|
|
|
|
|
/* The exception region created for it. */
|
2009-09-14 21:18:58 +02:00
|
|
|
|
eh_region region;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
basic-block.h (enum profile_status): Break out of struct control_flow_graph.
./: * basic-block.h (enum profile_status): Break out of struct
control_flow_graph.
* cgraph.h (struct inline_summary): Break out of struct
cgraph_local_info.
* cgraphunit.c (enum cgraph_order_sort_kind): New enum, broken out
of struct cgraph_order_sort.
* combine.c (enum undo_kind): New enum, broken out of struct
undo.
* cse.c (struct branch_path): Break out of struct
cse_basic_block_data.
* except.h (enum eh_region_type): Break out of struct eh_region.
* gcc.c (enum add_del): Break out of struct modify_target.
* genrecog.c (enum decision_type): Break out of struct
decision_test.
* ggc-page.c (struct ggc_pch_ondisk): Break out of struct
ggc_pch_data.
* matrix-reorg.c (struct free_info): Break out of struct
matrix_info.
* regmove.c (enum match_use): New enum, broken out of struct
match.
* sched-int.h (enum post_call_group): New enum, broken out of
struct deps.
(struct deps_reg): Break out of struct deps.
* target.h (struct asm_int_op): Break out of struct gcc_target.
* tree-eh.c (struct goto_queue_node): Break out of struct
leh_tf_state.
* tree-inline.h (enum copy_body_cge_which): Break out of
copy_body_data.
* tree-pass.h (enum opt_pass_type): Break out of struct opt_pass.
* c-decl.c (in_struct, struct_types): New static variables.
(pushtag): Add loc parameter. Change all callers.
(lookup_tag): Add ploc parameter. Change all callers.
(check_compound_literal_type): New function.
(parser_xref_tag): Add loc parameter. Change all callers. If
-Wc++-compat, warn about struct/union/enum types defined within a
struct or union.
(start_struct): Add enclosing_in_struct, enclosing_struct_types,
and loc parameters. Change all callers. Change error calls to
error_at, using loc. For a redefinition, if the location of the
original definition is known, report it. Set in_struct and
struct_types. If -Wc++-compat warn if in sizeof, typeof, or
alignof.
(finish_struct): Add new parameters enclosing_in_struct and
enclosing_struct_types. Change all callers. Set
C_TYPE_DEFINED_IN_STRUCT for all struct/union/enum types defined
in the struct. If in a struct, add this struct to struct_types.
(start_enum): Add loc parameter. Change all callers. Use
error_at for errors, using loc. For a redefinition, if the
location of the original definition is known, report it. If in a
struct, add this enum type to struct_types. If -Wc++-compat warn
if in sizeof, typeof, or alignof.
* c-parser.c (disable_extension_diagnostics): Disable
-Wc++-compat.
(enable_extension_diagnostics): Reenable -Wc++-compat if
appropriate.
(c_parser_enum_specifier): Get enum location for start_enum.
(c_parser_struct_or_union_specifier): Get struct location for
start_struct. Save in_struct and struct_types status between
start_struct and finish_struct.
(c_parser_cast_expression): Get location of cast.
(c_parser_alignof_expression): Get location of type.
(c_parser_postfix_expression): Likewise.
(c_parser_postfix_expression_after_paren_type): Add type_loc
parameter. Change all callers. Call
check_compound_literal_type. Use type_loc for error about
variable size type.
* c-typeck.c (build_external_ref): If -Wc++-compat, warn about a
use of an enum constant from an enum type defined in a struct or
union.
(c_cast_expr): Add loc parameter. Change all callers. If
-Wc++-compat, warn about defining a type in a cast.
* c-tree.h (C_TYPE_DEFINED_IN_STRUCT): Define.
(start_enum, start_struct, finish_struct): Update declarations.
(parser_xref_tag, c_cast_expr): Update declarations.
(check_compound_literal_type): Declare.
fortran/:
* gfortran.h (enum gfc_omp_sched_kind): New enum, broken out of
gfc_omp_clauses.
(enum gfc_omp_default_sharing): Likewise.
* module.c (enum gfc_rsym_state): New enum, broken out of
pointer_info.
(enum gfc_wsym_state): Likewise.
* parse.c (enum state_order): New enum, broken out of st_state.
objc/:
* objc-act.c (objc_building_struct): New static variable.
(objc_in_struct, objc_struct_types): New static variables.
(objc_start_struct, objc_finish_struct): New static functions.
(generate_struct_by_value_array): Call objc_start_struct instead
of start_struct, and call objc_finish_struct instead of
finish_struct.
(objc_build_struct, build_objc_symtab_template): Likewise.
(build_module_descriptor): Likewise.
(build_next_objc_exception_stuff): Likewise.
(build_protocol_template): Likewise.
(build_method_prototype_list_template): Likewise.
(build_method_prototype_template): Likewise.
(build_category_template, build_selector_template): Likewise.
(build_class_template, build_super_template): Likewise.
(build_ivar_template, build_ivar_list_template): Likewise.
(build_method_list_template): Likewise.
(build_method_template): Likewise.
objcp/:
* objcp-decl.h (start_struct): Add three new, ignored, macro
parameters.
(finish_struct): Add two new, ignored, macro parameters.
testsuite/:
* gcc.dg/Wcxx-compat-7.c: New testcase.
* gcc.dg/Wcxx-compat-8.c: New testcase.
* gcc.dg/c99-tag-1.c: Recognize new "originally defined here"
notes
* gcc.dg/pr17188-1.c: Likewise.
* gcc.dg/pr39084.c: Likewise.
From-SVN: r147358
2009-05-11 03:02:40 +02:00
|
|
|
|
/* The goto queue. */
|
|
|
|
|
struct goto_queue_node *goto_queue;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
size_t goto_queue_size;
|
|
|
|
|
size_t goto_queue_active;
|
|
|
|
|
|
2008-06-06 07:42:00 +02:00
|
|
|
|
/* Pointer map to help in searching goto_queue when it is large. */
|
2007-08-14 20:12:34 +02:00
|
|
|
|
struct pointer_map_t *goto_queue_map;
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
/* The set of unique labels seen as entries in the goto queue. */
|
2005-05-14 05:25:44 +02:00
|
|
|
|
VEC(tree,heap) *dest_array;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* A label to be added at the end of the completed transformed
|
|
|
|
|
sequence. It will be set if may_fallthru was true *at one time*,
|
|
|
|
|
though subsequent transformations may have cleared that flag. */
|
|
|
|
|
tree fallthru_label;
|
|
|
|
|
|
|
|
|
|
/* True if it is possible to fall out the bottom of the try block.
|
|
|
|
|
Cleared if the fallthru is converted to a goto. */
|
|
|
|
|
bool may_fallthru;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* True if any entry in goto_queue is a GIMPLE_RETURN. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
bool may_return;
|
|
|
|
|
|
|
|
|
|
/* True if the finally block can receive an exception edge.
|
|
|
|
|
Cleared if the exception case is handled by code duplication. */
|
|
|
|
|
bool may_throw;
|
|
|
|
|
};
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
static gimple_seq lower_eh_must_not_throw (struct leh_state *, gimple);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* Search for STMT in the goto queue. Return the replacement,
|
|
|
|
|
or null if the statement isn't in the queue. */
|
|
|
|
|
|
2007-08-14 20:12:34 +02:00
|
|
|
|
#define LARGE_GOTO_QUEUE 20
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
static void lower_eh_constructs_1 (struct leh_state *state, gimple_seq seq);
|
|
|
|
|
|
|
|
|
|
static gimple_seq
|
|
|
|
|
find_goto_replacement (struct leh_tf_state *tf, treemple stmt)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2007-08-14 20:12:34 +02:00
|
|
|
|
unsigned int i;
|
|
|
|
|
void **slot;
|
|
|
|
|
|
|
|
|
|
if (tf->goto_queue_active < LARGE_GOTO_QUEUE)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < tf->goto_queue_active; i++)
|
2008-07-28 16:33:56 +02:00
|
|
|
|
if ( tf->goto_queue[i].stmt.g == stmt.g)
|
2007-08-14 20:12:34 +02:00
|
|
|
|
return tf->goto_queue[i].repl_stmt;
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we have a large number of entries in the goto_queue, create a
|
|
|
|
|
pointer map and use that for searching. */
|
|
|
|
|
|
|
|
|
|
if (!tf->goto_queue_map)
|
|
|
|
|
{
|
|
|
|
|
tf->goto_queue_map = pointer_map_create ();
|
|
|
|
|
for (i = 0; i < tf->goto_queue_active; i++)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
slot = pointer_map_insert (tf->goto_queue_map,
|
|
|
|
|
tf->goto_queue[i].stmt.g);
|
2007-08-14 20:12:34 +02:00
|
|
|
|
gcc_assert (*slot == NULL);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
*slot = &tf->goto_queue[i];
|
2007-08-14 20:12:34 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
slot = pointer_map_contains (tf->goto_queue_map, stmt.g);
|
2007-08-14 20:12:34 +02:00
|
|
|
|
if (slot != NULL)
|
|
|
|
|
return (((struct goto_queue_node *) *slot)->repl_stmt);
|
|
|
|
|
|
|
|
|
|
return NULL;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A subroutine of replace_goto_queue_1. Handles the sub-clauses of a
|
2008-07-28 16:33:56 +02:00
|
|
|
|
lowered GIMPLE_COND. If, by chance, the replacement is a simple goto,
|
2004-05-13 08:41:07 +02:00
|
|
|
|
then we can just splat it in, otherwise we add the new stmts immediately
|
2008-07-28 16:33:56 +02:00
|
|
|
|
after the GIMPLE_COND and redirect. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
replace_goto_queue_cond_clause (tree *tp, struct leh_tf_state *tf,
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_stmt_iterator *gsi)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
tree label;
|
builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* calls.c (avoid_likely_spilled_reg): Likewise.
* cfgexpand.c (gimple_assign_rhs_to_tree): Likewise.
* cgraph.c (cgraph_clone_edge, cgraph_clone_node): Likewise.
* config/i386/i386.c (ix86_expand_special_args_builtin,
ix86_secondary_reload): Likewise.
* except.c (struct eh_region, gen_eh_region_catch,
remove_unreachable_regions, duplicate_eh_regions,
assign_filter_values, build_post_landing_pads,
sjlj_find_directly_reachable_regions, remove_eh_handler,
reachable_next_level, foreach_reachable_handler,
can_throw_internal_1, can_throw_external_1,
collect_one_action_chain): Likewise.
* expr.c (expand_expr_real_1, vector_mode_valid_p): Likewise.
* fold-const.c (twoval_comparison_p, eval_subst): Likewise.
* function.c (update_temp_slot_address, instantiate_new_reg,
instantiate_virtual_regs_in_rtx,
instantiate_virtual_regs_in_insn): Likewise.
* gimple.c (extract_ops_from_tree, gimple_seq_copy): Likewise.
* gimplify.c (gimplify_call_expr, gimplify_init_constructor,
gimplify_cleanup_point_expr): Likewise.
* ipa-cp.c (ipcp_lattice_changed): Likewise.
* passes.c (next_pass_1): Likewise.
* print-tree.c (print_node_brief, print_node): Likewise.
* profile.c (branch_prob): Likewise.
* tree-dump.c (dump_register): Likewise.
* tree-eh.c (replace_goto_queue_cond_clause, lower_catch):
Likewise.
* tree-inline.c (remap_ssa_name, remap_type_1, remap_blocks,
copy_statement_list, remap_gimple_op_r, copy_tree_body_r,
copy_edges_for_bb, copy_cfg_body, copy_tree_r,
copy_arguments_for_versioning, copy_static_chain): Likewise.
* tree-into-ssa.c (names_replaced_by, add_to_repl_tbl,
add_new_name_mapping, register_new_name_mapping): Likewise.
* tree-mudflap.c (mf_xform_derefs): Likewise.
* tree-predcom.c (struct chain, dump_chain, replace_ref_with,
get_init_expr, combine_chains): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
* tree-ssa-structalias.c (create_variable_info_for): Likewise.
* tree-vrp.c (simplify_cond_using_ranges): Likewise.
* tree.c (substitute_in_expr, iterative_hash_expr): Likewise.
* value-prof.c (gimple_duplicate_stmt_histograms): Likewise.
From-SVN: r138809
2008-08-06 17:57:09 +02:00
|
|
|
|
gimple_seq new_seq;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
treemple temp;
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
location_t loc = gimple_location (gsi_stmt (*gsi));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
temp.tp = tp;
|
builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* calls.c (avoid_likely_spilled_reg): Likewise.
* cfgexpand.c (gimple_assign_rhs_to_tree): Likewise.
* cgraph.c (cgraph_clone_edge, cgraph_clone_node): Likewise.
* config/i386/i386.c (ix86_expand_special_args_builtin,
ix86_secondary_reload): Likewise.
* except.c (struct eh_region, gen_eh_region_catch,
remove_unreachable_regions, duplicate_eh_regions,
assign_filter_values, build_post_landing_pads,
sjlj_find_directly_reachable_regions, remove_eh_handler,
reachable_next_level, foreach_reachable_handler,
can_throw_internal_1, can_throw_external_1,
collect_one_action_chain): Likewise.
* expr.c (expand_expr_real_1, vector_mode_valid_p): Likewise.
* fold-const.c (twoval_comparison_p, eval_subst): Likewise.
* function.c (update_temp_slot_address, instantiate_new_reg,
instantiate_virtual_regs_in_rtx,
instantiate_virtual_regs_in_insn): Likewise.
* gimple.c (extract_ops_from_tree, gimple_seq_copy): Likewise.
* gimplify.c (gimplify_call_expr, gimplify_init_constructor,
gimplify_cleanup_point_expr): Likewise.
* ipa-cp.c (ipcp_lattice_changed): Likewise.
* passes.c (next_pass_1): Likewise.
* print-tree.c (print_node_brief, print_node): Likewise.
* profile.c (branch_prob): Likewise.
* tree-dump.c (dump_register): Likewise.
* tree-eh.c (replace_goto_queue_cond_clause, lower_catch):
Likewise.
* tree-inline.c (remap_ssa_name, remap_type_1, remap_blocks,
copy_statement_list, remap_gimple_op_r, copy_tree_body_r,
copy_edges_for_bb, copy_cfg_body, copy_tree_r,
copy_arguments_for_versioning, copy_static_chain): Likewise.
* tree-into-ssa.c (names_replaced_by, add_to_repl_tbl,
add_new_name_mapping, register_new_name_mapping): Likewise.
* tree-mudflap.c (mf_xform_derefs): Likewise.
* tree-predcom.c (struct chain, dump_chain, replace_ref_with,
get_init_expr, combine_chains): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
* tree-ssa-structalias.c (create_variable_info_for): Likewise.
* tree-vrp.c (simplify_cond_using_ranges): Likewise.
* tree.c (substitute_in_expr, iterative_hash_expr): Likewise.
* value-prof.c (gimple_duplicate_stmt_histograms): Likewise.
From-SVN: r138809
2008-08-06 17:57:09 +02:00
|
|
|
|
new_seq = find_goto_replacement (tf, temp);
|
|
|
|
|
if (!new_seq)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
return;
|
|
|
|
|
|
builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* calls.c (avoid_likely_spilled_reg): Likewise.
* cfgexpand.c (gimple_assign_rhs_to_tree): Likewise.
* cgraph.c (cgraph_clone_edge, cgraph_clone_node): Likewise.
* config/i386/i386.c (ix86_expand_special_args_builtin,
ix86_secondary_reload): Likewise.
* except.c (struct eh_region, gen_eh_region_catch,
remove_unreachable_regions, duplicate_eh_regions,
assign_filter_values, build_post_landing_pads,
sjlj_find_directly_reachable_regions, remove_eh_handler,
reachable_next_level, foreach_reachable_handler,
can_throw_internal_1, can_throw_external_1,
collect_one_action_chain): Likewise.
* expr.c (expand_expr_real_1, vector_mode_valid_p): Likewise.
* fold-const.c (twoval_comparison_p, eval_subst): Likewise.
* function.c (update_temp_slot_address, instantiate_new_reg,
instantiate_virtual_regs_in_rtx,
instantiate_virtual_regs_in_insn): Likewise.
* gimple.c (extract_ops_from_tree, gimple_seq_copy): Likewise.
* gimplify.c (gimplify_call_expr, gimplify_init_constructor,
gimplify_cleanup_point_expr): Likewise.
* ipa-cp.c (ipcp_lattice_changed): Likewise.
* passes.c (next_pass_1): Likewise.
* print-tree.c (print_node_brief, print_node): Likewise.
* profile.c (branch_prob): Likewise.
* tree-dump.c (dump_register): Likewise.
* tree-eh.c (replace_goto_queue_cond_clause, lower_catch):
Likewise.
* tree-inline.c (remap_ssa_name, remap_type_1, remap_blocks,
copy_statement_list, remap_gimple_op_r, copy_tree_body_r,
copy_edges_for_bb, copy_cfg_body, copy_tree_r,
copy_arguments_for_versioning, copy_static_chain): Likewise.
* tree-into-ssa.c (names_replaced_by, add_to_repl_tbl,
add_new_name_mapping, register_new_name_mapping): Likewise.
* tree-mudflap.c (mf_xform_derefs): Likewise.
* tree-predcom.c (struct chain, dump_chain, replace_ref_with,
get_init_expr, combine_chains): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
* tree-ssa-structalias.c (create_variable_info_for): Likewise.
* tree-vrp.c (simplify_cond_using_ranges): Likewise.
* tree.c (substitute_in_expr, iterative_hash_expr): Likewise.
* value-prof.c (gimple_duplicate_stmt_histograms): Likewise.
From-SVN: r138809
2008-08-06 17:57:09 +02:00
|
|
|
|
if (gimple_seq_singleton_p (new_seq)
|
|
|
|
|
&& gimple_code (gimple_seq_first_stmt (new_seq)) == GIMPLE_GOTO)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* calls.c (avoid_likely_spilled_reg): Likewise.
* cfgexpand.c (gimple_assign_rhs_to_tree): Likewise.
* cgraph.c (cgraph_clone_edge, cgraph_clone_node): Likewise.
* config/i386/i386.c (ix86_expand_special_args_builtin,
ix86_secondary_reload): Likewise.
* except.c (struct eh_region, gen_eh_region_catch,
remove_unreachable_regions, duplicate_eh_regions,
assign_filter_values, build_post_landing_pads,
sjlj_find_directly_reachable_regions, remove_eh_handler,
reachable_next_level, foreach_reachable_handler,
can_throw_internal_1, can_throw_external_1,
collect_one_action_chain): Likewise.
* expr.c (expand_expr_real_1, vector_mode_valid_p): Likewise.
* fold-const.c (twoval_comparison_p, eval_subst): Likewise.
* function.c (update_temp_slot_address, instantiate_new_reg,
instantiate_virtual_regs_in_rtx,
instantiate_virtual_regs_in_insn): Likewise.
* gimple.c (extract_ops_from_tree, gimple_seq_copy): Likewise.
* gimplify.c (gimplify_call_expr, gimplify_init_constructor,
gimplify_cleanup_point_expr): Likewise.
* ipa-cp.c (ipcp_lattice_changed): Likewise.
* passes.c (next_pass_1): Likewise.
* print-tree.c (print_node_brief, print_node): Likewise.
* profile.c (branch_prob): Likewise.
* tree-dump.c (dump_register): Likewise.
* tree-eh.c (replace_goto_queue_cond_clause, lower_catch):
Likewise.
* tree-inline.c (remap_ssa_name, remap_type_1, remap_blocks,
copy_statement_list, remap_gimple_op_r, copy_tree_body_r,
copy_edges_for_bb, copy_cfg_body, copy_tree_r,
copy_arguments_for_versioning, copy_static_chain): Likewise.
* tree-into-ssa.c (names_replaced_by, add_to_repl_tbl,
add_new_name_mapping, register_new_name_mapping): Likewise.
* tree-mudflap.c (mf_xform_derefs): Likewise.
* tree-predcom.c (struct chain, dump_chain, replace_ref_with,
get_init_expr, combine_chains): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
* tree-ssa-structalias.c (create_variable_info_for): Likewise.
* tree-vrp.c (simplify_cond_using_ranges): Likewise.
* tree.c (substitute_in_expr, iterative_hash_expr): Likewise.
* value-prof.c (gimple_duplicate_stmt_histograms): Likewise.
From-SVN: r138809
2008-08-06 17:57:09 +02:00
|
|
|
|
*tp = gimple_goto_dest (gimple_seq_first_stmt (new_seq));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
label = create_artificial_label (loc);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* Set the new label for the GIMPLE_COND */
|
|
|
|
|
*tp = label;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gsi_insert_after (gsi, gimple_build_label (label), GSI_CONTINUE_LINKING);
|
builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* calls.c (avoid_likely_spilled_reg): Likewise.
* cfgexpand.c (gimple_assign_rhs_to_tree): Likewise.
* cgraph.c (cgraph_clone_edge, cgraph_clone_node): Likewise.
* config/i386/i386.c (ix86_expand_special_args_builtin,
ix86_secondary_reload): Likewise.
* except.c (struct eh_region, gen_eh_region_catch,
remove_unreachable_regions, duplicate_eh_regions,
assign_filter_values, build_post_landing_pads,
sjlj_find_directly_reachable_regions, remove_eh_handler,
reachable_next_level, foreach_reachable_handler,
can_throw_internal_1, can_throw_external_1,
collect_one_action_chain): Likewise.
* expr.c (expand_expr_real_1, vector_mode_valid_p): Likewise.
* fold-const.c (twoval_comparison_p, eval_subst): Likewise.
* function.c (update_temp_slot_address, instantiate_new_reg,
instantiate_virtual_regs_in_rtx,
instantiate_virtual_regs_in_insn): Likewise.
* gimple.c (extract_ops_from_tree, gimple_seq_copy): Likewise.
* gimplify.c (gimplify_call_expr, gimplify_init_constructor,
gimplify_cleanup_point_expr): Likewise.
* ipa-cp.c (ipcp_lattice_changed): Likewise.
* passes.c (next_pass_1): Likewise.
* print-tree.c (print_node_brief, print_node): Likewise.
* profile.c (branch_prob): Likewise.
* tree-dump.c (dump_register): Likewise.
* tree-eh.c (replace_goto_queue_cond_clause, lower_catch):
Likewise.
* tree-inline.c (remap_ssa_name, remap_type_1, remap_blocks,
copy_statement_list, remap_gimple_op_r, copy_tree_body_r,
copy_edges_for_bb, copy_cfg_body, copy_tree_r,
copy_arguments_for_versioning, copy_static_chain): Likewise.
* tree-into-ssa.c (names_replaced_by, add_to_repl_tbl,
add_new_name_mapping, register_new_name_mapping): Likewise.
* tree-mudflap.c (mf_xform_derefs): Likewise.
* tree-predcom.c (struct chain, dump_chain, replace_ref_with,
get_init_expr, combine_chains): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
* tree-ssa-structalias.c (create_variable_info_for): Likewise.
* tree-vrp.c (simplify_cond_using_ranges): Likewise.
* tree.c (substitute_in_expr, iterative_hash_expr): Likewise.
* value-prof.c (gimple_duplicate_stmt_histograms): Likewise.
From-SVN: r138809
2008-08-06 17:57:09 +02:00
|
|
|
|
gsi_insert_seq_after (gsi, gimple_seq_copy (new_seq), GSI_CONTINUE_LINKING);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2004-08-19 23:34:37 +02:00
|
|
|
|
/* The real work of replace_goto_queue. Returns with TSI updated to
|
2004-05-13 08:41:07 +02:00
|
|
|
|
point to the next statement. */
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
static void replace_goto_queue_stmt_list (gimple_seq, struct leh_tf_state *);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
replace_goto_queue_1 (gimple stmt, struct leh_tf_state *tf,
|
|
|
|
|
gimple_stmt_iterator *gsi)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq seq;
|
|
|
|
|
treemple temp;
|
|
|
|
|
temp.g = NULL;
|
|
|
|
|
|
|
|
|
|
switch (gimple_code (stmt))
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_GOTO:
|
|
|
|
|
case GIMPLE_RETURN:
|
|
|
|
|
temp.g = stmt;
|
|
|
|
|
seq = find_goto_replacement (tf, temp);
|
|
|
|
|
if (seq)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gsi_insert_seq_before (gsi, gimple_seq_copy (seq), GSI_SAME_STMT);
|
|
|
|
|
gsi_remove (gsi, false);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_COND:
|
|
|
|
|
replace_goto_queue_cond_clause (gimple_op_ptr (stmt, 2), tf, gsi);
|
|
|
|
|
replace_goto_queue_cond_clause (gimple_op_ptr (stmt, 3), tf, gsi);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_TRY:
|
|
|
|
|
replace_goto_queue_stmt_list (gimple_try_eval (stmt), tf);
|
|
|
|
|
replace_goto_queue_stmt_list (gimple_try_cleanup (stmt), tf);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
break;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_CATCH:
|
|
|
|
|
replace_goto_queue_stmt_list (gimple_catch_handler (stmt), tf);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
break;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_EH_FILTER:
|
|
|
|
|
replace_goto_queue_stmt_list (gimple_eh_filter_failure (stmt), tf);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
/* These won't have gotos in them. */
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gsi_next (gsi);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* A subroutine of replace_goto_queue. Handles GIMPLE_SEQ. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
replace_goto_queue_stmt_list (gimple_seq seq, struct leh_tf_state *tf)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_stmt_iterator gsi = gsi_start (seq);
|
|
|
|
|
|
|
|
|
|
while (!gsi_end_p (gsi))
|
|
|
|
|
replace_goto_queue_1 (gsi_stmt (gsi), tf, &gsi);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Replace all goto queue members. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
replace_goto_queue (struct leh_tf_state *tf)
|
|
|
|
|
{
|
2005-01-04 13:45:42 +01:00
|
|
|
|
if (tf->goto_queue_active == 0)
|
|
|
|
|
return;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
replace_goto_queue_stmt_list (tf->top_p_seq, tf);
|
2010-03-17 00:02:35 +01:00
|
|
|
|
replace_goto_queue_stmt_list (eh_seq, tf);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* Add a new record to the goto queue contained in TF. NEW_STMT is the
|
|
|
|
|
data to be added, IS_LABEL indicates whether NEW_STMT is a label or
|
|
|
|
|
a gimple return. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
record_in_goto_queue (struct leh_tf_state *tf,
|
|
|
|
|
treemple new_stmt,
|
|
|
|
|
int index,
|
|
|
|
|
bool is_label)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
|
|
|
|
size_t active, size;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
struct goto_queue_node *q;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2007-08-14 20:12:34 +02:00
|
|
|
|
gcc_assert (!tf->goto_queue_map);
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
active = tf->goto_queue_active;
|
|
|
|
|
size = tf->goto_queue_size;
|
|
|
|
|
if (active >= size)
|
|
|
|
|
{
|
|
|
|
|
size = (size ? size * 2 : 32);
|
|
|
|
|
tf->goto_queue_size = size;
|
|
|
|
|
tf->goto_queue
|
2005-12-18 02:19:20 +01:00
|
|
|
|
= XRESIZEVEC (struct goto_queue_node, tf->goto_queue, size);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
q = &tf->goto_queue[active];
|
|
|
|
|
tf->goto_queue_active = active + 1;
|
2004-08-19 23:34:37 +02:00
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
memset (q, 0, sizeof (*q));
|
2008-07-28 16:33:56 +02:00
|
|
|
|
q->stmt = new_stmt;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
q->index = index;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
q->is_label = is_label;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Record the LABEL label in the goto queue contained in TF.
|
|
|
|
|
TF is not null. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
record_in_goto_queue_label (struct leh_tf_state *tf, treemple stmt, tree label)
|
|
|
|
|
{
|
|
|
|
|
int index;
|
|
|
|
|
treemple temp, new_stmt;
|
|
|
|
|
|
|
|
|
|
if (!label)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Computed and non-local gotos do not get processed. Given
|
|
|
|
|
their nature we can neither tell whether we've escaped the
|
|
|
|
|
finally block nor redirect them if we knew. */
|
|
|
|
|
if (TREE_CODE (label) != LABEL_DECL)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* No need to record gotos that don't leave the try block. */
|
|
|
|
|
temp.t = label;
|
|
|
|
|
if (!outside_finally_tree (temp, tf->try_finally_expr))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (! tf->dest_array)
|
|
|
|
|
{
|
|
|
|
|
tf->dest_array = VEC_alloc (tree, heap, 10);
|
|
|
|
|
VEC_quick_push (tree, tf->dest_array, label);
|
|
|
|
|
index = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int n = VEC_length (tree, tf->dest_array);
|
|
|
|
|
for (index = 0; index < n; ++index)
|
|
|
|
|
if (VEC_index (tree, tf->dest_array, index) == label)
|
|
|
|
|
break;
|
|
|
|
|
if (index == n)
|
|
|
|
|
VEC_safe_push (tree, heap, tf->dest_array, label);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* In the case of a GOTO we want to record the destination label,
|
|
|
|
|
since with a GIMPLE_COND we have an easy access to the then/else
|
|
|
|
|
labels. */
|
|
|
|
|
new_stmt = stmt;
|
|
|
|
|
record_in_goto_queue (tf, new_stmt, index, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* For any GIMPLE_GOTO or GIMPLE_RETURN, decide whether it leaves a try_finally
|
|
|
|
|
node, and if so record that fact in the goto queue associated with that
|
|
|
|
|
try_finally node. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
maybe_record_in_goto_queue (struct leh_state *state, gimple stmt)
|
|
|
|
|
{
|
|
|
|
|
struct leh_tf_state *tf = state->tf;
|
|
|
|
|
treemple new_stmt;
|
|
|
|
|
|
|
|
|
|
if (!tf)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
switch (gimple_code (stmt))
|
|
|
|
|
{
|
|
|
|
|
case GIMPLE_COND:
|
|
|
|
|
new_stmt.tp = gimple_op_ptr (stmt, 2);
|
|
|
|
|
record_in_goto_queue_label (tf, new_stmt, gimple_cond_true_label (stmt));
|
|
|
|
|
new_stmt.tp = gimple_op_ptr (stmt, 3);
|
|
|
|
|
record_in_goto_queue_label (tf, new_stmt, gimple_cond_false_label (stmt));
|
|
|
|
|
break;
|
|
|
|
|
case GIMPLE_GOTO:
|
|
|
|
|
new_stmt.g = stmt;
|
|
|
|
|
record_in_goto_queue_label (tf, new_stmt, gimple_goto_dest (stmt));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GIMPLE_RETURN:
|
|
|
|
|
tf->may_return = true;
|
|
|
|
|
new_stmt.g = stmt;
|
|
|
|
|
record_in_goto_queue (tf, new_stmt, -1, false);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
gcc_unreachable ();
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
#ifdef ENABLE_CHECKING
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* We do not process GIMPLE_SWITCHes for now. As long as the original source
|
2004-05-13 08:41:07 +02:00
|
|
|
|
was in fact structured, and we've not yet done jump threading, then none
|
2008-07-28 16:33:56 +02:00
|
|
|
|
of the labels will leave outer GIMPLE_TRY_FINALLY nodes. Verify this. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
verify_norecord_switch_expr (struct leh_state *state, gimple switch_expr)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
|
|
|
|
struct leh_tf_state *tf = state->tf;
|
|
|
|
|
size_t i, n;
|
|
|
|
|
|
|
|
|
|
if (!tf)
|
|
|
|
|
return;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
n = gimple_switch_num_labels (switch_expr);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < n; ++i)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
treemple temp;
|
|
|
|
|
tree lab = CASE_LABEL (gimple_switch_label (switch_expr, i));
|
|
|
|
|
temp.t = lab;
|
|
|
|
|
gcc_assert (!outside_finally_tree (temp, tf->try_finally_expr));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
#define verify_norecord_switch_expr(state, switch_expr)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Redirect a RETURN_EXPR pointed to by STMT_P to FINLAB. Place in CONT_P
|
|
|
|
|
whatever is needed to finish the return. If MOD is non-null, insert it
|
|
|
|
|
before the new branch. RETURN_VALUE_P is a cache containing a temporary
|
bb-reorder.c, [...]: Fix comment formatting.
* bb-reorder.c, builtins.c, c-common.c, c-gimplify.c,
c-incpath.c, cgraphunit.c, ddg.c, defaults.h, dwarf2out.c,
expmed.c, flags.h, gcc.c, gensupport.c, gimplify.c, global.c,
passes.c, reg-stack.c, target.h, toplev.c, tree-alias-ander.c,
tree-alias-common.c, tree-cfg.c, tree-complex.c, tree-dfa.c,
tree-eh.c, tree-mudflap.c, tree-mudflap.h, tree-outof-ssa.c,
tree-phinodes.c, tree-pretty-print.c, tree-ssa-alias.c,
tree-ssa-ccp.c, tree-ssa-live.c, tree-ssa-live.h,
tree-ssa-pre.c, tree.h, value-prof.h, varasm.c: Fix comment
formatting.
From-SVN: r82463
2004-05-30 20:32:31 +02:00
|
|
|
|
variable to be used in manipulating the value returned from the function. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
do_return_redirection (struct goto_queue_node *q, tree finlab, gimple_seq mod,
|
2004-05-13 08:41:07 +02:00
|
|
|
|
tree *return_value_p)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
tree ret_expr;
|
|
|
|
|
gimple x;
|
|
|
|
|
|
|
|
|
|
/* In the case of a return, the queue node must be a gimple statement. */
|
|
|
|
|
gcc_assert (!q->is_label);
|
|
|
|
|
|
|
|
|
|
ret_expr = gimple_return_retval (q->stmt.g);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
if (ret_expr)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
if (!*return_value_p)
|
|
|
|
|
*return_value_p = ret_expr;
|
|
|
|
|
else
|
|
|
|
|
gcc_assert (*return_value_p == ret_expr);
|
|
|
|
|
q->cont_stmt = q->stmt.g;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
/* The nasty part about redirecting the return value is that the
|
|
|
|
|
return value itself is to be computed before the FINALLY block
|
|
|
|
|
is executed. e.g.
|
|
|
|
|
|
|
|
|
|
int x;
|
|
|
|
|
int foo (void)
|
|
|
|
|
{
|
|
|
|
|
x = 0;
|
|
|
|
|
try {
|
|
|
|
|
return x;
|
|
|
|
|
} finally {
|
|
|
|
|
x++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
should return 0, not 1. Arrange for this to happen by copying
|
|
|
|
|
computed the return value into a local temporary. This also
|
|
|
|
|
allows us to redirect multiple return statements through the
|
|
|
|
|
same destination block; whether this is a net win or not really
|
|
|
|
|
depends, I guess, but it does make generation of the switch in
|
|
|
|
|
lower_try_finally_switch easier. */
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
if (TREE_CODE (ret_expr) == RESULT_DECL)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
|
|
|
|
if (!*return_value_p)
|
|
|
|
|
*return_value_p = ret_expr;
|
|
|
|
|
else
|
targhooks.c (default_unwind_emit, [...]): Use gcc_assert, gcc_unreachable & internal_error instead of abort.
* targhooks.c (default_unwind_emit, default_scalar_mode_supported_p):
Use gcc_assert, gcc_unreachable & internal_error instead of abort.
* timevar.c (timevar_push, timevar_pop, timevar_start,
timevar_stop): Likewise.
* toplev.c (default_pch_valid_p): Likewise.
* tracer.c (tail_duplicate): Likewise.
* tree-alias-common.c (get_alias_var_decl,
get_values_from_constructor, create_alias_var, delete_alias_vars,
empty_points_to_set, same_points_to_set, ptr_may_alias_var):
Likewise.
* tree.c (tree_size, make_node_stat, copy_node_stat,
build_int_cst_wide, integer_all_onesp, list_length, chainon,
tree_node_structure, type_contains_placeholder_p, substitute_in_expr,
substitute_placeholder_in_expr, tabilize_reference_1, build0_stat,
build1_stat, build2_stat, build3_stat, build4_stat, is_attribute_p,
lookup_attribute, type_hash_canon, host_integerp, iterative_hash_expr,
build_method_type_directly, decl_type_context, get_callee_fndecl,
get_set_constructor_bits, build_vector_type_for_mode, int_cst_value,
tree_fold_gcd): Likewise.
* tree-cfg.c (create_bb, make_ctrl_stmt_edges, make_exit_edges,
make_cond_expr_edges, group_case_labels, tree_merge_blocks,
cleanup_control_expr_graph, find_taken_edge,
find_taken_edge_switch_expr, phi_alternatives_equal,
is_ctrl_altering_stmt, disband_implicit_edges, set_bb_for_stmt,
stmt_for_bsi, tree_find_edge_insert_loc, bsi_insert_on_edge_immediate,
tree_split_edge, tree_verify_flow_info, thread_jumps,
tree_redirect_edge_and_branch, tree_flow_call_edges_add): Likewise.
* tree-chrec.c (chrec_fold_poly_cst, chrec_fold_plus_poly_poly,
chrec_fold_multiply_poly_poly): Likewise.
* tree-complex.c (extract_component, expand_complex_division,
expand_complex_comparison, expand_complex_operations_1,
build_replicated_const, expand_vector_operations_1): Likewise.
* tree-data-ref.c (tree_fold_bezout, build_classic_dist_vector,
build_classic_dir_vector): Likewise.
* tree-dfa.c (compute_immediate_uses_for_phi,
compute_immediate_uses_for_stmt, create_var_ann, create_stmt_ann,
create_tree_ann, collect_dfa_stats, get_virtual_var): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-eh.c (record_stmt_eh_region, add_stmt_to_eh_region,
record_in_finally_tree, replace_goto_queue_1,
maybe_record_in_goto_queue, verify_norecord_switch_expr,
do_return_redirection): Likewise.
* tree-if-conv.c (tree_if_convert_stmt, tree_if_convert_cond_expr,
add_to_dst_predicate_list, find_phi_replacement_condition,
replace_phi_with_cond_modify_expr, get_loop_body_in_if_conv_order):
Likewise.
* tree-inline.c (remap_decl, remap_type, remap_decls, copy_body_r,
initialize_inlined_parameters, declare_return_variable,
estimate_num_insns_1, expand_call_inline, expand_calls_inline,
optimize_inline_calls, copy_tree_r): Likewise.
* tree-into-ssa.c (rewrite_initialize_block_local_data, rewrite_stmt,
ssa_rewrite_stmt, rewrite_into_ssa): Likewise.
* tree-iterator.c (alloc_stmt_list, tsi_link_before, tsi_link_after,
tsi_split_statement_list_after, tsi_split_statement_list_before):
Likewise.
* tree-mudflap.c (mf_varname_tree): Likewise.
* tree-nested.c (create_tmp_var_for, lookup_field_for_decl,
lookup_tramp_for_decl, convert_all_function_calls): Likewise.
* tree-optimize.c (tree_rest_of_compilation): Likewise.
* tree-outof-ssa.c (create_temp, eliminate_build, eliminate_phi,
coalesce_abnormal_edges, coalesce_ssa_name, eliminate_virtual_phis,
free_temp_expr_table, add_dependance, finish_expr, rewrite_trees):
Likewise.
* tree-phinodes.c (resize_phi_node, add_phi_arg,
remove_all_phi_nodes_for): Likewise.
* tree-pretty-print.c (op_prio, print_call_name): Likewise.
* tree-profile.c (tree_gen_interval_profiler, tree_gen_pow2_profiler,
tree_gen_one_value_profiler, tree_gen_const_delta_profiler): Likewise.
* tree-sra.c (type_can_instantiate_all_elements, sra_hash_tree,
sra_elt_eq, sra_walk_expr, instantiate_missing_elements,
generate_one_element_ref, generate_element_copy,
generate_element_zero, scalarize_copy, scalarize_init,
scalarize_ldst): Likewise.
* tree-ssa-alias.c (delete_alias_info, group_aliases, may_alias_p,
add_may_alias, add_pointed_to_expr, add_pointed_to_var,
collect_points_to_info_r, get_tmt_for, get_ptr_info): Likewise.
* tree-ssa.c (walk_use_def_chains, check_phi_redundancy): Likewise.
* tree-ssa-ccp.c (dump_lattice_value, get_default_value, get_value,
set_lattice_value, likely_value, ccp_visit_phi_node, visit_assignment,
widen_bitfield, ccp_fold_builtin): Likewise.
* tree-ssa-copy.c (may_propagate_copy, merge_alias_info,
replace_exp_1, propagate_tree_value): Likewise.
* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise.
* tree-ssa-dce.c (set_control_dependence_map_bit,
find_control_dependence, find_pdom, mark_operand_necessary,
mark_stmt_if_obviously_necessary,
mark_control_dependent_edges_necessary, remove_dead_stmt): Likewise.
* tree-ssa-dom.c (dom_opt_initialize_block_local_data,
simplify_switch_and_lookup_avail_expr, cprop_into_successor_phis,
eliminate_redundant_computations, avail_expr_eq): Likewise.
* tree-ssa-dse.c (fix_stmt_v_may_defs): Likewise.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p,
duplicate_blocks): Likewise.
* tree-ssa-loop-im.c (for_each_index, set_level,
is_call_clobbered_ref): Likewise.
* tree-ssa-loop-ivopts.c (dump_use, divide, stmt_after_ip_normal_pos,
stmt_after_increment, set_iv, contains_abnormal_ssa_name_p,
find_interesting_uses_outer_or_nonlin, add_derived_ivs_candidates,
peel_address, ptr_difference_cost, may_replace_final_value,
determine_use_iv_cost, rewrite_use_nonlinear_expr, rewrite_use_outer,
rewrite_use, rewrite_uses): Likewise.
* tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa,
check_loop_closed_ssa_use): Likewise.
* tree-ssanames.c (make_ssa_name): Likewise.
* tree-ssa-operands.c (finalize_ssa_defs, finalize_ssa_uses,
finalize_ssa_v_must_defs, finalize_ssa_stmt_operands,
get_stmt_operands, get_expr_operands, get_asm_expr_operands,
get_indirect_ref_operands, add_stmt_operand): Likewise.
* tree-ssa-pre.c (value_exists_in_set_bitmap,
value_remove_from_set_bitmap, bitmap_insert_into_set, insert_into_set,
phi_translate, valid_in_set, compute_antic,
find_or_generate_expression, create_expression_by_pieces, insert_aux,
create_value_expr_from, eliminate): Likewise.
* tree-ssa-propagate.c (cfg_blocks_get): Likewise.
* tree-ssa-threadupdate.c (remove_last_stmt_and_useless_edges):
Likewise.
* tree-tailcall.c (independent_of_stmt_p, adjust_return_value,
eliminate_tail_call): Likewise.
* tree-vectorizer.c (vect_create_index_for_array_ref,
vect_align_data_ref, vect_create_data_ref,
vect_create_destination_var, vect_get_vec_def_for_operand,
vect_finish_stmt_generation, vect_transform_stmt,
vect_transform_loop_bound, vect_transform_loop,
vect_analyze_operations): Likewise.
* tree-vn.c (vn_compute, set_value_handle, get_value_handle):
Likewise.
* tree-flow-inline.h (var_ann, get_var_ann, get_def_from_ptr,
get_use_op_ptr, immediate_use, phi_ssa_name_p, bsi_start,
bsi_after_labels, bsi_last): Likewise.
* tree-ssa-live.c (var_union, change_partition_var,
create_ssa_var_map, calculate_live_on_entry, root_var_init,
type_var_init, add_coalesce, sort_coalesce_list, pop_best_coalesce):
Likewise.
* tree-ssa-live.h (partition_is_global, live_entry_blocks,
tpa_find_tree): Likewise.
(register_ssa_partition_check): Declare.
(register_ssa_partition): use it.
* tree-ssa-live.c: Include errors.h.
(register_ssa_partition_check): New.
* tree-ssa-operands.c: Include errors.h.
* Makefile.in (tree-ssa-operands.o): Depend on errors.h.
Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>
From-SVN: r87223
2004-09-09 09:54:12 +02:00
|
|
|
|
gcc_assert (*return_value_p == ret_expr);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
q->cont_stmt = q->stmt.g;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
else
|
|
|
|
|
gcc_unreachable ();
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
/* If we don't return a value, all return statements are the same. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
q->cont_stmt = q->stmt.g;
|
|
|
|
|
|
|
|
|
|
if (!q->repl_stmt)
|
|
|
|
|
q->repl_stmt = gimple_seq_alloc ();
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
if (mod)
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq_add_seq (&q->repl_stmt, mod);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_goto (finlab);
|
|
|
|
|
gimple_seq_add_stmt (&q->repl_stmt, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* Similar, but easier, for GIMPLE_GOTO. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
do_goto_redirection (struct goto_queue_node *q, tree finlab, gimple_seq mod,
|
|
|
|
|
struct leh_tf_state *tf)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple x;
|
|
|
|
|
|
|
|
|
|
gcc_assert (q->is_label);
|
|
|
|
|
if (!q->repl_stmt)
|
|
|
|
|
q->repl_stmt = gimple_seq_alloc ();
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
q->cont_stmt = gimple_build_goto (VEC_index (tree, tf->dest_array, q->index));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
if (mod)
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq_add_seq (&q->repl_stmt, mod);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_goto (finlab);
|
|
|
|
|
gimple_seq_add_stmt (&q->repl_stmt, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Emit a standard landing pad sequence into SEQ for REGION. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
emit_post_landing_pad (gimple_seq *seq, eh_region region)
|
|
|
|
|
{
|
|
|
|
|
eh_landing_pad lp = region->landing_pads;
|
|
|
|
|
gimple x;
|
|
|
|
|
|
|
|
|
|
if (lp == NULL)
|
|
|
|
|
lp = gen_eh_landing_pad (region);
|
|
|
|
|
|
|
|
|
|
lp->post_landing_pad = create_artificial_label (UNKNOWN_LOCATION);
|
|
|
|
|
EH_LANDING_PAD_NR (lp->post_landing_pad) = lp->index;
|
|
|
|
|
|
|
|
|
|
x = gimple_build_label (lp->post_landing_pad);
|
|
|
|
|
gimple_seq_add_stmt (seq, x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit a RESX statement into SEQ for REGION. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
emit_resx (gimple_seq *seq, eh_region region)
|
|
|
|
|
{
|
|
|
|
|
gimple x = gimple_build_resx (region->index);
|
|
|
|
|
gimple_seq_add_stmt (seq, x);
|
|
|
|
|
if (region->outer)
|
|
|
|
|
record_stmt_eh_region (region->outer, x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit an EH_DISPATCH statement into SEQ for REGION. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
emit_eh_dispatch (gimple_seq *seq, eh_region region)
|
|
|
|
|
{
|
|
|
|
|
gimple x = gimple_build_eh_dispatch (region->index);
|
|
|
|
|
gimple_seq_add_stmt (seq, x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Note that the current EH region may contain a throw, or a
|
|
|
|
|
call to a function which itself may contain a throw. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
note_eh_region_may_contain_throw (eh_region region)
|
|
|
|
|
{
|
2010-08-19 18:51:39 +02:00
|
|
|
|
while (bitmap_set_bit (eh_region_may_contain_throw_map, region->index))
|
2009-09-14 21:18:58 +02:00
|
|
|
|
{
|
2011-04-20 20:18:16 +02:00
|
|
|
|
if (region->type == ERT_MUST_NOT_THROW)
|
|
|
|
|
break;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
region = region->outer;
|
|
|
|
|
if (region == NULL)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-27 21:09:07 +01:00
|
|
|
|
/* Check if REGION has been marked as containing a throw. If REGION is
|
|
|
|
|
NULL, this predicate is false. */
|
|
|
|
|
|
|
|
|
|
static inline bool
|
|
|
|
|
eh_region_may_contain_throw (eh_region r)
|
|
|
|
|
{
|
|
|
|
|
return r && bitmap_bit_p (eh_region_may_contain_throw_map, r->index);
|
|
|
|
|
}
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
/* We want to transform
|
|
|
|
|
try { body; } catch { stuff; }
|
|
|
|
|
to
|
2009-09-14 21:18:58 +02:00
|
|
|
|
normal_seqence:
|
|
|
|
|
body;
|
|
|
|
|
over:
|
|
|
|
|
eh_seqence:
|
|
|
|
|
landing_pad:
|
|
|
|
|
stuff;
|
|
|
|
|
goto over;
|
|
|
|
|
|
|
|
|
|
TP is a GIMPLE_TRY node. REGION is the region whose post_landing_pad
|
2004-05-13 08:41:07 +02:00
|
|
|
|
should be placed before the second operand, or NULL. OVER is
|
|
|
|
|
an existing label that should be put at the exit, or NULL. */
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
static gimple_seq
|
2009-09-14 21:18:58 +02:00
|
|
|
|
frob_into_branch_around (gimple tp, eh_region region, tree over)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple x;
|
|
|
|
|
gimple_seq cleanup, result;
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
location_t loc = gimple_location (tp);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
cleanup = gimple_try_cleanup (tp);
|
|
|
|
|
result = gimple_try_eval (tp);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (region)
|
|
|
|
|
emit_post_landing_pad (&eh_seq, region);
|
|
|
|
|
|
|
|
|
|
if (gimple_seq_may_fallthru (cleanup))
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
|
|
|
|
if (!over)
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
over = create_artificial_label (loc);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_goto (over);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple_seq_add_stmt (&cleanup, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple_seq_add_seq (&eh_seq, cleanup);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
if (over)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_label (over);
|
|
|
|
|
gimple_seq_add_stmt (&result, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
return result;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A subroutine of lower_try_finally. Duplicate the tree rooted at T.
|
|
|
|
|
Make sure to record all new labels found. */
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
static gimple_seq
|
|
|
|
|
lower_try_finally_dup_block (gimple_seq seq, struct leh_state *outer_state)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple region = NULL;
|
|
|
|
|
gimple_seq new_seq;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
new_seq = copy_gimple_seq_and_replace_locals (seq);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
if (outer_state->tf)
|
|
|
|
|
region = outer_state->tf->try_finally_expr;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
collect_finally_tree_1 (new_seq, region);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
return new_seq;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A subroutine of lower_try_finally. Create a fallthru label for
|
|
|
|
|
the given try_finally state. The only tricky bit here is that
|
|
|
|
|
we have to make sure to record the label in our outer context. */
|
|
|
|
|
|
|
|
|
|
static tree
|
|
|
|
|
lower_try_finally_fallthru_label (struct leh_tf_state *tf)
|
|
|
|
|
{
|
|
|
|
|
tree label = tf->fallthru_label;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
treemple temp;
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
if (!label)
|
|
|
|
|
{
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
label = create_artificial_label (gimple_location (tf->try_finally_expr));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
tf->fallthru_label = label;
|
|
|
|
|
if (tf->outer->tf)
|
2008-07-28 16:33:56 +02:00
|
|
|
|
{
|
|
|
|
|
temp.t = label;
|
|
|
|
|
record_in_finally_tree (temp, tf->outer->tf->try_finally_expr);
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
return label;
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-28 12:52:46 +02:00
|
|
|
|
/* A subroutine of lower_try_finally. If the eh_protect_cleanup_actions
|
|
|
|
|
langhook returns non-null, then the language requires that the exception
|
|
|
|
|
path out of a try_finally be treated specially. To wit: the code within
|
|
|
|
|
the finally block may not itself throw an exception. We have two choices
|
|
|
|
|
here. First we can duplicate the finally block and wrap it in a
|
|
|
|
|
must_not_throw region. Second, we can generate code like
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
finally_block;
|
|
|
|
|
} catch {
|
|
|
|
|
if (fintmp == eh_edge)
|
|
|
|
|
protect_cleanup_actions;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
where "fintmp" is the temporary used in the switch statement generation
|
|
|
|
|
alternative considered below. For the nonce, we always choose the first
|
2004-08-19 23:34:37 +02:00
|
|
|
|
option.
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2005-02-24 22:47:26 +01:00
|
|
|
|
THIS_STATE may be null if this is a try-cleanup, not a try-finally. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
honor_protect_cleanup_actions (struct leh_state *outer_state,
|
|
|
|
|
struct leh_state *this_state,
|
|
|
|
|
struct leh_tf_state *tf)
|
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
tree protect_cleanup_actions;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_stmt_iterator gsi;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
bool finally_may_fallthru;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq finally;
|
|
|
|
|
gimple x;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* First check for nothing to do. */
|
2010-06-28 12:52:46 +02:00
|
|
|
|
if (lang_hooks.eh_protect_cleanup_actions == NULL)
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return;
|
2010-06-28 12:52:46 +02:00
|
|
|
|
protect_cleanup_actions = lang_hooks.eh_protect_cleanup_actions ();
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (protect_cleanup_actions == NULL)
|
|
|
|
|
return;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
finally = gimple_try_cleanup (tf->top_p);
|
|
|
|
|
finally_may_fallthru = gimple_seq_may_fallthru (finally);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* Duplicate the FINALLY block. Only need to do this for try-finally,
|
|
|
|
|
and not for cleanups. */
|
|
|
|
|
if (this_state)
|
|
|
|
|
finally = lower_try_finally_dup_block (finally, outer_state);
|
|
|
|
|
|
2008-01-22 05:53:33 +01:00
|
|
|
|
/* If this cleanup consists of a TRY_CATCH_EXPR with TRY_CATCH_IS_CLEANUP
|
|
|
|
|
set, the handler of the TRY_CATCH_EXPR is another cleanup which ought
|
|
|
|
|
to be in an enclosing scope, but needs to be implemented at this level
|
|
|
|
|
to avoid a nesting violation (see wrap_temporary_cleanups in
|
|
|
|
|
cp/decl.c). Since it's logically at an outer level, we should call
|
|
|
|
|
terminate before we get to it, so strip it away before adding the
|
|
|
|
|
MUST_NOT_THROW filter. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gsi = gsi_start (finally);
|
|
|
|
|
x = gsi_stmt (gsi);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (gimple_code (x) == GIMPLE_TRY
|
2008-07-28 16:33:56 +02:00
|
|
|
|
&& gimple_try_kind (x) == GIMPLE_TRY_CATCH
|
|
|
|
|
&& gimple_try_catch_is_cleanup (x))
|
2008-01-22 05:53:33 +01:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gsi_insert_seq_before (&gsi, gimple_try_eval (x), GSI_SAME_STMT);
|
|
|
|
|
gsi_remove (&gsi, false);
|
2008-01-22 05:53:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
/* Wrap the block with protect_cleanup_actions as the action. */
|
2009-09-14 21:18:58 +02:00
|
|
|
|
x = gimple_build_eh_must_not_throw (protect_cleanup_actions);
|
|
|
|
|
x = gimple_build_try (finally, gimple_seq_alloc_with_stmt (x),
|
|
|
|
|
GIMPLE_TRY_CATCH);
|
|
|
|
|
finally = lower_eh_must_not_throw (outer_state, x);
|
|
|
|
|
|
|
|
|
|
/* Drop all of this into the exception sequence. */
|
|
|
|
|
emit_post_landing_pad (&eh_seq, tf->region);
|
|
|
|
|
gimple_seq_add_seq (&eh_seq, finally);
|
|
|
|
|
if (finally_may_fallthru)
|
|
|
|
|
emit_resx (&eh_seq, tf->region);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* Having now been handled, EH isn't to be considered with
|
|
|
|
|
the rest of the outgoing edges. */
|
|
|
|
|
tf->may_throw = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A subroutine of lower_try_finally. We have determined that there is
|
|
|
|
|
no fallthru edge out of the finally block. This means that there is
|
|
|
|
|
no outgoing edge corresponding to any incoming edge. Restructure the
|
|
|
|
|
try_finally node for this special case. */
|
|
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
lower_try_finally_nofallthru (struct leh_state *state,
|
|
|
|
|
struct leh_tf_state *tf)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
tree lab, return_val;
|
|
|
|
|
gimple x;
|
|
|
|
|
gimple_seq finally;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
struct goto_queue_node *q, *qe;
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
lab = create_artificial_label (gimple_location (tf->try_finally_expr));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* We expect that tf->top_p is a GIMPLE_TRY. */
|
|
|
|
|
finally = gimple_try_cleanup (tf->top_p);
|
|
|
|
|
tf->top_p_seq = gimple_try_eval (tf->top_p);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_label (lab);
|
|
|
|
|
gimple_seq_add_stmt (&tf->top_p_seq, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
return_val = NULL;
|
|
|
|
|
q = tf->goto_queue;
|
|
|
|
|
qe = q + tf->goto_queue_active;
|
|
|
|
|
for (; q < qe; ++q)
|
|
|
|
|
if (q->index < 0)
|
|
|
|
|
do_return_redirection (q, lab, NULL, &return_val);
|
|
|
|
|
else
|
2008-07-28 16:33:56 +02:00
|
|
|
|
do_goto_redirection (q, lab, NULL, tf);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
replace_goto_queue (tf);
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
lower_eh_constructs_1 (state, finally);
|
|
|
|
|
gimple_seq_add_seq (&tf->top_p_seq, finally);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
if (tf->may_throw)
|
|
|
|
|
{
|
|
|
|
|
emit_post_landing_pad (&eh_seq, tf->region);
|
|
|
|
|
|
|
|
|
|
x = gimple_build_goto (lab);
|
|
|
|
|
gimple_seq_add_stmt (&eh_seq, x);
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A subroutine of lower_try_finally. We have determined that there is
|
|
|
|
|
exactly one destination of the finally block. Restructure the
|
|
|
|
|
try_finally node for this special case. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
lower_try_finally_onedest (struct leh_state *state, struct leh_tf_state *tf)
|
|
|
|
|
{
|
|
|
|
|
struct goto_queue_node *q, *qe;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple x;
|
|
|
|
|
gimple_seq finally;
|
|
|
|
|
tree finally_label;
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
location_t loc = gimple_location (tf->try_finally_expr);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
finally = gimple_try_cleanup (tf->top_p);
|
|
|
|
|
tf->top_p_seq = gimple_try_eval (tf->top_p);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
lower_eh_constructs_1 (state, finally);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
if (tf->may_throw)
|
|
|
|
|
{
|
|
|
|
|
/* Only reachable via the exception edge. Add the given label to
|
|
|
|
|
the head of the FINALLY block. Append a RESX at the end. */
|
2009-09-14 21:18:58 +02:00
|
|
|
|
emit_post_landing_pad (&eh_seq, tf->region);
|
|
|
|
|
gimple_seq_add_seq (&eh_seq, finally);
|
|
|
|
|
emit_resx (&eh_seq, tf->region);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tf->may_fallthru)
|
|
|
|
|
{
|
|
|
|
|
/* Only reachable via the fallthru edge. Do nothing but let
|
|
|
|
|
the two blocks run together; we'll fall out the bottom. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq_add_seq (&tf->top_p_seq, finally);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
finally_label = create_artificial_label (loc);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_label (finally_label);
|
|
|
|
|
gimple_seq_add_stmt (&tf->top_p_seq, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq_add_seq (&tf->top_p_seq, finally);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
q = tf->goto_queue;
|
|
|
|
|
qe = q + tf->goto_queue_active;
|
|
|
|
|
|
|
|
|
|
if (tf->may_return)
|
|
|
|
|
{
|
|
|
|
|
/* Reachable by return expressions only. Redirect them. */
|
|
|
|
|
tree return_val = NULL;
|
|
|
|
|
for (; q < qe; ++q)
|
|
|
|
|
do_return_redirection (q, finally_label, NULL, &return_val);
|
|
|
|
|
replace_goto_queue (tf);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Reachable by goto expressions only. Redirect them. */
|
|
|
|
|
for (; q < qe; ++q)
|
2008-07-28 16:33:56 +02:00
|
|
|
|
do_goto_redirection (q, finally_label, NULL, tf);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
replace_goto_queue (tf);
|
2004-08-19 23:34:37 +02:00
|
|
|
|
|
2005-05-14 05:25:44 +02:00
|
|
|
|
if (VEC_index (tree, tf->dest_array, 0) == tf->fallthru_label)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
|
|
|
|
/* Reachable by goto to fallthru label only. Redirect it
|
|
|
|
|
to the new label (already created, sadly), and do not
|
|
|
|
|
emit the final branch out, or the fallthru label. */
|
|
|
|
|
tf->fallthru_label = NULL;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* Place the original return/goto to the original destination
|
|
|
|
|
immediately after the finally block. */
|
|
|
|
|
x = tf->goto_queue[0].cont_stmt;
|
|
|
|
|
gimple_seq_add_stmt (&tf->top_p_seq, x);
|
|
|
|
|
maybe_record_in_goto_queue (state, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A subroutine of lower_try_finally. There are multiple edges incoming
|
|
|
|
|
and outgoing from the finally block. Implement this by duplicating the
|
|
|
|
|
finally block for every destination. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
lower_try_finally_copy (struct leh_state *state, struct leh_tf_state *tf)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq finally;
|
|
|
|
|
gimple_seq new_stmt;
|
|
|
|
|
gimple_seq seq;
|
|
|
|
|
gimple x;
|
|
|
|
|
tree tmp;
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
location_t tf_loc = gimple_location (tf->try_finally_expr);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
finally = gimple_try_cleanup (tf->top_p);
|
|
|
|
|
tf->top_p_seq = gimple_try_eval (tf->top_p);
|
|
|
|
|
new_stmt = NULL;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
if (tf->may_fallthru)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
seq = lower_try_finally_dup_block (finally, state);
|
|
|
|
|
lower_eh_constructs_1 (state, seq);
|
|
|
|
|
gimple_seq_add_seq (&new_stmt, seq);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
tmp = lower_try_finally_fallthru_label (tf);
|
|
|
|
|
x = gimple_build_goto (tmp);
|
|
|
|
|
gimple_seq_add_stmt (&new_stmt, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tf->may_throw)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
seq = lower_try_finally_dup_block (finally, state);
|
|
|
|
|
lower_eh_constructs_1 (state, seq);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-10-21 00:54:28 +02:00
|
|
|
|
emit_post_landing_pad (&eh_seq, tf->region);
|
|
|
|
|
gimple_seq_add_seq (&eh_seq, seq);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
emit_resx (&eh_seq, tf->region);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tf->goto_queue)
|
|
|
|
|
{
|
|
|
|
|
struct goto_queue_node *q, *qe;
|
|
|
|
|
tree return_val = NULL;
|
2005-04-14 20:44:09 +02:00
|
|
|
|
int return_index, index;
|
2005-12-18 02:19:20 +01:00
|
|
|
|
struct labels_s
|
2005-04-14 20:44:09 +02:00
|
|
|
|
{
|
|
|
|
|
struct goto_queue_node *q;
|
|
|
|
|
tree label;
|
|
|
|
|
} *labels;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2005-05-14 05:25:44 +02:00
|
|
|
|
return_index = VEC_length (tree, tf->dest_array);
|
2005-12-18 02:19:20 +01:00
|
|
|
|
labels = XCNEWVEC (struct labels_s, return_index + 1);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
q = tf->goto_queue;
|
|
|
|
|
qe = q + tf->goto_queue_active;
|
|
|
|
|
for (; q < qe; q++)
|
|
|
|
|
{
|
2005-04-14 20:44:09 +02:00
|
|
|
|
index = q->index < 0 ? return_index : q->index;
|
|
|
|
|
|
|
|
|
|
if (!labels[index].q)
|
|
|
|
|
labels[index].q = q;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (index = 0; index < return_index + 1; index++)
|
|
|
|
|
{
|
|
|
|
|
tree lab;
|
|
|
|
|
|
|
|
|
|
q = labels[index].q;
|
|
|
|
|
if (! q)
|
|
|
|
|
continue;
|
|
|
|
|
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
lab = labels[index].label
|
|
|
|
|
= create_artificial_label (tf_loc);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
if (index == return_index)
|
|
|
|
|
do_return_redirection (q, lab, NULL, &return_val);
|
|
|
|
|
else
|
2008-07-28 16:33:56 +02:00
|
|
|
|
do_goto_redirection (q, lab, NULL, tf);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_label (lab);
|
|
|
|
|
gimple_seq_add_stmt (&new_stmt, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
seq = lower_try_finally_dup_block (finally, state);
|
|
|
|
|
lower_eh_constructs_1 (state, seq);
|
|
|
|
|
gimple_seq_add_seq (&new_stmt, seq);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq_add_stmt (&new_stmt, q->cont_stmt);
|
2005-04-14 20:44:09 +02:00
|
|
|
|
maybe_record_in_goto_queue (state, q->cont_stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
2005-04-14 20:44:09 +02:00
|
|
|
|
|
|
|
|
|
for (q = tf->goto_queue; q < qe; q++)
|
|
|
|
|
{
|
|
|
|
|
tree lab;
|
|
|
|
|
|
|
|
|
|
index = q->index < 0 ? return_index : q->index;
|
|
|
|
|
|
|
|
|
|
if (labels[index].q == q)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
lab = labels[index].label;
|
|
|
|
|
|
|
|
|
|
if (index == return_index)
|
|
|
|
|
do_return_redirection (q, lab, NULL, &return_val);
|
|
|
|
|
else
|
2008-07-28 16:33:56 +02:00
|
|
|
|
do_goto_redirection (q, lab, NULL, tf);
|
2005-04-14 20:44:09 +02:00
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
replace_goto_queue (tf);
|
|
|
|
|
free (labels);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Need to link new stmts after running replace_goto_queue due
|
|
|
|
|
to not wanting to process the same goto stmts twice. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq_add_seq (&tf->top_p_seq, new_stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A subroutine of lower_try_finally. There are multiple edges incoming
|
|
|
|
|
and outgoing from the finally block. Implement this by instrumenting
|
|
|
|
|
each incoming edge and creating a switch statement at the end of the
|
|
|
|
|
finally block that branches to the appropriate destination. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
|
|
|
|
|
{
|
|
|
|
|
struct goto_queue_node *q, *qe;
|
|
|
|
|
tree return_val = NULL;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
tree finally_tmp, finally_label;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
int return_index, eh_index, fallthru_index;
|
|
|
|
|
int nlabels, ndests, j, last_case_index;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
tree last_case;
|
|
|
|
|
VEC (tree,heap) *case_label_vec;
|
|
|
|
|
gimple_seq switch_body;
|
|
|
|
|
gimple x;
|
|
|
|
|
tree tmp;
|
|
|
|
|
gimple switch_stmt;
|
|
|
|
|
gimple_seq finally;
|
|
|
|
|
struct pointer_map_t *cont_map = NULL;
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
/* The location of the TRY_FINALLY stmt. */
|
2009-06-15 16:27:18 +02:00
|
|
|
|
location_t tf_loc = gimple_location (tf->try_finally_expr);
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
/* The location of the finally block. */
|
|
|
|
|
location_t finally_loc;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
|
|
switch_body = gimple_seq_alloc ();
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* Mash the TRY block to the head of the chain. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
finally = gimple_try_cleanup (tf->top_p);
|
|
|
|
|
tf->top_p_seq = gimple_try_eval (tf->top_p);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
/* The location of the finally is either the last stmt in the finally
|
|
|
|
|
block or the location of the TRY_FINALLY itself. */
|
|
|
|
|
finally_loc = gimple_seq_last_stmt (tf->top_p_seq) != NULL ?
|
|
|
|
|
gimple_location (gimple_seq_last_stmt (tf->top_p_seq))
|
|
|
|
|
: tf_loc;
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
/* Lower the finally block itself. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
lower_eh_constructs_1 (state, finally);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* Prepare for switch statement generation. */
|
2005-05-14 05:25:44 +02:00
|
|
|
|
nlabels = VEC_length (tree, tf->dest_array);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
return_index = nlabels;
|
|
|
|
|
eh_index = return_index + tf->may_return;
|
|
|
|
|
fallthru_index = eh_index + tf->may_throw;
|
|
|
|
|
ndests = fallthru_index + tf->may_fallthru;
|
|
|
|
|
|
|
|
|
|
finally_tmp = create_tmp_var (integer_type_node, "finally_tmp");
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
finally_label = create_artificial_label (finally_loc);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* We use VEC_quick_push on case_label_vec throughout this function,
|
|
|
|
|
since we know the size in advance and allocate precisely as muce
|
|
|
|
|
space as needed. */
|
|
|
|
|
case_label_vec = VEC_alloc (tree, heap, ndests);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
last_case = NULL;
|
|
|
|
|
last_case_index = 0;
|
|
|
|
|
|
|
|
|
|
/* Begin inserting code for getting to the finally block. Things
|
|
|
|
|
are done in this order to correspond to the sequence the code is
|
|
|
|
|
layed out. */
|
|
|
|
|
|
|
|
|
|
if (tf->may_fallthru)
|
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
x = gimple_build_assign (finally_tmp,
|
|
|
|
|
build_int_cst (NULL, fallthru_index));
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq_add_stmt (&tf->top_p_seq, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build.
2005-12-02 Richard Guenther <rguenther@suse.de>
* tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build.
* tree-complex.c (update_complex_assignment, expand_complex_div_wide):
Likewise.
* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref,
maybe_fold_offset_to_component_ref): Likewise.
* tree-ssa-dom.c (thread_across_edge,
simplify_rhs_and_lookup_avail_expr,
find_equivalent_equality_comparison, record_equivalences_from_stmt):
Likewise.
* gimple-low.c (lower_function_body, lower_return_expr): Likewise.
* tree-eh.c (do_return_redirection, honor_protect_cleanup_actions,
lower_try_finally_switch): Likewise.
* tree-if-conv.c (add_to_dst_predicate_list,
replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise.
* gimplify.c (internal_get_tmp_var, gimple_build_eh_filter,
voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr,
gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr,
gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr,
shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr,
gimplify_init_ctor_eval, gimplify_init_constructor,
gimplify_variable_sized_compare, gimplify_boolean_expr,
gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr,
gimplify_expr, gimplify_body, gimplify_function_tree,
force_gimple_operand): Likewise.
* tree-ssa-pre.c (create_expression_by_pieces): Likewise.
* tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for,
mx_register_decls): Likewise.
* tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain,
get_frame_field, finalize_nesting_tree_1): Likewise.
* tree-inline.c (setup_one_parameter): Likewise.
* tree-vect-transform.c (vectorizable_condition): Likewise.
* tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies):
Likewise.
* tree-profile.c (tree_gen_edge_profiler): Likewise.
* tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise.
* c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise.
* tree-chrec.h (build_polynomial_chrec): Likewise.
From-SVN: r107907
2005-12-02 18:09:40 +01:00
|
|
|
|
last_case = build3 (CASE_LABEL_EXPR, void_type_node,
|
2009-09-14 21:18:58 +02:00
|
|
|
|
build_int_cst (NULL, fallthru_index),
|
|
|
|
|
NULL, create_artificial_label (tf_loc));
|
2008-07-28 16:33:56 +02:00
|
|
|
|
VEC_quick_push (tree, case_label_vec, last_case);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
last_case_index++;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_label (CASE_LABEL (last_case));
|
|
|
|
|
gimple_seq_add_stmt (&switch_body, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
tmp = lower_try_finally_fallthru_label (tf);
|
|
|
|
|
x = gimple_build_goto (tmp);
|
|
|
|
|
gimple_seq_add_stmt (&switch_body, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tf->may_throw)
|
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
emit_post_landing_pad (&eh_seq, tf->region);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
x = gimple_build_assign (finally_tmp,
|
|
|
|
|
build_int_cst (NULL, eh_index));
|
|
|
|
|
gimple_seq_add_stmt (&eh_seq, x);
|
|
|
|
|
|
|
|
|
|
x = gimple_build_goto (finally_label);
|
|
|
|
|
gimple_seq_add_stmt (&eh_seq, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build.
2005-12-02 Richard Guenther <rguenther@suse.de>
* tree-ssa-loop-im.c (schedule_sm): Use buildN instead of build.
* tree-complex.c (update_complex_assignment, expand_complex_div_wide):
Likewise.
* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref,
maybe_fold_offset_to_component_ref): Likewise.
* tree-ssa-dom.c (thread_across_edge,
simplify_rhs_and_lookup_avail_expr,
find_equivalent_equality_comparison, record_equivalences_from_stmt):
Likewise.
* gimple-low.c (lower_function_body, lower_return_expr): Likewise.
* tree-eh.c (do_return_redirection, honor_protect_cleanup_actions,
lower_try_finally_switch): Likewise.
* tree-if-conv.c (add_to_dst_predicate_list,
replace_phi_with_cond_modify_expr, ifc_temp_var): Likewise.
* gimplify.c (internal_get_tmp_var, gimple_build_eh_filter,
voidify_wrapper_expr, build_stack_save_restore, gimplify_bind_expr,
gimplify_return_expr, gimplify_decl_expr, gimplify_switch_expr,
gimplify_case_label_expr, gimplify_exit_expr, gimplify_self_mod_expr,
shortcut_cond_r, shortcut_cond_expr, gimplify_cond_expr,
gimplify_init_ctor_eval, gimplify_init_constructor,
gimplify_variable_sized_compare, gimplify_boolean_expr,
gimplify_cleanup_point_expr, gimple_push_cleanup, gimplify_target_expr,
gimplify_expr, gimplify_body, gimplify_function_tree,
force_gimple_operand): Likewise.
* tree-ssa-pre.c (create_expression_by_pieces): Likewise.
* tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for,
mx_register_decls): Likewise.
* tree-nested.c (init_tmp_var, save_tmp_var, get_static_chain,
get_frame_field, finalize_nesting_tree_1): Likewise.
* tree-inline.c (setup_one_parameter): Likewise.
* tree-vect-transform.c (vectorizable_condition): Likewise.
* tree-outof-ssa.c (insert_copy_on_edge, insert_backedge_copies):
Likewise.
* tree-profile.c (tree_gen_edge_profiler): Likewise.
* tree-cfg.c (factor_computed_gotos, gimplify_val): Likewise.
* c-parser.c (c_parser_if_body, c_parser_switch_statement): Likewise.
* tree-chrec.h (build_polynomial_chrec): Likewise.
From-SVN: r107907
2005-12-02 18:09:40 +01:00
|
|
|
|
last_case = build3 (CASE_LABEL_EXPR, void_type_node,
|
2009-09-14 21:18:58 +02:00
|
|
|
|
build_int_cst (NULL, eh_index),
|
|
|
|
|
NULL, create_artificial_label (tf_loc));
|
2008-07-28 16:33:56 +02:00
|
|
|
|
VEC_quick_push (tree, case_label_vec, last_case);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
last_case_index++;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_label (CASE_LABEL (last_case));
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple_seq_add_stmt (&eh_seq, x);
|
|
|
|
|
emit_resx (&eh_seq, tf->region);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_label (finally_label);
|
|
|
|
|
gimple_seq_add_stmt (&tf->top_p_seq, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq_add_seq (&tf->top_p_seq, finally);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* Redirect each incoming goto edge. */
|
|
|
|
|
q = tf->goto_queue;
|
|
|
|
|
qe = q + tf->goto_queue_active;
|
|
|
|
|
j = last_case_index + tf->may_return;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* Prepare the assignments to finally_tmp that are executed upon the
|
|
|
|
|
entrance through a particular edge. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
for (; q < qe; ++q)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq mod;
|
|
|
|
|
int switch_id;
|
|
|
|
|
unsigned int case_index;
|
|
|
|
|
|
|
|
|
|
mod = gimple_seq_alloc ();
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
if (q->index < 0)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_assign (finally_tmp,
|
2009-09-14 21:18:58 +02:00
|
|
|
|
build_int_cst (NULL, return_index));
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq_add_stmt (&mod, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
do_return_redirection (q, finally_label, mod, &return_val);
|
|
|
|
|
switch_id = return_index;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_assign (finally_tmp,
|
2009-09-14 21:18:58 +02:00
|
|
|
|
build_int_cst (NULL, q->index));
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq_add_stmt (&mod, x);
|
|
|
|
|
do_goto_redirection (q, finally_label, mod, tf);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
switch_id = q->index;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case_index = j + q->index;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
if (VEC_length (tree, case_label_vec) <= case_index
|
|
|
|
|
|| !VEC_index (tree, case_label_vec, case_index))
|
|
|
|
|
{
|
|
|
|
|
tree case_lab;
|
|
|
|
|
void **slot;
|
|
|
|
|
case_lab = build3 (CASE_LABEL_EXPR, void_type_node,
|
2009-09-14 21:18:58 +02:00
|
|
|
|
build_int_cst (NULL, switch_id),
|
|
|
|
|
NULL, NULL);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* We store the cont_stmt in the pointer map, so that we can recover
|
|
|
|
|
it in the loop below. We don't create the new label while
|
2009-09-14 21:18:58 +02:00
|
|
|
|
walking the goto_queue because pointers don't offer a stable
|
2008-07-28 16:33:56 +02:00
|
|
|
|
order. */
|
|
|
|
|
if (!cont_map)
|
|
|
|
|
cont_map = pointer_map_create ();
|
|
|
|
|
slot = pointer_map_insert (cont_map, case_lab);
|
|
|
|
|
*slot = q->cont_stmt;
|
|
|
|
|
VEC_quick_push (tree, case_label_vec, case_lab);
|
|
|
|
|
}
|
2005-04-14 20:44:09 +02:00
|
|
|
|
}
|
|
|
|
|
for (j = last_case_index; j < last_case_index + nlabels; j++)
|
|
|
|
|
{
|
|
|
|
|
tree label;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple cont_stmt;
|
|
|
|
|
void **slot;
|
2005-04-14 20:44:09 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
last_case = VEC_index (tree, case_label_vec, j);
|
2005-04-14 20:44:09 +02:00
|
|
|
|
|
|
|
|
|
gcc_assert (last_case);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gcc_assert (cont_map);
|
2005-04-14 20:44:09 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
slot = pointer_map_contains (cont_map, last_case);
|
|
|
|
|
/* As the comment above suggests, CASE_LABEL (last_case) was just a
|
|
|
|
|
placeholder, it does not store an actual label, yet. */
|
|
|
|
|
gcc_assert (slot);
|
|
|
|
|
cont_stmt = *(gimple *) slot;
|
2005-04-14 20:44:09 +02:00
|
|
|
|
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
label = create_artificial_label (tf_loc);
|
2005-04-14 20:44:09 +02:00
|
|
|
|
CASE_LABEL (last_case) = label;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_label (label);
|
|
|
|
|
gimple_seq_add_stmt (&switch_body, x);
|
|
|
|
|
gimple_seq_add_stmt (&switch_body, cont_stmt);
|
2005-04-14 20:44:09 +02:00
|
|
|
|
maybe_record_in_goto_queue (state, cont_stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
if (cont_map)
|
|
|
|
|
pointer_map_destroy (cont_map);
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
replace_goto_queue (tf);
|
|
|
|
|
|
2004-05-30 20:19:18 +02:00
|
|
|
|
/* Make sure that the last case is the default label, as one is required.
|
|
|
|
|
Then sort the labels, which is also required in GIMPLE. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
CASE_LOW (last_case) = NULL;
|
2004-05-30 20:19:18 +02:00
|
|
|
|
sort_case_labels (case_label_vec);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* Build the switch statement, setting last_case to be the default
|
|
|
|
|
label. */
|
|
|
|
|
switch_stmt = gimple_build_switch_vec (finally_tmp, last_case,
|
|
|
|
|
case_label_vec);
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
gimple_set_location (switch_stmt, finally_loc);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
|
|
/* Need to link SWITCH_STMT after running replace_goto_queue
|
|
|
|
|
due to not wanting to process the same goto stmts twice. */
|
|
|
|
|
gimple_seq_add_stmt (&tf->top_p_seq, switch_stmt);
|
|
|
|
|
gimple_seq_add_seq (&tf->top_p_seq, switch_body);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Decide whether or not we are going to duplicate the finally block.
|
|
|
|
|
There are several considerations.
|
|
|
|
|
|
|
|
|
|
First, if this is Java, then the finally block contains code
|
|
|
|
|
written by the user. It has line numbers associated with it,
|
|
|
|
|
so duplicating the block means it's difficult to set a breakpoint.
|
|
|
|
|
Since controlling code generation via -g is verboten, we simply
|
|
|
|
|
never duplicate code without optimization.
|
|
|
|
|
|
|
|
|
|
Second, we'd like to prevent egregious code growth. One way to
|
|
|
|
|
do this is to estimate the size of the finally block, multiply
|
|
|
|
|
that by the number of copies we'd need to make, and compare against
|
|
|
|
|
the estimate of the size of the switch machinery we'd have to add. */
|
|
|
|
|
|
|
|
|
|
static bool
|
2008-07-28 16:33:56 +02:00
|
|
|
|
decide_copy_try_finally (int ndests, gimple_seq finally)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
|
|
|
|
int f_estimate, sw_estimate;
|
|
|
|
|
|
|
|
|
|
if (!optimize)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
/* Finally estimate N times, plus N gotos. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
f_estimate = count_insns_seq (finally, &eni_size_weights);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
f_estimate = (f_estimate + 1) * ndests;
|
|
|
|
|
|
|
|
|
|
/* Switch statement (cost 10), N variable assignments, N gotos. */
|
|
|
|
|
sw_estimate = 10 + 2 * ndests;
|
|
|
|
|
|
|
|
|
|
/* Optimize for size clearly wants our best guess. */
|
loop-unswitch.c (unswitch_single_loop): Use optimize_loop_for_speed_p.
* loop-unswitch.c (unswitch_single_loop): Use optimize_loop_for_speed_p.
* tree-ssa-threadupdate.c (mark_threaded_blocks): Use optimize_function_for_size_p.
* tracer.c (ignore_bb_p): Use optimize_bb_for_size_p.
* postreload-gcse.c (eliminate_partially_redundant_load): Use optimize_bb_for_size_p.
* value-prof.c (gimple_divmod_fixed_value_transform,
gimple_mod_pow2_value_transform, gimple_mod_subtract_transform,
gimple_stringops_transform): Use optimize_bb_for_size_p.
* ipa-cp.c (ipcp_insert_stage): Use optimize_function_for_size_p.
* final.c (compute_alignments): Use optimize_function_for_size_p.
* builtins.c (fold_builtin_cabs): Use optimize_function_for_speed_p.
(fold_builtin_strcpy, fold_builtin_fputs): Use
optimize_function_for_size_p.
* fold-const.c (tree_swap_operands_p): Use optimize_function_for_size_p.
* recog.c (relax_delay_slots): Likewise.
* tree-ssa-math-opts.c (replace_reciprocal): Use optimize_bb_for_speed_p.
(execute_cse_reciprocals): Use optimize_bb_for_size_p.
* ipa-inline.c (cgraph_decide_recursive_inlining): Use
optimize_function_for_size_p.
(cgraph_decide_inlining_of_small_function): Use
optimize_function_for_size_p.
* global.c (find_reg): Use optimize_function_for_size_p.
* opts.c (decode_options): Do not clear flag_tree_ch, flag_inline_functions,
flag_unswitch_loops, flag_unroll_loops, flag_unroll_all_loops and
flag_prefetch_loop_arrays. Those can work it out from profile.
* tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Use
optimize_loop_for_speed_p.
* predict.c (optimize_bb_for_size_p, optimize_bb_for_speed_p): Constify
argument.
(optimize_loop_nest_for_size_p, optimize_loop_nest_for_speed_p): New.
* tree-parloops.c (parallelize_loops): Use optimize_loop_for_size_p.
* tree-eh.c (decide_copy_try_finally): Use optimize_function_for_size_p.
* local-alloc.c (block_alloc): Pass BB pointer.
(find_free_reg): Add BB pointer, use optimize_bb_for_size_p.
* gcse.c (gcse_main): Use optimize_function_for_size_p.
* loop-unroll.c (decide_unrolling_and_peeling): Use optimize_loop_for_size_p.
(decide_peel_completely): Likewise.
* tree-vect-analyze.c (vect_mark_for_runtime_alias_test): Use
optimize_loop_for_size_p.
(vect_enhance_data_refs_alignment): Likewise.
* tree-ssa-coalesce.c (coalesce_cost): Add optimize_for_size argument.
(coalesce_cost_bb, coalesce_cost_edge, create_outofssa_var_map): Update call.
* cfgcleanup.c (outgoing_edges_match): Use optimize_bb_for_speed_p.
(try_crossjump_bb): Use optimize_bb_for_size_p.
* tree-ssa-loop-prefetch.c (loop_prefetch_arrays): Use
optimize_loop_for_speed_p.
* bb-reorder.c (find_traces_1_round): Likewise.
(copy_bb): Use optimize_bb_for_speed_p.
(duplicate_computed_gotos): Likewise.
* basic-block.h (optimize_loop_nest_for_size_p,
optimize_loop_nest_for_speed_p): New.
* stmt.c (expand_case): Use optimize_insn_for_size_p.
From-SVN: r139760
2008-08-29 12:35:57 +02:00
|
|
|
|
if (optimize_function_for_size_p (cfun))
|
2004-05-13 08:41:07 +02:00
|
|
|
|
return f_estimate < sw_estimate;
|
|
|
|
|
|
|
|
|
|
/* ??? These numbers are completely made up so far. */
|
|
|
|
|
if (optimize > 1)
|
2004-06-19 00:32:49 +02:00
|
|
|
|
return f_estimate < 100 || f_estimate < sw_estimate * 2;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
else
|
2004-06-19 00:32:49 +02:00
|
|
|
|
return f_estimate < 40 || f_estimate * 2 < sw_estimate * 3;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2010-05-21 21:32:29 +02:00
|
|
|
|
/* REG is the enclosing region for a possible cleanup region, or the region
|
|
|
|
|
itself. Returns TRUE if such a region would be unreachable.
|
|
|
|
|
|
|
|
|
|
Cleanup regions within a must-not-throw region aren't actually reachable
|
|
|
|
|
even if there are throwing stmts within them, because the personality
|
|
|
|
|
routine will call terminate before unwinding. */
|
|
|
|
|
|
|
|
|
|
static bool
|
|
|
|
|
cleanup_is_dead_in (eh_region reg)
|
|
|
|
|
{
|
|
|
|
|
while (reg && reg->type == ERT_CLEANUP)
|
|
|
|
|
reg = reg->outer;
|
|
|
|
|
return (reg && reg->type == ERT_MUST_NOT_THROW);
|
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
|
|
/* A subroutine of lower_eh_constructs_1. Lower a GIMPLE_TRY_FINALLY nodes
|
2004-05-13 08:41:07 +02:00
|
|
|
|
to a sequence of labels and blocks, plus the exception region trees
|
2004-08-19 23:34:37 +02:00
|
|
|
|
that record all the magic. This is complicated by the need to
|
2004-05-13 08:41:07 +02:00
|
|
|
|
arrange for the FINALLY block to be executed on all exits. */
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
static gimple_seq
|
|
|
|
|
lower_try_finally (struct leh_state *state, gimple tp)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
|
|
|
|
struct leh_tf_state this_tf;
|
|
|
|
|
struct leh_state this_state;
|
|
|
|
|
int ndests;
|
2010-03-17 00:02:35 +01:00
|
|
|
|
gimple_seq old_eh_seq;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* Process the try block. */
|
|
|
|
|
|
|
|
|
|
memset (&this_tf, 0, sizeof (this_tf));
|
2008-07-28 16:33:56 +02:00
|
|
|
|
this_tf.try_finally_expr = tp;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
this_tf.top_p = tp;
|
|
|
|
|
this_tf.outer = state;
|
2010-05-21 21:32:29 +02:00
|
|
|
|
if (using_eh_for_cleanups_p && !cleanup_is_dead_in (state->cur_region))
|
|
|
|
|
{
|
|
|
|
|
this_tf.region = gen_eh_region_cleanup (state->cur_region);
|
|
|
|
|
this_state.cur_region = this_tf.region;
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
else
|
2010-05-21 21:32:29 +02:00
|
|
|
|
{
|
|
|
|
|
this_tf.region = NULL;
|
|
|
|
|
this_state.cur_region = state->cur_region;
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
this_state.ehp_region = state->ehp_region;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
this_state.tf = &this_tf;
|
|
|
|
|
|
2010-03-17 00:02:35 +01:00
|
|
|
|
old_eh_seq = eh_seq;
|
|
|
|
|
eh_seq = NULL;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
lower_eh_constructs_1 (&this_state, gimple_try_eval(tp));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* Determine if the try block is escaped through the bottom. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
this_tf.may_fallthru = gimple_seq_may_fallthru (gimple_try_eval (tp));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* Determine if any exceptions are possible within the try block. */
|
2010-05-21 21:32:29 +02:00
|
|
|
|
if (this_tf.region)
|
2009-10-27 21:09:07 +01:00
|
|
|
|
this_tf.may_throw = eh_region_may_contain_throw (this_tf.region);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
if (this_tf.may_throw)
|
2009-09-14 21:18:58 +02:00
|
|
|
|
honor_protect_cleanup_actions (state, &this_state, &this_tf);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* Determine how many edges (still) reach the finally block. Or rather,
|
|
|
|
|
how many destinations are reached by the finally block. Use this to
|
|
|
|
|
determine how we process the finally block itself. */
|
|
|
|
|
|
2005-05-14 05:25:44 +02:00
|
|
|
|
ndests = VEC_length (tree, this_tf.dest_array);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
ndests += this_tf.may_fallthru;
|
|
|
|
|
ndests += this_tf.may_return;
|
|
|
|
|
ndests += this_tf.may_throw;
|
|
|
|
|
|
|
|
|
|
/* If the FINALLY block is not reachable, dike it out. */
|
|
|
|
|
if (ndests == 0)
|
2008-07-28 16:33:56 +02:00
|
|
|
|
{
|
|
|
|
|
gimple_seq_add_seq (&this_tf.top_p_seq, gimple_try_eval (tp));
|
|
|
|
|
gimple_try_set_cleanup (tp, NULL);
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
/* If the finally block doesn't fall through, then any destination
|
|
|
|
|
we might try to impose there isn't reached either. There may be
|
|
|
|
|
some minor amount of cleanup and redirection still needed. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
else if (!gimple_seq_may_fallthru (gimple_try_cleanup (tp)))
|
2004-05-13 08:41:07 +02:00
|
|
|
|
lower_try_finally_nofallthru (state, &this_tf);
|
|
|
|
|
|
|
|
|
|
/* We can easily special-case redirection to a single destination. */
|
|
|
|
|
else if (ndests == 1)
|
|
|
|
|
lower_try_finally_onedest (state, &this_tf);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
else if (decide_copy_try_finally (ndests, gimple_try_cleanup (tp)))
|
2004-05-13 08:41:07 +02:00
|
|
|
|
lower_try_finally_copy (state, &this_tf);
|
|
|
|
|
else
|
|
|
|
|
lower_try_finally_switch (state, &this_tf);
|
|
|
|
|
|
|
|
|
|
/* If someone requested we add a label at the end of the transformed
|
|
|
|
|
block, do so. */
|
|
|
|
|
if (this_tf.fallthru_label)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* This must be reached only if ndests == 0. */
|
|
|
|
|
gimple x = gimple_build_label (this_tf.fallthru_label);
|
|
|
|
|
gimple_seq_add_stmt (&this_tf.top_p_seq, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-14 05:25:44 +02:00
|
|
|
|
VEC_free (tree, heap, this_tf.dest_array);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
if (this_tf.goto_queue)
|
|
|
|
|
free (this_tf.goto_queue);
|
2007-08-14 20:12:34 +02:00
|
|
|
|
if (this_tf.goto_queue_map)
|
|
|
|
|
pointer_map_destroy (this_tf.goto_queue_map);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2010-03-17 00:02:35 +01:00
|
|
|
|
/* If there was an old (aka outer) eh_seq, append the current eh_seq.
|
|
|
|
|
If there was no old eh_seq, then the append is trivially already done. */
|
|
|
|
|
if (old_eh_seq)
|
|
|
|
|
{
|
|
|
|
|
if (eh_seq == NULL)
|
|
|
|
|
eh_seq = old_eh_seq;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gimple_seq new_eh_seq = eh_seq;
|
|
|
|
|
eh_seq = old_eh_seq;
|
|
|
|
|
gimple_seq_add_seq(&eh_seq, new_eh_seq);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
return this_tf.top_p_seq;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* A subroutine of lower_eh_constructs_1. Lower a GIMPLE_TRY_CATCH with a
|
|
|
|
|
list of GIMPLE_CATCH to a sequence of labels and blocks, plus the
|
|
|
|
|
exception region trees that records all the magic. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
static gimple_seq
|
|
|
|
|
lower_catch (struct leh_state *state, gimple tp)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2009-10-27 21:09:07 +01:00
|
|
|
|
eh_region try_region = NULL;
|
|
|
|
|
struct leh_state this_state = *state;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_stmt_iterator gsi;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
tree out_label;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple_seq new_seq;
|
|
|
|
|
gimple x;
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
location_t try_catch_loc = gimple_location (tp);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-10-27 21:09:07 +01:00
|
|
|
|
if (flag_exceptions)
|
|
|
|
|
{
|
|
|
|
|
try_region = gen_eh_region_try (state->cur_region);
|
|
|
|
|
this_state.cur_region = try_region;
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-10-27 21:09:07 +01:00
|
|
|
|
if (!eh_region_may_contain_throw (try_region))
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return gimple_try_eval (tp);
|
|
|
|
|
|
|
|
|
|
new_seq = NULL;
|
|
|
|
|
emit_eh_dispatch (&new_seq, try_region);
|
|
|
|
|
emit_resx (&new_seq, try_region);
|
|
|
|
|
|
|
|
|
|
this_state.cur_region = state->cur_region;
|
|
|
|
|
this_state.ehp_region = try_region;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
out_label = NULL;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
for (gsi = gsi_start (gimple_try_cleanup (tp));
|
|
|
|
|
!gsi_end_p (gsi);
|
|
|
|
|
gsi_next (&gsi))
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
eh_catch c;
|
|
|
|
|
gimple gcatch;
|
|
|
|
|
gimple_seq handler;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* builtins.c (expand_builtin_profile_func): Avoid C++ keywords.
* calls.c (avoid_likely_spilled_reg): Likewise.
* cfgexpand.c (gimple_assign_rhs_to_tree): Likewise.
* cgraph.c (cgraph_clone_edge, cgraph_clone_node): Likewise.
* config/i386/i386.c (ix86_expand_special_args_builtin,
ix86_secondary_reload): Likewise.
* except.c (struct eh_region, gen_eh_region_catch,
remove_unreachable_regions, duplicate_eh_regions,
assign_filter_values, build_post_landing_pads,
sjlj_find_directly_reachable_regions, remove_eh_handler,
reachable_next_level, foreach_reachable_handler,
can_throw_internal_1, can_throw_external_1,
collect_one_action_chain): Likewise.
* expr.c (expand_expr_real_1, vector_mode_valid_p): Likewise.
* fold-const.c (twoval_comparison_p, eval_subst): Likewise.
* function.c (update_temp_slot_address, instantiate_new_reg,
instantiate_virtual_regs_in_rtx,
instantiate_virtual_regs_in_insn): Likewise.
* gimple.c (extract_ops_from_tree, gimple_seq_copy): Likewise.
* gimplify.c (gimplify_call_expr, gimplify_init_constructor,
gimplify_cleanup_point_expr): Likewise.
* ipa-cp.c (ipcp_lattice_changed): Likewise.
* passes.c (next_pass_1): Likewise.
* print-tree.c (print_node_brief, print_node): Likewise.
* profile.c (branch_prob): Likewise.
* tree-dump.c (dump_register): Likewise.
* tree-eh.c (replace_goto_queue_cond_clause, lower_catch):
Likewise.
* tree-inline.c (remap_ssa_name, remap_type_1, remap_blocks,
copy_statement_list, remap_gimple_op_r, copy_tree_body_r,
copy_edges_for_bb, copy_cfg_body, copy_tree_r,
copy_arguments_for_versioning, copy_static_chain): Likewise.
* tree-into-ssa.c (names_replaced_by, add_to_repl_tbl,
add_new_name_mapping, register_new_name_mapping): Likewise.
* tree-mudflap.c (mf_xform_derefs): Likewise.
* tree-predcom.c (struct chain, dump_chain, replace_ref_with,
get_init_expr, combine_chains): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
* tree-ssa-structalias.c (create_variable_info_for): Likewise.
* tree-vrp.c (simplify_cond_using_ranges): Likewise.
* tree.c (substitute_in_expr, iterative_hash_expr): Likewise.
* value-prof.c (gimple_duplicate_stmt_histograms): Likewise.
From-SVN: r138809
2008-08-06 17:57:09 +02:00
|
|
|
|
gcatch = gsi_stmt (gsi);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
c = gen_eh_region_catch (try_region, gimple_catch_types (gcatch));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
handler = gimple_catch_handler (gcatch);
|
|
|
|
|
lower_eh_constructs_1 (&this_state, handler);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
c->label = create_artificial_label (UNKNOWN_LOCATION);
|
|
|
|
|
x = gimple_build_label (c->label);
|
|
|
|
|
gimple_seq_add_stmt (&new_seq, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple_seq_add_seq (&new_seq, handler);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (gimple_seq_may_fallthru (new_seq))
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
|
|
|
|
if (!out_label)
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
out_label = create_artificial_label (try_catch_loc);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_build_goto (out_label);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple_seq_add_stmt (&new_seq, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
2009-11-27 14:08:58 +01:00
|
|
|
|
if (!c->type_list)
|
|
|
|
|
break;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple_try_set_cleanup (tp, new_seq);
|
|
|
|
|
|
|
|
|
|
return frob_into_branch_around (tp, try_region, out_label);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* A subroutine of lower_eh_constructs_1. Lower a GIMPLE_TRY with a
|
|
|
|
|
GIMPLE_EH_FILTER to a sequence of labels and blocks, plus the exception
|
2004-05-13 08:41:07 +02:00
|
|
|
|
region trees that record all the magic. */
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
static gimple_seq
|
|
|
|
|
lower_eh_filter (struct leh_state *state, gimple tp)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2009-10-27 21:09:07 +01:00
|
|
|
|
struct leh_state this_state = *state;
|
|
|
|
|
eh_region this_region = NULL;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple inner, x;
|
|
|
|
|
gimple_seq new_seq;
|
2004-08-19 23:34:37 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
inner = gimple_seq_first_stmt (gimple_try_cleanup (tp));
|
|
|
|
|
|
2009-10-27 21:09:07 +01:00
|
|
|
|
if (flag_exceptions)
|
|
|
|
|
{
|
|
|
|
|
this_region = gen_eh_region_allowed (state->cur_region,
|
|
|
|
|
gimple_eh_filter_types (inner));
|
|
|
|
|
this_state.cur_region = this_region;
|
|
|
|
|
}
|
2004-08-19 23:34:37 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-10-27 21:09:07 +01:00
|
|
|
|
if (!eh_region_may_contain_throw (this_region))
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return gimple_try_eval (tp);
|
|
|
|
|
|
|
|
|
|
new_seq = NULL;
|
|
|
|
|
this_state.cur_region = state->cur_region;
|
|
|
|
|
this_state.ehp_region = this_region;
|
|
|
|
|
|
|
|
|
|
emit_eh_dispatch (&new_seq, this_region);
|
|
|
|
|
emit_resx (&new_seq, this_region);
|
|
|
|
|
|
|
|
|
|
this_region->u.allowed.label = create_artificial_label (UNKNOWN_LOCATION);
|
|
|
|
|
x = gimple_build_label (this_region->u.allowed.label);
|
|
|
|
|
gimple_seq_add_stmt (&new_seq, x);
|
|
|
|
|
|
|
|
|
|
lower_eh_constructs_1 (&this_state, gimple_eh_filter_failure (inner));
|
|
|
|
|
gimple_seq_add_seq (&new_seq, gimple_eh_filter_failure (inner));
|
|
|
|
|
|
|
|
|
|
gimple_try_set_cleanup (tp, new_seq);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return frob_into_branch_around (tp, this_region, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A subroutine of lower_eh_constructs_1. Lower a GIMPLE_TRY with
|
|
|
|
|
an GIMPLE_EH_MUST_NOT_THROW to a sequence of labels and blocks,
|
|
|
|
|
plus the exception region trees that record all the magic. */
|
|
|
|
|
|
|
|
|
|
static gimple_seq
|
|
|
|
|
lower_eh_must_not_throw (struct leh_state *state, gimple tp)
|
|
|
|
|
{
|
2009-10-27 21:09:07 +01:00
|
|
|
|
struct leh_state this_state = *state;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
2009-10-27 21:09:07 +01:00
|
|
|
|
if (flag_exceptions)
|
|
|
|
|
{
|
|
|
|
|
gimple inner = gimple_seq_first_stmt (gimple_try_cleanup (tp));
|
|
|
|
|
eh_region this_region;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
2009-10-27 21:09:07 +01:00
|
|
|
|
this_region = gen_eh_region_must_not_throw (state->cur_region);
|
|
|
|
|
this_region->u.must_not_throw.failure_decl
|
|
|
|
|
= gimple_eh_must_not_throw_fndecl (inner);
|
|
|
|
|
this_region->u.must_not_throw.failure_loc = gimple_location (tp);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
2009-10-27 21:09:07 +01:00
|
|
|
|
/* In order to get mangling applied to this decl, we must mark it
|
|
|
|
|
used now. Otherwise, pass_ipa_free_lang_data won't think it
|
|
|
|
|
needs to happen. */
|
|
|
|
|
TREE_USED (this_region->u.must_not_throw.failure_decl) = 1;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
2009-10-27 21:09:07 +01:00
|
|
|
|
this_state.cur_region = this_region;
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return gimple_try_eval (tp);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Implement a cleanup expression. This is similar to try-finally,
|
|
|
|
|
except that we only execute the cleanup block for exception edges. */
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
static gimple_seq
|
|
|
|
|
lower_cleanup (struct leh_state *state, gimple tp)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2009-10-27 21:09:07 +01:00
|
|
|
|
struct leh_state this_state = *state;
|
|
|
|
|
eh_region this_region = NULL;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
struct leh_tf_state fake_tf;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq result;
|
2010-05-21 21:32:29 +02:00
|
|
|
|
bool cleanup_dead = cleanup_is_dead_in (state->cur_region);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2010-05-21 21:32:29 +02:00
|
|
|
|
if (flag_exceptions && !cleanup_dead)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2009-10-27 21:09:07 +01:00
|
|
|
|
this_region = gen_eh_region_cleanup (state->cur_region);
|
|
|
|
|
this_state.cur_region = this_region;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2010-05-21 21:32:29 +02:00
|
|
|
|
if (cleanup_dead || !eh_region_may_contain_throw (this_region))
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return gimple_try_eval (tp);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* Build enough of a try-finally state so that we can reuse
|
|
|
|
|
honor_protect_cleanup_actions. */
|
|
|
|
|
memset (&fake_tf, 0, sizeof (fake_tf));
|
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
2009-06-13 00:06:47 +02:00
|
|
|
|
fake_tf.top_p = fake_tf.try_finally_expr = tp;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
fake_tf.outer = state;
|
|
|
|
|
fake_tf.region = this_region;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
fake_tf.may_fallthru = gimple_seq_may_fallthru (gimple_try_eval (tp));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
fake_tf.may_throw = true;
|
|
|
|
|
|
|
|
|
|
honor_protect_cleanup_actions (state, NULL, &fake_tf);
|
|
|
|
|
|
|
|
|
|
if (fake_tf.may_throw)
|
|
|
|
|
{
|
|
|
|
|
/* In this case honor_protect_cleanup_actions had nothing to do,
|
|
|
|
|
and we should process this normally. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
lower_eh_constructs_1 (state, gimple_try_cleanup (tp));
|
2009-09-14 21:18:58 +02:00
|
|
|
|
result = frob_into_branch_around (tp, this_region,
|
|
|
|
|
fake_tf.fallthru_label);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* In this case honor_protect_cleanup_actions did nearly all of
|
|
|
|
|
the work. All we have left is to append the fallthru_label. */
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
result = gimple_try_eval (tp);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
if (fake_tf.fallthru_label)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple x = gimple_build_label (fake_tf.fallthru_label);
|
|
|
|
|
gimple_seq_add_stmt (&result, x);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
return result;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Main loop for lowering eh constructs. Also moves gsi to the next
|
2008-07-28 16:33:56 +02:00
|
|
|
|
statement. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
lower_eh_constructs_2 (struct leh_state *state, gimple_stmt_iterator *gsi)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq replace;
|
|
|
|
|
gimple x;
|
|
|
|
|
gimple stmt = gsi_stmt (*gsi);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
switch (gimple_code (stmt))
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_CALL:
|
2009-09-14 21:18:58 +02:00
|
|
|
|
{
|
|
|
|
|
tree fndecl = gimple_call_fndecl (stmt);
|
|
|
|
|
tree rhs, lhs;
|
|
|
|
|
|
|
|
|
|
if (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
|
|
|
|
|
switch (DECL_FUNCTION_CODE (fndecl))
|
|
|
|
|
{
|
|
|
|
|
case BUILT_IN_EH_POINTER:
|
|
|
|
|
/* The front end may have generated a call to
|
|
|
|
|
__builtin_eh_pointer (0) within a catch region. Replace
|
|
|
|
|
this zero argument with the current catch region number. */
|
|
|
|
|
if (state->ehp_region)
|
|
|
|
|
{
|
|
|
|
|
tree nr = build_int_cst (NULL, state->ehp_region->index);
|
|
|
|
|
gimple_call_set_arg (stmt, 0, nr);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* The user has dome something silly. Remove it. */
|
2010-07-15 20:47:23 +02:00
|
|
|
|
rhs = null_pointer_node;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
goto do_replace;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case BUILT_IN_EH_FILTER:
|
|
|
|
|
/* ??? This should never appear, but since it's a builtin it
|
|
|
|
|
is accessible to abuse by users. Just remove it and
|
|
|
|
|
replace the use with the arbitrary value zero. */
|
|
|
|
|
rhs = build_int_cst (TREE_TYPE (TREE_TYPE (fndecl)), 0);
|
|
|
|
|
do_replace:
|
|
|
|
|
lhs = gimple_call_lhs (stmt);
|
|
|
|
|
x = gimple_build_assign (lhs, rhs);
|
|
|
|
|
gsi_insert_before (gsi, x, GSI_SAME_STMT);
|
|
|
|
|
/* FALLTHRU */
|
|
|
|
|
|
|
|
|
|
case BUILT_IN_EH_COPY_VALUES:
|
|
|
|
|
/* Likewise this should not appear. Remove it. */
|
|
|
|
|
gsi_remove (gsi, true);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* FALLTHRU */
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_ASSIGN:
|
2009-03-31 12:23:44 +02:00
|
|
|
|
/* If the stmt can throw use a new temporary for the assignment
|
|
|
|
|
to a LHS. This makes sure the old value of the LHS is
|
2009-11-26 16:54:07 +01:00
|
|
|
|
available on the EH edge. Only do so for statements that
|
|
|
|
|
potentially fall thru (no noreturn calls e.g.), otherwise
|
|
|
|
|
this new assignment might create fake fallthru regions. */
|
2009-03-31 12:23:44 +02:00
|
|
|
|
if (stmt_could_throw_p (stmt)
|
|
|
|
|
&& gimple_has_lhs (stmt)
|
2009-11-26 16:54:07 +01:00
|
|
|
|
&& gimple_stmt_may_fallthru (stmt)
|
2009-03-31 12:23:44 +02:00
|
|
|
|
&& !tree_could_throw_p (gimple_get_lhs (stmt))
|
|
|
|
|
&& is_gimple_reg_type (TREE_TYPE (gimple_get_lhs (stmt))))
|
|
|
|
|
{
|
|
|
|
|
tree lhs = gimple_get_lhs (stmt);
|
|
|
|
|
tree tmp = create_tmp_var (TREE_TYPE (lhs), NULL);
|
|
|
|
|
gimple s = gimple_build_assign (lhs, tmp);
|
|
|
|
|
gimple_set_location (s, gimple_location (stmt));
|
|
|
|
|
gimple_set_block (s, gimple_block (stmt));
|
|
|
|
|
gimple_set_lhs (stmt, tmp);
|
|
|
|
|
if (TREE_CODE (TREE_TYPE (tmp)) == COMPLEX_TYPE
|
|
|
|
|
|| TREE_CODE (TREE_TYPE (tmp)) == VECTOR_TYPE)
|
|
|
|
|
DECL_GIMPLE_REG_P (tmp) = 1;
|
|
|
|
|
gsi_insert_after (gsi, s, GSI_SAME_STMT);
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
/* Look for things that can throw exceptions, and record them. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
if (state->cur_region && stmt_could_throw_p (stmt))
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
record_stmt_eh_region (state->cur_region, stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
note_eh_region_may_contain_throw (state->cur_region);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_COND:
|
|
|
|
|
case GIMPLE_GOTO:
|
|
|
|
|
case GIMPLE_RETURN:
|
|
|
|
|
maybe_record_in_goto_queue (state, stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_SWITCH:
|
|
|
|
|
verify_norecord_switch_expr (state, stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
break;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_TRY:
|
|
|
|
|
if (gimple_try_kind (stmt) == GIMPLE_TRY_FINALLY)
|
|
|
|
|
replace = lower_try_finally (state, stmt);
|
|
|
|
|
else
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
x = gimple_seq_first_stmt (gimple_try_cleanup (stmt));
|
re PR middle-end/41573 (segfault in trunk related to strings)
PR middle-end/41573
* builtins.c (fold_builtin_isascii): Use fold_build2.
(fold_builtin_isdigit): Ditto.
* except.c (duplicate_eh_regions_1): Tolerate NULL labels.
* tree-cfg.c (struct rus_data, remove_useless_stmts_warn_notreached,
remove_useless_stmts_cond, remove_useless_stmts_tf,
remove_useless_stmts_tc, remove_useless_stmts_bind,
remove_useless_stmts_goto, remove_useless_stmts_label,
remove_useless_stmts_1, remove_useless_stmts,
pass_remove_useless_stmts): Remove.
* tree-pass.h (pass_remove_useless_stmts): Don't declare.
* passes.c (init_optimization_passes): Don't add
pass_remove_useless_stmts.
* tree-eh.c (lower_eh_constructs_2): Handle empty cleanups.
* tree.c (free_lang_data_in_decl): Don't clear DECL_INITIAL of
static constants.
* lto-symtab.c (lto_symtab_register_decl): Accepts DECL_INITIAL
for static constants.
* lto-streamer-out.c (output_gimple_stmt): Handle GIMPLE_NOP.
* lto-streamer-in.c (input_gimple_stmt): Handle GIMPLE_NOP.
testsuite/
* gcc.dg/tree-ssa/foldstring-1.c: Use fre dump.
* gcc.dg/tree-ssa/useless-1.c: Use gimple dump.
* gcc.dg/pr41573.c: New test.
From-SVN: r152563
2009-10-08 18:03:11 +02:00
|
|
|
|
if (!x)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
re PR middle-end/41573 (segfault in trunk related to strings)
PR middle-end/41573
* builtins.c (fold_builtin_isascii): Use fold_build2.
(fold_builtin_isdigit): Ditto.
* except.c (duplicate_eh_regions_1): Tolerate NULL labels.
* tree-cfg.c (struct rus_data, remove_useless_stmts_warn_notreached,
remove_useless_stmts_cond, remove_useless_stmts_tf,
remove_useless_stmts_tc, remove_useless_stmts_bind,
remove_useless_stmts_goto, remove_useless_stmts_label,
remove_useless_stmts_1, remove_useless_stmts,
pass_remove_useless_stmts): Remove.
* tree-pass.h (pass_remove_useless_stmts): Don't declare.
* passes.c (init_optimization_passes): Don't add
pass_remove_useless_stmts.
* tree-eh.c (lower_eh_constructs_2): Handle empty cleanups.
* tree.c (free_lang_data_in_decl): Don't clear DECL_INITIAL of
static constants.
* lto-symtab.c (lto_symtab_register_decl): Accepts DECL_INITIAL
for static constants.
* lto-streamer-out.c (output_gimple_stmt): Handle GIMPLE_NOP.
* lto-streamer-in.c (input_gimple_stmt): Handle GIMPLE_NOP.
testsuite/
* gcc.dg/tree-ssa/foldstring-1.c: Use fre dump.
* gcc.dg/tree-ssa/useless-1.c: Use gimple dump.
* gcc.dg/pr41573.c: New test.
From-SVN: r152563
2009-10-08 18:03:11 +02:00
|
|
|
|
replace = gimple_try_eval (stmt);
|
|
|
|
|
lower_eh_constructs_1 (state, replace);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
re PR middle-end/41573 (segfault in trunk related to strings)
PR middle-end/41573
* builtins.c (fold_builtin_isascii): Use fold_build2.
(fold_builtin_isdigit): Ditto.
* except.c (duplicate_eh_regions_1): Tolerate NULL labels.
* tree-cfg.c (struct rus_data, remove_useless_stmts_warn_notreached,
remove_useless_stmts_cond, remove_useless_stmts_tf,
remove_useless_stmts_tc, remove_useless_stmts_bind,
remove_useless_stmts_goto, remove_useless_stmts_label,
remove_useless_stmts_1, remove_useless_stmts,
pass_remove_useless_stmts): Remove.
* tree-pass.h (pass_remove_useless_stmts): Don't declare.
* passes.c (init_optimization_passes): Don't add
pass_remove_useless_stmts.
* tree-eh.c (lower_eh_constructs_2): Handle empty cleanups.
* tree.c (free_lang_data_in_decl): Don't clear DECL_INITIAL of
static constants.
* lto-symtab.c (lto_symtab_register_decl): Accepts DECL_INITIAL
for static constants.
* lto-streamer-out.c (output_gimple_stmt): Handle GIMPLE_NOP.
* lto-streamer-in.c (input_gimple_stmt): Handle GIMPLE_NOP.
testsuite/
* gcc.dg/tree-ssa/foldstring-1.c: Use fre dump.
* gcc.dg/tree-ssa/useless-1.c: Use gimple dump.
* gcc.dg/pr41573.c: New test.
From-SVN: r152563
2009-10-08 18:03:11 +02:00
|
|
|
|
else
|
|
|
|
|
switch (gimple_code (x))
|
|
|
|
|
{
|
|
|
|
|
case GIMPLE_CATCH:
|
|
|
|
|
replace = lower_catch (state, stmt);
|
|
|
|
|
break;
|
|
|
|
|
case GIMPLE_EH_FILTER:
|
|
|
|
|
replace = lower_eh_filter (state, stmt);
|
|
|
|
|
break;
|
|
|
|
|
case GIMPLE_EH_MUST_NOT_THROW:
|
|
|
|
|
replace = lower_eh_must_not_throw (state, stmt);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
replace = lower_cleanup (state, stmt);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
|
|
/* Remove the old stmt and insert the transformed sequence
|
|
|
|
|
instead. */
|
|
|
|
|
gsi_insert_seq_before (gsi, replace, GSI_SAME_STMT);
|
|
|
|
|
gsi_remove (gsi, true);
|
|
|
|
|
|
|
|
|
|
/* Return since we don't want gsi_next () */
|
|
|
|
|
return;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
/* A type, a decl, or some kind of statement that we're not
|
|
|
|
|
interested in. Don't walk them. */
|
|
|
|
|
break;
|
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
|
|
gsi_next (gsi);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A helper to unwrap a gimple_seq and feed stmts to lower_eh_constructs_2. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
lower_eh_constructs_1 (struct leh_state *state, gimple_seq seq)
|
|
|
|
|
{
|
|
|
|
|
gimple_stmt_iterator gsi;
|
|
|
|
|
for (gsi = gsi_start (seq); !gsi_end_p (gsi);)
|
|
|
|
|
lower_eh_constructs_2 (state, &gsi);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2006-03-02 20:00:11 +01:00
|
|
|
|
static unsigned int
|
2004-05-13 08:41:07 +02:00
|
|
|
|
lower_eh_constructs (void)
|
|
|
|
|
{
|
|
|
|
|
struct leh_state null_state;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple_seq bodyp;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
bodyp = gimple_body (current_function_decl);
|
|
|
|
|
if (bodyp == NULL)
|
|
|
|
|
return 0;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
finally_tree = htab_create (31, struct_ptr_hash, struct_ptr_eq, free);
|
2009-10-27 21:09:07 +01:00
|
|
|
|
eh_region_may_contain_throw_map = BITMAP_ALLOC (NULL);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
memset (&null_state, 0, sizeof (null_state));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
collect_finally_tree_1 (bodyp, NULL);
|
|
|
|
|
lower_eh_constructs_1 (&null_state, bodyp);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* We assume there's a return statement, or something, at the end of
|
|
|
|
|
the function, and thus ploping the EH sequence afterward won't
|
|
|
|
|
change anything. */
|
|
|
|
|
gcc_assert (!gimple_seq_may_fallthru (bodyp));
|
|
|
|
|
gimple_seq_add_seq (&bodyp, eh_seq);
|
|
|
|
|
|
|
|
|
|
/* We assume that since BODYP already existed, adding EH_SEQ to it
|
|
|
|
|
didn't change its value, and we don't have to re-set the function. */
|
|
|
|
|
gcc_assert (bodyp == gimple_body (current_function_decl));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
htab_delete (finally_tree);
|
2009-10-27 21:09:07 +01:00
|
|
|
|
BITMAP_FREE (eh_region_may_contain_throw_map);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
eh_seq = NULL;
|
2009-09-13 21:40:33 +02:00
|
|
|
|
|
|
|
|
|
/* If this function needs a language specific EH personality routine
|
|
|
|
|
and the frontend didn't already set one do so now. */
|
|
|
|
|
if (function_needs_eh_personality (cfun) == eh_personality_lang
|
|
|
|
|
&& !DECL_FUNCTION_PERSONALITY (current_function_decl))
|
|
|
|
|
DECL_FUNCTION_PERSONALITY (current_function_decl)
|
|
|
|
|
= lang_hooks.eh_personality ();
|
|
|
|
|
|
2006-03-02 20:00:11 +01:00
|
|
|
|
return 0;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
re PR other/35094 (RTL dump file letters hosed and partly undocumented)
* gcc.dg/20050811-2.c: Update dumping flags.
* gcc.dg/sms-2.c: Update dumping flags.
* gcc.dg/var-expand1.c: Update dumping flags.
* gcc.dg/var-expand3.c: Update dumping flags.
* gcc.dg/pr30957-1.c: Update dumping flags.
* gcc.dg/20050811-1.c: Update dumping flags.
* gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail.
* gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail.
PR other/35094
* toplev.c (decode_d_option): Handle all CPP flags.
* tree-vrp.c: Update tree_pass descriptors.
* regrename.c: Update tree_pass descriptors.
* fwprop.c: Update tree_pass descriptors.
* doc/invoke.texi: Remove documentation of dropped -d? flags.
* tree-into-ssa.c: Update tree_pass descriptors.
* tree-dump.c: Update tree_pass descriptors.
* tree-complex.c: Update tree_pass descriptors.
* tree-dump.h: Update tree_pass descriptors.
* see.c: Update tree_pass descriptors.
* cgraphbuild.c: Update tree_pass descriptors.
* tracer.c: Update tree_pass descriptors.
* tree-loop-distribution.c: Update tree_pass descriptors.
* cgraph.c: Update tree_pass descriptors.
* postreload-gcse.c: Update tree_pass descriptors.
* postreload.c: Update tree_pass descriptors.
* tree-ssa-loop-ch.c: Update tree_pass descriptors.
* tree-tailcall.c: Update tree_pass descriptors.
* tree-pass.h (tree_opt_pass): Rename to ...
(opt_pass) ... this one; add "type" field and remove letter field.
(gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New.
(execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes,
all_lowering_passes): Update declaration.
* ipa-cp.c: Update tree_pass descriptors.
* final.c: Update tree_pass descriptors.
* omp-low.c: Update tree_pass descriptors.
* tree-ssa-dse.c: Update tree_pass descriptors.
* ipa-reference.c: Update tree_pass descriptors.
* tree-ssa-uncprop.c: Update tree_pass descriptors.
* auto-inc-dec.c: Update tree_pass descriptors.
* reorg.c: Update tree_pass descriptors.
* cgraphunit.c: Update tree_pass descriptors.
* tree-ssa-copyrename.c: Update tree_pass descriptors.
* tree-ssa-ccp.c: Update tree_pass descriptors.
* df-core.c: Update tree_pass descriptors.
* mode-switching.c: Update tree_pass descriptors.
* tree-nomudflap.c: Update tree_pass descriptors.
* modulo-sched.c: Update tree_pass descriptors.
* ipa-pure-const.c: Update tree_pass descriptors.
* cse.c: Update tree_pass descriptors.
* web.c: Update tree_pass descriptors.
* tree-stdarg.c: Update tree_pass descriptors.
* tree-ssa-math-opts.c: Update tree_pass descriptors.
* tree-ssa-dom.c: Update tree_pass descriptors.
* tree-nrv.c: Update tree_pass descriptors.
* tree-ssa-alias.c: Update tree_pass descriptors.
* loop-init.c: Update tree_pass descriptors.
* gimple-low.c: Update tree_pass descriptors.
* ipa-inline.c: Update tree_pass descriptors.
* tree-ssa-sink.c: Update tree_pass descriptors.
* global.c: Update tree_pass descriptors.
* ifcvt.c: Update tree_pass descriptors.
* jump.c: Update tree_pass descriptors.
* predict.c: Update tree_pass descriptors.
* tree-ssa-loop.c: Update tree_pass descriptors.
* recog.c: Update tree_pass descriptors.
* dse.c: Update tree_pass descriptors.
* tree-ssa-ifcombine.c: Update tree_pass descriptors.
* tree-eh.c: Update tree_pass descriptors.
* regmove.c: Update tree_pass descriptors.
* local-alloc.c
* function.c: Update tree_pass descriptors.
* tree-vectorizer.c: Update tree_pass descriptors.
* gcse.c: Update tree_pass descriptors.
* ipa-type-escape.c: Update tree_pass descriptors.
* tree-if-conv.c: Update tree_pass descriptors.
* init-regs.c: Update tree_pass descriptors.
* ipa.c: Update tree_pass descriptors.
* tree-ssa-phiopt.c: Update tree_pass descriptors.
* rtl-factoring.c: Update tree_pass descriptors.
* lower-subreg.c: Update tree_pass descriptors.
* bt-load.c: Update tree_pass descriptors.
* tree-dfa.c: Update tree_pass descriptors.
* except.c: Update tree_pass descriptors.
* emit-rtl.c: Update tree_pass descriptors.
* cfgexpand.c: Update tree_pass descriptors.
* tree-cfgcleanup.c: Update tree_pass descriptors.
* cfgcleanup.c: Update tree_pass descriptors.
* tree-ssa-pre.c: Update tree_pass descriptors.
* tree-sra.c: Update tree_pass descriptors.
* tree-mudflap.c: Update tree_pass descriptors.
* tree-ssa-copy.c: Update tree_pass descriptors.
* cfglayout.c: Update tree_pass descriptors.
* tree-ssa-forwprop.c: Update tree_pass descriptors.
* tree-ssa-dce.c: Update tree_pass descriptors.
* tree-ssa.c: Update tree_pass descriptors.
* regclass.c: Update tree_pass descriptors.
* integrate.c: Update tree_pass descriptors.
* tree-optimize.c: Update tree_pass descriptors.
* tree-ssa-phiprop.c: Update tree_pass descriptors.
* tree-object-size.c: Update tree_pass descriptors.
* combine.c: Update tree_pass descriptors.
* tree-outof-ssa.c: Update tree_pass descriptors.
* bb-reorder.c: Update tree_pass descriptors.
* stack-ptr-mod.c: Update tree_pass descriptors.
* var-tracking.c: Update tree_pass descriptors.
* tree-profile.c: Update tree_pass descriptors.
* tree-vect-generic.c: Update tree_pass descriptors.
* reg-stack.c: Update tree_pass descriptors.
* sched-rgn.c: Update tree_pass descriptors.
* tree-ssa-structalias.c: Update tree_pass descriptors.
* tree-cfg.c: Update tree_pass descriptors.
* passes.c (current_pass): Update declaration.
(finish_optimization_passes): Update.
(all_passes, all_ipa_passes, all_lowering_passes): Update declaration.
(register_one_dump_file, register_dump_files_1, next_pass_1):
Update arguments.
(init_optimization_passes): Update handling of new types.
(execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update.
* ipa-struct-reorg.c: Update tree_pass descriptors.
* tree-ssa-reassoc.c: Update tree_pass descriptors.
* combine-stack-adj.c: Update tree_pass descriptors.
* cfgrtl.c: Update tree_pass descriptors.
* dce.c: Update tree_pass descriptors.
* tree-ssanames.c: Update tree_pass descriptors.
From-SVN: r133342
2008-03-19 12:22:40 +01:00
|
|
|
|
struct gimple_opt_pass pass_lower_eh =
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
re PR other/35094 (RTL dump file letters hosed and partly undocumented)
* gcc.dg/20050811-2.c: Update dumping flags.
* gcc.dg/sms-2.c: Update dumping flags.
* gcc.dg/var-expand1.c: Update dumping flags.
* gcc.dg/var-expand3.c: Update dumping flags.
* gcc.dg/pr30957-1.c: Update dumping flags.
* gcc.dg/20050811-1.c: Update dumping flags.
* gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail.
* gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail.
PR other/35094
* toplev.c (decode_d_option): Handle all CPP flags.
* tree-vrp.c: Update tree_pass descriptors.
* regrename.c: Update tree_pass descriptors.
* fwprop.c: Update tree_pass descriptors.
* doc/invoke.texi: Remove documentation of dropped -d? flags.
* tree-into-ssa.c: Update tree_pass descriptors.
* tree-dump.c: Update tree_pass descriptors.
* tree-complex.c: Update tree_pass descriptors.
* tree-dump.h: Update tree_pass descriptors.
* see.c: Update tree_pass descriptors.
* cgraphbuild.c: Update tree_pass descriptors.
* tracer.c: Update tree_pass descriptors.
* tree-loop-distribution.c: Update tree_pass descriptors.
* cgraph.c: Update tree_pass descriptors.
* postreload-gcse.c: Update tree_pass descriptors.
* postreload.c: Update tree_pass descriptors.
* tree-ssa-loop-ch.c: Update tree_pass descriptors.
* tree-tailcall.c: Update tree_pass descriptors.
* tree-pass.h (tree_opt_pass): Rename to ...
(opt_pass) ... this one; add "type" field and remove letter field.
(gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New.
(execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes,
all_lowering_passes): Update declaration.
* ipa-cp.c: Update tree_pass descriptors.
* final.c: Update tree_pass descriptors.
* omp-low.c: Update tree_pass descriptors.
* tree-ssa-dse.c: Update tree_pass descriptors.
* ipa-reference.c: Update tree_pass descriptors.
* tree-ssa-uncprop.c: Update tree_pass descriptors.
* auto-inc-dec.c: Update tree_pass descriptors.
* reorg.c: Update tree_pass descriptors.
* cgraphunit.c: Update tree_pass descriptors.
* tree-ssa-copyrename.c: Update tree_pass descriptors.
* tree-ssa-ccp.c: Update tree_pass descriptors.
* df-core.c: Update tree_pass descriptors.
* mode-switching.c: Update tree_pass descriptors.
* tree-nomudflap.c: Update tree_pass descriptors.
* modulo-sched.c: Update tree_pass descriptors.
* ipa-pure-const.c: Update tree_pass descriptors.
* cse.c: Update tree_pass descriptors.
* web.c: Update tree_pass descriptors.
* tree-stdarg.c: Update tree_pass descriptors.
* tree-ssa-math-opts.c: Update tree_pass descriptors.
* tree-ssa-dom.c: Update tree_pass descriptors.
* tree-nrv.c: Update tree_pass descriptors.
* tree-ssa-alias.c: Update tree_pass descriptors.
* loop-init.c: Update tree_pass descriptors.
* gimple-low.c: Update tree_pass descriptors.
* ipa-inline.c: Update tree_pass descriptors.
* tree-ssa-sink.c: Update tree_pass descriptors.
* global.c: Update tree_pass descriptors.
* ifcvt.c: Update tree_pass descriptors.
* jump.c: Update tree_pass descriptors.
* predict.c: Update tree_pass descriptors.
* tree-ssa-loop.c: Update tree_pass descriptors.
* recog.c: Update tree_pass descriptors.
* dse.c: Update tree_pass descriptors.
* tree-ssa-ifcombine.c: Update tree_pass descriptors.
* tree-eh.c: Update tree_pass descriptors.
* regmove.c: Update tree_pass descriptors.
* local-alloc.c
* function.c: Update tree_pass descriptors.
* tree-vectorizer.c: Update tree_pass descriptors.
* gcse.c: Update tree_pass descriptors.
* ipa-type-escape.c: Update tree_pass descriptors.
* tree-if-conv.c: Update tree_pass descriptors.
* init-regs.c: Update tree_pass descriptors.
* ipa.c: Update tree_pass descriptors.
* tree-ssa-phiopt.c: Update tree_pass descriptors.
* rtl-factoring.c: Update tree_pass descriptors.
* lower-subreg.c: Update tree_pass descriptors.
* bt-load.c: Update tree_pass descriptors.
* tree-dfa.c: Update tree_pass descriptors.
* except.c: Update tree_pass descriptors.
* emit-rtl.c: Update tree_pass descriptors.
* cfgexpand.c: Update tree_pass descriptors.
* tree-cfgcleanup.c: Update tree_pass descriptors.
* cfgcleanup.c: Update tree_pass descriptors.
* tree-ssa-pre.c: Update tree_pass descriptors.
* tree-sra.c: Update tree_pass descriptors.
* tree-mudflap.c: Update tree_pass descriptors.
* tree-ssa-copy.c: Update tree_pass descriptors.
* cfglayout.c: Update tree_pass descriptors.
* tree-ssa-forwprop.c: Update tree_pass descriptors.
* tree-ssa-dce.c: Update tree_pass descriptors.
* tree-ssa.c: Update tree_pass descriptors.
* regclass.c: Update tree_pass descriptors.
* integrate.c: Update tree_pass descriptors.
* tree-optimize.c: Update tree_pass descriptors.
* tree-ssa-phiprop.c: Update tree_pass descriptors.
* tree-object-size.c: Update tree_pass descriptors.
* combine.c: Update tree_pass descriptors.
* tree-outof-ssa.c: Update tree_pass descriptors.
* bb-reorder.c: Update tree_pass descriptors.
* stack-ptr-mod.c: Update tree_pass descriptors.
* var-tracking.c: Update tree_pass descriptors.
* tree-profile.c: Update tree_pass descriptors.
* tree-vect-generic.c: Update tree_pass descriptors.
* reg-stack.c: Update tree_pass descriptors.
* sched-rgn.c: Update tree_pass descriptors.
* tree-ssa-structalias.c: Update tree_pass descriptors.
* tree-cfg.c: Update tree_pass descriptors.
* passes.c (current_pass): Update declaration.
(finish_optimization_passes): Update.
(all_passes, all_ipa_passes, all_lowering_passes): Update declaration.
(register_one_dump_file, register_dump_files_1, next_pass_1):
Update arguments.
(init_optimization_passes): Update handling of new types.
(execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update.
* ipa-struct-reorg.c: Update tree_pass descriptors.
* tree-ssa-reassoc.c: Update tree_pass descriptors.
* combine-stack-adj.c: Update tree_pass descriptors.
* cfgrtl.c: Update tree_pass descriptors.
* dce.c: Update tree_pass descriptors.
* tree-ssanames.c: Update tree_pass descriptors.
From-SVN: r133342
2008-03-19 12:22:40 +01:00
|
|
|
|
{
|
|
|
|
|
GIMPLE_PASS,
|
2004-05-13 08:41:07 +02:00
|
|
|
|
"eh", /* name */
|
|
|
|
|
NULL, /* gate */
|
|
|
|
|
lower_eh_constructs, /* execute */
|
|
|
|
|
NULL, /* sub */
|
|
|
|
|
NULL, /* next */
|
|
|
|
|
0, /* static_pass_number */
|
|
|
|
|
TV_TREE_EH, /* tv_id */
|
|
|
|
|
PROP_gimple_lcf, /* properties_required */
|
|
|
|
|
PROP_gimple_leh, /* properties_provided */
|
2006-02-08 09:13:20 +01:00
|
|
|
|
0, /* properties_destroyed */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
0, /* todo_flags_start */
|
re PR other/35094 (RTL dump file letters hosed and partly undocumented)
* gcc.dg/20050811-2.c: Update dumping flags.
* gcc.dg/sms-2.c: Update dumping flags.
* gcc.dg/var-expand1.c: Update dumping flags.
* gcc.dg/var-expand3.c: Update dumping flags.
* gcc.dg/pr30957-1.c: Update dumping flags.
* gcc.dg/20050811-1.c: Update dumping flags.
* gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail.
* gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail.
PR other/35094
* toplev.c (decode_d_option): Handle all CPP flags.
* tree-vrp.c: Update tree_pass descriptors.
* regrename.c: Update tree_pass descriptors.
* fwprop.c: Update tree_pass descriptors.
* doc/invoke.texi: Remove documentation of dropped -d? flags.
* tree-into-ssa.c: Update tree_pass descriptors.
* tree-dump.c: Update tree_pass descriptors.
* tree-complex.c: Update tree_pass descriptors.
* tree-dump.h: Update tree_pass descriptors.
* see.c: Update tree_pass descriptors.
* cgraphbuild.c: Update tree_pass descriptors.
* tracer.c: Update tree_pass descriptors.
* tree-loop-distribution.c: Update tree_pass descriptors.
* cgraph.c: Update tree_pass descriptors.
* postreload-gcse.c: Update tree_pass descriptors.
* postreload.c: Update tree_pass descriptors.
* tree-ssa-loop-ch.c: Update tree_pass descriptors.
* tree-tailcall.c: Update tree_pass descriptors.
* tree-pass.h (tree_opt_pass): Rename to ...
(opt_pass) ... this one; add "type" field and remove letter field.
(gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New.
(execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes,
all_lowering_passes): Update declaration.
* ipa-cp.c: Update tree_pass descriptors.
* final.c: Update tree_pass descriptors.
* omp-low.c: Update tree_pass descriptors.
* tree-ssa-dse.c: Update tree_pass descriptors.
* ipa-reference.c: Update tree_pass descriptors.
* tree-ssa-uncprop.c: Update tree_pass descriptors.
* auto-inc-dec.c: Update tree_pass descriptors.
* reorg.c: Update tree_pass descriptors.
* cgraphunit.c: Update tree_pass descriptors.
* tree-ssa-copyrename.c: Update tree_pass descriptors.
* tree-ssa-ccp.c: Update tree_pass descriptors.
* df-core.c: Update tree_pass descriptors.
* mode-switching.c: Update tree_pass descriptors.
* tree-nomudflap.c: Update tree_pass descriptors.
* modulo-sched.c: Update tree_pass descriptors.
* ipa-pure-const.c: Update tree_pass descriptors.
* cse.c: Update tree_pass descriptors.
* web.c: Update tree_pass descriptors.
* tree-stdarg.c: Update tree_pass descriptors.
* tree-ssa-math-opts.c: Update tree_pass descriptors.
* tree-ssa-dom.c: Update tree_pass descriptors.
* tree-nrv.c: Update tree_pass descriptors.
* tree-ssa-alias.c: Update tree_pass descriptors.
* loop-init.c: Update tree_pass descriptors.
* gimple-low.c: Update tree_pass descriptors.
* ipa-inline.c: Update tree_pass descriptors.
* tree-ssa-sink.c: Update tree_pass descriptors.
* global.c: Update tree_pass descriptors.
* ifcvt.c: Update tree_pass descriptors.
* jump.c: Update tree_pass descriptors.
* predict.c: Update tree_pass descriptors.
* tree-ssa-loop.c: Update tree_pass descriptors.
* recog.c: Update tree_pass descriptors.
* dse.c: Update tree_pass descriptors.
* tree-ssa-ifcombine.c: Update tree_pass descriptors.
* tree-eh.c: Update tree_pass descriptors.
* regmove.c: Update tree_pass descriptors.
* local-alloc.c
* function.c: Update tree_pass descriptors.
* tree-vectorizer.c: Update tree_pass descriptors.
* gcse.c: Update tree_pass descriptors.
* ipa-type-escape.c: Update tree_pass descriptors.
* tree-if-conv.c: Update tree_pass descriptors.
* init-regs.c: Update tree_pass descriptors.
* ipa.c: Update tree_pass descriptors.
* tree-ssa-phiopt.c: Update tree_pass descriptors.
* rtl-factoring.c: Update tree_pass descriptors.
* lower-subreg.c: Update tree_pass descriptors.
* bt-load.c: Update tree_pass descriptors.
* tree-dfa.c: Update tree_pass descriptors.
* except.c: Update tree_pass descriptors.
* emit-rtl.c: Update tree_pass descriptors.
* cfgexpand.c: Update tree_pass descriptors.
* tree-cfgcleanup.c: Update tree_pass descriptors.
* cfgcleanup.c: Update tree_pass descriptors.
* tree-ssa-pre.c: Update tree_pass descriptors.
* tree-sra.c: Update tree_pass descriptors.
* tree-mudflap.c: Update tree_pass descriptors.
* tree-ssa-copy.c: Update tree_pass descriptors.
* cfglayout.c: Update tree_pass descriptors.
* tree-ssa-forwprop.c: Update tree_pass descriptors.
* tree-ssa-dce.c: Update tree_pass descriptors.
* tree-ssa.c: Update tree_pass descriptors.
* regclass.c: Update tree_pass descriptors.
* integrate.c: Update tree_pass descriptors.
* tree-optimize.c: Update tree_pass descriptors.
* tree-ssa-phiprop.c: Update tree_pass descriptors.
* tree-object-size.c: Update tree_pass descriptors.
* combine.c: Update tree_pass descriptors.
* tree-outof-ssa.c: Update tree_pass descriptors.
* bb-reorder.c: Update tree_pass descriptors.
* stack-ptr-mod.c: Update tree_pass descriptors.
* var-tracking.c: Update tree_pass descriptors.
* tree-profile.c: Update tree_pass descriptors.
* tree-vect-generic.c: Update tree_pass descriptors.
* reg-stack.c: Update tree_pass descriptors.
* sched-rgn.c: Update tree_pass descriptors.
* tree-ssa-structalias.c: Update tree_pass descriptors.
* tree-cfg.c: Update tree_pass descriptors.
* passes.c (current_pass): Update declaration.
(finish_optimization_passes): Update.
(all_passes, all_ipa_passes, all_lowering_passes): Update declaration.
(register_one_dump_file, register_dump_files_1, next_pass_1):
Update arguments.
(init_optimization_passes): Update handling of new types.
(execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update.
* ipa-struct-reorg.c: Update tree_pass descriptors.
* tree-ssa-reassoc.c: Update tree_pass descriptors.
* combine-stack-adj.c: Update tree_pass descriptors.
* cfgrtl.c: Update tree_pass descriptors.
* dce.c: Update tree_pass descriptors.
* tree-ssanames.c: Update tree_pass descriptors.
From-SVN: r133342
2008-03-19 12:22:40 +01:00
|
|
|
|
TODO_dump_func /* todo_flags_finish */
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
};
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Create the multiple edges from an EH_DISPATCH statement to all of
|
|
|
|
|
the possible handlers for its EH region. Return true if there's
|
|
|
|
|
no fallthru edge; false if there is. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
bool
|
|
|
|
|
make_eh_dispatch_edges (gimple stmt)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
eh_region r;
|
|
|
|
|
eh_catch c;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
basic_block src, dst;
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
r = get_eh_region_from_number (gimple_eh_dispatch_region (stmt));
|
2008-07-28 16:33:56 +02:00
|
|
|
|
src = gimple_bb (stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
switch (r->type)
|
|
|
|
|
{
|
|
|
|
|
case ERT_TRY:
|
|
|
|
|
for (c = r->u.eh_try.first_catch; c ; c = c->next_catch)
|
|
|
|
|
{
|
|
|
|
|
dst = label_to_block (c->label);
|
|
|
|
|
make_edge (src, dst, 0);
|
2004-08-19 23:34:37 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* A catch-all handler doesn't have a fallthru. */
|
|
|
|
|
if (c->type_list == NULL)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
break;
|
2009-03-28 10:08:52 +01:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
case ERT_ALLOWED_EXCEPTIONS:
|
|
|
|
|
dst = label_to_block (r->u.allowed.label);
|
|
|
|
|
make_edge (src, dst, 0);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
gcc_unreachable ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
2009-03-28 10:08:52 +01:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Create the single EH edge from STMT to its nearest landing pad,
|
|
|
|
|
if there is such a landing pad within the current function. */
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
make_eh_edges (gimple stmt)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
basic_block src, dst;
|
|
|
|
|
eh_landing_pad lp;
|
|
|
|
|
int lp_nr;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
lp_nr = lookup_stmt_eh_lp (stmt);
|
|
|
|
|
if (lp_nr <= 0)
|
|
|
|
|
return;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
lp = get_eh_landing_pad_from_number (lp_nr);
|
|
|
|
|
gcc_assert (lp != NULL);
|
2009-03-31 00:35:22 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
src = gimple_bb (stmt);
|
|
|
|
|
dst = label_to_block (lp->post_landing_pad);
|
|
|
|
|
make_edge (src, dst, EDGE_EH);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Do the work in redirecting EDGE_IN to NEW_BB within the EH region tree;
|
|
|
|
|
do not actually perform the final edge redirection.
|
tree.c (list_equal_p): New function.
* tree.c (list_equal_p): New function.
* tree.h (list_equal_p): Declare.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): New.
* tree-eh.c (make_eh_edge): EH edges are not abnormal.
(redirect_eh_edge): New function.
(make_eh_edge_update_phi): EH edges are not abnormal.
* except.c: Include tree-flow.h.
(list_match): New function.
(eh_region_replaceable_by_p): New function.
(replace_region): New function.
(hash_type_list): New function.
(hash_eh_region): New function.
(eh_regions_equal_p): New function.
(merge_peers): New function.
(remove_unreachable_regions): Verify EH tree when checking;
merge peers.
(copy_eh_region_1): New function.
(copy_eh_region): New function.
(push_reachable_handler): New function.
(build_post_landing_pads, dw2_build_landing_pads): Be ready for
regions without label but with live RESX.
* except.h (redirect_eh_edge_to_label): New.
* tree-flow.h (redirect_eh_edge): New.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): Remove.
* Makefile.in (except.o): Add dependency on tree-flow.h
* tree-cfg.c (gimple_redirect_edge_and_branch): Handle EH edges.
* basic-block.h (edge, const_edge, basic_block, const_basic_block):
Remove.
From-SVN: r146776
2009-04-25 20:27:19 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
CHANGE_REGION is true when we're being called from cleanup_empty_eh and
|
|
|
|
|
we intend to change the destination EH region as well; this means
|
|
|
|
|
EH_LANDING_PAD_NR must already be set on the destination block label.
|
|
|
|
|
If false, we're being called from generic cfg manipulation code and we
|
|
|
|
|
should preserve our place within the region tree. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
redirect_eh_edge_1 (edge edge_in, basic_block new_bb, bool change_region)
|
tree.c (list_equal_p): New function.
* tree.c (list_equal_p): New function.
* tree.h (list_equal_p): Declare.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): New.
* tree-eh.c (make_eh_edge): EH edges are not abnormal.
(redirect_eh_edge): New function.
(make_eh_edge_update_phi): EH edges are not abnormal.
* except.c: Include tree-flow.h.
(list_match): New function.
(eh_region_replaceable_by_p): New function.
(replace_region): New function.
(hash_type_list): New function.
(hash_eh_region): New function.
(eh_regions_equal_p): New function.
(merge_peers): New function.
(remove_unreachable_regions): Verify EH tree when checking;
merge peers.
(copy_eh_region_1): New function.
(copy_eh_region): New function.
(push_reachable_handler): New function.
(build_post_landing_pads, dw2_build_landing_pads): Be ready for
regions without label but with live RESX.
* except.h (redirect_eh_edge_to_label): New.
* tree-flow.h (redirect_eh_edge): New.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): Remove.
* Makefile.in (except.o): Add dependency on tree-flow.h
* tree-cfg.c (gimple_redirect_edge_and_branch): Handle EH edges.
* basic-block.h (edge, const_edge, basic_block, const_basic_block):
Remove.
From-SVN: r146776
2009-04-25 20:27:19 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
eh_landing_pad old_lp, new_lp;
|
|
|
|
|
basic_block old_bb;
|
|
|
|
|
gimple throw_stmt;
|
|
|
|
|
int old_lp_nr, new_lp_nr;
|
|
|
|
|
tree old_label, new_label;
|
|
|
|
|
edge_iterator ei;
|
|
|
|
|
edge e;
|
|
|
|
|
|
|
|
|
|
old_bb = edge_in->dest;
|
|
|
|
|
old_label = gimple_block_label (old_bb);
|
|
|
|
|
old_lp_nr = EH_LANDING_PAD_NR (old_label);
|
|
|
|
|
gcc_assert (old_lp_nr > 0);
|
|
|
|
|
old_lp = get_eh_landing_pad_from_number (old_lp_nr);
|
|
|
|
|
|
|
|
|
|
throw_stmt = last_stmt (edge_in->src);
|
|
|
|
|
gcc_assert (lookup_stmt_eh_lp (throw_stmt) == old_lp_nr);
|
|
|
|
|
|
|
|
|
|
new_label = gimple_block_label (new_bb);
|
tree.c (list_equal_p): New function.
* tree.c (list_equal_p): New function.
* tree.h (list_equal_p): Declare.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): New.
* tree-eh.c (make_eh_edge): EH edges are not abnormal.
(redirect_eh_edge): New function.
(make_eh_edge_update_phi): EH edges are not abnormal.
* except.c: Include tree-flow.h.
(list_match): New function.
(eh_region_replaceable_by_p): New function.
(replace_region): New function.
(hash_type_list): New function.
(hash_eh_region): New function.
(eh_regions_equal_p): New function.
(merge_peers): New function.
(remove_unreachable_regions): Verify EH tree when checking;
merge peers.
(copy_eh_region_1): New function.
(copy_eh_region): New function.
(push_reachable_handler): New function.
(build_post_landing_pads, dw2_build_landing_pads): Be ready for
regions without label but with live RESX.
* except.h (redirect_eh_edge_to_label): New.
* tree-flow.h (redirect_eh_edge): New.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): Remove.
* Makefile.in (except.o): Add dependency on tree-flow.h
* tree-cfg.c (gimple_redirect_edge_and_branch): Handle EH edges.
* basic-block.h (edge, const_edge, basic_block, const_basic_block):
Remove.
From-SVN: r146776
2009-04-25 20:27:19 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Look for an existing region that might be using NEW_BB already. */
|
|
|
|
|
new_lp_nr = EH_LANDING_PAD_NR (new_label);
|
|
|
|
|
if (new_lp_nr)
|
tree.c (list_equal_p): New function.
* tree.c (list_equal_p): New function.
* tree.h (list_equal_p): Declare.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): New.
* tree-eh.c (make_eh_edge): EH edges are not abnormal.
(redirect_eh_edge): New function.
(make_eh_edge_update_phi): EH edges are not abnormal.
* except.c: Include tree-flow.h.
(list_match): New function.
(eh_region_replaceable_by_p): New function.
(replace_region): New function.
(hash_type_list): New function.
(hash_eh_region): New function.
(eh_regions_equal_p): New function.
(merge_peers): New function.
(remove_unreachable_regions): Verify EH tree when checking;
merge peers.
(copy_eh_region_1): New function.
(copy_eh_region): New function.
(push_reachable_handler): New function.
(build_post_landing_pads, dw2_build_landing_pads): Be ready for
regions without label but with live RESX.
* except.h (redirect_eh_edge_to_label): New.
* tree-flow.h (redirect_eh_edge): New.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): Remove.
* Makefile.in (except.o): Add dependency on tree-flow.h
* tree-cfg.c (gimple_redirect_edge_and_branch): Handle EH edges.
* basic-block.h (edge, const_edge, basic_block, const_basic_block):
Remove.
From-SVN: r146776
2009-04-25 20:27:19 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
new_lp = get_eh_landing_pad_from_number (new_lp_nr);
|
|
|
|
|
gcc_assert (new_lp);
|
2009-11-25 11:55:54 +01:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Unless CHANGE_REGION is true, the new and old landing pad
|
|
|
|
|
had better be associated with the same EH region. */
|
|
|
|
|
gcc_assert (change_region || new_lp->region == old_lp->region);
|
tree.c (list_equal_p): New function.
* tree.c (list_equal_p): New function.
* tree.h (list_equal_p): Declare.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): New.
* tree-eh.c (make_eh_edge): EH edges are not abnormal.
(redirect_eh_edge): New function.
(make_eh_edge_update_phi): EH edges are not abnormal.
* except.c: Include tree-flow.h.
(list_match): New function.
(eh_region_replaceable_by_p): New function.
(replace_region): New function.
(hash_type_list): New function.
(hash_eh_region): New function.
(eh_regions_equal_p): New function.
(merge_peers): New function.
(remove_unreachable_regions): Verify EH tree when checking;
merge peers.
(copy_eh_region_1): New function.
(copy_eh_region): New function.
(push_reachable_handler): New function.
(build_post_landing_pads, dw2_build_landing_pads): Be ready for
regions without label but with live RESX.
* except.h (redirect_eh_edge_to_label): New.
* tree-flow.h (redirect_eh_edge): New.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): Remove.
* Makefile.in (except.o): Add dependency on tree-flow.h
* tree-cfg.c (gimple_redirect_edge_and_branch): Handle EH edges.
* basic-block.h (edge, const_edge, basic_block, const_basic_block):
Remove.
From-SVN: r146776
2009-04-25 20:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
new_lp = NULL;
|
|
|
|
|
gcc_assert (!change_region);
|
tree.c (list_equal_p): New function.
* tree.c (list_equal_p): New function.
* tree.h (list_equal_p): Declare.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): New.
* tree-eh.c (make_eh_edge): EH edges are not abnormal.
(redirect_eh_edge): New function.
(make_eh_edge_update_phi): EH edges are not abnormal.
* except.c: Include tree-flow.h.
(list_match): New function.
(eh_region_replaceable_by_p): New function.
(replace_region): New function.
(hash_type_list): New function.
(hash_eh_region): New function.
(eh_regions_equal_p): New function.
(merge_peers): New function.
(remove_unreachable_regions): Verify EH tree when checking;
merge peers.
(copy_eh_region_1): New function.
(copy_eh_region): New function.
(push_reachable_handler): New function.
(build_post_landing_pads, dw2_build_landing_pads): Be ready for
regions without label but with live RESX.
* except.h (redirect_eh_edge_to_label): New.
* tree-flow.h (redirect_eh_edge): New.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): Remove.
* Makefile.in (except.o): Add dependency on tree-flow.h
* tree-cfg.c (gimple_redirect_edge_and_branch): Handle EH edges.
* basic-block.h (edge, const_edge, basic_block, const_basic_block):
Remove.
From-SVN: r146776
2009-04-25 20:27:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Notice when we redirect the last EH edge away from OLD_BB. */
|
|
|
|
|
FOR_EACH_EDGE (e, ei, old_bb->preds)
|
|
|
|
|
if (e != edge_in && (e->flags & EDGE_EH))
|
|
|
|
|
break;
|
2005-04-25 19:24:28 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (new_lp)
|
2005-04-25 19:24:28 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* NEW_LP already exists. If there are still edges into OLD_LP,
|
|
|
|
|
there's nothing to do with the EH tree. If there are no more
|
|
|
|
|
edges into OLD_LP, then we want to remove OLD_LP as it is unused.
|
|
|
|
|
If CHANGE_REGION is true, then our caller is expecting to remove
|
|
|
|
|
the landing pad. */
|
|
|
|
|
if (e == NULL && !change_region)
|
|
|
|
|
remove_eh_landing_pad (old_lp);
|
2005-04-25 19:24:28 +02:00
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
else
|
2005-04-25 19:24:28 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* No correct landing pad exists. If there are no more edges
|
|
|
|
|
into OLD_LP, then we can simply re-use the existing landing pad.
|
|
|
|
|
Otherwise, we have to create a new landing pad. */
|
|
|
|
|
if (e == NULL)
|
|
|
|
|
{
|
|
|
|
|
EH_LANDING_PAD_NR (old_lp->post_landing_pad) = 0;
|
|
|
|
|
new_lp = old_lp;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
new_lp = gen_eh_landing_pad (old_lp->region);
|
|
|
|
|
new_lp->post_landing_pad = new_label;
|
|
|
|
|
EH_LANDING_PAD_NR (new_label) = new_lp->index;
|
2005-04-25 19:24:28 +02:00
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
/* Maybe move the throwing statement to the new region. */
|
|
|
|
|
if (old_lp != new_lp)
|
2005-04-25 19:24:28 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
remove_stmt_from_eh_lp (throw_stmt);
|
|
|
|
|
add_stmt_to_eh_lp (throw_stmt, new_lp->index);
|
2005-04-25 19:24:28 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Redirect EH edge E to NEW_BB. */
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
edge
|
|
|
|
|
redirect_eh_edge (edge edge_in, basic_block new_bb)
|
2005-04-25 19:24:28 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
redirect_eh_edge_1 (edge_in, new_bb, false);
|
|
|
|
|
return ssa_redirect_edge (edge_in, new_bb);
|
|
|
|
|
}
|
2005-04-25 19:24:28 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* This is a subroutine of gimple_redirect_edge_and_branch. Update the
|
|
|
|
|
labels for redirecting a non-fallthru EH_DISPATCH edge E to NEW_BB.
|
|
|
|
|
The actual edge update will happen in the caller. */
|
2005-04-25 19:24:28 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
void
|
|
|
|
|
redirect_eh_dispatch_edge (gimple stmt, edge e, basic_block new_bb)
|
|
|
|
|
{
|
|
|
|
|
tree new_lab = gimple_block_label (new_bb);
|
|
|
|
|
bool any_changed = false;
|
|
|
|
|
basic_block old_bb;
|
|
|
|
|
eh_region r;
|
|
|
|
|
eh_catch c;
|
|
|
|
|
|
|
|
|
|
r = get_eh_region_from_number (gimple_eh_dispatch_region (stmt));
|
|
|
|
|
switch (r->type)
|
2005-04-25 19:24:28 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
case ERT_TRY:
|
|
|
|
|
for (c = r->u.eh_try.first_catch; c ; c = c->next_catch)
|
2005-04-25 19:24:28 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
old_bb = label_to_block (c->label);
|
|
|
|
|
if (old_bb == e->dest)
|
|
|
|
|
{
|
|
|
|
|
c->label = new_lab;
|
|
|
|
|
any_changed = true;
|
|
|
|
|
}
|
2005-04-25 19:24:28 +02:00
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ERT_ALLOWED_EXCEPTIONS:
|
|
|
|
|
old_bb = label_to_block (r->u.allowed.label);
|
|
|
|
|
gcc_assert (old_bb == e->dest);
|
|
|
|
|
r->u.allowed.label = new_lab;
|
|
|
|
|
any_changed = true;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
gcc_unreachable ();
|
2005-04-25 19:24:28 +02:00
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gcc_assert (any_changed);
|
2005-04-25 19:24:28 +02:00
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* Helper function for operation_could_trap_p and stmt_could_throw_p. */
|
|
|
|
|
|
2009-01-18 16:51:12 +01:00
|
|
|
|
bool
|
2008-07-28 16:33:56 +02:00
|
|
|
|
operation_could_trap_helper_p (enum tree_code op,
|
|
|
|
|
bool fp_operation,
|
|
|
|
|
bool honor_trapv,
|
|
|
|
|
bool honor_nans,
|
|
|
|
|
bool honor_snans,
|
|
|
|
|
tree divisor,
|
|
|
|
|
bool *handled)
|
|
|
|
|
{
|
|
|
|
|
*handled = true;
|
|
|
|
|
switch (op)
|
|
|
|
|
{
|
|
|
|
|
case TRUNC_DIV_EXPR:
|
|
|
|
|
case CEIL_DIV_EXPR:
|
|
|
|
|
case FLOOR_DIV_EXPR:
|
|
|
|
|
case ROUND_DIV_EXPR:
|
|
|
|
|
case EXACT_DIV_EXPR:
|
|
|
|
|
case CEIL_MOD_EXPR:
|
|
|
|
|
case FLOOR_MOD_EXPR:
|
|
|
|
|
case ROUND_MOD_EXPR:
|
|
|
|
|
case TRUNC_MOD_EXPR:
|
|
|
|
|
case RDIV_EXPR:
|
|
|
|
|
if (honor_snans || honor_trapv)
|
|
|
|
|
return true;
|
|
|
|
|
if (fp_operation)
|
|
|
|
|
return flag_trapping_math;
|
|
|
|
|
if (!TREE_CONSTANT (divisor) || integer_zerop (divisor))
|
|
|
|
|
return true;
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
case LT_EXPR:
|
|
|
|
|
case LE_EXPR:
|
|
|
|
|
case GT_EXPR:
|
|
|
|
|
case GE_EXPR:
|
|
|
|
|
case LTGT_EXPR:
|
|
|
|
|
/* Some floating point comparisons may trap. */
|
|
|
|
|
return honor_nans;
|
|
|
|
|
|
|
|
|
|
case EQ_EXPR:
|
|
|
|
|
case NE_EXPR:
|
|
|
|
|
case UNORDERED_EXPR:
|
|
|
|
|
case ORDERED_EXPR:
|
|
|
|
|
case UNLT_EXPR:
|
|
|
|
|
case UNLE_EXPR:
|
|
|
|
|
case UNGT_EXPR:
|
|
|
|
|
case UNGE_EXPR:
|
|
|
|
|
case UNEQ_EXPR:
|
|
|
|
|
return honor_snans;
|
|
|
|
|
|
|
|
|
|
case CONVERT_EXPR:
|
|
|
|
|
case FIX_TRUNC_EXPR:
|
|
|
|
|
/* Conversion of floating point might trap. */
|
|
|
|
|
return honor_nans;
|
|
|
|
|
|
|
|
|
|
case NEGATE_EXPR:
|
|
|
|
|
case ABS_EXPR:
|
|
|
|
|
case CONJ_EXPR:
|
|
|
|
|
/* These operations don't trap with floating point. */
|
|
|
|
|
if (honor_trapv)
|
|
|
|
|
return true;
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
case PLUS_EXPR:
|
|
|
|
|
case MINUS_EXPR:
|
|
|
|
|
case MULT_EXPR:
|
|
|
|
|
/* Any floating arithmetic may trap. */
|
|
|
|
|
if (fp_operation && flag_trapping_math)
|
|
|
|
|
return true;
|
|
|
|
|
if (honor_trapv)
|
|
|
|
|
return true;
|
|
|
|
|
return false;
|
|
|
|
|
|
2010-09-07 14:27:45 +02:00
|
|
|
|
case COMPLEX_EXPR:
|
|
|
|
|
case CONSTRUCTOR:
|
|
|
|
|
/* Constructing an object cannot trap. */
|
|
|
|
|
return false;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
default:
|
|
|
|
|
/* Any floating arithmetic may trap. */
|
|
|
|
|
if (fp_operation && flag_trapping_math)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
*handled = false;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return true if operation OP may trap. FP_OPERATION is true if OP is applied
|
|
|
|
|
on floating-point values. HONOR_TRAPV is true if OP is applied on integer
|
|
|
|
|
type operands that may trap. If OP is a division operator, DIVISOR contains
|
|
|
|
|
the value of the divisor. */
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
operation_could_trap_p (enum tree_code op, bool fp_operation, bool honor_trapv,
|
|
|
|
|
tree divisor)
|
|
|
|
|
{
|
|
|
|
|
bool honor_nans = (fp_operation && flag_trapping_math
|
|
|
|
|
&& !flag_finite_math_only);
|
|
|
|
|
bool honor_snans = fp_operation && flag_signaling_nans != 0;
|
|
|
|
|
bool handled;
|
|
|
|
|
|
|
|
|
|
if (TREE_CODE_CLASS (op) != tcc_comparison
|
|
|
|
|
&& TREE_CODE_CLASS (op) != tcc_unary
|
|
|
|
|
&& TREE_CODE_CLASS (op) != tcc_binary)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return operation_could_trap_helper_p (op, fp_operation, honor_trapv,
|
|
|
|
|
honor_nans, honor_snans, divisor,
|
|
|
|
|
&handled);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return true if EXPR can trap, as in dereferencing an invalid pointer
|
2004-06-29 08:59:35 +02:00
|
|
|
|
location or floating point arithmetic. C.f. the rtl version, may_trap_p.
|
|
|
|
|
This routine expects only GIMPLE lhs or rhs input. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
tree_could_trap_p (tree expr)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
enum tree_code code;
|
2004-06-29 08:59:35 +02:00
|
|
|
|
bool fp_operation = false;
|
2004-07-11 20:14:48 +02:00
|
|
|
|
bool honor_trapv = false;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
tree t, base, div = NULL_TREE;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
if (!expr)
|
|
|
|
|
return false;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
code = TREE_CODE (expr);
|
|
|
|
|
t = TREE_TYPE (expr);
|
|
|
|
|
|
|
|
|
|
if (t)
|
2004-06-29 08:59:35 +02:00
|
|
|
|
{
|
2008-05-09 00:16:59 +02:00
|
|
|
|
if (COMPARISON_CLASS_P (expr))
|
|
|
|
|
fp_operation = FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 0)));
|
|
|
|
|
else
|
|
|
|
|
fp_operation = FLOAT_TYPE_P (t);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
honor_trapv = INTEGRAL_TYPE_P (t) && TYPE_OVERFLOW_TRAPS (t);
|
2004-06-29 08:59:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
if (TREE_CODE_CLASS (code) == tcc_binary)
|
|
|
|
|
div = TREE_OPERAND (expr, 1);
|
|
|
|
|
if (operation_could_trap_p (code, fp_operation, honor_trapv, div))
|
|
|
|
|
return true;
|
|
|
|
|
|
2004-07-16 23:13:08 +02:00
|
|
|
|
restart:
|
2004-05-13 08:41:07 +02:00
|
|
|
|
switch (code)
|
|
|
|
|
{
|
tree-ssa-address.c: New file.
* tree-ssa-address.c: New file.
* Makefile.in (tree-ssa-address.o): Add.
* expr.c (expand_expr_real_1): Do not handle REF_ORIGINAL on
INDIRECT_REFs. Handle TARGET_MEM_REFs.
* tree-eh.c (tree_could_trap_p): Handle TARGET_MEM_REFs.
* tree-flow.h (struct mem_address): New.
(struct affine_tree_combination): Moved from tree-ssa-loop-ivopts.c.
(create_mem_ref, addr_for_mem_ref, get_address_description,
maybe_fold_tmr, multiplier_allowed_in_address_p,
multiply_by_cost): Declare.
* tree-mudflap.c (mf_xform_derefs_1): Handle TARGET_MEM_REFs.
* tree-pretty-print.c (dump_generic_node): Ditto.
* tree-ssa-loop-im.c (for_each_index): Ditto.
* tree-ssa-loop-ivopts.c (may_be_unaligned_p,
find_interesting_uses_address): Ditto.
(rewrite_address_base, build_addr_strip_iref): Removed.
(struct affine_tree_combination): Moved to tree-flow.h.
(get_ref_tag, copy_ref_info): New functions.
(rewrite_use_address): Produce TARGET_MEM_REFs.
(tree_ssa_iv_optimize): Do not call update_ssa
and rewrite_into_loop_closed_ssa.
(tree_to_aff_combination): Use build_fold_addr_expr instead of
build_addr_strip_iref.
(unshare_aff_combination): New function.
(fold_affine_sum): Removed.
(get_computation_at): Use get_computation_aff. Unshare the result.
(get_computation_aff, multiplier_allowed_in_address_p): New function.
(multiply_by_cost): Exported.
(get_address_cost): Use multiplier_allowed_in_address_p.
* tree-ssa-operands.c (get_tmr_operands): New function.
(get_expr_operands): Handle TARGET_MEM_REFs.
* tree.c (copy_node_stat): Copy annotations for TARGET_MEM_REFs.
(build): Handle 7 arguments.
(build7_stat): New function.
* tree.def (TARGET_MEM_DEF): New.
* tree.h (REF_ORIGINAL): Removed.
(TMR_SYMBOL, TMR_BASE, TMR_INDEX, TMR_STEP, TMR_OFFSET, TMR_ORIGINAL,
TMR_TAG, build7): New macros.
(build7_stat, tree_mem_ref_addr, copy_mem_ref_info): Declare.
* tree-ssa-ccp.c (fold_stmt_r): Call maybe_fold_tmr.
* doc/c-tree.texi: Document TARGET_MEM_REF.
* doc/tree-ssa.texi: Add TARGET_MEM_REF to gimple grammar.
* gcc.dg/tree-ssa/loop-2.c: Update outcome.
* gcc.dg/tree-ssa/loop-3.c: Update outcome.
* gcc.dg/tree-ssa/loop-4.c: Update outcome.
* gcc.dg/tree-ssa/loop-9.c: New test.
From-SVN: r100708
2005-06-07 14:01:47 +02:00
|
|
|
|
case TARGET_MEM_REF:
|
2010-09-03 11:50:17 +02:00
|
|
|
|
if (TREE_CODE (TMR_BASE (expr)) == ADDR_EXPR
|
|
|
|
|
&& !TMR_INDEX (expr) && !TMR_INDEX2 (expr))
|
2010-08-16 11:55:54 +02:00
|
|
|
|
return false;
|
|
|
|
|
return !TREE_THIS_NOTRAP (expr);
|
tree-ssa-address.c: New file.
* tree-ssa-address.c: New file.
* Makefile.in (tree-ssa-address.o): Add.
* expr.c (expand_expr_real_1): Do not handle REF_ORIGINAL on
INDIRECT_REFs. Handle TARGET_MEM_REFs.
* tree-eh.c (tree_could_trap_p): Handle TARGET_MEM_REFs.
* tree-flow.h (struct mem_address): New.
(struct affine_tree_combination): Moved from tree-ssa-loop-ivopts.c.
(create_mem_ref, addr_for_mem_ref, get_address_description,
maybe_fold_tmr, multiplier_allowed_in_address_p,
multiply_by_cost): Declare.
* tree-mudflap.c (mf_xform_derefs_1): Handle TARGET_MEM_REFs.
* tree-pretty-print.c (dump_generic_node): Ditto.
* tree-ssa-loop-im.c (for_each_index): Ditto.
* tree-ssa-loop-ivopts.c (may_be_unaligned_p,
find_interesting_uses_address): Ditto.
(rewrite_address_base, build_addr_strip_iref): Removed.
(struct affine_tree_combination): Moved to tree-flow.h.
(get_ref_tag, copy_ref_info): New functions.
(rewrite_use_address): Produce TARGET_MEM_REFs.
(tree_ssa_iv_optimize): Do not call update_ssa
and rewrite_into_loop_closed_ssa.
(tree_to_aff_combination): Use build_fold_addr_expr instead of
build_addr_strip_iref.
(unshare_aff_combination): New function.
(fold_affine_sum): Removed.
(get_computation_at): Use get_computation_aff. Unshare the result.
(get_computation_aff, multiplier_allowed_in_address_p): New function.
(multiply_by_cost): Exported.
(get_address_cost): Use multiplier_allowed_in_address_p.
* tree-ssa-operands.c (get_tmr_operands): New function.
(get_expr_operands): Handle TARGET_MEM_REFs.
* tree.c (copy_node_stat): Copy annotations for TARGET_MEM_REFs.
(build): Handle 7 arguments.
(build7_stat): New function.
* tree.def (TARGET_MEM_DEF): New.
* tree.h (REF_ORIGINAL): Removed.
(TMR_SYMBOL, TMR_BASE, TMR_INDEX, TMR_STEP, TMR_OFFSET, TMR_ORIGINAL,
TMR_TAG, build7): New macros.
(build7_stat, tree_mem_ref_addr, copy_mem_ref_info): Declare.
* tree-ssa-ccp.c (fold_stmt_r): Call maybe_fold_tmr.
* doc/c-tree.texi: Document TARGET_MEM_REF.
* doc/tree-ssa.texi: Add TARGET_MEM_REF to gimple grammar.
* gcc.dg/tree-ssa/loop-2.c: Update outcome.
* gcc.dg/tree-ssa/loop-3.c: Update outcome.
* gcc.dg/tree-ssa/loop-4.c: Update outcome.
* gcc.dg/tree-ssa/loop-9.c: New test.
From-SVN: r100708
2005-06-07 14:01:47 +02:00
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
case COMPONENT_REF:
|
|
|
|
|
case REALPART_EXPR:
|
|
|
|
|
case IMAGPART_EXPR:
|
|
|
|
|
case BIT_FIELD_REF:
|
2007-02-18 15:03:24 +01:00
|
|
|
|
case VIEW_CONVERT_EXPR:
|
2004-07-16 23:13:08 +02:00
|
|
|
|
case WITH_SIZE_EXPR:
|
|
|
|
|
expr = TREE_OPERAND (expr, 0);
|
|
|
|
|
code = TREE_CODE (expr);
|
|
|
|
|
goto restart;
|
2004-07-10 06:57:58 +02:00
|
|
|
|
|
|
|
|
|
case ARRAY_RANGE_REF:
|
2006-07-03 22:14:18 +02:00
|
|
|
|
base = TREE_OPERAND (expr, 0);
|
|
|
|
|
if (tree_could_trap_p (base))
|
2004-07-10 06:57:58 +02:00
|
|
|
|
return true;
|
2006-07-03 22:14:18 +02:00
|
|
|
|
if (TREE_THIS_NOTRAP (expr))
|
|
|
|
|
return false;
|
|
|
|
|
return !range_in_array_bounds_p (expr);
|
2004-07-10 06:57:58 +02:00
|
|
|
|
|
|
|
|
|
case ARRAY_REF:
|
|
|
|
|
base = TREE_OPERAND (expr, 0);
|
|
|
|
|
if (tree_could_trap_p (base))
|
|
|
|
|
return true;
|
|
|
|
|
if (TREE_THIS_NOTRAP (expr))
|
|
|
|
|
return false;
|
|
|
|
|
return !in_array_bounds_p (expr);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
re PR middle-end/42834 (memcpy folding overeager)
2010-07-01 Richard Guenther <rguenther@suse.de>
PR middle-end/42834
PR middle-end/44468
* doc/gimple.texi (is_gimple_mem_ref_addr): Document.
* doc/generic.texi (References to storage): Document MEM_REF.
* tree-pretty-print.c (dump_generic_node): Handle MEM_REF.
(print_call_name): Likewise.
* tree.c (recompute_tree_invariant_for_addr_expr): Handle MEM_REF.
(build_simple_mem_ref_loc): New function.
(mem_ref_offset): Likewise.
* tree.h (build_simple_mem_ref_loc): Declare.
(build_simple_mem_ref): Define.
(mem_ref_offset): Declare.
* fold-const.c: Include tree-flow.h.
(operand_equal_p): Handle MEM_REF.
(build_fold_addr_expr_with_type_loc): Likewise.
(fold_comparison): Likewise.
(fold_unary_loc): Fold
VIEW_CONVERT_EXPR <T1, MEM_REF <T2, ...>> to MEM_REF <T1, ...>.
(fold_binary_loc): Fold MEM[&MEM[p, CST1], CST2] to MEM[p, CST1 + CST2],
fold MEM[&a.b, CST2] to MEM[&a, offsetof (a, b) + CST2].
* tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle MEM_REF.
(ptr_deref_may_alias_ref_p_1): Likewise.
(ao_ref_base_alias_set): Properly differentiate base object for
offset and TBAA.
(ao_ref_init_from_ptr_and_size): Use MEM_REF.
(indirect_ref_may_alias_decl_p): Handle MEM_REFs properly.
(indirect_refs_may_alias_p): Likewise.
(refs_may_alias_p_1): Likewise. Remove pointer SSA name def
chasing code.
(ref_maybe_used_by_call_p_1): Handle MEM_REF.
(call_may_clobber_ref_p_1): Likewise.
* dwarf2out.c (loc_list_from_tree): Handle MEM_REF.
* expr.c (expand_assignment): Handle MEM_REF.
(store_expr): Handle MEM_REFs from STRING_CSTs.
(store_field): If expanding a MEM_REF of a non-addressable
decl use bitfield operations.
(get_inner_reference): Handle MEM_REF.
(expand_expr_addr_expr_1): Likewise.
(expand_expr_real_1): Likewise.
* tree-eh.c (tree_could_trap_p): Handle MEM_REF.
* alias.c (ao_ref_from_mem): Handle MEM_REF.
(get_alias_set): Likewise. Properly handle VIEW_CONVERT_EXPRs.
* tree-data-ref.c (dr_analyze_innermost): Handle MEM_REF.
(dr_analyze_indices): Likewise.
(dr_analyze_alias): Likewise.
(object_address_invariant_in_loop_p): Likewise.
* gimplify.c (mark_addressable): Handle MEM_REF.
(gimplify_cond_expr): Build MEM_REFs.
(gimplify_modify_expr_to_memcpy): Likewise.
(gimplify_init_ctor_preeval_1): Handle MEM_REF.
(gimple_fold_indirect_ref): Adjust.
(gimplify_expr): Handle MEM_REF. Gimplify INDIRECT_REF to MEM_REF.
* tree.def (MEM_REF): New tree code.
* tree-dfa.c: Include toplev.h.
(get_ref_base_and_extent): Handle MEM_REF.
(get_addr_base_and_unit_offset): New function.
* emit-rtl.c (set_mem_attributes_minus_bitpos): Handle MEM_REF.
* gimple-fold.c (may_propagate_address_into_dereference): Handle
MEM_REF.
(maybe_fold_offset_to_array_ref): Allow possibly out-of bounds
accesses if the array has just one dimension. Remove always true
parameter. Do not require type compatibility here.
(maybe_fold_offset_to_component_ref): Remove.
(maybe_fold_stmt_indirect): Remove.
(maybe_fold_reference): Remove INDIRECT_REF handling.
Fold back to non-MEM_REF.
(maybe_fold_offset_to_address): Simplify. Deal with type
mismatches here.
(maybe_fold_reference): Likewise.
(maybe_fold_stmt_addition): Likewise. Also handle
&ARRAY + I in addition to &ARRAY[0] + I.
(fold_gimple_assign): Handle ADDR_EXPR of MEM_REFs.
(gimple_get_relevant_ref_binfo): Handle MEM_REF.
* cfgexpand.c (expand_debug_expr): Handle MEM_REF.
* tree-ssa.c (useless_type_conversion_p): Make most pointer
conversions useless.
(warn_uninitialized_var): Handle MEM_REF.
(maybe_rewrite_mem_ref_base): New function.
(execute_update_addresses_taken): Implement re-writing of MEM_REFs
to SSA form.
* tree-inline.c (remap_gimple_op_r): Handle MEM_REF, remove
INDIRECT_REF handling.
(copy_tree_body_r): Handle MEM_REF.
* gimple.c (is_gimple_addressable): Adjust.
(is_gimple_address): Likewise.
(is_gimple_invariant_address): ADDR_EXPRs of MEM_REFs with
invariant base are invariant.
(is_gimple_min_lval): Adjust.
(is_gimple_mem_ref_addr): New function.
(get_base_address): Handle MEM_REF.
(count_ptr_derefs): Likewise.
(get_base_loadstore): Likewise.
* gimple.h (is_gimple_mem_ref_addr): Declare.
(gimple_call_fndecl): Handle invariant MEM_REF addresses.
* tree-cfg.c (verify_address): New function, split out from ...
(verify_expr): ... here. Use for verifying ADDR_EXPRs and
the address operand of MEM_REFs. Verify MEM_REFs. Reject
INDIRECT_REFs.
(verify_types_in_gimple_min_lval): Handle MEM_REF. Disallow
INDIRECT_REF. Allow conversions.
(verify_types_in_gimple_reference): Verify VIEW_CONVERT_EXPR of
a register does not change its size.
(verify_types_in_gimple_reference): Verify MEM_REF.
(verify_gimple_assign_single): Disallow INDIRECT_REF.
Handle MEM_REF.
* tree-ssa-operands.c (opf_non_addressable, opf_not_non_addressable):
New.
(mark_address_taken): Handle MEM_REF.
(get_indirect_ref_operands): Pass through opf_not_non_addressable.
(get_asm_expr_operands): Pass opf_not_non_addressable.
(get_expr_operands): Handle opf_[not_]non_addressable.
Handle MEM_REF. Remove INDIRECT_REF handling.
* tree-vrp.c: (check_array_ref): Handle MEM_REF.
(search_for_addr_array): Likewise.
(check_array_bounds): Likewise.
(vrp_stmt_computes_nonzero): Adjust for MEM_REF.
* tree-ssa-loop-im.c (for_each_index): Handle MEM_REF.
(ref_always_accessed_p): Likewise.
(gen_lsm_tmp_name): Likewise. Handle ADDR_EXPR.
* tree-complex.c (extract_component): Do not handle INDIRECT_REF.
Handle MEM_REF.
* cgraphbuild.c (mark_load): Properly check for NULL result
from get_base_address.
(mark_store): Likewise.
* tree-ssa-loop-niter.c (array_at_struct_end_p): Handle MEM_REF.
* tree-loop-distribution.c (generate_builtin): Exchange INDIRECT_REF
handling for MEM_REF.
* tree-scalar-evolution.c (follow_ssa_edge_expr): Handle
&MEM[ptr + CST] similar to POINTER_PLUS_EXPR.
* builtins.c (stabilize_va_list_loc): Use the function ABI
valist type if we couldn't canonicalize the argument type.
Always dereference with the canonical va-list type.
(maybe_emit_free_warning): Handle MEM_REF.
(fold_builtin_memory_op): Simplify and handle MEM_REFs in folding
memmove to memcpy.
* builtins.c (fold_builtin_memory_op): Use ref-all types
for all memcpy foldings.
* omp-low.c (build_receiver_ref): Adjust for MEM_REF.
(build_outer_var_ref): Likewise.
(scan_omp_1_op): Likewise.
(lower_rec_input_clauses): Likewise.
(lower_lastprivate_clauses): Likewise.
(lower_reduction_clauses): Likewise.
(lower_copyprivate_clauses): Likewise.
(expand_omp_atomic_pipeline): Likewise.
(expand_omp_atomic_mutex): Likewise.
(create_task_copyfn): Likewise.
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle MEM_REF.
Remove old union trick. Initialize constant offsets.
(ao_ref_init_from_vn_reference): Likewise. Do not handle
INDIRECT_REF. Init base_alias_set properly.
(vn_reference_lookup_3): Replace INDIRECT_REF handling with
MEM_REF.
(vn_reference_fold_indirect): Adjust for MEM_REFs.
(valueize_refs): Fold MEM_REFs. Re-evaluate constant offset
for ARRAY_REFs.
(may_insert): Remove.
(visit_reference_op_load): Do not test may_insert.
(run_scc_vn): Remove parameter, do not fiddle with may_insert.
* tree-ssa-sccvn.h (struct vn_reference_op_struct): Add
a field to store the constant offset this op applies.
(run_scc_vn): Adjust prototype.
* cgraphunit.c (thunk_adjust): Adjust for MEM_REF.
* tree-ssa-ccp.c (ccp_fold): Replace INDIRECT_REF folding with
MEM_REF. Propagate &foo + CST as &MEM[&foo, CST]. Do not
bother about volatile qualifiers on pointers.
(fold_const_aggregate_ref): Handle MEM_REF, do not handle INDIRECT_REF.
* tree-ssa-loop-ivopts.c
* tree-ssa-loop-ivopts.c (determine_base_object): Adjust
for MEM_REF.
(strip_offset_1): Likewise.
(find_interesting_uses_address): Replace INDIRECT_REF handling with
MEM_REF handling.
(get_computation_cost_at): Likewise.
* ipa-pure-const.c (check_op): Handle MEM_REF.
* tree-stdarg.c (check_all_va_list_escapes): Adjust for MEM_REF.
* tree-ssa-sink.c (is_hidden_global_store): Handle MEM_REF
and constants.
* ipa-inline.c (likely_eliminated_by_inlining_p): Handle MEM_REF.
* tree-parloops.c (take_address_of): Adjust for MEM_REF.
(eliminate_local_variables_1): Likewise.
(create_call_for_reduction_1): Likewise.
(create_loads_for_reductions): Likewise.
(create_loads_and_stores_for_name): Likewise.
* matrix-reorg.c (may_flatten_matrices_1): Sanitize.
(ssa_accessed_in_tree): Handle MEM_REF.
(ssa_accessed_in_assign_rhs): Likewise.
(update_type_size): Likewise.
(analyze_accesses_for_call_stmt): Likewise.
(analyze_accesses_for_assign_stmt): Likewise.
(transform_access_sites): Likewise.
(transform_allocation_sites): Likewise.
* tree-affine.c (tree_to_aff_combination): Handle MEM_REF.
* tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Do
not handle INDIRECT_REF.
* tree-ssa-phiopt.c (add_or_mark_expr): Handle MEM_REF.
(cond_store_replacement): Likewise.
* tree-ssa-pre.c (create_component_ref_by_pieces_1): Handle
MEM_REF, no not handle INDIRECT_REFs.
(insert_into_preds_of_block): Properly initialize avail.
(phi_translate_1): Fold MEM_REFs. Re-evaluate constant offset
for ARRAY_REFs. Properly handle reference lookups that
require a bit re-interpretation.
(can_PRE_operation): Do not handle INDIRECT_REF. Handle MEM_REF.
* tree-sra.c
* tree-sra.c (build_access_from_expr_1): Handle MEM_REF.
(build_ref_for_offset_1): Remove.
(build_ref_for_offset): Build MEM_REFs.
(gate_intra_sra): Disable for now.
(sra_ipa_modify_expr): Handle MEM_REF.
(ipa_early_sra_gate): Disable for now.
* tree-sra.c (create_access): Swap INDIRECT_REF handling for
MEM_REF handling.
(disqualify_base_of_expr): Likewise.
(ptr_parm_has_direct_uses): Swap INDIRECT_REF handling for
MEM_REF handling.
(sra_ipa_modify_expr): Remove INDIRECT_REF handling.
Use mem_ref_offset. Remove bogus folding.
(build_access_from_expr_1): Properly handle MEM_REF for
non IPA-SRA.
(make_fancy_name_1): Add support for MEM_REF.
* tree-predcom.c (ref_at_iteration): Handle MEM_REFs.
* tree-mudflap.c (mf_xform_derefs_1): Adjust for MEM_REF.
* ipa-prop.c (compute_complex_assign_jump_func): Handle MEM_REF.
(compute_complex_ancestor_jump_func): Likewise.
(ipa_analyze_virtual_call_uses): Likewise.
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Replace
INDIRECT_REF folding with more generalized MEM_REF folding.
(tree_ssa_forward_propagate_single_use_vars): Adjust accordingly.
(forward_propagate_addr_into_variable_array_index): Also handle
&ARRAY + I in addition to &ARRAY[0] + I.
* tree-ssa-dce.c (ref_may_be_aliased): Handle MEM_REF.
* tree-ssa-ter.c (find_replaceable_in_bb): Avoid TER if that
creates assignments with overlap.
* tree-nested.c (get_static_chain): Adjust for MEM_REF.
(get_frame_field): Likewise.
(get_nonlocal_debug_decl): Likewise.
(convert_nonlocal_reference_op): Likewise.
(struct nesting_info): Add mem_refs pointer-set.
(create_nesting_tree): Allocate it.
(convert_local_reference_op): Insert to be folded mem-refs.
(fold_mem_refs): New function.
(finalize_nesting_tree_1): Perform defered folding of mem-refs
(free_nesting_tree): Free the pointer-set.
* tree-vect-stmts.c (vectorizable_store): Adjust for MEM_REF.
(vectorizable_load): Likewise.
* tree-ssa-phiprop.c (phiprop_insert_phi): Adjust for MEM_REF.
(propagate_with_phi): Likewise.
* tree-object-size.c (addr_object_size): Handle MEM_REFs
instead of INDIRECT_REFs.
(compute_object_offset): Handle MEM_REF.
(plus_stmt_object_size): Handle MEM_REF.
(collect_object_sizes_for): Dispatch to plus_stmt_object_size
for &MEM_REF.
* tree-flow.h (get_addr_base_and_unit_offset): Declare.
(symbol_marked_for_renaming): Likewise.
* Makefile.in (tree-dfa.o): Add $(TOPLEV_H).
(fold-const.o): Add $(TREE_FLOW_H).
* tree-ssa-structalias.c (get_constraint_for_1): Handle MEM_REF.
(find_func_clobbers): Likewise.
* ipa-struct-reorg.c (decompose_indirect_ref_acc): Handle MEM_REF.
(decompose_access): Likewise.
(replace_field_acc): Likewise.
(replace_field_access_stmt): Likewise.
(insert_new_var_in_stmt): Likewise.
(get_stmt_accesses): Likewise.
(reorg_structs_drive): Disable.
* config/i386/i386.c (ix86_va_start): Adjust for MEM_REF.
(ix86_canonical_va_list_type): Likewise.
cp/
* cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
predicate we are looking for, allow non-gimplified
INDIRECT_REFs.
testsuite/
* gcc.c-torture/execute/20100316-1.c: New testcase.
* gcc.c-torture/execute/pr44468.c: Likewise.
* gcc.c-torture/compile/20100609-1.c: Likewise.
* gcc.dg/volatile2.c: Adjust.
* gcc.dg/plugin/selfassign.c: Likewise.
* gcc.dg/pr36902.c: Likewise.
* gcc.dg/tree-ssa/foldaddr-2.c: Remove.
* gcc.dg/tree-ssa/foldaddr-3.c: Likewise.
* gcc.dg/tree-ssa/forwprop-8.c: Adjust.
* gcc.dg/tree-ssa/pr17141-1.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-13.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-14.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-21.c: Likewise.
* gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise.
* gcc.dg/tree-ssa/20030807-7.c: Likewise.
* gcc.dg/tree-ssa/forwprop-10.c: Likewise.
* gcc.dg/tree-ssa/ssa-fre-1.c: Likewise.
* gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-23.c: Likewise.
* gcc.dg/tree-ssa/forwprop-1.c: Likewise.
* gcc.dg/tree-ssa/forwprop-2.c: Likewise.
* gcc.dg/tree-ssa/struct-aliasing-1.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-25.c: Likewise.
* gcc.dg/tree-ssa/ssa-pre-26.c: Likewise.
* gcc.dg/tree-ssa/struct-aliasing-2.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-26.c: Likewise.
* gcc.dg/tree-ssa/ssa-sccvn-4.c: Likewise.
* gcc.dg/tree-ssa/ssa-pre-7.c: Likewise.
* gcc.dg/tree-ssa/forwprop-5.c: Likewise.
* gcc.dg/struct/w_prof_two_strs.c: XFAIL.
* gcc.dg/struct/wo_prof_escape_arg_to_local.c: Likewise.
* gcc.dg/struct/wo_prof_global_var.c: Likewise.
* gcc.dg/struct/wo_prof_malloc_size_var.c: Likewise.
* gcc.dg/struct/w_prof_local_array.c: Likewise.
* gcc.dg/struct/w_prof_single_str_global.c: Likewise.
* gcc.dg/struct/wo_prof_escape_str_init.c: Likewise.
* gcc.dg/struct/wo_prof_array_through_pointer.c: Likewise.
* gcc.dg/struct/w_prof_global_array.c: Likewise.
* gcc.dg/struct/wo_prof_array_field.c: Likewise.
* gcc.dg/struct/wo_prof_single_str_local.c: Likewise.
* gcc.dg/struct/w_prof_local_var.c: Likewise.
* gcc.dg/struct/wo_prof_two_strs.c: Likewise.
* gcc.dg/struct/wo_prof_empty_str.c: Likewise.
* gcc.dg/struct/wo_prof_local_array.c: Likewise.
* gcc.dg/struct/w_prof_global_var.c: Likewise.
* gcc.dg/struct/wo_prof_single_str_global.c: Likewise.
* gcc.dg/struct/wo_prof_escape_substr_value.c: Likewise.
* gcc.dg/struct/wo_prof_global_array.c: Likewise.
* gcc.dg/struct/wo_prof_escape_return.c: Likewise.
* gcc.dg/struct/wo_prof_escape_substr_array.c: Likewise.
* gcc.dg/struct/wo_prof_double_malloc.c: Likewise.
* gcc.dg/struct/w_ratio_cold_str.c: Likewise.
* gcc.dg/struct/wo_prof_escape_substr_pointer.c: Likewise.
* gcc.dg/struct/wo_prof_local_var.c: Likewise.
* gcc.dg/tree-prof/stringop-1.c: Adjust.
* g++.dg/tree-ssa/pr31146.C: Likewise.
* g++.dg/tree-ssa/copyprop-1.C: Likewise.
* g++.dg/tree-ssa/pr33604.C: Likewise.
* g++.dg/plugin/selfassign.c: Likewise.
* gfortran.dg/array_memcpy_3.f90: Likewise.
* gfortran.dg/array_memcpy_4.f90: Likewise.
* c-c++-common/torture/pr42834.c: New testcase.
From-SVN: r161655
2010-07-01 10:49:19 +02:00
|
|
|
|
case MEM_REF:
|
|
|
|
|
if (TREE_CODE (TREE_OPERAND (expr, 0)) == ADDR_EXPR)
|
|
|
|
|
return false;
|
|
|
|
|
/* Fallthru. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
case INDIRECT_REF:
|
2004-06-29 08:59:35 +02:00
|
|
|
|
return !TREE_THIS_NOTRAP (expr);
|
|
|
|
|
|
|
|
|
|
case ASM_EXPR:
|
|
|
|
|
return TREE_THIS_VOLATILE (expr);
|
2004-06-26 12:10:25 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case CALL_EXPR:
|
|
|
|
|
t = get_callee_fndecl (expr);
|
|
|
|
|
/* Assume that calls to weak functions may trap. */
|
|
|
|
|
if (!t || !DECL_P (t) || DECL_WEAK (t))
|
2004-06-29 08:59:35 +02:00
|
|
|
|
return true;
|
|
|
|
|
return false;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
default:
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-06-29 08:59:35 +02:00
|
|
|
|
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* Helper for stmt_could_throw_p. Return true if STMT (assumed to be a
|
|
|
|
|
an assignment or a conditional) may throw. */
|
2004-06-29 08:59:35 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
static bool
|
|
|
|
|
stmt_could_throw_1_p (gimple stmt)
|
|
|
|
|
{
|
|
|
|
|
enum tree_code code = gimple_expr_code (stmt);
|
|
|
|
|
bool honor_nans = false;
|
|
|
|
|
bool honor_snans = false;
|
|
|
|
|
bool fp_operation = false;
|
|
|
|
|
bool honor_trapv = false;
|
|
|
|
|
tree t;
|
|
|
|
|
size_t i;
|
|
|
|
|
bool handled, ret;
|
2004-07-11 20:14:48 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
if (TREE_CODE_CLASS (code) == tcc_comparison
|
|
|
|
|
|| TREE_CODE_CLASS (code) == tcc_unary
|
|
|
|
|
|| TREE_CODE_CLASS (code) == tcc_binary)
|
|
|
|
|
{
|
|
|
|
|
t = gimple_expr_type (stmt);
|
|
|
|
|
fp_operation = FLOAT_TYPE_P (t);
|
|
|
|
|
if (fp_operation)
|
|
|
|
|
{
|
|
|
|
|
honor_nans = flag_trapping_math && !flag_finite_math_only;
|
|
|
|
|
honor_snans = flag_signaling_nans != 0;
|
|
|
|
|
}
|
|
|
|
|
else if (INTEGRAL_TYPE_P (t) && TYPE_OVERFLOW_TRAPS (t))
|
|
|
|
|
honor_trapv = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Check if the main expression may trap. */
|
|
|
|
|
t = is_gimple_assign (stmt) ? gimple_assign_rhs2 (stmt) : NULL;
|
|
|
|
|
ret = operation_could_trap_helper_p (code, fp_operation, honor_trapv,
|
|
|
|
|
honor_nans, honor_snans, t,
|
|
|
|
|
&handled);
|
|
|
|
|
if (handled)
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
|
|
/* If the expression does not trap, see if any of the individual operands may
|
|
|
|
|
trap. */
|
|
|
|
|
for (i = 0; i < gimple_num_ops (stmt); i++)
|
|
|
|
|
if (tree_could_trap_p (gimple_op (stmt, i)))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Return true if statement STMT could throw an exception. */
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
stmt_could_throw_p (gimple stmt)
|
|
|
|
|
{
|
|
|
|
|
if (!flag_exceptions)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
/* The only statements that can throw an exception are assignments,
|
2009-09-14 21:18:58 +02:00
|
|
|
|
conditionals, calls, resx, and asms. */
|
|
|
|
|
switch (gimple_code (stmt))
|
|
|
|
|
{
|
|
|
|
|
case GIMPLE_RESX:
|
|
|
|
|
return true;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
case GIMPLE_CALL:
|
|
|
|
|
return !gimple_call_nothrow_p (stmt);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
case GIMPLE_ASSIGN:
|
|
|
|
|
case GIMPLE_COND:
|
2010-05-26 00:34:36 +02:00
|
|
|
|
if (!cfun->can_throw_non_call_exceptions)
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return false;
|
|
|
|
|
return stmt_could_throw_1_p (stmt);
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
case GIMPLE_ASM:
|
2010-05-26 00:34:36 +02:00
|
|
|
|
if (!cfun->can_throw_non_call_exceptions)
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return false;
|
|
|
|
|
return gimple_asm_volatile_p (stmt);
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
|
|
/* Return true if expression T could throw an exception. */
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
bool
|
|
|
|
|
tree_could_throw_p (tree t)
|
|
|
|
|
{
|
|
|
|
|
if (!flag_exceptions)
|
|
|
|
|
return false;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
if (TREE_CODE (t) == MODIFY_EXPR)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2010-05-26 00:34:36 +02:00
|
|
|
|
if (cfun->can_throw_non_call_exceptions
|
2009-09-14 21:18:58 +02:00
|
|
|
|
&& tree_could_trap_p (TREE_OPERAND (t, 0)))
|
|
|
|
|
return true;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
t = TREE_OPERAND (t, 1);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2004-07-16 23:13:08 +02:00
|
|
|
|
if (TREE_CODE (t) == WITH_SIZE_EXPR)
|
|
|
|
|
t = TREE_OPERAND (t, 0);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
if (TREE_CODE (t) == CALL_EXPR)
|
|
|
|
|
return (call_expr_flags (t) & ECF_NOTHROW) == 0;
|
2010-05-26 00:34:36 +02:00
|
|
|
|
if (cfun->can_throw_non_call_exceptions)
|
2004-06-11 20:41:47 +02:00
|
|
|
|
return tree_could_trap_p (t);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-28 20:29:35 +01:00
|
|
|
|
/* Return true if STMT can throw an exception that is not caught within
|
|
|
|
|
the current function (CFUN). */
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
stmt_can_throw_external (gimple stmt)
|
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
int lp_nr;
|
2009-03-28 20:29:35 +01:00
|
|
|
|
|
|
|
|
|
if (!stmt_could_throw_p (stmt))
|
|
|
|
|
return false;
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
lp_nr = lookup_stmt_eh_lp (stmt);
|
|
|
|
|
return lp_nr == 0;
|
2009-03-28 20:29:35 +01:00
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
|
|
|
|
/* Return true if STMT can throw an exception that is caught within
|
|
|
|
|
the current function (CFUN). */
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
bool
|
2008-07-28 16:33:56 +02:00
|
|
|
|
stmt_can_throw_internal (gimple stmt)
|
2004-05-13 08:41:07 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
int lp_nr;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (!stmt_could_throw_p (stmt))
|
2004-05-13 08:41:07 +02:00
|
|
|
|
return false;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
lp_nr = lookup_stmt_eh_lp (stmt);
|
|
|
|
|
return lp_nr > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Given a statement STMT in IFUN, if STMT can no longer throw, then
|
|
|
|
|
remove any entry it might have from the EH table. Return true if
|
|
|
|
|
any change was made. */
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
maybe_clean_eh_stmt_fn (struct function *ifun, gimple stmt)
|
|
|
|
|
{
|
|
|
|
|
if (stmt_could_throw_p (stmt))
|
|
|
|
|
return false;
|
|
|
|
|
return remove_stmt_from_eh_lp_fn (ifun, stmt);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Likewise, but always use the current function. */
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
maybe_clean_eh_stmt (gimple stmt)
|
|
|
|
|
{
|
|
|
|
|
return maybe_clean_eh_stmt_fn (cfun, stmt);
|
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
2005-05-17 01:14:02 +02:00
|
|
|
|
/* Given a statement OLD_STMT and a new statement NEW_STMT that has replaced
|
|
|
|
|
OLD_STMT in the function, remove OLD_STMT from the EH table and put NEW_STMT
|
|
|
|
|
in the table if it should be in there. Return TRUE if a replacement was
|
|
|
|
|
done that my require an EH edge purge. */
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
bool
|
|
|
|
|
maybe_clean_or_replace_eh_stmt (gimple old_stmt, gimple new_stmt)
|
2004-06-29 08:59:35 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
int lp_nr = lookup_stmt_eh_lp (old_stmt);
|
2005-05-17 01:14:02 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (lp_nr != 0)
|
2005-05-17 01:14:02 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
bool new_stmt_could_throw = stmt_could_throw_p (new_stmt);
|
2005-05-17 01:14:02 +02:00
|
|
|
|
|
|
|
|
|
if (new_stmt == old_stmt && new_stmt_could_throw)
|
|
|
|
|
return false;
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
remove_stmt_from_eh_lp (old_stmt);
|
2005-05-17 01:14:02 +02:00
|
|
|
|
if (new_stmt_could_throw)
|
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
add_stmt_to_eh_lp (new_stmt, lp_nr);
|
2005-05-17 01:14:02 +02:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2004-06-29 08:59:35 +02:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
/* Given a statement OLD_STMT in OLD_FUN and a duplicate statment NEW_STMT
|
|
|
|
|
in NEW_FUN, copy the EH table data from OLD_STMT to NEW_STMT. The MAP
|
|
|
|
|
operand is the return value of duplicate_eh_regions. */
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
maybe_duplicate_eh_stmt_fn (struct function *new_fun, gimple new_stmt,
|
|
|
|
|
struct function *old_fun, gimple old_stmt,
|
|
|
|
|
struct pointer_map_t *map, int default_lp_nr)
|
|
|
|
|
{
|
|
|
|
|
int old_lp_nr, new_lp_nr;
|
|
|
|
|
void **slot;
|
|
|
|
|
|
|
|
|
|
if (!stmt_could_throw_p (new_stmt))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
old_lp_nr = lookup_stmt_eh_lp_fn (old_fun, old_stmt);
|
|
|
|
|
if (old_lp_nr == 0)
|
|
|
|
|
{
|
|
|
|
|
if (default_lp_nr == 0)
|
|
|
|
|
return false;
|
|
|
|
|
new_lp_nr = default_lp_nr;
|
|
|
|
|
}
|
|
|
|
|
else if (old_lp_nr > 0)
|
|
|
|
|
{
|
|
|
|
|
eh_landing_pad old_lp, new_lp;
|
|
|
|
|
|
|
|
|
|
old_lp = VEC_index (eh_landing_pad, old_fun->eh->lp_array, old_lp_nr);
|
|
|
|
|
slot = pointer_map_contains (map, old_lp);
|
|
|
|
|
new_lp = (eh_landing_pad) *slot;
|
|
|
|
|
new_lp_nr = new_lp->index;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
eh_region old_r, new_r;
|
|
|
|
|
|
|
|
|
|
old_r = VEC_index (eh_region, old_fun->eh->region_array, -old_lp_nr);
|
|
|
|
|
slot = pointer_map_contains (map, old_r);
|
|
|
|
|
new_r = (eh_region) *slot;
|
|
|
|
|
new_lp_nr = -new_r->index;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
add_stmt_to_eh_lp_fn (new_fun, new_stmt, new_lp_nr);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Similar, but both OLD_STMT and NEW_STMT are within the current function,
|
|
|
|
|
and thus no remapping is required. */
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
maybe_duplicate_eh_stmt (gimple new_stmt, gimple old_stmt)
|
|
|
|
|
{
|
|
|
|
|
int lp_nr;
|
|
|
|
|
|
|
|
|
|
if (!stmt_could_throw_p (new_stmt))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
lp_nr = lookup_stmt_eh_lp (old_stmt);
|
|
|
|
|
if (lp_nr == 0)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
add_stmt_to_eh_lp (new_stmt, lp_nr);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2007-10-03 12:43:42 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
/* Returns TRUE if oneh and twoh are exception handlers (gimple_try_cleanup of
|
|
|
|
|
GIMPLE_TRY) that are similar enough to be considered the same. Currently
|
|
|
|
|
this only handles handlers consisting of a single call, as that's the
|
|
|
|
|
important case for C++: a destructor call for a particular object showing
|
|
|
|
|
up in multiple handlers. */
|
2007-10-03 12:43:42 +02:00
|
|
|
|
|
|
|
|
|
static bool
|
2008-07-28 16:33:56 +02:00
|
|
|
|
same_handler_p (gimple_seq oneh, gimple_seq twoh)
|
2007-10-03 12:43:42 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_stmt_iterator gsi;
|
|
|
|
|
gimple ones, twos;
|
|
|
|
|
unsigned int ai;
|
2007-10-03 12:43:42 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gsi = gsi_start (oneh);
|
|
|
|
|
if (!gsi_one_before_end_p (gsi))
|
2007-10-03 12:43:42 +02:00
|
|
|
|
return false;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
ones = gsi_stmt (gsi);
|
2007-10-03 12:43:42 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gsi = gsi_start (twoh);
|
|
|
|
|
if (!gsi_one_before_end_p (gsi))
|
2007-10-03 12:43:42 +02:00
|
|
|
|
return false;
|
2008-07-28 16:33:56 +02:00
|
|
|
|
twos = gsi_stmt (gsi);
|
|
|
|
|
|
|
|
|
|
if (!is_gimple_call (ones)
|
|
|
|
|
|| !is_gimple_call (twos)
|
|
|
|
|
|| gimple_call_lhs (ones)
|
|
|
|
|
|| gimple_call_lhs (twos)
|
|
|
|
|
|| gimple_call_chain (ones)
|
|
|
|
|
|| gimple_call_chain (twos)
|
2011-04-20 10:21:25 +02:00
|
|
|
|
|| !gimple_call_same_target_p (ones, twos)
|
2008-07-28 16:33:56 +02:00
|
|
|
|
|| gimple_call_num_args (ones) != gimple_call_num_args (twos))
|
2007-10-03 12:43:42 +02:00
|
|
|
|
return false;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
for (ai = 0; ai < gimple_call_num_args (ones); ++ai)
|
|
|
|
|
if (!operand_equal_p (gimple_call_arg (ones, ai),
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple_call_arg (twos, ai), 0))
|
2007-10-03 12:43:42 +02:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Optimize
|
|
|
|
|
try { A() } finally { try { ~B() } catch { ~A() } }
|
|
|
|
|
try { ... } finally { ~A() }
|
|
|
|
|
into
|
|
|
|
|
try { A() } catch { ~B() }
|
|
|
|
|
try { ~B() ... } finally { ~A() }
|
|
|
|
|
|
|
|
|
|
This occurs frequently in C++, where A is a local variable and B is a
|
|
|
|
|
temporary used in the initializer for A. */
|
|
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
optimize_double_finally (gimple one, gimple two)
|
2007-10-03 12:43:42 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple oneh;
|
|
|
|
|
gimple_stmt_iterator gsi;
|
2007-10-03 12:43:42 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gsi = gsi_start (gimple_try_cleanup (one));
|
|
|
|
|
if (!gsi_one_before_end_p (gsi))
|
2007-10-03 12:43:42 +02:00
|
|
|
|
return;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
oneh = gsi_stmt (gsi);
|
|
|
|
|
if (gimple_code (oneh) != GIMPLE_TRY
|
|
|
|
|
|| gimple_try_kind (oneh) != GIMPLE_TRY_CATCH)
|
2007-10-03 12:43:42 +02:00
|
|
|
|
return;
|
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
if (same_handler_p (gimple_try_cleanup (oneh), gimple_try_cleanup (two)))
|
2007-10-03 12:43:42 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_seq seq = gimple_try_eval (oneh);
|
2007-10-03 12:43:42 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_try_set_cleanup (one, seq);
|
|
|
|
|
gimple_try_set_kind (one, GIMPLE_TRY_CATCH);
|
|
|
|
|
seq = copy_gimple_seq_and_replace_locals (seq);
|
|
|
|
|
gimple_seq_add_seq (&seq, gimple_try_eval (two));
|
|
|
|
|
gimple_try_set_eval (two, seq);
|
2007-10-03 12:43:42 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Perform EH refactoring optimizations that are simpler to do when code
|
fixed-bit.c, [...]: Fix comment typos.
* config/fixed-bit.c, config/i386/cpuid.h, config/i386/i386.c,
config/i386/i386.md, config/i386/sse.md, function.c, jump.c,
modulo-sched.c, ra-conflict.c, toplev.c, tree-eh.c, tree-sra.c,
tree-ssa-dse.c, tree-vect-analyze.c, tree-vect-patterns.c,
tree-vect-transform.c: Fix comment typos.
* doc/extend.texi: Fix a typo.
From-SVN: r129291
2007-10-14 03:36:18 +02:00
|
|
|
|
flow has been lowered but EH structures haven't. */
|
2007-10-03 12:43:42 +02:00
|
|
|
|
|
|
|
|
|
static void
|
2008-07-28 16:33:56 +02:00
|
|
|
|
refactor_eh_r (gimple_seq seq)
|
2007-10-03 12:43:42 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
gimple_stmt_iterator gsi;
|
|
|
|
|
gimple one, two;
|
2007-10-03 12:43:42 +02:00
|
|
|
|
|
2008-07-28 16:33:56 +02:00
|
|
|
|
one = NULL;
|
|
|
|
|
two = NULL;
|
|
|
|
|
gsi = gsi_start (seq);
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
one = two;
|
|
|
|
|
if (gsi_end_p (gsi))
|
|
|
|
|
two = NULL;
|
|
|
|
|
else
|
|
|
|
|
two = gsi_stmt (gsi);
|
|
|
|
|
if (one
|
|
|
|
|
&& two
|
|
|
|
|
&& gimple_code (one) == GIMPLE_TRY
|
|
|
|
|
&& gimple_code (two) == GIMPLE_TRY
|
|
|
|
|
&& gimple_try_kind (one) == GIMPLE_TRY_FINALLY
|
|
|
|
|
&& gimple_try_kind (two) == GIMPLE_TRY_FINALLY)
|
|
|
|
|
optimize_double_finally (one, two);
|
|
|
|
|
if (one)
|
|
|
|
|
switch (gimple_code (one))
|
2007-10-03 12:43:42 +02:00
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
case GIMPLE_TRY:
|
|
|
|
|
refactor_eh_r (gimple_try_eval (one));
|
|
|
|
|
refactor_eh_r (gimple_try_cleanup (one));
|
|
|
|
|
break;
|
|
|
|
|
case GIMPLE_CATCH:
|
|
|
|
|
refactor_eh_r (gimple_catch_handler (one));
|
|
|
|
|
break;
|
|
|
|
|
case GIMPLE_EH_FILTER:
|
|
|
|
|
refactor_eh_r (gimple_eh_filter_failure (one));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
2007-10-03 12:43:42 +02:00
|
|
|
|
}
|
2008-07-28 16:33:56 +02:00
|
|
|
|
if (two)
|
|
|
|
|
gsi_next (&gsi);
|
|
|
|
|
else
|
|
|
|
|
break;
|
2007-10-03 12:43:42 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static unsigned
|
|
|
|
|
refactor_eh (void)
|
|
|
|
|
{
|
2008-07-28 16:33:56 +02:00
|
|
|
|
refactor_eh_r (gimple_body (current_function_decl));
|
2007-10-03 12:43:42 +02:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
static bool
|
|
|
|
|
gate_refactor_eh (void)
|
|
|
|
|
{
|
|
|
|
|
return flag_exceptions != 0;
|
|
|
|
|
}
|
|
|
|
|
|
re PR other/35094 (RTL dump file letters hosed and partly undocumented)
* gcc.dg/20050811-2.c: Update dumping flags.
* gcc.dg/sms-2.c: Update dumping flags.
* gcc.dg/var-expand1.c: Update dumping flags.
* gcc.dg/var-expand3.c: Update dumping flags.
* gcc.dg/pr30957-1.c: Update dumping flags.
* gcc.dg/20050811-1.c: Update dumping flags.
* gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail.
* gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail.
PR other/35094
* toplev.c (decode_d_option): Handle all CPP flags.
* tree-vrp.c: Update tree_pass descriptors.
* regrename.c: Update tree_pass descriptors.
* fwprop.c: Update tree_pass descriptors.
* doc/invoke.texi: Remove documentation of dropped -d? flags.
* tree-into-ssa.c: Update tree_pass descriptors.
* tree-dump.c: Update tree_pass descriptors.
* tree-complex.c: Update tree_pass descriptors.
* tree-dump.h: Update tree_pass descriptors.
* see.c: Update tree_pass descriptors.
* cgraphbuild.c: Update tree_pass descriptors.
* tracer.c: Update tree_pass descriptors.
* tree-loop-distribution.c: Update tree_pass descriptors.
* cgraph.c: Update tree_pass descriptors.
* postreload-gcse.c: Update tree_pass descriptors.
* postreload.c: Update tree_pass descriptors.
* tree-ssa-loop-ch.c: Update tree_pass descriptors.
* tree-tailcall.c: Update tree_pass descriptors.
* tree-pass.h (tree_opt_pass): Rename to ...
(opt_pass) ... this one; add "type" field and remove letter field.
(gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New.
(execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes,
all_lowering_passes): Update declaration.
* ipa-cp.c: Update tree_pass descriptors.
* final.c: Update tree_pass descriptors.
* omp-low.c: Update tree_pass descriptors.
* tree-ssa-dse.c: Update tree_pass descriptors.
* ipa-reference.c: Update tree_pass descriptors.
* tree-ssa-uncprop.c: Update tree_pass descriptors.
* auto-inc-dec.c: Update tree_pass descriptors.
* reorg.c: Update tree_pass descriptors.
* cgraphunit.c: Update tree_pass descriptors.
* tree-ssa-copyrename.c: Update tree_pass descriptors.
* tree-ssa-ccp.c: Update tree_pass descriptors.
* df-core.c: Update tree_pass descriptors.
* mode-switching.c: Update tree_pass descriptors.
* tree-nomudflap.c: Update tree_pass descriptors.
* modulo-sched.c: Update tree_pass descriptors.
* ipa-pure-const.c: Update tree_pass descriptors.
* cse.c: Update tree_pass descriptors.
* web.c: Update tree_pass descriptors.
* tree-stdarg.c: Update tree_pass descriptors.
* tree-ssa-math-opts.c: Update tree_pass descriptors.
* tree-ssa-dom.c: Update tree_pass descriptors.
* tree-nrv.c: Update tree_pass descriptors.
* tree-ssa-alias.c: Update tree_pass descriptors.
* loop-init.c: Update tree_pass descriptors.
* gimple-low.c: Update tree_pass descriptors.
* ipa-inline.c: Update tree_pass descriptors.
* tree-ssa-sink.c: Update tree_pass descriptors.
* global.c: Update tree_pass descriptors.
* ifcvt.c: Update tree_pass descriptors.
* jump.c: Update tree_pass descriptors.
* predict.c: Update tree_pass descriptors.
* tree-ssa-loop.c: Update tree_pass descriptors.
* recog.c: Update tree_pass descriptors.
* dse.c: Update tree_pass descriptors.
* tree-ssa-ifcombine.c: Update tree_pass descriptors.
* tree-eh.c: Update tree_pass descriptors.
* regmove.c: Update tree_pass descriptors.
* local-alloc.c
* function.c: Update tree_pass descriptors.
* tree-vectorizer.c: Update tree_pass descriptors.
* gcse.c: Update tree_pass descriptors.
* ipa-type-escape.c: Update tree_pass descriptors.
* tree-if-conv.c: Update tree_pass descriptors.
* init-regs.c: Update tree_pass descriptors.
* ipa.c: Update tree_pass descriptors.
* tree-ssa-phiopt.c: Update tree_pass descriptors.
* rtl-factoring.c: Update tree_pass descriptors.
* lower-subreg.c: Update tree_pass descriptors.
* bt-load.c: Update tree_pass descriptors.
* tree-dfa.c: Update tree_pass descriptors.
* except.c: Update tree_pass descriptors.
* emit-rtl.c: Update tree_pass descriptors.
* cfgexpand.c: Update tree_pass descriptors.
* tree-cfgcleanup.c: Update tree_pass descriptors.
* cfgcleanup.c: Update tree_pass descriptors.
* tree-ssa-pre.c: Update tree_pass descriptors.
* tree-sra.c: Update tree_pass descriptors.
* tree-mudflap.c: Update tree_pass descriptors.
* tree-ssa-copy.c: Update tree_pass descriptors.
* cfglayout.c: Update tree_pass descriptors.
* tree-ssa-forwprop.c: Update tree_pass descriptors.
* tree-ssa-dce.c: Update tree_pass descriptors.
* tree-ssa.c: Update tree_pass descriptors.
* regclass.c: Update tree_pass descriptors.
* integrate.c: Update tree_pass descriptors.
* tree-optimize.c: Update tree_pass descriptors.
* tree-ssa-phiprop.c: Update tree_pass descriptors.
* tree-object-size.c: Update tree_pass descriptors.
* combine.c: Update tree_pass descriptors.
* tree-outof-ssa.c: Update tree_pass descriptors.
* bb-reorder.c: Update tree_pass descriptors.
* stack-ptr-mod.c: Update tree_pass descriptors.
* var-tracking.c: Update tree_pass descriptors.
* tree-profile.c: Update tree_pass descriptors.
* tree-vect-generic.c: Update tree_pass descriptors.
* reg-stack.c: Update tree_pass descriptors.
* sched-rgn.c: Update tree_pass descriptors.
* tree-ssa-structalias.c: Update tree_pass descriptors.
* tree-cfg.c: Update tree_pass descriptors.
* passes.c (current_pass): Update declaration.
(finish_optimization_passes): Update.
(all_passes, all_ipa_passes, all_lowering_passes): Update declaration.
(register_one_dump_file, register_dump_files_1, next_pass_1):
Update arguments.
(init_optimization_passes): Update handling of new types.
(execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update.
* ipa-struct-reorg.c: Update tree_pass descriptors.
* tree-ssa-reassoc.c: Update tree_pass descriptors.
* combine-stack-adj.c: Update tree_pass descriptors.
* cfgrtl.c: Update tree_pass descriptors.
* dce.c: Update tree_pass descriptors.
* tree-ssanames.c: Update tree_pass descriptors.
From-SVN: r133342
2008-03-19 12:22:40 +01:00
|
|
|
|
struct gimple_opt_pass pass_refactor_eh =
|
2007-10-03 12:43:42 +02:00
|
|
|
|
{
|
re PR other/35094 (RTL dump file letters hosed and partly undocumented)
* gcc.dg/20050811-2.c: Update dumping flags.
* gcc.dg/sms-2.c: Update dumping flags.
* gcc.dg/var-expand1.c: Update dumping flags.
* gcc.dg/var-expand3.c: Update dumping flags.
* gcc.dg/pr30957-1.c: Update dumping flags.
* gcc.dg/20050811-1.c: Update dumping flags.
* gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail.
* gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail.
PR other/35094
* toplev.c (decode_d_option): Handle all CPP flags.
* tree-vrp.c: Update tree_pass descriptors.
* regrename.c: Update tree_pass descriptors.
* fwprop.c: Update tree_pass descriptors.
* doc/invoke.texi: Remove documentation of dropped -d? flags.
* tree-into-ssa.c: Update tree_pass descriptors.
* tree-dump.c: Update tree_pass descriptors.
* tree-complex.c: Update tree_pass descriptors.
* tree-dump.h: Update tree_pass descriptors.
* see.c: Update tree_pass descriptors.
* cgraphbuild.c: Update tree_pass descriptors.
* tracer.c: Update tree_pass descriptors.
* tree-loop-distribution.c: Update tree_pass descriptors.
* cgraph.c: Update tree_pass descriptors.
* postreload-gcse.c: Update tree_pass descriptors.
* postreload.c: Update tree_pass descriptors.
* tree-ssa-loop-ch.c: Update tree_pass descriptors.
* tree-tailcall.c: Update tree_pass descriptors.
* tree-pass.h (tree_opt_pass): Rename to ...
(opt_pass) ... this one; add "type" field and remove letter field.
(gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New.
(execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes,
all_lowering_passes): Update declaration.
* ipa-cp.c: Update tree_pass descriptors.
* final.c: Update tree_pass descriptors.
* omp-low.c: Update tree_pass descriptors.
* tree-ssa-dse.c: Update tree_pass descriptors.
* ipa-reference.c: Update tree_pass descriptors.
* tree-ssa-uncprop.c: Update tree_pass descriptors.
* auto-inc-dec.c: Update tree_pass descriptors.
* reorg.c: Update tree_pass descriptors.
* cgraphunit.c: Update tree_pass descriptors.
* tree-ssa-copyrename.c: Update tree_pass descriptors.
* tree-ssa-ccp.c: Update tree_pass descriptors.
* df-core.c: Update tree_pass descriptors.
* mode-switching.c: Update tree_pass descriptors.
* tree-nomudflap.c: Update tree_pass descriptors.
* modulo-sched.c: Update tree_pass descriptors.
* ipa-pure-const.c: Update tree_pass descriptors.
* cse.c: Update tree_pass descriptors.
* web.c: Update tree_pass descriptors.
* tree-stdarg.c: Update tree_pass descriptors.
* tree-ssa-math-opts.c: Update tree_pass descriptors.
* tree-ssa-dom.c: Update tree_pass descriptors.
* tree-nrv.c: Update tree_pass descriptors.
* tree-ssa-alias.c: Update tree_pass descriptors.
* loop-init.c: Update tree_pass descriptors.
* gimple-low.c: Update tree_pass descriptors.
* ipa-inline.c: Update tree_pass descriptors.
* tree-ssa-sink.c: Update tree_pass descriptors.
* global.c: Update tree_pass descriptors.
* ifcvt.c: Update tree_pass descriptors.
* jump.c: Update tree_pass descriptors.
* predict.c: Update tree_pass descriptors.
* tree-ssa-loop.c: Update tree_pass descriptors.
* recog.c: Update tree_pass descriptors.
* dse.c: Update tree_pass descriptors.
* tree-ssa-ifcombine.c: Update tree_pass descriptors.
* tree-eh.c: Update tree_pass descriptors.
* regmove.c: Update tree_pass descriptors.
* local-alloc.c
* function.c: Update tree_pass descriptors.
* tree-vectorizer.c: Update tree_pass descriptors.
* gcse.c: Update tree_pass descriptors.
* ipa-type-escape.c: Update tree_pass descriptors.
* tree-if-conv.c: Update tree_pass descriptors.
* init-regs.c: Update tree_pass descriptors.
* ipa.c: Update tree_pass descriptors.
* tree-ssa-phiopt.c: Update tree_pass descriptors.
* rtl-factoring.c: Update tree_pass descriptors.
* lower-subreg.c: Update tree_pass descriptors.
* bt-load.c: Update tree_pass descriptors.
* tree-dfa.c: Update tree_pass descriptors.
* except.c: Update tree_pass descriptors.
* emit-rtl.c: Update tree_pass descriptors.
* cfgexpand.c: Update tree_pass descriptors.
* tree-cfgcleanup.c: Update tree_pass descriptors.
* cfgcleanup.c: Update tree_pass descriptors.
* tree-ssa-pre.c: Update tree_pass descriptors.
* tree-sra.c: Update tree_pass descriptors.
* tree-mudflap.c: Update tree_pass descriptors.
* tree-ssa-copy.c: Update tree_pass descriptors.
* cfglayout.c: Update tree_pass descriptors.
* tree-ssa-forwprop.c: Update tree_pass descriptors.
* tree-ssa-dce.c: Update tree_pass descriptors.
* tree-ssa.c: Update tree_pass descriptors.
* regclass.c: Update tree_pass descriptors.
* integrate.c: Update tree_pass descriptors.
* tree-optimize.c: Update tree_pass descriptors.
* tree-ssa-phiprop.c: Update tree_pass descriptors.
* tree-object-size.c: Update tree_pass descriptors.
* combine.c: Update tree_pass descriptors.
* tree-outof-ssa.c: Update tree_pass descriptors.
* bb-reorder.c: Update tree_pass descriptors.
* stack-ptr-mod.c: Update tree_pass descriptors.
* var-tracking.c: Update tree_pass descriptors.
* tree-profile.c: Update tree_pass descriptors.
* tree-vect-generic.c: Update tree_pass descriptors.
* reg-stack.c: Update tree_pass descriptors.
* sched-rgn.c: Update tree_pass descriptors.
* tree-ssa-structalias.c: Update tree_pass descriptors.
* tree-cfg.c: Update tree_pass descriptors.
* passes.c (current_pass): Update declaration.
(finish_optimization_passes): Update.
(all_passes, all_ipa_passes, all_lowering_passes): Update declaration.
(register_one_dump_file, register_dump_files_1, next_pass_1):
Update arguments.
(init_optimization_passes): Update handling of new types.
(execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update.
* ipa-struct-reorg.c: Update tree_pass descriptors.
* tree-ssa-reassoc.c: Update tree_pass descriptors.
* combine-stack-adj.c: Update tree_pass descriptors.
* cfgrtl.c: Update tree_pass descriptors.
* dce.c: Update tree_pass descriptors.
* tree-ssanames.c: Update tree_pass descriptors.
From-SVN: r133342
2008-03-19 12:22:40 +01:00
|
|
|
|
{
|
|
|
|
|
GIMPLE_PASS,
|
2007-10-03 12:43:42 +02:00
|
|
|
|
"ehopt", /* name */
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gate_refactor_eh, /* gate */
|
2007-10-03 12:43:42 +02:00
|
|
|
|
refactor_eh, /* execute */
|
|
|
|
|
NULL, /* sub */
|
|
|
|
|
NULL, /* next */
|
|
|
|
|
0, /* static_pass_number */
|
|
|
|
|
TV_TREE_EH, /* tv_id */
|
|
|
|
|
PROP_gimple_lcf, /* properties_required */
|
|
|
|
|
0, /* properties_provided */
|
|
|
|
|
0, /* properties_destroyed */
|
|
|
|
|
0, /* todo_flags_start */
|
re PR other/35094 (RTL dump file letters hosed and partly undocumented)
* gcc.dg/20050811-2.c: Update dumping flags.
* gcc.dg/sms-2.c: Update dumping flags.
* gcc.dg/var-expand1.c: Update dumping flags.
* gcc.dg/var-expand3.c: Update dumping flags.
* gcc.dg/pr30957-1.c: Update dumping flags.
* gcc.dg/20050811-1.c: Update dumping flags.
* gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail.
* gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail.
PR other/35094
* toplev.c (decode_d_option): Handle all CPP flags.
* tree-vrp.c: Update tree_pass descriptors.
* regrename.c: Update tree_pass descriptors.
* fwprop.c: Update tree_pass descriptors.
* doc/invoke.texi: Remove documentation of dropped -d? flags.
* tree-into-ssa.c: Update tree_pass descriptors.
* tree-dump.c: Update tree_pass descriptors.
* tree-complex.c: Update tree_pass descriptors.
* tree-dump.h: Update tree_pass descriptors.
* see.c: Update tree_pass descriptors.
* cgraphbuild.c: Update tree_pass descriptors.
* tracer.c: Update tree_pass descriptors.
* tree-loop-distribution.c: Update tree_pass descriptors.
* cgraph.c: Update tree_pass descriptors.
* postreload-gcse.c: Update tree_pass descriptors.
* postreload.c: Update tree_pass descriptors.
* tree-ssa-loop-ch.c: Update tree_pass descriptors.
* tree-tailcall.c: Update tree_pass descriptors.
* tree-pass.h (tree_opt_pass): Rename to ...
(opt_pass) ... this one; add "type" field and remove letter field.
(gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New.
(execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes,
all_lowering_passes): Update declaration.
* ipa-cp.c: Update tree_pass descriptors.
* final.c: Update tree_pass descriptors.
* omp-low.c: Update tree_pass descriptors.
* tree-ssa-dse.c: Update tree_pass descriptors.
* ipa-reference.c: Update tree_pass descriptors.
* tree-ssa-uncprop.c: Update tree_pass descriptors.
* auto-inc-dec.c: Update tree_pass descriptors.
* reorg.c: Update tree_pass descriptors.
* cgraphunit.c: Update tree_pass descriptors.
* tree-ssa-copyrename.c: Update tree_pass descriptors.
* tree-ssa-ccp.c: Update tree_pass descriptors.
* df-core.c: Update tree_pass descriptors.
* mode-switching.c: Update tree_pass descriptors.
* tree-nomudflap.c: Update tree_pass descriptors.
* modulo-sched.c: Update tree_pass descriptors.
* ipa-pure-const.c: Update tree_pass descriptors.
* cse.c: Update tree_pass descriptors.
* web.c: Update tree_pass descriptors.
* tree-stdarg.c: Update tree_pass descriptors.
* tree-ssa-math-opts.c: Update tree_pass descriptors.
* tree-ssa-dom.c: Update tree_pass descriptors.
* tree-nrv.c: Update tree_pass descriptors.
* tree-ssa-alias.c: Update tree_pass descriptors.
* loop-init.c: Update tree_pass descriptors.
* gimple-low.c: Update tree_pass descriptors.
* ipa-inline.c: Update tree_pass descriptors.
* tree-ssa-sink.c: Update tree_pass descriptors.
* global.c: Update tree_pass descriptors.
* ifcvt.c: Update tree_pass descriptors.
* jump.c: Update tree_pass descriptors.
* predict.c: Update tree_pass descriptors.
* tree-ssa-loop.c: Update tree_pass descriptors.
* recog.c: Update tree_pass descriptors.
* dse.c: Update tree_pass descriptors.
* tree-ssa-ifcombine.c: Update tree_pass descriptors.
* tree-eh.c: Update tree_pass descriptors.
* regmove.c: Update tree_pass descriptors.
* local-alloc.c
* function.c: Update tree_pass descriptors.
* tree-vectorizer.c: Update tree_pass descriptors.
* gcse.c: Update tree_pass descriptors.
* ipa-type-escape.c: Update tree_pass descriptors.
* tree-if-conv.c: Update tree_pass descriptors.
* init-regs.c: Update tree_pass descriptors.
* ipa.c: Update tree_pass descriptors.
* tree-ssa-phiopt.c: Update tree_pass descriptors.
* rtl-factoring.c: Update tree_pass descriptors.
* lower-subreg.c: Update tree_pass descriptors.
* bt-load.c: Update tree_pass descriptors.
* tree-dfa.c: Update tree_pass descriptors.
* except.c: Update tree_pass descriptors.
* emit-rtl.c: Update tree_pass descriptors.
* cfgexpand.c: Update tree_pass descriptors.
* tree-cfgcleanup.c: Update tree_pass descriptors.
* cfgcleanup.c: Update tree_pass descriptors.
* tree-ssa-pre.c: Update tree_pass descriptors.
* tree-sra.c: Update tree_pass descriptors.
* tree-mudflap.c: Update tree_pass descriptors.
* tree-ssa-copy.c: Update tree_pass descriptors.
* cfglayout.c: Update tree_pass descriptors.
* tree-ssa-forwprop.c: Update tree_pass descriptors.
* tree-ssa-dce.c: Update tree_pass descriptors.
* tree-ssa.c: Update tree_pass descriptors.
* regclass.c: Update tree_pass descriptors.
* integrate.c: Update tree_pass descriptors.
* tree-optimize.c: Update tree_pass descriptors.
* tree-ssa-phiprop.c: Update tree_pass descriptors.
* tree-object-size.c: Update tree_pass descriptors.
* combine.c: Update tree_pass descriptors.
* tree-outof-ssa.c: Update tree_pass descriptors.
* bb-reorder.c: Update tree_pass descriptors.
* stack-ptr-mod.c: Update tree_pass descriptors.
* var-tracking.c: Update tree_pass descriptors.
* tree-profile.c: Update tree_pass descriptors.
* tree-vect-generic.c: Update tree_pass descriptors.
* reg-stack.c: Update tree_pass descriptors.
* sched-rgn.c: Update tree_pass descriptors.
* tree-ssa-structalias.c: Update tree_pass descriptors.
* tree-cfg.c: Update tree_pass descriptors.
* passes.c (current_pass): Update declaration.
(finish_optimization_passes): Update.
(all_passes, all_ipa_passes, all_lowering_passes): Update declaration.
(register_one_dump_file, register_dump_files_1, next_pass_1):
Update arguments.
(init_optimization_passes): Update handling of new types.
(execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update.
* ipa-struct-reorg.c: Update tree_pass descriptors.
* tree-ssa-reassoc.c: Update tree_pass descriptors.
* combine-stack-adj.c: Update tree_pass descriptors.
* cfgrtl.c: Update tree_pass descriptors.
* dce.c: Update tree_pass descriptors.
* tree-ssanames.c: Update tree_pass descriptors.
From-SVN: r133342
2008-03-19 12:22:40 +01:00
|
|
|
|
TODO_dump_func /* todo_flags_finish */
|
|
|
|
|
}
|
2007-10-03 12:43:42 +02:00
|
|
|
|
};
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
/* At the end of gimple optimization, we can lower RESX. */
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
static bool
|
|
|
|
|
lower_resx (basic_block bb, gimple stmt, struct pointer_map_t *mnt_map)
|
2009-03-29 15:32:13 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
int lp_nr;
|
|
|
|
|
eh_region src_r, dst_r;
|
|
|
|
|
gimple_stmt_iterator gsi;
|
|
|
|
|
gimple x;
|
|
|
|
|
tree fn, src_nr;
|
|
|
|
|
bool ret = false;
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
lp_nr = lookup_stmt_eh_lp (stmt);
|
|
|
|
|
if (lp_nr != 0)
|
|
|
|
|
dst_r = get_eh_region_from_lp_number (lp_nr);
|
|
|
|
|
else
|
|
|
|
|
dst_r = NULL;
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
src_r = get_eh_region_from_number (gimple_resx_region (stmt));
|
|
|
|
|
gsi = gsi_last_bb (bb);
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-25 22:49:08 +02:00
|
|
|
|
if (src_r == NULL)
|
|
|
|
|
{
|
|
|
|
|
/* We can wind up with no source region when pass_cleanup_eh shows
|
|
|
|
|
that there are no entries into an eh region and deletes it, but
|
|
|
|
|
then the block that contains the resx isn't removed. This can
|
|
|
|
|
happen without optimization when the switch statement created by
|
|
|
|
|
lower_try_finally_switch isn't simplified to remove the eh case.
|
|
|
|
|
|
|
|
|
|
Resolve this by expanding the resx node to an abort. */
|
|
|
|
|
|
|
|
|
|
fn = implicit_built_in_decls[BUILT_IN_TRAP];
|
|
|
|
|
x = gimple_build_call (fn, 0);
|
|
|
|
|
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
|
|
|
|
|
|
|
|
|
|
while (EDGE_COUNT (bb->succs) > 0)
|
|
|
|
|
remove_edge (EDGE_SUCC (bb, 0));
|
|
|
|
|
}
|
|
|
|
|
else if (dst_r)
|
2009-09-14 21:18:58 +02:00
|
|
|
|
{
|
|
|
|
|
/* When we have a destination region, we resolve this by copying
|
|
|
|
|
the excptr and filter values into place, and changing the edge
|
|
|
|
|
to immediately after the landing pad. */
|
|
|
|
|
edge e;
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (lp_nr < 0)
|
|
|
|
|
{
|
|
|
|
|
basic_block new_bb;
|
|
|
|
|
void **slot;
|
|
|
|
|
tree lab;
|
2009-04-25 11:02:05 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* We are resuming into a MUST_NOT_CALL region. Expand a call to
|
|
|
|
|
the failure decl into a new block, if needed. */
|
|
|
|
|
gcc_assert (dst_r->type == ERT_MUST_NOT_THROW);
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
slot = pointer_map_contains (mnt_map, dst_r);
|
|
|
|
|
if (slot == NULL)
|
|
|
|
|
{
|
|
|
|
|
gimple_stmt_iterator gsi2;
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
new_bb = create_empty_bb (bb);
|
|
|
|
|
lab = gimple_block_label (new_bb);
|
|
|
|
|
gsi2 = gsi_start_bb (new_bb);
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
fn = dst_r->u.must_not_throw.failure_decl;
|
|
|
|
|
x = gimple_build_call (fn, 0);
|
|
|
|
|
gimple_set_location (x, dst_r->u.must_not_throw.failure_loc);
|
|
|
|
|
gsi_insert_after (&gsi2, x, GSI_CONTINUE_LINKING);
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
slot = pointer_map_insert (mnt_map, dst_r);
|
|
|
|
|
*slot = lab;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
lab = (tree) *slot;
|
|
|
|
|
new_bb = label_to_block (lab);
|
|
|
|
|
}
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gcc_assert (EDGE_COUNT (bb->succs) == 0);
|
|
|
|
|
e = make_edge (bb, new_bb, EDGE_FALLTHRU);
|
|
|
|
|
e->count = bb->count;
|
|
|
|
|
e->probability = REG_BR_PROB_BASE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
edge_iterator ei;
|
|
|
|
|
tree dst_nr = build_int_cst (NULL, dst_r->index);
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
fn = implicit_built_in_decls[BUILT_IN_EH_COPY_VALUES];
|
2009-09-25 22:49:08 +02:00
|
|
|
|
src_nr = build_int_cst (NULL, src_r->index);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
x = gimple_build_call (fn, 2, dst_nr, src_nr);
|
|
|
|
|
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Update the flags for the outgoing edge. */
|
|
|
|
|
e = single_succ_edge (bb);
|
|
|
|
|
gcc_assert (e->flags & EDGE_EH);
|
|
|
|
|
e->flags = (e->flags & ~EDGE_EH) | EDGE_FALLTHRU;
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* If there are no more EH users of the landing pad, delete it. */
|
|
|
|
|
FOR_EACH_EDGE (e, ei, e->dest->preds)
|
|
|
|
|
if (e->flags & EDGE_EH)
|
|
|
|
|
break;
|
|
|
|
|
if (e == NULL)
|
|
|
|
|
{
|
|
|
|
|
eh_landing_pad lp = get_eh_landing_pad_from_number (lp_nr);
|
|
|
|
|
remove_eh_landing_pad (lp);
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
ret = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tree var;
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* When we don't have a destination region, this exception escapes
|
|
|
|
|
up the call chain. We resolve this by generating a call to the
|
|
|
|
|
_Unwind_Resume library function. */
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-28 18:44:32 +02:00
|
|
|
|
/* The ARM EABI redefines _Unwind_Resume as __cxa_end_cleanup
|
2009-09-14 21:18:58 +02:00
|
|
|
|
with no arguments for C++ and Java. Check for that. */
|
2009-09-28 18:44:32 +02:00
|
|
|
|
if (src_r->use_cxa_end_cleanup)
|
|
|
|
|
{
|
|
|
|
|
fn = implicit_built_in_decls[BUILT_IN_CXA_END_CLEANUP];
|
|
|
|
|
x = gimple_build_call (fn, 0);
|
|
|
|
|
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
|
|
|
|
|
}
|
|
|
|
|
else
|
2009-04-04 19:09:45 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
fn = implicit_built_in_decls[BUILT_IN_EH_POINTER];
|
2009-09-25 22:49:08 +02:00
|
|
|
|
src_nr = build_int_cst (NULL, src_r->index);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
x = gimple_build_call (fn, 1, src_nr);
|
|
|
|
|
var = create_tmp_var (ptr_type_node, NULL);
|
|
|
|
|
var = make_ssa_name (var, x);
|
|
|
|
|
gimple_call_set_lhs (x, var);
|
|
|
|
|
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
|
|
|
|
|
|
|
|
|
|
fn = implicit_built_in_decls[BUILT_IN_UNWIND_RESUME];
|
|
|
|
|
x = gimple_build_call (fn, 1, var);
|
|
|
|
|
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
|
2009-04-04 19:09:45 +02:00
|
|
|
|
}
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gcc_assert (EDGE_COUNT (bb->succs) == 0);
|
2009-04-04 19:09:45 +02:00
|
|
|
|
}
|
2009-04-25 11:02:05 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gsi_remove (&gsi, true);
|
|
|
|
|
|
|
|
|
|
return ret;
|
2009-04-04 19:09:45 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
static unsigned
|
|
|
|
|
execute_lower_resx (void)
|
|
|
|
|
{
|
|
|
|
|
basic_block bb;
|
|
|
|
|
struct pointer_map_t *mnt_map;
|
|
|
|
|
bool dominance_invalidated = false;
|
|
|
|
|
bool any_rewritten = false;
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
mnt_map = pointer_map_create ();
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
FOR_EACH_BB (bb)
|
|
|
|
|
{
|
|
|
|
|
gimple last = last_stmt (bb);
|
|
|
|
|
if (last && is_gimple_resx (last))
|
|
|
|
|
{
|
|
|
|
|
dominance_invalidated |= lower_resx (bb, last, mnt_map);
|
|
|
|
|
any_rewritten = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pointer_map_destroy (mnt_map);
|
|
|
|
|
|
|
|
|
|
if (dominance_invalidated)
|
|
|
|
|
{
|
|
|
|
|
free_dominance_info (CDI_DOMINATORS);
|
|
|
|
|
free_dominance_info (CDI_POST_DOMINATORS);
|
2009-04-04 19:09:45 +02:00
|
|
|
|
}
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return any_rewritten ? TODO_update_ssa_only_virtuals : 0;
|
|
|
|
|
}
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
static bool
|
2009-09-25 22:49:08 +02:00
|
|
|
|
gate_lower_resx (void)
|
2009-09-14 21:18:58 +02:00
|
|
|
|
{
|
2009-09-25 22:49:08 +02:00
|
|
|
|
return flag_exceptions != 0;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
}
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
struct gimple_opt_pass pass_lower_resx =
|
2009-04-04 19:09:45 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
{
|
|
|
|
|
GIMPLE_PASS,
|
|
|
|
|
"resx", /* name */
|
2009-09-25 22:49:08 +02:00
|
|
|
|
gate_lower_resx, /* gate */
|
2009-09-14 21:18:58 +02:00
|
|
|
|
execute_lower_resx, /* execute */
|
|
|
|
|
NULL, /* sub */
|
|
|
|
|
NULL, /* next */
|
|
|
|
|
0, /* static_pass_number */
|
|
|
|
|
TV_TREE_EH, /* tv_id */
|
|
|
|
|
PROP_gimple_lcf, /* properties_required */
|
|
|
|
|
0, /* properties_provided */
|
|
|
|
|
0, /* properties_destroyed */
|
|
|
|
|
0, /* todo_flags_start */
|
|
|
|
|
TODO_dump_func | TODO_verify_flow /* todo_flags_finish */
|
|
|
|
|
}
|
2009-04-04 19:09:45 +02:00
|
|
|
|
};
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
2010-03-10 12:08:48 +01:00
|
|
|
|
/* At the end of inlining, we can lower EH_DISPATCH. Return true when
|
|
|
|
|
we have found some duplicate labels and removed some edges. */
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2010-03-10 12:08:48 +01:00
|
|
|
|
static bool
|
2009-09-14 21:18:58 +02:00
|
|
|
|
lower_eh_dispatch (basic_block src, gimple stmt)
|
2009-04-04 19:09:45 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple_stmt_iterator gsi;
|
|
|
|
|
int region_nr;
|
|
|
|
|
eh_region r;
|
|
|
|
|
tree filter, fn;
|
|
|
|
|
gimple x;
|
2010-03-10 12:08:48 +01:00
|
|
|
|
bool redirected = false;
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
region_nr = gimple_eh_dispatch_region (stmt);
|
|
|
|
|
r = get_eh_region_from_number (region_nr);
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gsi = gsi_last_bb (src);
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
switch (r->type)
|
2009-04-04 19:09:45 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
case ERT_TRY:
|
|
|
|
|
{
|
|
|
|
|
VEC (tree, heap) *labels = NULL;
|
|
|
|
|
tree default_label = NULL;
|
|
|
|
|
eh_catch c;
|
|
|
|
|
edge_iterator ei;
|
|
|
|
|
edge e;
|
2010-03-10 12:08:48 +01:00
|
|
|
|
struct pointer_set_t *seen_values = pointer_set_create ();
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
/* Collect the labels for a switch. Zero the post_landing_pad
|
|
|
|
|
field becase we'll no longer have anything keeping these labels
|
|
|
|
|
in existance and the optimizer will be free to merge these
|
|
|
|
|
blocks at will. */
|
|
|
|
|
for (c = r->u.eh_try.first_catch; c ; c = c->next_catch)
|
|
|
|
|
{
|
|
|
|
|
tree tp_node, flt_node, lab = c->label;
|
2010-03-10 12:08:48 +01:00
|
|
|
|
bool have_label = false;
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
c->label = NULL;
|
|
|
|
|
tp_node = c->type_list;
|
|
|
|
|
flt_node = c->filter_list;
|
|
|
|
|
|
|
|
|
|
if (tp_node == NULL)
|
|
|
|
|
{
|
|
|
|
|
default_label = lab;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
do
|
|
|
|
|
{
|
2010-03-10 12:08:48 +01:00
|
|
|
|
/* Filter out duplicate labels that arise when this handler
|
|
|
|
|
is shadowed by an earlier one. When no labels are
|
|
|
|
|
attached to the handler anymore, we remove
|
|
|
|
|
the corresponding edge and then we delete unreachable
|
|
|
|
|
blocks at the end of this pass. */
|
|
|
|
|
if (! pointer_set_contains (seen_values, TREE_VALUE (flt_node)))
|
|
|
|
|
{
|
|
|
|
|
tree t = build3 (CASE_LABEL_EXPR, void_type_node,
|
|
|
|
|
TREE_VALUE (flt_node), NULL, lab);
|
|
|
|
|
VEC_safe_push (tree, heap, labels, t);
|
|
|
|
|
pointer_set_insert (seen_values, TREE_VALUE (flt_node));
|
|
|
|
|
have_label = true;
|
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
tp_node = TREE_CHAIN (tp_node);
|
|
|
|
|
flt_node = TREE_CHAIN (flt_node);
|
|
|
|
|
}
|
|
|
|
|
while (tp_node);
|
2010-03-10 12:08:48 +01:00
|
|
|
|
if (! have_label)
|
|
|
|
|
{
|
|
|
|
|
remove_edge (find_edge (src, label_to_block (lab)));
|
|
|
|
|
redirected = true;
|
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Clean up the edge flags. */
|
|
|
|
|
FOR_EACH_EDGE (e, ei, src->succs)
|
|
|
|
|
{
|
|
|
|
|
if (e->flags & EDGE_FALLTHRU)
|
|
|
|
|
{
|
|
|
|
|
/* If there was no catch-all, use the fallthru edge. */
|
|
|
|
|
if (default_label == NULL)
|
|
|
|
|
default_label = gimple_block_label (e->dest);
|
|
|
|
|
e->flags &= ~EDGE_FALLTHRU;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gcc_assert (default_label != NULL);
|
|
|
|
|
|
|
|
|
|
/* Don't generate a switch if there's only a default case.
|
|
|
|
|
This is common in the form of try { A; } catch (...) { B; }. */
|
|
|
|
|
if (labels == NULL)
|
|
|
|
|
{
|
|
|
|
|
e = single_succ_edge (src);
|
|
|
|
|
e->flags |= EDGE_FALLTHRU;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fn = implicit_built_in_decls[BUILT_IN_EH_FILTER];
|
|
|
|
|
x = gimple_build_call (fn, 1, build_int_cst (NULL, region_nr));
|
|
|
|
|
filter = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
|
|
|
|
|
filter = make_ssa_name (filter, x);
|
|
|
|
|
gimple_call_set_lhs (x, filter);
|
|
|
|
|
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
|
|
|
|
|
|
|
|
|
|
/* Turn the default label into a default case. */
|
|
|
|
|
default_label = build3 (CASE_LABEL_EXPR, void_type_node,
|
|
|
|
|
NULL, NULL, default_label);
|
|
|
|
|
sort_case_labels (labels);
|
|
|
|
|
|
|
|
|
|
x = gimple_build_switch_vec (filter, default_label, labels);
|
|
|
|
|
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
|
|
|
|
|
|
|
|
|
|
VEC_free (tree, heap, labels);
|
|
|
|
|
}
|
2010-03-10 12:08:48 +01:00
|
|
|
|
pointer_set_destroy (seen_values);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ERT_ALLOWED_EXCEPTIONS:
|
|
|
|
|
{
|
|
|
|
|
edge b_e = BRANCH_EDGE (src);
|
|
|
|
|
edge f_e = FALLTHRU_EDGE (src);
|
|
|
|
|
|
|
|
|
|
fn = implicit_built_in_decls[BUILT_IN_EH_FILTER];
|
|
|
|
|
x = gimple_build_call (fn, 1, build_int_cst (NULL, region_nr));
|
|
|
|
|
filter = create_tmp_var (TREE_TYPE (TREE_TYPE (fn)), NULL);
|
|
|
|
|
filter = make_ssa_name (filter, x);
|
|
|
|
|
gimple_call_set_lhs (x, filter);
|
|
|
|
|
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
|
|
|
|
|
|
|
|
|
|
r->u.allowed.label = NULL;
|
|
|
|
|
x = gimple_build_cond (EQ_EXPR, filter,
|
|
|
|
|
build_int_cst (TREE_TYPE (filter),
|
|
|
|
|
r->u.allowed.filter),
|
|
|
|
|
NULL_TREE, NULL_TREE);
|
|
|
|
|
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
|
|
|
|
|
|
|
|
|
|
b_e->flags = b_e->flags | EDGE_TRUE_VALUE;
|
|
|
|
|
f_e->flags = (f_e->flags & ~EDGE_FALLTHRU) | EDGE_FALSE_VALUE;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
gcc_unreachable ();
|
2009-04-04 19:09:45 +02:00
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
/* Replace the EH_DISPATCH with the SWITCH or COND generated above. */
|
|
|
|
|
gsi_remove (&gsi, true);
|
2010-03-10 12:08:48 +01:00
|
|
|
|
return redirected;
|
2009-04-04 19:09:45 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
static unsigned
|
|
|
|
|
execute_lower_eh_dispatch (void)
|
|
|
|
|
{
|
|
|
|
|
basic_block bb;
|
|
|
|
|
bool any_rewritten = false;
|
2010-03-10 12:08:48 +01:00
|
|
|
|
bool redirected = false;
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
assign_filter_values ();
|
2009-04-25 11:02:05 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
FOR_EACH_BB (bb)
|
|
|
|
|
{
|
|
|
|
|
gimple last = last_stmt (bb);
|
|
|
|
|
if (last && gimple_code (last) == GIMPLE_EH_DISPATCH)
|
|
|
|
|
{
|
2010-03-10 12:08:48 +01:00
|
|
|
|
redirected |= lower_eh_dispatch (bb, last);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
any_rewritten = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-10 12:08:48 +01:00
|
|
|
|
if (redirected)
|
|
|
|
|
delete_unreachable_blocks ();
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return any_rewritten ? TODO_update_ssa_only_virtuals : 0;
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-25 22:49:08 +02:00
|
|
|
|
static bool
|
|
|
|
|
gate_lower_eh_dispatch (void)
|
|
|
|
|
{
|
|
|
|
|
return cfun->eh->region_tree != NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
struct gimple_opt_pass pass_lower_eh_dispatch =
|
2009-04-04 19:09:45 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
{
|
|
|
|
|
GIMPLE_PASS,
|
|
|
|
|
"ehdisp", /* name */
|
2009-09-25 22:49:08 +02:00
|
|
|
|
gate_lower_eh_dispatch, /* gate */
|
2009-09-14 21:18:58 +02:00
|
|
|
|
execute_lower_eh_dispatch, /* execute */
|
|
|
|
|
NULL, /* sub */
|
|
|
|
|
NULL, /* next */
|
|
|
|
|
0, /* static_pass_number */
|
|
|
|
|
TV_TREE_EH, /* tv_id */
|
|
|
|
|
PROP_gimple_lcf, /* properties_required */
|
|
|
|
|
0, /* properties_provided */
|
|
|
|
|
0, /* properties_destroyed */
|
|
|
|
|
0, /* todo_flags_start */
|
|
|
|
|
TODO_dump_func | TODO_verify_flow /* todo_flags_finish */
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Walk statements, see what regions are really referenced and remove
|
|
|
|
|
those that are unused. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
remove_unreachable_handlers (void)
|
|
|
|
|
{
|
|
|
|
|
sbitmap r_reachable, lp_reachable;
|
|
|
|
|
eh_region region;
|
|
|
|
|
eh_landing_pad lp;
|
|
|
|
|
basic_block bb;
|
|
|
|
|
int lp_nr, r_nr;
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
r_reachable = sbitmap_alloc (VEC_length (eh_region, cfun->eh->region_array));
|
|
|
|
|
lp_reachable
|
|
|
|
|
= sbitmap_alloc (VEC_length (eh_landing_pad, cfun->eh->lp_array));
|
|
|
|
|
sbitmap_zero (r_reachable);
|
|
|
|
|
sbitmap_zero (lp_reachable);
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
FOR_EACH_BB (bb)
|
2009-04-04 19:09:45 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple_stmt_iterator gsi = gsi_start_bb (bb);
|
|
|
|
|
|
|
|
|
|
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
|
|
|
|
|
{
|
|
|
|
|
gimple stmt = gsi_stmt (gsi);
|
|
|
|
|
lp_nr = lookup_stmt_eh_lp (stmt);
|
|
|
|
|
|
|
|
|
|
/* Negative LP numbers are MUST_NOT_THROW regions which
|
|
|
|
|
are not considered BB enders. */
|
|
|
|
|
if (lp_nr < 0)
|
|
|
|
|
SET_BIT (r_reachable, -lp_nr);
|
|
|
|
|
|
|
|
|
|
/* Positive LP numbers are real landing pads, are are BB enders. */
|
|
|
|
|
else if (lp_nr > 0)
|
|
|
|
|
{
|
|
|
|
|
gcc_assert (gsi_one_before_end_p (gsi));
|
|
|
|
|
region = get_eh_region_from_lp_number (lp_nr);
|
|
|
|
|
SET_BIT (r_reachable, region->index);
|
|
|
|
|
SET_BIT (lp_reachable, lp_nr);
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-04-04 19:09:45 +02:00
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
if (dump_file)
|
2009-04-04 19:09:45 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
fprintf (dump_file, "Before removal of unreachable regions:\n");
|
|
|
|
|
dump_eh_tree (dump_file, cfun);
|
|
|
|
|
fprintf (dump_file, "Reachable regions: ");
|
|
|
|
|
dump_sbitmap_file (dump_file, r_reachable);
|
|
|
|
|
fprintf (dump_file, "Reachable landing pads: ");
|
|
|
|
|
dump_sbitmap_file (dump_file, lp_reachable);
|
2009-04-04 19:09:45 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
for (r_nr = 1;
|
|
|
|
|
VEC_iterate (eh_region, cfun->eh->region_array, r_nr, region); ++r_nr)
|
|
|
|
|
if (region && !TEST_BIT (r_reachable, r_nr))
|
|
|
|
|
{
|
|
|
|
|
if (dump_file)
|
|
|
|
|
fprintf (dump_file, "Removing unreachable region %d\n", r_nr);
|
|
|
|
|
remove_eh_handler (region);
|
|
|
|
|
}
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
for (lp_nr = 1;
|
|
|
|
|
VEC_iterate (eh_landing_pad, cfun->eh->lp_array, lp_nr, lp); ++lp_nr)
|
|
|
|
|
if (lp && !TEST_BIT (lp_reachable, lp_nr))
|
|
|
|
|
{
|
|
|
|
|
if (dump_file)
|
|
|
|
|
fprintf (dump_file, "Removing unreachable landing pad %d\n", lp_nr);
|
|
|
|
|
remove_eh_landing_pad (lp);
|
|
|
|
|
}
|
2009-11-25 11:55:54 +01:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (dump_file)
|
2009-04-04 19:09:45 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
fprintf (dump_file, "\n\nAfter removal of unreachable regions:\n");
|
|
|
|
|
dump_eh_tree (dump_file, cfun);
|
|
|
|
|
fprintf (dump_file, "\n\n");
|
2009-04-04 19:09:45 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
sbitmap_free (r_reachable);
|
|
|
|
|
sbitmap_free (lp_reachable);
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_CHECKING
|
|
|
|
|
verify_eh_tree (cfun);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Remove regions that do not have landing pads. This assumes
|
|
|
|
|
that remove_unreachable_handlers has already been run, and
|
|
|
|
|
that we've just manipulated the landing pads since then. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
remove_unreachable_handlers_no_lp (void)
|
|
|
|
|
{
|
|
|
|
|
eh_region r;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = 1; VEC_iterate (eh_region, cfun->eh->region_array, i, r); ++i)
|
|
|
|
|
if (r && r->landing_pads == NULL && r->type != ERT_MUST_NOT_THROW)
|
|
|
|
|
{
|
|
|
|
|
if (dump_file)
|
|
|
|
|
fprintf (dump_file, "Removing unreachable region %d\n", i);
|
|
|
|
|
remove_eh_handler (r);
|
|
|
|
|
}
|
2009-04-04 19:09:45 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Undo critical edge splitting on an EH landing pad. Earlier, we
|
|
|
|
|
optimisticaly split all sorts of edges, including EH edges. The
|
|
|
|
|
optimization passes in between may not have needed them; if not,
|
|
|
|
|
we should undo the split.
|
|
|
|
|
|
|
|
|
|
Recognize this case by having one EH edge incoming to the BB and
|
|
|
|
|
one normal edge outgoing; BB should be empty apart from the
|
|
|
|
|
post_landing_pad label.
|
|
|
|
|
|
|
|
|
|
Note that this is slightly different from the empty handler case
|
|
|
|
|
handled by cleanup_empty_eh, in that the actual handler may yet
|
|
|
|
|
have actual code but the landing pad has been separated from the
|
|
|
|
|
handler. As such, cleanup_empty_eh relies on this transformation
|
|
|
|
|
having been done first. */
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
|
|
|
|
static bool
|
2009-09-14 21:18:58 +02:00
|
|
|
|
unsplit_eh (eh_landing_pad lp)
|
2009-03-29 15:32:13 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
basic_block bb = label_to_block (lp->post_landing_pad);
|
|
|
|
|
gimple_stmt_iterator gsi;
|
|
|
|
|
edge e_in, e_out;
|
|
|
|
|
|
|
|
|
|
/* Quickly check the edge counts on BB for singularity. */
|
|
|
|
|
if (EDGE_COUNT (bb->preds) != 1 || EDGE_COUNT (bb->succs) != 1)
|
|
|
|
|
return false;
|
|
|
|
|
e_in = EDGE_PRED (bb, 0);
|
|
|
|
|
e_out = EDGE_SUCC (bb, 0);
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Input edge must be EH and output edge must be normal. */
|
|
|
|
|
if ((e_in->flags & EDGE_EH) == 0 || (e_out->flags & EDGE_EH) != 0)
|
|
|
|
|
return false;
|
|
|
|
|
|
2010-01-26 16:09:43 +01:00
|
|
|
|
/* The block must be empty except for the labels and debug insns. */
|
|
|
|
|
gsi = gsi_after_labels (bb);
|
|
|
|
|
if (!gsi_end_p (gsi) && is_gimple_debug (gsi_stmt (gsi)))
|
|
|
|
|
gsi_next_nondebug (&gsi);
|
|
|
|
|
if (!gsi_end_p (gsi))
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
/* The destination block must not already have a landing pad
|
|
|
|
|
for a different region. */
|
|
|
|
|
for (gsi = gsi_start_bb (e_out->dest); !gsi_end_p (gsi); gsi_next (&gsi))
|
2009-03-29 15:32:13 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gimple stmt = gsi_stmt (gsi);
|
|
|
|
|
tree lab;
|
|
|
|
|
int lp_nr;
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (gimple_code (stmt) != GIMPLE_LABEL)
|
|
|
|
|
break;
|
|
|
|
|
lab = gimple_label_label (stmt);
|
|
|
|
|
lp_nr = EH_LANDING_PAD_NR (lab);
|
|
|
|
|
if (lp_nr && get_eh_region_from_lp_number (lp_nr) != lp->region)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-30 01:46:02 +02:00
|
|
|
|
/* The new destination block must not already be a destination of
|
|
|
|
|
the source block, lest we merge fallthru and eh edges and get
|
|
|
|
|
all sorts of confused. */
|
|
|
|
|
if (find_edge (e_in->src, e_out->dest))
|
|
|
|
|
return false;
|
|
|
|
|
|
2009-10-13 20:41:56 +02:00
|
|
|
|
/* ??? We can get degenerate phis due to cfg cleanups. I would have
|
|
|
|
|
thought this should have been cleaned up by a phicprop pass, but
|
|
|
|
|
that doesn't appear to handle virtuals. Propagate by hand. */
|
|
|
|
|
if (!gimple_seq_empty_p (phi_nodes (bb)))
|
|
|
|
|
{
|
|
|
|
|
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); )
|
|
|
|
|
{
|
|
|
|
|
gimple use_stmt, phi = gsi_stmt (gsi);
|
|
|
|
|
tree lhs = gimple_phi_result (phi);
|
|
|
|
|
tree rhs = gimple_phi_arg_def (phi, 0);
|
|
|
|
|
use_operand_p use_p;
|
|
|
|
|
imm_use_iterator iter;
|
|
|
|
|
|
|
|
|
|
FOR_EACH_IMM_USE_STMT (use_stmt, iter, lhs)
|
|
|
|
|
{
|
|
|
|
|
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
|
|
|
|
|
SET_USE (use_p, rhs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
|
|
|
|
|
SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs) = 1;
|
|
|
|
|
|
|
|
|
|
remove_phi_node (&gsi, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-04-25 11:02:05 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
|
fprintf (dump_file, "Unsplit EH landing pad %d to block %i.\n",
|
|
|
|
|
lp->index, e_out->dest->index);
|
|
|
|
|
|
|
|
|
|
/* Redirect the edge. Since redirect_eh_edge_1 expects to be moving
|
|
|
|
|
a successor edge, humor it. But do the real CFG change with the
|
|
|
|
|
predecessor of E_OUT in order to preserve the ordering of arguments
|
|
|
|
|
to the PHI nodes in E_OUT->DEST. */
|
|
|
|
|
redirect_eh_edge_1 (e_in, e_out->dest, false);
|
|
|
|
|
redirect_edge_pred (e_out, e_in->src);
|
|
|
|
|
e_out->flags = e_in->flags;
|
|
|
|
|
e_out->probability = e_in->probability;
|
|
|
|
|
e_out->count = e_in->count;
|
|
|
|
|
remove_edge (e_in);
|
2009-04-25 11:02:05 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return true;
|
|
|
|
|
}
|
2009-04-25 11:02:05 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Examine each landing pad block and see if it matches unsplit_eh. */
|
2009-04-25 11:02:05 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
static bool
|
|
|
|
|
unsplit_all_eh (void)
|
|
|
|
|
{
|
|
|
|
|
bool changed = false;
|
|
|
|
|
eh_landing_pad lp;
|
|
|
|
|
int i;
|
2009-04-25 11:02:05 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
for (i = 1; VEC_iterate (eh_landing_pad, cfun->eh->lp_array, i, lp); ++i)
|
|
|
|
|
if (lp)
|
|
|
|
|
changed |= unsplit_eh (lp);
|
|
|
|
|
|
|
|
|
|
return changed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A subroutine of cleanup_empty_eh. Redirect all EH edges incoming
|
|
|
|
|
to OLD_BB to NEW_BB; return true on success, false on failure.
|
|
|
|
|
|
|
|
|
|
OLD_BB_OUT is the edge into NEW_BB from OLD_BB, so if we miss any
|
|
|
|
|
PHI variables from OLD_BB we can pick them up from OLD_BB_OUT.
|
|
|
|
|
Virtual PHIs may be deleted and marked for renaming. */
|
|
|
|
|
|
|
|
|
|
static bool
|
|
|
|
|
cleanup_empty_eh_merge_phis (basic_block new_bb, basic_block old_bb,
|
2009-10-13 20:41:56 +02:00
|
|
|
|
edge old_bb_out, bool change_region)
|
2009-09-14 21:18:58 +02:00
|
|
|
|
{
|
|
|
|
|
gimple_stmt_iterator ngsi, ogsi;
|
|
|
|
|
edge_iterator ei;
|
|
|
|
|
edge e;
|
|
|
|
|
bitmap rename_virts;
|
|
|
|
|
bitmap ophi_handled;
|
|
|
|
|
|
|
|
|
|
FOR_EACH_EDGE (e, ei, old_bb->preds)
|
|
|
|
|
redirect_edge_var_map_clear (e);
|
|
|
|
|
|
|
|
|
|
ophi_handled = BITMAP_ALLOC (NULL);
|
|
|
|
|
rename_virts = BITMAP_ALLOC (NULL);
|
|
|
|
|
|
|
|
|
|
/* First, iterate through the PHIs on NEW_BB and set up the edge_var_map
|
|
|
|
|
for the edges we're going to move. */
|
|
|
|
|
for (ngsi = gsi_start_phis (new_bb); !gsi_end_p (ngsi); gsi_next (&ngsi))
|
|
|
|
|
{
|
|
|
|
|
gimple ophi, nphi = gsi_stmt (ngsi);
|
|
|
|
|
tree nresult, nop;
|
|
|
|
|
|
|
|
|
|
nresult = gimple_phi_result (nphi);
|
|
|
|
|
nop = gimple_phi_arg_def (nphi, old_bb_out->dest_idx);
|
|
|
|
|
|
|
|
|
|
/* Find the corresponding PHI in OLD_BB so we can forward-propagate
|
|
|
|
|
the source ssa_name. */
|
|
|
|
|
ophi = NULL;
|
|
|
|
|
for (ogsi = gsi_start_phis (old_bb); !gsi_end_p (ogsi); gsi_next (&ogsi))
|
|
|
|
|
{
|
|
|
|
|
ophi = gsi_stmt (ogsi);
|
|
|
|
|
if (gimple_phi_result (ophi) == nop)
|
|
|
|
|
break;
|
|
|
|
|
ophi = NULL;
|
tree.c (list_equal_p): New function.
* tree.c (list_equal_p): New function.
* tree.h (list_equal_p): Declare.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): New.
* tree-eh.c (make_eh_edge): EH edges are not abnormal.
(redirect_eh_edge): New function.
(make_eh_edge_update_phi): EH edges are not abnormal.
* except.c: Include tree-flow.h.
(list_match): New function.
(eh_region_replaceable_by_p): New function.
(replace_region): New function.
(hash_type_list): New function.
(hash_eh_region): New function.
(eh_regions_equal_p): New function.
(merge_peers): New function.
(remove_unreachable_regions): Verify EH tree when checking;
merge peers.
(copy_eh_region_1): New function.
(copy_eh_region): New function.
(push_reachable_handler): New function.
(build_post_landing_pads, dw2_build_landing_pads): Be ready for
regions without label but with live RESX.
* except.h (redirect_eh_edge_to_label): New.
* tree-flow.h (redirect_eh_edge): New.
* coretypes.h (edge_def, edge, const_edge, basic_block_def
basic_block_def, basic_block, const_basic_block): Remove.
* Makefile.in (except.o): Add dependency on tree-flow.h
* tree-cfg.c (gimple_redirect_edge_and_branch): Handle EH edges.
* basic-block.h (edge, const_edge, basic_block, const_basic_block):
Remove.
From-SVN: r146776
2009-04-25 20:27:19 +02:00
|
|
|
|
}
|
2009-04-25 11:02:05 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* If we did find the corresponding PHI, copy those inputs. */
|
|
|
|
|
if (ophi)
|
2009-03-29 15:32:13 +02:00
|
|
|
|
{
|
2011-01-21 16:15:40 +01:00
|
|
|
|
/* If NOP is used somewhere else beyond phis in new_bb, give up. */
|
|
|
|
|
if (!has_single_use (nop))
|
|
|
|
|
{
|
|
|
|
|
imm_use_iterator imm_iter;
|
|
|
|
|
use_operand_p use_p;
|
|
|
|
|
|
|
|
|
|
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, nop)
|
|
|
|
|
{
|
|
|
|
|
if (!gimple_debug_bind_p (USE_STMT (use_p))
|
|
|
|
|
&& (gimple_code (USE_STMT (use_p)) != GIMPLE_PHI
|
|
|
|
|
|| gimple_bb (USE_STMT (use_p)) != new_bb))
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
bitmap_set_bit (ophi_handled, SSA_NAME_VERSION (nop));
|
|
|
|
|
FOR_EACH_EDGE (e, ei, old_bb->preds)
|
2009-04-25 11:02:05 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
location_t oloc;
|
|
|
|
|
tree oop;
|
|
|
|
|
|
|
|
|
|
if ((e->flags & EDGE_EH) == 0)
|
|
|
|
|
continue;
|
|
|
|
|
oop = gimple_phi_arg_def (ophi, e->dest_idx);
|
|
|
|
|
oloc = gimple_phi_arg_location (ophi, e->dest_idx);
|
|
|
|
|
redirect_edge_var_map_add (e, nresult, oop, oloc);
|
2009-04-25 11:02:05 +02:00
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
}
|
|
|
|
|
/* If we didn't find the PHI, but it's a VOP, remember to rename
|
|
|
|
|
it later, assuming all other tests succeed. */
|
|
|
|
|
else if (!is_gimple_reg (nresult))
|
|
|
|
|
bitmap_set_bit (rename_virts, SSA_NAME_VERSION (nresult));
|
|
|
|
|
/* If we didn't find the PHI, and it's a real variable, we know
|
|
|
|
|
from the fact that OLD_BB is tree_empty_eh_handler_p that the
|
|
|
|
|
variable is unchanged from input to the block and we can simply
|
|
|
|
|
re-use the input to NEW_BB from the OLD_BB_OUT edge. */
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
location_t nloc
|
|
|
|
|
= gimple_phi_arg_location (nphi, old_bb_out->dest_idx);
|
|
|
|
|
FOR_EACH_EDGE (e, ei, old_bb->preds)
|
|
|
|
|
redirect_edge_var_map_add (e, nresult, nop, nloc);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Second, verify that all PHIs from OLD_BB have been handled. If not,
|
|
|
|
|
we don't know what values from the other edges into NEW_BB to use. */
|
|
|
|
|
for (ogsi = gsi_start_phis (old_bb); !gsi_end_p (ogsi); gsi_next (&ogsi))
|
|
|
|
|
{
|
|
|
|
|
gimple ophi = gsi_stmt (ogsi);
|
|
|
|
|
tree oresult = gimple_phi_result (ophi);
|
|
|
|
|
if (!bitmap_bit_p (ophi_handled, SSA_NAME_VERSION (oresult)))
|
|
|
|
|
goto fail;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* At this point we know that the merge will succeed. Remove the PHI
|
|
|
|
|
nodes for the virtuals that we want to rename. */
|
|
|
|
|
if (!bitmap_empty_p (rename_virts))
|
|
|
|
|
{
|
|
|
|
|
for (ngsi = gsi_start_phis (new_bb); !gsi_end_p (ngsi); )
|
|
|
|
|
{
|
|
|
|
|
gimple nphi = gsi_stmt (ngsi);
|
|
|
|
|
tree nresult = gimple_phi_result (nphi);
|
|
|
|
|
if (bitmap_bit_p (rename_virts, SSA_NAME_VERSION (nresult)))
|
2009-04-25 11:02:05 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
mark_virtual_phi_result_for_renaming (nphi);
|
|
|
|
|
remove_phi_node (&ngsi, true);
|
2009-04-25 11:02:05 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gsi_next (&ngsi);
|
2009-04-04 19:09:45 +02:00
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
}
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Finally, move the edges and update the PHIs. */
|
|
|
|
|
for (ei = ei_start (old_bb->preds); (e = ei_safe_edge (ei)); )
|
|
|
|
|
if (e->flags & EDGE_EH)
|
|
|
|
|
{
|
2009-10-13 20:41:56 +02:00
|
|
|
|
redirect_eh_edge_1 (e, new_bb, change_region);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
redirect_edge_succ (e, new_bb);
|
|
|
|
|
flush_pending_stmts (e);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
ei_next (&ei);
|
2009-04-04 19:09:45 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
BITMAP_FREE (ophi_handled);
|
|
|
|
|
BITMAP_FREE (rename_virts);
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
fail:
|
|
|
|
|
FOR_EACH_EDGE (e, ei, old_bb->preds)
|
|
|
|
|
redirect_edge_var_map_clear (e);
|
|
|
|
|
BITMAP_FREE (ophi_handled);
|
|
|
|
|
BITMAP_FREE (rename_virts);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A subroutine of cleanup_empty_eh. Move a landing pad LP from its
|
|
|
|
|
old region to NEW_REGION at BB. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
cleanup_empty_eh_move_lp (basic_block bb, edge e_out,
|
|
|
|
|
eh_landing_pad lp, eh_region new_region)
|
|
|
|
|
{
|
|
|
|
|
gimple_stmt_iterator gsi;
|
|
|
|
|
eh_landing_pad *pp;
|
|
|
|
|
|
|
|
|
|
for (pp = &lp->region->landing_pads; *pp != lp; pp = &(*pp)->next_lp)
|
|
|
|
|
continue;
|
|
|
|
|
*pp = lp->next_lp;
|
|
|
|
|
|
|
|
|
|
lp->region = new_region;
|
|
|
|
|
lp->next_lp = new_region->landing_pads;
|
|
|
|
|
new_region->landing_pads = lp;
|
|
|
|
|
|
|
|
|
|
/* Delete the RESX that was matched within the empty handler block. */
|
|
|
|
|
gsi = gsi_last_bb (bb);
|
|
|
|
|
mark_virtual_ops_for_renaming (gsi_stmt (gsi));
|
|
|
|
|
gsi_remove (&gsi, true);
|
|
|
|
|
|
|
|
|
|
/* Clean up E_OUT for the fallthru. */
|
|
|
|
|
e_out->flags = (e_out->flags & ~EDGE_EH) | EDGE_FALLTHRU;
|
|
|
|
|
e_out->probability = REG_BR_PROB_BASE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* A subroutine of cleanup_empty_eh. Handle more complex cases of
|
2009-11-25 11:55:54 +01:00
|
|
|
|
unsplitting than unsplit_eh was prepared to handle, e.g. when
|
2009-09-14 21:18:58 +02:00
|
|
|
|
multiple incoming edges and phis are involved. */
|
|
|
|
|
|
|
|
|
|
static bool
|
2009-10-13 20:41:56 +02:00
|
|
|
|
cleanup_empty_eh_unsplit (basic_block bb, edge e_out, eh_landing_pad lp)
|
2009-09-14 21:18:58 +02:00
|
|
|
|
{
|
|
|
|
|
gimple_stmt_iterator gsi;
|
|
|
|
|
tree lab;
|
2010-11-16 12:42:50 +01:00
|
|
|
|
edge_iterator ei;
|
|
|
|
|
edge e;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
/* We really ought not have totally lost everything following
|
|
|
|
|
a landing pad label. Given that BB is empty, there had better
|
|
|
|
|
be a successor. */
|
|
|
|
|
gcc_assert (e_out != NULL);
|
|
|
|
|
|
2009-10-13 20:41:56 +02:00
|
|
|
|
/* The destination block must not already have a landing pad
|
|
|
|
|
for a different region. */
|
2009-09-14 21:18:58 +02:00
|
|
|
|
lab = NULL;
|
|
|
|
|
for (gsi = gsi_start_bb (e_out->dest); !gsi_end_p (gsi); gsi_next (&gsi))
|
|
|
|
|
{
|
|
|
|
|
gimple stmt = gsi_stmt (gsi);
|
2009-10-13 20:41:56 +02:00
|
|
|
|
int lp_nr;
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
if (gimple_code (stmt) != GIMPLE_LABEL)
|
|
|
|
|
break;
|
|
|
|
|
lab = gimple_label_label (stmt);
|
2009-10-13 20:41:56 +02:00
|
|
|
|
lp_nr = EH_LANDING_PAD_NR (lab);
|
|
|
|
|
if (lp_nr && get_eh_region_from_lp_number (lp_nr) != lp->region)
|
|
|
|
|
return false;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
}
|
|
|
|
|
|
2010-11-16 12:42:50 +01:00
|
|
|
|
/* The destination block must not be a regular successor for any
|
|
|
|
|
of the preds of the landing pad. Thus, avoid turning
|
|
|
|
|
<..>
|
|
|
|
|
| \ EH
|
|
|
|
|
| <..>
|
|
|
|
|
| /
|
|
|
|
|
<..>
|
|
|
|
|
into
|
|
|
|
|
<..>
|
|
|
|
|
| | EH
|
|
|
|
|
<..>
|
|
|
|
|
which CFG verification would choke on. See PR45172. */
|
|
|
|
|
FOR_EACH_EDGE (e, ei, bb->preds)
|
|
|
|
|
if (find_edge (e->src, e_out->dest))
|
|
|
|
|
return false;
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Attempt to move the PHIs into the successor block. */
|
2009-10-13 20:41:56 +02:00
|
|
|
|
if (cleanup_empty_eh_merge_phis (e_out->dest, bb, e_out, false))
|
2009-09-14 21:18:58 +02:00
|
|
|
|
{
|
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
|
fprintf (dump_file,
|
2009-10-13 20:41:56 +02:00
|
|
|
|
"Unsplit EH landing pad %d to block %i "
|
|
|
|
|
"(via cleanup_empty_eh).\n",
|
|
|
|
|
lp->index, e_out->dest->index);
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-19 00:16:16 +01:00
|
|
|
|
/* Return true if edge E_FIRST is part of an empty infinite loop
|
|
|
|
|
or leads to such a loop through a series of single successor
|
|
|
|
|
empty bbs. */
|
|
|
|
|
|
|
|
|
|
static bool
|
|
|
|
|
infinite_empty_loop_p (edge e_first)
|
|
|
|
|
{
|
|
|
|
|
bool inf_loop = false;
|
|
|
|
|
edge e;
|
|
|
|
|
|
|
|
|
|
if (e_first->dest == e_first->src)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
e_first->src->aux = (void *) 1;
|
|
|
|
|
for (e = e_first; single_succ_p (e->dest); e = single_succ_edge (e->dest))
|
|
|
|
|
{
|
|
|
|
|
gimple_stmt_iterator gsi;
|
|
|
|
|
if (e->dest->aux)
|
|
|
|
|
{
|
|
|
|
|
inf_loop = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
e->dest->aux = (void *) 1;
|
|
|
|
|
gsi = gsi_after_labels (e->dest);
|
|
|
|
|
if (!gsi_end_p (gsi) && is_gimple_debug (gsi_stmt (gsi)))
|
|
|
|
|
gsi_next_nondebug (&gsi);
|
|
|
|
|
if (!gsi_end_p (gsi))
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
e_first->src->aux = NULL;
|
|
|
|
|
for (e = e_first; e->dest->aux; e = single_succ_edge (e->dest))
|
|
|
|
|
e->dest->aux = NULL;
|
|
|
|
|
|
|
|
|
|
return inf_loop;
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Examine the block associated with LP to determine if it's an empty
|
|
|
|
|
handler for its EH region. If so, attempt to redirect EH edges to
|
|
|
|
|
an outer region. Return true the CFG was updated in any way. This
|
|
|
|
|
is similar to jump forwarding, just across EH edges. */
|
|
|
|
|
|
|
|
|
|
static bool
|
|
|
|
|
cleanup_empty_eh (eh_landing_pad lp)
|
|
|
|
|
{
|
|
|
|
|
basic_block bb = label_to_block (lp->post_landing_pad);
|
|
|
|
|
gimple_stmt_iterator gsi;
|
|
|
|
|
gimple resx;
|
|
|
|
|
eh_region new_region;
|
|
|
|
|
edge_iterator ei;
|
|
|
|
|
edge e, e_out;
|
|
|
|
|
bool has_non_eh_pred;
|
|
|
|
|
int new_lp_nr;
|
|
|
|
|
|
|
|
|
|
/* There can be zero or one edges out of BB. This is the quickest test. */
|
|
|
|
|
switch (EDGE_COUNT (bb->succs))
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
e_out = NULL;
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
e_out = EDGE_SUCC (bb, 0);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
gsi = gsi_after_labels (bb);
|
|
|
|
|
|
|
|
|
|
/* Make sure to skip debug statements. */
|
|
|
|
|
if (!gsi_end_p (gsi) && is_gimple_debug (gsi_stmt (gsi)))
|
|
|
|
|
gsi_next_nondebug (&gsi);
|
|
|
|
|
|
|
|
|
|
/* If the block is totally empty, look for more unsplitting cases. */
|
|
|
|
|
if (gsi_end_p (gsi))
|
2010-10-01 14:07:47 +02:00
|
|
|
|
{
|
|
|
|
|
/* For the degenerate case of an infinite loop bail out. */
|
2011-01-19 00:16:16 +01:00
|
|
|
|
if (infinite_empty_loop_p (e_out))
|
2010-10-01 14:07:47 +02:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return cleanup_empty_eh_unsplit (bb, e_out, lp);
|
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
/* The block should consist only of a single RESX statement. */
|
|
|
|
|
resx = gsi_stmt (gsi);
|
|
|
|
|
if (!is_gimple_resx (resx))
|
|
|
|
|
return false;
|
|
|
|
|
gcc_assert (gsi_one_before_end_p (gsi));
|
|
|
|
|
|
|
|
|
|
/* Determine if there are non-EH edges, or resx edges into the handler. */
|
|
|
|
|
has_non_eh_pred = false;
|
|
|
|
|
FOR_EACH_EDGE (e, ei, bb->preds)
|
|
|
|
|
if (!(e->flags & EDGE_EH))
|
|
|
|
|
has_non_eh_pred = true;
|
|
|
|
|
|
|
|
|
|
/* Find the handler that's outer of the empty handler by looking at
|
|
|
|
|
where the RESX instruction was vectored. */
|
|
|
|
|
new_lp_nr = lookup_stmt_eh_lp (resx);
|
|
|
|
|
new_region = get_eh_region_from_lp_number (new_lp_nr);
|
|
|
|
|
|
|
|
|
|
/* If there's no destination region within the current function,
|
|
|
|
|
redirection is trivial via removing the throwing statements from
|
|
|
|
|
the EH region, removing the EH edges, and allowing the block
|
|
|
|
|
to go unreachable. */
|
|
|
|
|
if (new_region == NULL)
|
|
|
|
|
{
|
|
|
|
|
gcc_assert (e_out == NULL);
|
|
|
|
|
for (ei = ei_start (bb->preds); (e = ei_safe_edge (ei)); )
|
|
|
|
|
if (e->flags & EDGE_EH)
|
|
|
|
|
{
|
|
|
|
|
gimple stmt = last_stmt (e->src);
|
|
|
|
|
remove_stmt_from_eh_lp (stmt);
|
|
|
|
|
remove_edge (e);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
ei_next (&ei);
|
|
|
|
|
goto succeed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If the destination region is a MUST_NOT_THROW, allow the runtime
|
|
|
|
|
to handle the abort and allow the blocks to go unreachable. */
|
|
|
|
|
if (new_region->type == ERT_MUST_NOT_THROW)
|
|
|
|
|
{
|
|
|
|
|
for (ei = ei_start (bb->preds); (e = ei_safe_edge (ei)); )
|
|
|
|
|
if (e->flags & EDGE_EH)
|
|
|
|
|
{
|
|
|
|
|
gimple stmt = last_stmt (e->src);
|
|
|
|
|
remove_stmt_from_eh_lp (stmt);
|
|
|
|
|
add_stmt_to_eh_lp (stmt, new_lp_nr);
|
|
|
|
|
remove_edge (e);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
ei_next (&ei);
|
|
|
|
|
goto succeed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Try to redirect the EH edges and merge the PHIs into the destination
|
|
|
|
|
landing pad block. If the merge succeeds, we'll already have redirected
|
|
|
|
|
all the EH edges. The handler itself will go unreachable if there were
|
|
|
|
|
no normal edges. */
|
2009-10-13 20:41:56 +02:00
|
|
|
|
if (cleanup_empty_eh_merge_phis (e_out->dest, bb, e_out, true))
|
2009-09-14 21:18:58 +02:00
|
|
|
|
goto succeed;
|
|
|
|
|
|
|
|
|
|
/* Finally, if all input edges are EH edges, then we can (potentially)
|
|
|
|
|
reduce the number of transfers from the runtime by moving the landing
|
|
|
|
|
pad from the original region to the new region. This is a win when
|
|
|
|
|
we remove the last CLEANUP region along a particular exception
|
|
|
|
|
propagation path. Since nothing changes except for the region with
|
|
|
|
|
which the landing pad is associated, the PHI nodes do not need to be
|
|
|
|
|
adjusted at all. */
|
|
|
|
|
if (!has_non_eh_pred)
|
|
|
|
|
{
|
|
|
|
|
cleanup_empty_eh_move_lp (bb, e_out, lp, new_region);
|
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
|
fprintf (dump_file, "Empty EH handler %i moved to EH region %i.\n",
|
|
|
|
|
lp->index, new_region->index);
|
|
|
|
|
|
|
|
|
|
/* ??? The CFG didn't change, but we may have rendered the
|
|
|
|
|
old EH region unreachable. Trigger a cleanup there. */
|
2009-03-29 15:32:13 +02:00
|
|
|
|
return true;
|
|
|
|
|
}
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
2009-03-29 15:32:13 +02:00
|
|
|
|
return false;
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
succeed:
|
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
|
fprintf (dump_file, "Empty EH handler %i removed.\n", lp->index);
|
|
|
|
|
remove_eh_landing_pad (lp);
|
|
|
|
|
return true;
|
2009-03-29 15:32:13 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Do a post-order traversal of the EH region tree. Examine each
|
|
|
|
|
post_landing_pad block and see if we can eliminate it as empty. */
|
|
|
|
|
|
|
|
|
|
static bool
|
|
|
|
|
cleanup_all_empty_eh (void)
|
|
|
|
|
{
|
|
|
|
|
bool changed = false;
|
|
|
|
|
eh_landing_pad lp;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = 1; VEC_iterate (eh_landing_pad, cfun->eh->lp_array, i, lp); ++i)
|
|
|
|
|
if (lp)
|
|
|
|
|
changed |= cleanup_empty_eh (lp);
|
|
|
|
|
|
|
|
|
|
return changed;
|
|
|
|
|
}
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
|
|
|
|
/* Perform cleanups and lowering of exception handling
|
|
|
|
|
1) cleanups regions with handlers doing nothing are optimized out
|
|
|
|
|
2) MUST_NOT_THROW regions that became dead because of 1) are optimized out
|
|
|
|
|
3) Info about regions that are containing instructions, and regions
|
|
|
|
|
reachable via local EH edges is collected
|
|
|
|
|
4) Eh tree is pruned for regions no longer neccesary.
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
TODO: Push MUST_NOT_THROW regions to the root of the EH tree.
|
|
|
|
|
Unify those that have the same failure decl and locus.
|
|
|
|
|
*/
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
|
|
|
|
static unsigned int
|
2010-05-30 21:52:53 +02:00
|
|
|
|
execute_cleanup_eh_1 (void)
|
2009-03-29 15:32:13 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Do this first: unsplit_all_eh and cleanup_all_empty_eh can die
|
|
|
|
|
looking up unreachable landing pads. */
|
|
|
|
|
remove_unreachable_handlers ();
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* Watch out for the region tree vanishing due to all unreachable. */
|
|
|
|
|
if (cfun->eh->region_tree && optimize)
|
2009-03-29 15:32:13 +02:00
|
|
|
|
{
|
2009-09-14 21:18:58 +02:00
|
|
|
|
bool changed = false;
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
changed |= unsplit_all_eh ();
|
|
|
|
|
changed |= cleanup_all_empty_eh ();
|
|
|
|
|
|
|
|
|
|
if (changed)
|
2009-04-08 17:13:01 +02:00
|
|
|
|
{
|
|
|
|
|
free_dominance_info (CDI_DOMINATORS);
|
|
|
|
|
free_dominance_info (CDI_POST_DOMINATORS);
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* We delayed all basic block deletion, as we may have performed
|
|
|
|
|
cleanups on EH edges while non-EH edges were still present. */
|
|
|
|
|
delete_unreachable_blocks ();
|
2009-03-29 15:32:13 +02:00
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
/* We manipulated the landing pads. Remove any region that no
|
|
|
|
|
longer has a landing pad. */
|
|
|
|
|
remove_unreachable_handlers_no_lp ();
|
|
|
|
|
|
|
|
|
|
return TODO_cleanup_cfg | TODO_update_ssa_only_virtuals;
|
|
|
|
|
}
|
2009-03-29 15:32:13 +02:00
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-30 21:52:53 +02:00
|
|
|
|
static unsigned int
|
|
|
|
|
execute_cleanup_eh (void)
|
|
|
|
|
{
|
|
|
|
|
int ret = execute_cleanup_eh_1 ();
|
|
|
|
|
|
|
|
|
|
/* If the function no longer needs an EH personality routine
|
|
|
|
|
clear it. This exposes cross-language inlining opportunities
|
|
|
|
|
and avoids references to a never defined personality routine. */
|
|
|
|
|
if (DECL_FUNCTION_PERSONALITY (current_function_decl)
|
|
|
|
|
&& function_needs_eh_personality (cfun) != eh_personality_lang)
|
|
|
|
|
DECL_FUNCTION_PERSONALITY (current_function_decl) = NULL_TREE;
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-14 21:18:58 +02:00
|
|
|
|
static bool
|
|
|
|
|
gate_cleanup_eh (void)
|
|
|
|
|
{
|
|
|
|
|
return cfun->eh != NULL && cfun->eh->region_tree != NULL;
|
2009-03-29 15:32:13 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct gimple_opt_pass pass_cleanup_eh = {
|
|
|
|
|
{
|
|
|
|
|
GIMPLE_PASS,
|
|
|
|
|
"ehcleanup", /* name */
|
2009-09-14 21:18:58 +02:00
|
|
|
|
gate_cleanup_eh, /* gate */
|
|
|
|
|
execute_cleanup_eh, /* execute */
|
2009-03-29 15:32:13 +02:00
|
|
|
|
NULL, /* sub */
|
|
|
|
|
NULL, /* next */
|
|
|
|
|
0, /* static_pass_number */
|
|
|
|
|
TV_TREE_EH, /* tv_id */
|
|
|
|
|
PROP_gimple_lcf, /* properties_required */
|
|
|
|
|
0, /* properties_provided */
|
|
|
|
|
0, /* properties_destroyed */
|
|
|
|
|
0, /* todo_flags_start */
|
|
|
|
|
TODO_dump_func /* todo_flags_finish */
|
|
|
|
|
}
|
|
|
|
|
};
|
2009-09-14 21:18:58 +02:00
|
|
|
|
|
|
|
|
|
/* Verify that BB containing STMT as the last statement, has precisely the
|
|
|
|
|
edge that make_eh_edges would create. */
|
|
|
|
|
|
tree-vrp.c (debug_value_range, [...]): Annotate with DEBUG_FUNCTION.
* tree-vrp.c (debug_value_range, debug_all_value_ranges,
debug_asserts_for, debug_all_asserts): Annotate with DEBUG_FUNCTION.
* tree-into-ssa.c (debug_decl_set, debug_defs_stack, debug_currdefs,
debug_tree_ssa, debug_tree_ssa_stats, debug_def_blocks,
debug_names_replaced_by, debug_update_ssa): Likewise.
* sbitmap.c (debug_sbitmap): Likewise.
* genrecog.c (debug_decision, debug_decision_list): Likewise.
* tree-pretty-print.c (debug_generic_expr, debug_generic_stmt,
debug_tree_chain): Likewise.
* tree-loop-distribution.c (debug_rdg_partitions): Likewise.
* cgraph.c (debug_cgraph_node, debug_cgraph): Likewise.
* optabs.c (debug_optab_libfuncs): Likewise.
(verify_loop_closed_ssa): Likewise.
* value-prof.c (verify_histograms): Likewise.
* reload.c (debug_reload_to_stream, debug_reload): Likewise.
* bitmap.c (debug_bitmap_file, debug_bitmap, bitmap_print): Likewise.
* cfghooks.c (verify_flow_info): Likewise.
* fold-const.c (debug_fold_checksum): Likewise.
* omp-low.c (debug_omp_region, debug_all_omp_regions): Likewise.
* cfg.c (debug_regset, debug_flow_info, debug_bb, debug_bb_n):
Likewise.
* omega.c (debug_omega_problem): Likewise.
* cgraphunit.c (verify_cgraph_node, verify_cgraph): Likewise.
* tree-ssa-ccp.c (debug_lattice_value): Likewise.
* dominance.c (verify_dominators, debug_dominance_info,
debug_dominance_tree): Likewise.
* df-core.c (df_insn_uid_debug, df_insn_debug, df_insn_debug_regno,
* df_regno_debug, df_ref_debug,
debug_df_insn, debug_df_reg, debug_df_regno, debug_df_ref,
debug_df_defno, debug_df_useno, debug_df_chain): Likewise.
* tree-ssa-dom.c (debug_dominator_optimization_stats): Likewise.
* sel-sched.c (debug_state): Likewise.
* tree-ssa-alias.c (debug_alias_info, debug_points_to_info_for): Likewise.
* cfganal.c (print_edge_list, verify_edge_list): Likewise.
* dwarf2out.c (debug_dwarf_die, debug_dwarf): Likewise.
* tree-eh.c (verify_eh_edges, verify_eh_dispatch_edge): Likewise.
* gimple-pretty-print.c (debug_gimple_stmt, debug_gimple_seq): Likewise.
* c-pretty-print.c (debug_c_tree): Likewise.
* sel-sched-dump.c (debug_insn_rtx, debug_vinsn, debug_expr, debug_insn
debug_av_set, debug_lv_set, debug_ilist, debug_blist, debug_insn_vector,
debug_hard_reg_set, debug_mem_addr_value): Likewise.
* ebitmap.c (debug_ebitmap): Likewise.
* function.c (debug_find_var_in_block_tree): Likewise.
* print-rtl.c (debug_rtx): Likewise.
(debug_rtx_count): Likewise.
(debug_rtx_list, debug_rtx_range, debug_rtx_find): Likewise.
* stor-layout.c (debug_rli): Likewise.
* ipa.c (debug_cgraph_node_set, debug_varpool_node_set): Likewise.
* tree-data-ref.c (debug_data_references, debug_data_dependence_relations,
debug_data_reference, debug_data_dependence_relation, debug_rdg_vertex,
debug_rdg_component, debug_rdg): Likewise.
* tree-affine.c (debug_aff): Likewise.
* tree-dfa.c (debug_referenced_vars, debug_variable, debug_dfa_stats): Likewise.
* except.c (debug_eh_tree, verify_eh_tree): Likewise.
* emit-rtl.c (verify_rtl_sharing): Likewise.
* tree-ssa-pre.c (debug_pre_expr, debug_bitmap_set,
debug_value_expressions): Likewise.
* tree-ssa-live.c (debug_scope_block, debug_scope_blocks): Likewise.
* sese.c (debug_rename_map, debug_ivtype_map): Likewise.
* print-tree.c (debug_tree, debug_vec_tree): Likewise.
* cfglayout.c (verify_insn_chain): Likewise.
* graphite-clast-to-gimple.c (debug_clast_name_indexes,
debug_clast_stmt, debug_generated_program): Likewise.
* ggc-page.c (debug_print_page_list): Likewise.
* tree-ssa-ter.c (debug_ter): Likewise.
* graphite-dependences.c (debug_pddr): Likewise.
* sched-deps.c (debug_ds): Likewise.
* tree-ssa.c (verify_ssa): Likewise.
* graphite-poly.c (debug_scattering_function, debug_iteration_domain,
debug_scattering_functions, debug_iteration_domains, debug_pdr,
debug_pdrs, debug_pbb_domain, debug_pbb, debug_scop_context, debug_scop,
debug_cloog, debug_scop_params, debug_lst): Likewise.
* tree-inline.c (debug_find_tree): Likewise.
* graphite-ppl.c (debug_ppl_linear_expr, debug_ppl_polyhedron_matrix,
debug_ppl_powerset_matrix): Likewise.
* var-tracking.c (debug_dv): Likewise.
* system.h (DEBUG_FUNCTION, DEBUG_VARIABLE): Define.
* cfgloop.c (verify_loop_structure): Likewise.
* plugin.c (dump_active_plugins, debug_active_plugins): Likewise.
* c-common.c (verify_sequence_points): Likewise.
* sched-rgn.c (debug_regions, debug_region, debug_candidate,
debug_candidates, debug_rgn_dependencies): Likewise.
* tree-ssa-structalias.c (debug_constraint, debug_constraints,
* debug_constraint_graph, debug_solution_for_var,
debug_sa_points_to_info): Likewise.
* sched-vis.c (debug_insn_slim, debug_bb_slim, debug_bb_n_slim):
Likewie.
* tree-cfg.c (debug_cfg_stats, verify_stmts, debug_function,
debug_loops, debug_loop, debug_loop_num): Likewise.
* passes.c (debug_pass): Likewise.
(dump_properties): Likewise; add cfglayout property.
(debug_properties): Likewise.
* tree-ssa-reassoc.c (debug_ops_vector): Likewise.
* varpool.c (debug_varpool): Likewise.
* regcprop.c (debug_value_data): Likewise.
* tree-ssa-operands.c (verify_imm_links, debug_immediate_uses,
debug_immediate_uses_for): Likewise.
From-SVN: r160036
2010-05-29 22:31:45 +02:00
|
|
|
|
DEBUG_FUNCTION bool
|
2009-09-14 21:18:58 +02:00
|
|
|
|
verify_eh_edges (gimple stmt)
|
|
|
|
|
{
|
|
|
|
|
basic_block bb = gimple_bb (stmt);
|
|
|
|
|
eh_landing_pad lp = NULL;
|
|
|
|
|
int lp_nr;
|
|
|
|
|
edge_iterator ei;
|
|
|
|
|
edge e, eh_edge;
|
|
|
|
|
|
|
|
|
|
lp_nr = lookup_stmt_eh_lp (stmt);
|
|
|
|
|
if (lp_nr > 0)
|
|
|
|
|
lp = get_eh_landing_pad_from_number (lp_nr);
|
|
|
|
|
|
|
|
|
|
eh_edge = NULL;
|
|
|
|
|
FOR_EACH_EDGE (e, ei, bb->succs)
|
|
|
|
|
{
|
|
|
|
|
if (e->flags & EDGE_EH)
|
|
|
|
|
{
|
|
|
|
|
if (eh_edge)
|
|
|
|
|
{
|
|
|
|
|
error ("BB %i has multiple EH edges", bb->index);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
eh_edge = e;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (lp == NULL)
|
|
|
|
|
{
|
|
|
|
|
if (eh_edge)
|
|
|
|
|
{
|
|
|
|
|
error ("BB %i can not throw but has an EH edge", bb->index);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!stmt_could_throw_p (stmt))
|
|
|
|
|
{
|
|
|
|
|
error ("BB %i last statement has incorrectly set lp", bb->index);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (eh_edge == NULL)
|
|
|
|
|
{
|
|
|
|
|
error ("BB %i is missing an EH edge", bb->index);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (eh_edge->dest != label_to_block (lp->post_landing_pad))
|
|
|
|
|
{
|
|
|
|
|
error ("Incorrect EH edge %i->%i", bb->index, eh_edge->dest->index);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Similarly, but handle GIMPLE_EH_DISPATCH specifically. */
|
|
|
|
|
|
tree-vrp.c (debug_value_range, [...]): Annotate with DEBUG_FUNCTION.
* tree-vrp.c (debug_value_range, debug_all_value_ranges,
debug_asserts_for, debug_all_asserts): Annotate with DEBUG_FUNCTION.
* tree-into-ssa.c (debug_decl_set, debug_defs_stack, debug_currdefs,
debug_tree_ssa, debug_tree_ssa_stats, debug_def_blocks,
debug_names_replaced_by, debug_update_ssa): Likewise.
* sbitmap.c (debug_sbitmap): Likewise.
* genrecog.c (debug_decision, debug_decision_list): Likewise.
* tree-pretty-print.c (debug_generic_expr, debug_generic_stmt,
debug_tree_chain): Likewise.
* tree-loop-distribution.c (debug_rdg_partitions): Likewise.
* cgraph.c (debug_cgraph_node, debug_cgraph): Likewise.
* optabs.c (debug_optab_libfuncs): Likewise.
(verify_loop_closed_ssa): Likewise.
* value-prof.c (verify_histograms): Likewise.
* reload.c (debug_reload_to_stream, debug_reload): Likewise.
* bitmap.c (debug_bitmap_file, debug_bitmap, bitmap_print): Likewise.
* cfghooks.c (verify_flow_info): Likewise.
* fold-const.c (debug_fold_checksum): Likewise.
* omp-low.c (debug_omp_region, debug_all_omp_regions): Likewise.
* cfg.c (debug_regset, debug_flow_info, debug_bb, debug_bb_n):
Likewise.
* omega.c (debug_omega_problem): Likewise.
* cgraphunit.c (verify_cgraph_node, verify_cgraph): Likewise.
* tree-ssa-ccp.c (debug_lattice_value): Likewise.
* dominance.c (verify_dominators, debug_dominance_info,
debug_dominance_tree): Likewise.
* df-core.c (df_insn_uid_debug, df_insn_debug, df_insn_debug_regno,
* df_regno_debug, df_ref_debug,
debug_df_insn, debug_df_reg, debug_df_regno, debug_df_ref,
debug_df_defno, debug_df_useno, debug_df_chain): Likewise.
* tree-ssa-dom.c (debug_dominator_optimization_stats): Likewise.
* sel-sched.c (debug_state): Likewise.
* tree-ssa-alias.c (debug_alias_info, debug_points_to_info_for): Likewise.
* cfganal.c (print_edge_list, verify_edge_list): Likewise.
* dwarf2out.c (debug_dwarf_die, debug_dwarf): Likewise.
* tree-eh.c (verify_eh_edges, verify_eh_dispatch_edge): Likewise.
* gimple-pretty-print.c (debug_gimple_stmt, debug_gimple_seq): Likewise.
* c-pretty-print.c (debug_c_tree): Likewise.
* sel-sched-dump.c (debug_insn_rtx, debug_vinsn, debug_expr, debug_insn
debug_av_set, debug_lv_set, debug_ilist, debug_blist, debug_insn_vector,
debug_hard_reg_set, debug_mem_addr_value): Likewise.
* ebitmap.c (debug_ebitmap): Likewise.
* function.c (debug_find_var_in_block_tree): Likewise.
* print-rtl.c (debug_rtx): Likewise.
(debug_rtx_count): Likewise.
(debug_rtx_list, debug_rtx_range, debug_rtx_find): Likewise.
* stor-layout.c (debug_rli): Likewise.
* ipa.c (debug_cgraph_node_set, debug_varpool_node_set): Likewise.
* tree-data-ref.c (debug_data_references, debug_data_dependence_relations,
debug_data_reference, debug_data_dependence_relation, debug_rdg_vertex,
debug_rdg_component, debug_rdg): Likewise.
* tree-affine.c (debug_aff): Likewise.
* tree-dfa.c (debug_referenced_vars, debug_variable, debug_dfa_stats): Likewise.
* except.c (debug_eh_tree, verify_eh_tree): Likewise.
* emit-rtl.c (verify_rtl_sharing): Likewise.
* tree-ssa-pre.c (debug_pre_expr, debug_bitmap_set,
debug_value_expressions): Likewise.
* tree-ssa-live.c (debug_scope_block, debug_scope_blocks): Likewise.
* sese.c (debug_rename_map, debug_ivtype_map): Likewise.
* print-tree.c (debug_tree, debug_vec_tree): Likewise.
* cfglayout.c (verify_insn_chain): Likewise.
* graphite-clast-to-gimple.c (debug_clast_name_indexes,
debug_clast_stmt, debug_generated_program): Likewise.
* ggc-page.c (debug_print_page_list): Likewise.
* tree-ssa-ter.c (debug_ter): Likewise.
* graphite-dependences.c (debug_pddr): Likewise.
* sched-deps.c (debug_ds): Likewise.
* tree-ssa.c (verify_ssa): Likewise.
* graphite-poly.c (debug_scattering_function, debug_iteration_domain,
debug_scattering_functions, debug_iteration_domains, debug_pdr,
debug_pdrs, debug_pbb_domain, debug_pbb, debug_scop_context, debug_scop,
debug_cloog, debug_scop_params, debug_lst): Likewise.
* tree-inline.c (debug_find_tree): Likewise.
* graphite-ppl.c (debug_ppl_linear_expr, debug_ppl_polyhedron_matrix,
debug_ppl_powerset_matrix): Likewise.
* var-tracking.c (debug_dv): Likewise.
* system.h (DEBUG_FUNCTION, DEBUG_VARIABLE): Define.
* cfgloop.c (verify_loop_structure): Likewise.
* plugin.c (dump_active_plugins, debug_active_plugins): Likewise.
* c-common.c (verify_sequence_points): Likewise.
* sched-rgn.c (debug_regions, debug_region, debug_candidate,
debug_candidates, debug_rgn_dependencies): Likewise.
* tree-ssa-structalias.c (debug_constraint, debug_constraints,
* debug_constraint_graph, debug_solution_for_var,
debug_sa_points_to_info): Likewise.
* sched-vis.c (debug_insn_slim, debug_bb_slim, debug_bb_n_slim):
Likewie.
* tree-cfg.c (debug_cfg_stats, verify_stmts, debug_function,
debug_loops, debug_loop, debug_loop_num): Likewise.
* passes.c (debug_pass): Likewise.
(dump_properties): Likewise; add cfglayout property.
(debug_properties): Likewise.
* tree-ssa-reassoc.c (debug_ops_vector): Likewise.
* varpool.c (debug_varpool): Likewise.
* regcprop.c (debug_value_data): Likewise.
* tree-ssa-operands.c (verify_imm_links, debug_immediate_uses,
debug_immediate_uses_for): Likewise.
From-SVN: r160036
2010-05-29 22:31:45 +02:00
|
|
|
|
DEBUG_FUNCTION bool
|
2009-09-14 21:18:58 +02:00
|
|
|
|
verify_eh_dispatch_edge (gimple stmt)
|
|
|
|
|
{
|
|
|
|
|
eh_region r;
|
|
|
|
|
eh_catch c;
|
|
|
|
|
basic_block src, dst;
|
|
|
|
|
bool want_fallthru = true;
|
|
|
|
|
edge_iterator ei;
|
|
|
|
|
edge e, fall_edge;
|
|
|
|
|
|
|
|
|
|
r = get_eh_region_from_number (gimple_eh_dispatch_region (stmt));
|
|
|
|
|
src = gimple_bb (stmt);
|
|
|
|
|
|
|
|
|
|
FOR_EACH_EDGE (e, ei, src->succs)
|
|
|
|
|
gcc_assert (e->aux == NULL);
|
|
|
|
|
|
|
|
|
|
switch (r->type)
|
|
|
|
|
{
|
|
|
|
|
case ERT_TRY:
|
|
|
|
|
for (c = r->u.eh_try.first_catch; c ; c = c->next_catch)
|
|
|
|
|
{
|
|
|
|
|
dst = label_to_block (c->label);
|
|
|
|
|
e = find_edge (src, dst);
|
|
|
|
|
if (e == NULL)
|
|
|
|
|
{
|
|
|
|
|
error ("BB %i is missing an edge", src->index);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
e->aux = (void *)e;
|
|
|
|
|
|
|
|
|
|
/* A catch-all handler doesn't have a fallthru. */
|
|
|
|
|
if (c->type_list == NULL)
|
|
|
|
|
{
|
|
|
|
|
want_fallthru = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ERT_ALLOWED_EXCEPTIONS:
|
|
|
|
|
dst = label_to_block (r->u.allowed.label);
|
|
|
|
|
e = find_edge (src, dst);
|
|
|
|
|
if (e == NULL)
|
|
|
|
|
{
|
|
|
|
|
error ("BB %i is missing an edge", src->index);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
e->aux = (void *)e;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
gcc_unreachable ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fall_edge = NULL;
|
|
|
|
|
FOR_EACH_EDGE (e, ei, src->succs)
|
|
|
|
|
{
|
|
|
|
|
if (e->flags & EDGE_FALLTHRU)
|
|
|
|
|
{
|
|
|
|
|
if (fall_edge != NULL)
|
|
|
|
|
{
|
|
|
|
|
error ("BB %i too many fallthru edges", src->index);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
fall_edge = e;
|
|
|
|
|
}
|
|
|
|
|
else if (e->aux)
|
|
|
|
|
e->aux = NULL;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
error ("BB %i has incorrect edge", src->index);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ((fall_edge != NULL) ^ want_fallthru)
|
|
|
|
|
{
|
|
|
|
|
error ("BB %i has incorrect fallthru edge", src->index);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|