2013-07-18 20:55:48 +02:00
|
|
|
/* Description of pass structure
|
|
|
|
Copyright (C) 1987-2013 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
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 the Free
|
|
|
|
Software Foundation; either version 3, or (at your option) 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
|
|
|
|
along with GCC; see the file COPYING3. If not see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
/*
|
|
|
|
Macros that should be defined when using this file:
|
|
|
|
INSERT_PASSES_AFTER (PASS)
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (PASS)
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (PASS)
|
|
|
|
TERMINATE_PASS_LIST ()
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* All passes needed to lower the function into shape optimizers can
|
|
|
|
operate on. These passes are always run first on the function, but
|
|
|
|
backend might produce already lowered functions that are not processed
|
|
|
|
by these passes. */
|
|
|
|
INSERT_PASSES_AFTER (all_lowering_passes)
|
|
|
|
NEXT_PASS (pass_warn_unused_result);
|
|
|
|
NEXT_PASS (pass_diagnose_omp_blocks);
|
|
|
|
NEXT_PASS (pass_diagnose_tm_blocks);
|
|
|
|
NEXT_PASS (pass_lower_omp);
|
|
|
|
NEXT_PASS (pass_lower_cf);
|
|
|
|
NEXT_PASS (pass_lower_tm);
|
|
|
|
NEXT_PASS (pass_refactor_eh);
|
|
|
|
NEXT_PASS (pass_lower_eh);
|
|
|
|
NEXT_PASS (pass_build_cfg);
|
|
|
|
NEXT_PASS (pass_warn_function_return);
|
|
|
|
NEXT_PASS (pass_expand_omp);
|
|
|
|
NEXT_PASS (pass_build_cgraph_edges);
|
|
|
|
TERMINATE_PASS_LIST ()
|
|
|
|
|
|
|
|
/* Interprocedural optimization passes. */
|
|
|
|
INSERT_PASSES_AFTER (all_small_ipa_passes)
|
|
|
|
NEXT_PASS (pass_ipa_free_lang_data);
|
|
|
|
NEXT_PASS (pass_ipa_function_and_variable_visibility);
|
|
|
|
NEXT_PASS (pass_early_local_passes);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_early_local_passes)
|
|
|
|
NEXT_PASS (pass_fixup_cfg);
|
|
|
|
NEXT_PASS (pass_init_datastructures);
|
|
|
|
|
|
|
|
NEXT_PASS (pass_build_ssa);
|
2013-11-19 12:45:15 +01:00
|
|
|
NEXT_PASS (pass_ubsan);
|
2013-07-18 20:55:48 +02:00
|
|
|
NEXT_PASS (pass_early_warn_uninitialized);
|
|
|
|
NEXT_PASS (pass_rebuild_cgraph_edges);
|
|
|
|
NEXT_PASS (pass_inline_parameters);
|
|
|
|
NEXT_PASS (pass_early_inline);
|
|
|
|
NEXT_PASS (pass_all_early_optimizations);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_all_early_optimizations)
|
|
|
|
NEXT_PASS (pass_remove_cgraph_callee_edges);
|
|
|
|
NEXT_PASS (pass_rename_ssa_copies);
|
|
|
|
NEXT_PASS (pass_ccp);
|
|
|
|
/* After CCP we rewrite no longer addressed locals into SSA
|
|
|
|
form if possible. */
|
|
|
|
NEXT_PASS (pass_forwprop);
|
|
|
|
/* pass_build_ealias is a dummy pass that ensures that we
|
|
|
|
execute TODO_rebuild_alias at this point. */
|
|
|
|
NEXT_PASS (pass_build_ealias);
|
|
|
|
NEXT_PASS (pass_sra_early);
|
|
|
|
NEXT_PASS (pass_fre);
|
|
|
|
NEXT_PASS (pass_copy_prop);
|
|
|
|
NEXT_PASS (pass_merge_phi);
|
|
|
|
NEXT_PASS (pass_cd_dce);
|
|
|
|
NEXT_PASS (pass_early_ipa_sra);
|
|
|
|
NEXT_PASS (pass_tail_recursion);
|
|
|
|
NEXT_PASS (pass_convert_switch);
|
|
|
|
NEXT_PASS (pass_cleanup_eh);
|
|
|
|
NEXT_PASS (pass_profile);
|
|
|
|
NEXT_PASS (pass_local_pure_const);
|
|
|
|
/* Split functions creates parts that are not run through
|
|
|
|
early optimizations again. It is thus good idea to do this
|
|
|
|
late. */
|
|
|
|
NEXT_PASS (pass_split_functions);
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (pass_release_ssa_names);
|
|
|
|
NEXT_PASS (pass_rebuild_cgraph_edges);
|
|
|
|
NEXT_PASS (pass_inline_parameters);
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (pass_ipa_free_inline_summary);
|
|
|
|
NEXT_PASS (pass_ipa_tree_profile);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_ipa_tree_profile)
|
|
|
|
NEXT_PASS (pass_feedback_split_functions);
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (pass_ipa_increase_alignment);
|
|
|
|
NEXT_PASS (pass_ipa_tm);
|
|
|
|
NEXT_PASS (pass_ipa_lower_emutls);
|
|
|
|
TERMINATE_PASS_LIST ()
|
|
|
|
|
|
|
|
INSERT_PASSES_AFTER (all_regular_ipa_passes)
|
|
|
|
NEXT_PASS (pass_ipa_whole_program_visibility);
|
|
|
|
NEXT_PASS (pass_ipa_profile);
|
2013-09-01 17:14:24 +02:00
|
|
|
NEXT_PASS (pass_ipa_devirt);
|
2013-07-18 20:55:48 +02:00
|
|
|
NEXT_PASS (pass_ipa_cp);
|
|
|
|
NEXT_PASS (pass_ipa_cdtor_merge);
|
|
|
|
NEXT_PASS (pass_ipa_inline);
|
|
|
|
NEXT_PASS (pass_ipa_pure_const);
|
|
|
|
NEXT_PASS (pass_ipa_reference);
|
|
|
|
TERMINATE_PASS_LIST ()
|
|
|
|
|
|
|
|
/* Simple IPA passes executed after the regular passes. In WHOPR mode the
|
|
|
|
passes are executed after partitioning and thus see just parts of the
|
|
|
|
compiled unit. */
|
|
|
|
INSERT_PASSES_AFTER (all_late_ipa_passes)
|
|
|
|
NEXT_PASS (pass_ipa_pta);
|
cgraph.h (enum cgraph_simd_clone_arg_type): New.
* cgraph.h (enum cgraph_simd_clone_arg_type): New.
(struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New.
(struct cgraph_node): Add simdclone and simd_clones fields.
* config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen,
ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions.
(TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN,
TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define.
* doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN,
TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add.
* doc/tm.texi: Regenerated.
* ggc.h (ggc_alloc_cleared_simd_clone_stat): New function.
* ipa-cp.c (determine_versionability): Fail if "omp declare simd"
attribute is present.
* omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h.
(simd_clone_vector_of_formal_parm_types): New function.
(simd_clone_struct_alloc, simd_clone_struct_copy,
simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract,
simd_clone_compute_base_data_type, simd_clone_mangle,
simd_clone_create, simd_clone_adjust_return_type,
create_tmp_simd_array, simd_clone_adjust_argument_types,
simd_clone_init_simd_arrays): New functions.
(struct modify_stmt_info): New type.
(ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body,
simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New
functions.
(pass_data_omp_simd_clone): New variable.
(pass_omp_simd_clone): New class.
(make_pass_omp_simd_clone): New function.
* passes.def (pass_omp_simd_clone): New.
* target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN,
TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target
hooks.
* target.h (struct cgraph_node, struct cgraph_simd_node): Declare.
* tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document.
* tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define.
* tree-pass.h (make_pass_omp_simd_clone): New prototype.
* tree-vect-data-refs.c: Include cgraph.h.
(vect_analyze_data_refs): Inline by hand find_data_references_in_loop
and find_data_references_in_bb, if find_data_references_in_stmt
fails, still allow calls to #pragma omp declare simd functions
in #pragma omp simd loops unless they contain data references among
the call arguments or in lhs.
* tree-vect-loop.c (vect_determine_vectorization_factor): Handle
calls with no lhs.
(vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without
lhs.
* tree-vectorizer.h (enum stmt_vec_info_type): Add
call_simd_clone_vec_info_type.
(struct _stmt_vec_info): Add simd_clone_fndecl field.
(STMT_VINFO_SIMD_CLONE_FNDECL): Define.
* tree-vect-stmts.c: Include tree-ssa-loop.h,
tree-scalar-evolution.h and cgraph.h.
(vectorizable_call): Handle calls without lhs. Assert
!stmt_can_throw_internal instead of failing for it. Don't update
EH stuff.
(struct simd_call_arg_info): New.
(vectorizable_simd_clone_call): New function.
(vect_transform_stmt): Call it.
(vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for
calls without lhs.
* ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node
if cgraph_function_with_gimple_body_p is true.
c/
* c-decl.c (c_builtin_function_ext_scope): Avoid binding if
external_scope is NULL.
cp/
* semantics.c (finish_omp_clauses): For #pragma omp declare simd
linear clause step call maybe_constant_value.
testsuite/
* g++.dg/gomp/declare-simd-1.C (f38): Make sure
simdlen is a power of two.
* gcc.dg/gomp/simd-clones-2.c: Compile on all targets.
Remove -msse2. Adjust regexps for name mangling changes.
* gcc.dg/gomp/simd-clones-3.c: Likewise.
* gcc.dg/vect/vect-simd-clone-1.c: New test.
* gcc.dg/vect/vect-simd-clone-2.c: New test.
* gcc.dg/vect/vect-simd-clone-3.c: New test.
* gcc.dg/vect/vect-simd-clone-4.c: New test.
* gcc.dg/vect/vect-simd-clone-5.c: New test.
* gcc.dg/vect/vect-simd-clone-6.c: New test.
* gcc.dg/vect/vect-simd-clone-7.c: New test.
* gcc.dg/vect/vect-simd-clone-8.c: New test.
* gcc.dg/vect/vect-simd-clone-9.c: New test.
* gcc.dg/vect/vect-simd-clone-10.c: New test.
* gcc.dg/vect/vect-simd-clone-10.h: New file.
* gcc.dg/vect/vect-simd-clone-10a.c: New file.
* gcc.dg/vect/vect-simd-clone-11.c: New test.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r205442
2013-11-27 12:20:06 +01:00
|
|
|
NEXT_PASS (pass_omp_simd_clone);
|
2013-07-18 20:55:48 +02:00
|
|
|
TERMINATE_PASS_LIST ()
|
|
|
|
|
|
|
|
/* These passes are run after IPA passes on every function that is being
|
|
|
|
output to the assembler file. */
|
|
|
|
INSERT_PASSES_AFTER (all_passes)
|
2013-11-05 16:09:40 +01:00
|
|
|
NEXT_PASS (pass_fixup_cfg);
|
2013-07-18 20:55:48 +02:00
|
|
|
NEXT_PASS (pass_lower_eh_dispatch);
|
|
|
|
NEXT_PASS (pass_all_optimizations);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_all_optimizations)
|
|
|
|
NEXT_PASS (pass_remove_cgraph_callee_edges);
|
|
|
|
/* Initial scalar cleanups before alias computation.
|
|
|
|
They ensure memory accesses are not indirect wherever possible. */
|
|
|
|
NEXT_PASS (pass_strip_predict_hints);
|
|
|
|
NEXT_PASS (pass_rename_ssa_copies);
|
|
|
|
NEXT_PASS (pass_copy_prop);
|
|
|
|
NEXT_PASS (pass_complete_unrolli);
|
|
|
|
NEXT_PASS (pass_ccp);
|
|
|
|
/* After CCP we rewrite no longer addressed locals into SSA
|
|
|
|
form if possible. */
|
|
|
|
NEXT_PASS (pass_phiprop);
|
|
|
|
NEXT_PASS (pass_forwprop);
|
2013-11-18 16:25:05 +01:00
|
|
|
NEXT_PASS (pass_object_sizes);
|
2013-07-18 20:55:48 +02:00
|
|
|
/* pass_build_alias is a dummy pass that ensures that we
|
|
|
|
execute TODO_rebuild_alias at this point. */
|
|
|
|
NEXT_PASS (pass_build_alias);
|
|
|
|
NEXT_PASS (pass_return_slot);
|
|
|
|
NEXT_PASS (pass_fre);
|
|
|
|
NEXT_PASS (pass_copy_prop);
|
|
|
|
NEXT_PASS (pass_merge_phi);
|
|
|
|
NEXT_PASS (pass_vrp);
|
|
|
|
NEXT_PASS (pass_dce);
|
|
|
|
NEXT_PASS (pass_call_cdce);
|
|
|
|
NEXT_PASS (pass_cselim);
|
|
|
|
NEXT_PASS (pass_tree_ifcombine);
|
|
|
|
NEXT_PASS (pass_phiopt);
|
|
|
|
NEXT_PASS (pass_tail_recursion);
|
|
|
|
NEXT_PASS (pass_ch);
|
|
|
|
NEXT_PASS (pass_stdarg);
|
|
|
|
NEXT_PASS (pass_lower_complex);
|
|
|
|
NEXT_PASS (pass_sra);
|
|
|
|
NEXT_PASS (pass_rename_ssa_copies);
|
|
|
|
/* The dom pass will also resolve all __builtin_constant_p calls
|
|
|
|
that are still there to 0. This has to be done after some
|
|
|
|
propagations have already run, but before some more dead code
|
|
|
|
is removed, and this place fits nicely. Remember this when
|
|
|
|
trying to move or duplicate pass_dominator somewhere earlier. */
|
|
|
|
NEXT_PASS (pass_dominator);
|
2013-11-05 20:47:44 +01:00
|
|
|
/* At this point the majority of const/copy propagations
|
|
|
|
are exposed. Go ahead and identify paths that should never
|
|
|
|
be executed in a conforming program and isolate those paths.
|
|
|
|
|
|
|
|
This will expose more degenerate PHIs in the main path and
|
|
|
|
expose more PRE/DOM optimization opportunities. */
|
|
|
|
NEXT_PASS (pass_isolate_erroneous_paths);
|
2013-07-18 20:55:48 +02:00
|
|
|
/* The only const/copy propagation opportunities left after
|
2013-11-05 20:47:44 +01:00
|
|
|
DOM and erroneous path isolation should be due to degenerate PHI nodes.
|
|
|
|
So rather than run the full propagators, run a specialized pass which
|
2013-07-18 20:55:48 +02:00
|
|
|
only examines PHIs to discover const/copy propagation
|
|
|
|
opportunities. */
|
|
|
|
NEXT_PASS (pass_phi_only_cprop);
|
|
|
|
NEXT_PASS (pass_dse);
|
|
|
|
NEXT_PASS (pass_reassoc);
|
|
|
|
NEXT_PASS (pass_dce);
|
|
|
|
NEXT_PASS (pass_forwprop);
|
|
|
|
NEXT_PASS (pass_phiopt);
|
|
|
|
NEXT_PASS (pass_strlen);
|
|
|
|
NEXT_PASS (pass_ccp);
|
|
|
|
/* After CCP we rewrite no longer addressed locals into SSA
|
|
|
|
form if possible. */
|
|
|
|
NEXT_PASS (pass_copy_prop);
|
|
|
|
NEXT_PASS (pass_cse_sincos);
|
|
|
|
NEXT_PASS (pass_optimize_bswap);
|
|
|
|
NEXT_PASS (pass_split_crit_edges);
|
|
|
|
NEXT_PASS (pass_pre);
|
|
|
|
NEXT_PASS (pass_sink_code);
|
|
|
|
NEXT_PASS (pass_asan);
|
|
|
|
NEXT_PASS (pass_tsan);
|
|
|
|
NEXT_PASS (pass_tree_loop);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_tree_loop)
|
|
|
|
NEXT_PASS (pass_tree_loop_init);
|
|
|
|
NEXT_PASS (pass_lim);
|
|
|
|
NEXT_PASS (pass_copy_prop);
|
|
|
|
NEXT_PASS (pass_dce_loop);
|
|
|
|
NEXT_PASS (pass_tree_unswitch);
|
|
|
|
NEXT_PASS (pass_scev_cprop);
|
|
|
|
NEXT_PASS (pass_record_bounds);
|
|
|
|
NEXT_PASS (pass_check_data_deps);
|
|
|
|
NEXT_PASS (pass_loop_distribution);
|
|
|
|
NEXT_PASS (pass_copy_prop);
|
|
|
|
NEXT_PASS (pass_graphite);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_graphite)
|
|
|
|
NEXT_PASS (pass_graphite_transforms);
|
|
|
|
NEXT_PASS (pass_lim);
|
|
|
|
NEXT_PASS (pass_copy_prop);
|
|
|
|
NEXT_PASS (pass_dce_loop);
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (pass_iv_canon);
|
|
|
|
NEXT_PASS (pass_parallelize_loops);
|
|
|
|
NEXT_PASS (pass_if_conversion);
|
|
|
|
NEXT_PASS (pass_vectorize);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_vectorize)
|
|
|
|
NEXT_PASS (pass_dce_loop);
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (pass_predcom);
|
|
|
|
NEXT_PASS (pass_complete_unroll);
|
|
|
|
NEXT_PASS (pass_slp_vectorize);
|
|
|
|
NEXT_PASS (pass_loop_prefetch);
|
|
|
|
NEXT_PASS (pass_iv_optimize);
|
|
|
|
NEXT_PASS (pass_lim);
|
|
|
|
NEXT_PASS (pass_tree_loop_done);
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (pass_lower_vector_ssa);
|
|
|
|
NEXT_PASS (pass_cse_reciprocals);
|
|
|
|
NEXT_PASS (pass_reassoc);
|
|
|
|
NEXT_PASS (pass_strength_reduction);
|
|
|
|
NEXT_PASS (pass_dominator);
|
|
|
|
/* The only const/copy propagation opportunities left after
|
|
|
|
DOM should be due to degenerate PHI nodes. So rather than
|
|
|
|
run the full propagators, run a specialized pass which
|
|
|
|
only examines PHIs to discover const/copy propagation
|
|
|
|
opportunities. */
|
|
|
|
NEXT_PASS (pass_phi_only_cprop);
|
|
|
|
NEXT_PASS (pass_vrp);
|
|
|
|
NEXT_PASS (pass_cd_dce);
|
|
|
|
NEXT_PASS (pass_tracer);
|
2013-09-12 15:19:21 +02:00
|
|
|
NEXT_PASS (pass_dse);
|
|
|
|
NEXT_PASS (pass_forwprop);
|
|
|
|
NEXT_PASS (pass_phiopt);
|
|
|
|
NEXT_PASS (pass_fold_builtins);
|
|
|
|
NEXT_PASS (pass_optimize_widening_mul);
|
|
|
|
NEXT_PASS (pass_tail_calls);
|
|
|
|
NEXT_PASS (pass_rename_ssa_copies);
|
2013-07-18 20:55:48 +02:00
|
|
|
/* FIXME: If DCE is not run before checking for uninitialized uses,
|
|
|
|
we may get false warnings (e.g., testsuite/gcc.dg/uninit-5.c).
|
|
|
|
However, this also causes us to misdiagnose cases that should be
|
|
|
|
real warnings (e.g., testsuite/gcc.dg/pr18501.c).
|
|
|
|
|
|
|
|
To fix the false positives in uninit-5.c, we would have to
|
|
|
|
account for the predicates protecting the set and the use of each
|
|
|
|
variable. Using a representation like Gated Single Assignment
|
|
|
|
may help. */
|
2013-09-11 14:20:07 +02:00
|
|
|
/* Split critical edges before late uninit warning to reduce the
|
|
|
|
number of false positives from it. */
|
|
|
|
NEXT_PASS (pass_split_crit_edges);
|
2013-07-18 20:55:48 +02:00
|
|
|
NEXT_PASS (pass_late_warn_uninitialized);
|
|
|
|
NEXT_PASS (pass_uncprop);
|
|
|
|
NEXT_PASS (pass_local_pure_const);
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (pass_all_optimizations_g);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_all_optimizations_g)
|
|
|
|
NEXT_PASS (pass_remove_cgraph_callee_edges);
|
|
|
|
NEXT_PASS (pass_strip_predict_hints);
|
|
|
|
/* Lower remaining pieces of GIMPLE. */
|
|
|
|
NEXT_PASS (pass_lower_complex);
|
|
|
|
NEXT_PASS (pass_lower_vector_ssa);
|
|
|
|
/* Perform simple scalar cleanup which is constant/copy propagation. */
|
|
|
|
NEXT_PASS (pass_ccp);
|
|
|
|
NEXT_PASS (pass_object_sizes);
|
|
|
|
/* Fold remaining builtins. */
|
|
|
|
NEXT_PASS (pass_fold_builtins);
|
|
|
|
/* Copy propagation also copy-propagates constants, this is necessary
|
|
|
|
to forward object-size and builtin folding results properly. */
|
|
|
|
NEXT_PASS (pass_copy_prop);
|
|
|
|
NEXT_PASS (pass_dce);
|
|
|
|
NEXT_PASS (pass_asan);
|
|
|
|
NEXT_PASS (pass_tsan);
|
|
|
|
NEXT_PASS (pass_rename_ssa_copies);
|
|
|
|
/* ??? We do want some kind of loop invariant motion, but we possibly
|
|
|
|
need to adjust LIM to be more friendly towards preserving accurate
|
|
|
|
debug information here. */
|
2013-09-11 14:20:07 +02:00
|
|
|
/* Split critical edges before late uninit warning to reduce the
|
|
|
|
number of false positives from it. */
|
|
|
|
NEXT_PASS (pass_split_crit_edges);
|
2013-07-18 20:55:48 +02:00
|
|
|
NEXT_PASS (pass_late_warn_uninitialized);
|
|
|
|
NEXT_PASS (pass_uncprop);
|
|
|
|
NEXT_PASS (pass_local_pure_const);
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (pass_tm_init);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_tm_init)
|
|
|
|
NEXT_PASS (pass_tm_mark);
|
|
|
|
NEXT_PASS (pass_tm_memopt);
|
|
|
|
NEXT_PASS (pass_tm_edges);
|
|
|
|
POP_INSERT_PASSES ()
|
Commit the vtable verification feature.
Commit the vtable verification feature. This feature is designed to
detect, at run time, if/when the vtable pointer in a C++ object has
been corrupted, before allowing virtual calls through that pointer.
If pointer corruption is detected, execution of the program is halted.
libstdc++-v3 ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
* fragment.am: Add XTEMPLATE_FLAGS.
* configure.ac: Add definitions for --enable-vtable-verify.
* acinclude.m4: Add --enable-vtable-verify and
--disable-vtable-verify; define --enable-vtable-verify; define
VTV_CXXFLAGS, VTV_PCH_CXXFLAGS and VTV_CXXLINKFLAGS.
* config/abi/pre/gnu.ver: Export symbols for vtable verification.
* libsupc++/Makefile.am: Define vtv_sources and add it to
libsupc___la_SOURCES and libsupc__convenience_la_SOURCES.
* libsupc++/vtv_stubs.cc: New file.
* include/Makefile.am: Add VTV_PCH_CXXFLAGS to PCHFLAGS.
* src/Makefile.am: Add VTV_CXXFLAGS to AM_CXXFLAGS; add
VTV_CXXLINKFLAGS to CXXLINK.
* src/c++98/Makefile.am: Comment out XTEMPLATE_FLAGS; add VTV_CXXFLAGS
to AM_CXXFLAGS; add VTV_CXXXLINKFLAGS to CXXLINK.
* src/C++11/Makefile.am: Ditto.
* doc/xml/manual/configure.xml: Add entry for --enable-vtable-verify.
* scripts/testsuite_flags.in: Add cxxvtvflags to Usage; cause
cxxvtvflags to use VTV_CXXFLAGS and VTV_CXXLINKFLAGS.
* testsuite/lib/libstdc++.exp: Add cxxvtvflags; add code to locate
libvtv if --enable-vtable-verify was used; set cxxvtvflags; add
cxxvtvflags to cxx_final.
* testsuite/18_support/bad_exception/23591_thread-1.c: Add
-fvtable-verify=none to compiler flags.
* testsuite/17_intro/freestanding.cc: Add -fvtable-verify=none
to compiler flags.
* configure: Regenerated.
* Makefile.in: Regenerated.
* python/Makefile.in: Regenerated.
* include/Makefile.in: Regenerated.
* libsupc++/Makefile.in: Regenerated.
* config.h.in: Regenerated.
* po/Makefile.in: Regenerated.
* src/Makefile.in: Regenerated.
* src/c++98/Makefile.in: Regenerated.
* src/c++11/Makefile.in: Regenerated.
* doc/Makefile.in: Regenerated.
* testsuite/Makefile.in: Regenerated.
top level ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
* configure.ac: Add target-libvtv to target_libraries; disable libvtv
on non-linux systems; add target-libvtv to noconfigdirs; add
libsupc++/.libs to C++ library search paths.
* configure: Regenerated.
* Makefile.def: Add libvtv to target_modules; make libvtv depend on
libstdc++ and libgcc.
* Makefile.in: Regenerated.
include/ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
* vtv-change-permission.h: New file.
contrib/ChangeLog:
2013-08-06 Caroline Tice4 <cmtice@google.com>
* gcc_update: Add libvtv files.
libgcc/ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
config.host (extra_parts): Add vtv_start.o, vtv_end.o
vtv_start_preinit.o and vtv_end_preinit.o.
configure.ac: Add code to check/set enable_vtable_verify.
Makefile.in: Add rules to build vtv_*.o, if enable_vtable_verify is
true.
vtv_start_preinit.c: New file.
vtv_end_preinit.c: New file.
vtv_start.c: New file.
vtv_end.c: New file.
configure: Regenerated.
gcc/ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
* gcc.c (VTABLE_VERIFICATION_SPEC): New definition.
(LINK_COMMAND_SPEC): Add VTABLE_VERIFICATION_SPEC.
* tree-pass.h: Add pass_vtable_verify.
* varasm.c (assemble_variable): Add code to properly set the comdat
section and name for the .vtable_map_vars section.
(assemble_vtyv_preinit_initializer): New function.
(default_sectin_type_flags): Make sure .vtable_map_vars section has
LINK_ONCE flag.
* output.h: Add function decl for assemble_vtv_preinit_initializer.
* vtable-verify.c: New file.
* vtable-verify.h: New file.
* flag-types.h (enum vtv_priority): Defintions for flag_vtable_verify
initialiation levels.
* timevar.def (TV_VTABLE_VERIFICATION): New definition.
* passes.def: Insert pass_vtable_verify.
* aclocal.m4: Reorder includes.
* doc/invoke.texi: Add documentation for the flags -fvtable-verify=,
-fvtv-debug and -fvtv-counts.
* config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Add vtv_start*.o,
as appropriate, if -fvtable-verify=... is used.
(GNU_USER_TARGET_ENDFILE_SPEC): Add vtv_end*.o as appropriate, if
-fvtable-verify=... is used.
* Makefile.in (OBJS): Add vtable-verify.o to list.
(vtable-verify.o): Add new build rule.
(GTFILES): Add vtable-verify.c to list.
* common.opt (fvtable-verify=): New flag.
(vtv_priority): Values for fvtable-verify= flag.
(fvtv-counts): New flag.
(fvtv-debug): New flag.
* tree.h (save_vtable_map_decl): New extern function decl.
gcc/cp/ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
* Make-lang.in (*CXX_AND_OBJCXX_OBJS): Add vtable-class-hierarchy.o to
list.
(vtable-class-hierarchy.o): Add build rule.
* cp-tree.h (vtv_start_verification_constructor_init_function): New
extern function decl.
(vtv_finish_verification_constructor_init_function): New extern
function decl.
(build_vtbl_address): New extern function decl.
(get_mangled_vtable_map_var_name): New extern function decl.
(vtv_compute_class_hierarchy_transitive_closure): New extern function
decl.
(vtv_generate_init_routine): New extern function decl.
(vtv_save_class_info): New extern function decl.
(vtv_recover_class_info): New extern function decl.
(vtv_build_vtable_verify_fndecl): New extern function decl.
* class.c (finish_struct_1): Add call to vtv_save_class_info if
flag_vtable_verify is true.
* config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
* vtable-class-hierarchy.c: New file.
* mangle.c (get_mangled_vtable_map_var_name): New function.
* decl2.c (start_objects): Update function comment.
(cp_write_global_declarations): Call vtv_recover_class_info,
vtv_compute_class_hierarchy_transitive_closure and
vtv_build_vtable_verify_fndecl, before calling
finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
flag_vtable_verify is true.
(vtv_start_verification_constructor_init_function): New function.
(vtv_finish_verification_constructor_init_function): New function.
* init.c (build_vtbl_address): Remove static qualifier from function.
libvtv/ChangeLog:
2013-08-06 Caroline Tice <cmtice@google.com>
Initial check-in of new vtable verification feature.
* configure.ac : New file.
* acinclude.m4 : New file.
* Makefile.am : New file.
* aclocal.m4 : New file.
* configure.tgt : New file.
* configure: New file (generated).
* Makefile.in: New file (generated).
* vtv_set.h : New file.
* vtv_utils.cc : New file.
* vtv_utils.h : New file.
* vtv_malloc.cc : New file.
* vtv_rts.cc : New file.
* vtv_malloc.h : New file.
* vtv_rts.h : New file.
* vtv_fail.cc : New file.
* vtv_fail.h : New file.
* vtv_map.h : New file.
* scripts/run-testsuite.sh : New file.
* scripts/sum-vtv-counts.c : New file.
* testsuite/parts-test-main.h : New file.
* testusite/dataentry.cc : New file.
* testsuite/temp_deriv.cc : New file.
* testsuite/register_pair.cc : New file.
* testsuite/virtual_inheritance.cc : New file.
* testsuite/field-test.cc : New file.
* testsuite/nested_vcall_test.cc : New file.
* testsuite/template-list-iostream.cc : New file.
* testsuite/register_pair_inserts.cc : New file.
* testsuite/register_pair_inserts_mt.cc : New file.
* testsuite/event.list : New file.
* testsuite/parts-test-extra-parts-views.cc : New file.
* testsuite/parts-test-extra-parts-views.h : New file.
* testsuite/environment-fail-32.s : New file.
* testsuite/parts-test-extra-parts.h : New file.
* testsuite/temp_deriv2.cc : New file.
* testsuite/dlopen_mt.cc : New file.
* testsuite/event.h : New file.
* testsuite/template-list.cc : New file.
* testsuite/replace-fail.cc : New file.
* testsuite/Makefile.am : New file.
* testsuite/Makefile.in: New file (generated).
* testsuite/mempool_negative.c : New file.
* testsuite/parts-test-main.cc : New file.
* testsuite/event-private.cc : New file.
* testsuite/thunk.cc : New file.
* testsuite/event-defintiions.cc : New file.
* testsuite/event-private.h : New file.
* testsuite/parts-test.list : New file.
* testusite/register_pair_mt.cc : New file.
* testsuite/povray-derived.cc : New file.
* testsuite/event-main.cc : New file.
* testsuite/environment.cc : New file.
* testsuite/template-list2.cc : New file.
* testsuite/thunk_vtable_map_attack.cc : New file.
* testsuite/parts-test-extra-parts.cc : New file.
* testsuite/environment-fail-64.s : New file.
* testsuite/dlopen.cc : New file.
* testsuite/so.cc : New file.
* testsuite/temp_deriv3.cc : New file.
* testsuite/const_vtable.cc : New file.
* testsuite/mempool_positive.c : New file.
* testsuite/dup_name.cc : New file.
From-SVN: r201555
2013-08-07 05:38:59 +02:00
|
|
|
NEXT_PASS (pass_vtable_verify);
|
2013-07-18 20:55:48 +02:00
|
|
|
NEXT_PASS (pass_lower_vector);
|
|
|
|
NEXT_PASS (pass_lower_complex_O0);
|
|
|
|
NEXT_PASS (pass_asan_O0);
|
|
|
|
NEXT_PASS (pass_tsan_O0);
|
2013-11-19 12:45:15 +01:00
|
|
|
NEXT_PASS (pass_sanopt);
|
2013-07-18 20:55:48 +02:00
|
|
|
NEXT_PASS (pass_cleanup_eh);
|
|
|
|
NEXT_PASS (pass_lower_resx);
|
|
|
|
NEXT_PASS (pass_nrv);
|
|
|
|
NEXT_PASS (pass_cleanup_cfg_post_optimizing);
|
|
|
|
NEXT_PASS (pass_warn_function_noreturn);
|
|
|
|
|
|
|
|
NEXT_PASS (pass_expand);
|
|
|
|
|
|
|
|
NEXT_PASS (pass_rest_of_compilation);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_rest_of_compilation)
|
|
|
|
NEXT_PASS (pass_instantiate_virtual_regs);
|
|
|
|
NEXT_PASS (pass_into_cfg_layout_mode);
|
|
|
|
NEXT_PASS (pass_jump);
|
|
|
|
NEXT_PASS (pass_lower_subreg);
|
|
|
|
NEXT_PASS (pass_df_initialize_opt);
|
|
|
|
NEXT_PASS (pass_cse);
|
|
|
|
NEXT_PASS (pass_rtl_fwprop);
|
|
|
|
NEXT_PASS (pass_rtl_cprop);
|
|
|
|
NEXT_PASS (pass_rtl_pre);
|
|
|
|
NEXT_PASS (pass_rtl_hoist);
|
|
|
|
NEXT_PASS (pass_rtl_cprop);
|
|
|
|
NEXT_PASS (pass_rtl_store_motion);
|
|
|
|
NEXT_PASS (pass_cse_after_global_opts);
|
|
|
|
NEXT_PASS (pass_rtl_ifcvt);
|
|
|
|
NEXT_PASS (pass_reginfo_init);
|
|
|
|
/* Perform loop optimizations. It might be better to do them a bit
|
|
|
|
sooner, but we want the profile feedback to work more
|
|
|
|
efficiently. */
|
|
|
|
NEXT_PASS (pass_loop2);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_loop2)
|
|
|
|
NEXT_PASS (pass_rtl_loop_init);
|
|
|
|
NEXT_PASS (pass_rtl_move_loop_invariants);
|
|
|
|
NEXT_PASS (pass_rtl_unswitch);
|
|
|
|
NEXT_PASS (pass_rtl_unroll_and_peel_loops);
|
|
|
|
NEXT_PASS (pass_rtl_doloop);
|
|
|
|
NEXT_PASS (pass_rtl_loop_done);
|
|
|
|
TERMINATE_PASS_LIST ()
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (pass_web);
|
|
|
|
NEXT_PASS (pass_rtl_cprop);
|
|
|
|
NEXT_PASS (pass_cse2);
|
|
|
|
NEXT_PASS (pass_rtl_dse1);
|
|
|
|
NEXT_PASS (pass_rtl_fwprop_addr);
|
|
|
|
NEXT_PASS (pass_inc_dec);
|
|
|
|
NEXT_PASS (pass_initialize_regs);
|
|
|
|
NEXT_PASS (pass_ud_rtl_dce);
|
|
|
|
NEXT_PASS (pass_combine);
|
|
|
|
NEXT_PASS (pass_if_after_combine);
|
|
|
|
NEXT_PASS (pass_partition_blocks);
|
|
|
|
NEXT_PASS (pass_outof_cfg_layout_mode);
|
|
|
|
NEXT_PASS (pass_split_all_insns);
|
|
|
|
NEXT_PASS (pass_lower_subreg2);
|
|
|
|
NEXT_PASS (pass_df_initialize_no_opt);
|
|
|
|
NEXT_PASS (pass_stack_ptr_mod);
|
|
|
|
NEXT_PASS (pass_mode_switching);
|
|
|
|
NEXT_PASS (pass_match_asm_constraints);
|
|
|
|
NEXT_PASS (pass_sms);
|
2013-11-06 20:46:39 +01:00
|
|
|
NEXT_PASS (pass_live_range_shrinkage);
|
2013-07-18 20:55:48 +02:00
|
|
|
NEXT_PASS (pass_sched);
|
|
|
|
NEXT_PASS (pass_ira);
|
|
|
|
NEXT_PASS (pass_reload);
|
|
|
|
NEXT_PASS (pass_postreload);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_postreload)
|
|
|
|
NEXT_PASS (pass_postreload_cse);
|
|
|
|
NEXT_PASS (pass_gcse2);
|
|
|
|
NEXT_PASS (pass_split_after_reload);
|
|
|
|
NEXT_PASS (pass_ree);
|
|
|
|
NEXT_PASS (pass_compare_elim_after_reload);
|
|
|
|
NEXT_PASS (pass_branch_target_load_optimize1);
|
|
|
|
NEXT_PASS (pass_thread_prologue_and_epilogue);
|
|
|
|
NEXT_PASS (pass_rtl_dse2);
|
|
|
|
NEXT_PASS (pass_stack_adjustments);
|
|
|
|
NEXT_PASS (pass_jump2);
|
|
|
|
NEXT_PASS (pass_peephole2);
|
|
|
|
NEXT_PASS (pass_if_after_reload);
|
|
|
|
NEXT_PASS (pass_regrename);
|
|
|
|
NEXT_PASS (pass_cprop_hardreg);
|
|
|
|
NEXT_PASS (pass_fast_rtl_dce);
|
2013-11-18 23:38:51 +01:00
|
|
|
NEXT_PASS (pass_duplicate_computed_gotos);
|
2013-07-18 20:55:48 +02:00
|
|
|
NEXT_PASS (pass_reorder_blocks);
|
|
|
|
NEXT_PASS (pass_branch_target_load_optimize2);
|
|
|
|
NEXT_PASS (pass_leaf_regs);
|
|
|
|
NEXT_PASS (pass_split_before_sched2);
|
|
|
|
NEXT_PASS (pass_sched2);
|
|
|
|
NEXT_PASS (pass_stack_regs);
|
|
|
|
PUSH_INSERT_PASSES_WITHIN (pass_stack_regs)
|
|
|
|
NEXT_PASS (pass_split_before_regstack);
|
|
|
|
NEXT_PASS (pass_stack_regs_run);
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (pass_compute_alignments);
|
|
|
|
NEXT_PASS (pass_variable_tracking);
|
|
|
|
NEXT_PASS (pass_free_cfg);
|
|
|
|
NEXT_PASS (pass_machine_reorg);
|
|
|
|
NEXT_PASS (pass_cleanup_barriers);
|
|
|
|
NEXT_PASS (pass_delay_slots);
|
|
|
|
NEXT_PASS (pass_split_for_shorten_branches);
|
|
|
|
NEXT_PASS (pass_convert_to_eh_region_ranges);
|
|
|
|
NEXT_PASS (pass_shorten_branches);
|
|
|
|
NEXT_PASS (pass_set_nothrow_function_flags);
|
|
|
|
NEXT_PASS (pass_dwarf2_frame);
|
|
|
|
NEXT_PASS (pass_final);
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (pass_df_finish);
|
|
|
|
POP_INSERT_PASSES ()
|
|
|
|
NEXT_PASS (pass_clean_state);
|
|
|
|
TERMINATE_PASS_LIST ()
|