Convert various gimple to gimple_phi within ssa-iterators.h
[official-gcc.git] / gcc / ChangeLog.gimple-classes
blob04bb1a7172506b068cf54d42c6e5c4abc922dfec
1 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
3         Convert various gimple to gimple_phi within ssa-iterators.h
5         * ssa-iterators.h (FOR_EACH_PHI_OR_STMT_USE): Add checked cast to
6         gimple_phi.
7         (FOR_EACH_PHI_OR_STMT_DEF): Likewise.
9         * ssa-iterators.h (single_phi_def): Require a gimple_phi.
10         (op_iter_init_phiuse): Likewise.
11         (op_iter_init_phidef): Likewise.
12         * tree-ssa-loop-im.c (extract_true_false_args_from_phi): Likewise.
14         * tree-ssa-loop-im.c (link_use_stmts_after): Replace check against
15         GIMPLE_PHI with add a dyn_cast to gimple_phi, using result as needed.
16         (determine_max_movement): Likewise.
17         * tree-ssa-reassoc.c (is_phi_for_stmt): Likewise.
18         * tree-ssa-sccvn.c (start_over:): Likewise.
20         * tree-ssa-loop-im.c
21         (move_computations_dom_walker::before_dom_children): Split iterator
22         into gimple_stmt_iterator and a gimple_phi_iterator so that a local
23         can become a gimple_phi.
25 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
27         Use gimple_phi in many more places.
29         * gimple-ssa-strength-reduction.c (slsr_process_phi): Require a
30         gimple_phi.
31         * ipa-inline-analysis.c (predicate_for_phi_result): Likewise.
32         * tree-emutls.c (lower_emutls_phi_arg): Likewise.
33         * tree-if-conv.c (predicate_scalar_phi): Likewise.
34         * tree-into-ssa.c (mark_virtual_phi_result_for_renaming): Likewise.
35         * tree-into-ssa.h (mark_virtual_phi_result_for_renaming): Likewise.
36         * tree-phinodes.c (degenerate_phi_result): Likewise.
37         * tree-phinodes.h (degenerate_phi_result): Likewise.
38         * tree-ssa.c (verify_use): Likewise.
39         * tree-switch-conversion.c (array_value_type): Likewise.
41         * graphite-scop-detection.c (same_close_phi_node): Require a pair
42         of gimple_phi.
43         (remove_duplicate_close_phi): Require a gimple_phi and a
44         gimple_phi_iterator.
45         (make_close_phi_nodes_unique): Convert a local into a
46         gimple_phi_iterator.
48         * gimple-pretty-print.c (gimple_dump_bb_for_graph): Split iterator
49         into gimple_stmt_iterator and gimple_phi_iterator, converting local
50         from gimple to gimple_phi.
51         * gimple-ssa-strength-reduction.c
52         (find_candidates_dom_walker::before_dom_children): Likewise.
53         * ipa-inline-analysis.c (estimate_function_body_sizes): Likewise.
54         * ipa-split.c (verify_non_ssa_vars): Likewise.
55         (visit_bb): Likewise.
56         (split_function): Likewise.
57         * lto-streamer-out.c (output_function): Likewise.
58         * sese.c (sese_build_liveouts_bb): Likewise.
59         * tree-cfg.c (gimple_can_merge_blocks_p): Likewise.
60         * tree-complex.c (init_dont_simulate_again): Likewise.
61         * tree-dfa.c (collect_dfa_stats): Likewise.
62         * tree-eh.c (sink_clobbers): Likewise.
63         * tree-emutls.c (lower_emutls_function_body): Likewise.
64         * tree-into-ssa.c (rewrite_dom_walker::before_dom_children):
65         Likewise.
66         (rewrite_update_dom_walker::before_dom_children): Likewise.
67         (prepare_block_for_update): Likewise.
68         * tree-loop-distribution.c (stmts_from_loop): Likewise.
69         (generate_loops_for_partition): Likewise.
70         (destroy_loop): Likewise.
71         (tree_loop_distribution): Likewise.
72         * tree-ssa-coalesce.c (build_ssa_conflict_graph): Likewise.
73         * tree-ssa-copy.c (init_copy_prop): Likewise.
74         * tree-ssa-copyrename.c (rename_ssa_copies): Likewise.
75         * tree-ssa-loop-ivcanon.c (propagate_constants_for_unrolling): Likewise.
76         * tree-ssa-loop-manip.c (find_uses_to_rename_bb): Likewise.
77         (verify_loop_closed_ssa): Likewise.
78         * tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise.
79         * tree-ssa-pre.c (compute_avail): Likewise.
80         (eliminate_dom_walker::before_dom_children): Likewise.
81         * tree-ssa-strlen.c (strlen_dom_walker::before_dom_children): Likewise.
82         * tree-ssa-structalias.c (compute_points_to_sets): Likewise.
83         (ipa_pta_execute): Likewise.
84         * tree-ssa-tail-merge.c (same_succ_hash): Likewise.
85         (release_last_vdef): Likewise.
86         * tree-ssa.c (verify_ssa): Likewise.
87         (execute_update_addresses_taken): Likewise.
88         * tree-stdarg.c (check_all_va_list_escapes): Likewise.
89         (execute_optimize_stdarg): Likewise.
90         * tree-switch-conversion.c (build_arrays): Likewise.
91         * tree-vect-loop-manip.c (rename_variables_in_bb): Likewise.
92         * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
93         (vect_analyze_loop_operations): Likewise.
94         (vect_transform_loop): Likewise.
95         * tree-vrp.c (find_assert_locations_1): Likewise.
96         (vrp_initialize): Likewise.
98         * graphite-sese-to-poly.c (gsi_for_phi_node): Convert psi to a
99         gimple_phi_iterator.
100         (rewrite_degenerate_phi): Require a gimple_phi_iterator; strengthen
101         local "phi" from gimple to gimple-phi.
103         * ipa-split.c (consider_split): Convert local psi to a
104         gimple_phi_iterator.
105         * tree-cfg.c (gimple_merge_blocks): Likewise.
107         * tree-eh.c (unsplit_eh): Replace reuse of gsi with a new
108         gimple_phi_iterator gpi, using it to convert statement from gimple
109         to a gimple_phi.
110         (cleanup_empty_eh_merge_phis): Strengthen ophi from gimple to
111         gimple_phi.
112         * tree-ssa-dce.c (eliminate_unnecessary_stmts): Replace reuse of
113         gsi with a new gimple_phi_iterator gpi, using it to convert
114         expressions from gimple to gimple_phi; add a checked cast to
115         gimple_phi.
117         * tree-if-conv.c (predicate_all_scalar_phis): Convert local phi_gsi
118         to be a gimple_phi_iterator; convert "phi" to be a gimple_phi.
119         * tree-parloops.c (loop_has_vector_phi_nodes): Convert local to be a
120         gimple_phi_iterator.
121         * tree-ssa-ccp.c (ccp_initialize): Likewise.
123         * tree-scalar-evolution.c (analyze_initial_condition): Add checked cast
124         to a gimple_phi.
125         * tree-ssa.c (insert_debug_temp_for_var_def): Likewise.
126         * tree-ssa-dom.c (get_rhs_or_phi_arg): Likewise.
128 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
130         Use gimple_call in some places within tree-ssa-dom.c
132         * tree-ssa-dom.c (struct hashable_expr): Strengthen field
133         call.fn_from from gimple to gimple_call.
134         (initialize_hash_element): Replace check against GIMPLE_CALL
135         with dyn_cast<gimple_call> and update gimple_call_ uses to use
136         new gimple_call local, along with fn_from initializer.
137         (iterative_hash_hashable_expr): Strengthen type of local "fn_from"
138         from gimple to gimple_call.
139         (print_expr_hash_elt): Likewise.
141 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
143         Concretize gimple_call_copy_flags and ipa_modify_call_arguments
145         * gimple.h (gimple_call_copy_flags): Require gimple_calls.
147         * ipa-prop.c (ipa_modify_call_arguments): Require a gimple_call.
148         * ipa-prop.h (ipa_modify_call_arguments): Likewise.
150         * tree-inline.c (copy_bb): Replace is_gimple_call with new local
151         and call to dyn_cast<gimple_call>, updating gimple_call_ uses to
152         use the type-checked local.
154         * tree-sra.c (convert_callers): Replace check for GIMPLE_CALL with
155         a dyn_cast.
157 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
159         Concretize gimple_assign_nontemporal_move_p
161         * gimple.h (gimple_assign_nontemporal_move_p): Require a
162         const_gimple_assign rather than a const_gimple.
164         * cfgexpand.c (expand_gimple_stmt_1): Add local assign_stmt and
165         checked cast within "case GIMPLE_ASSIGN".
167         * gimple-streamer-out.c (output_gimple_stmt): Add checked cast to
168         gimple_assign.
170 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
172         Concretize gimple_call_arg_flags
174         * gimple.h (gimple_call_arg_flags): Require a const_gimple_call
175         rather than a const_gimple.
177         * gimple.c (gimple_call_fnspec): Likewise.
178         (gimple_call_arg_flags): Likewise.
180         * tree-inline.c (remap_gimple_stmt): Use a dyn_cast rather than a
181         is_gimple_call and repeated checked casts.
183 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
185         Concretize gimple_call_set_tail and gimple_call_tail_p
187         * gimple.h (gimple_call_set_tail): Require a gimple_call.
188         (gimple_call_tail_p): Likewise.
190         * cfgexpand.c (expand_gimple_tailcall): Likewise.
191         (expand_gimple_basic_block): Convert calls to is_gimple_call to a
192         dyn_cast, introducing a new "call_stmt" local.
194         * trans-mem.c (expand_block_edges): Likewise, for comparison against
195         GIMPLE_CALL.
197         * tree-inline.c (remap_gimple_stmt): Add checked casts to
198         gimple_call in region guarded by is_gimple_call.
200         * tree-tailcall.c (optimize_tail_call): Add checked cast to gimple_call
201         for t->call_gsi.
203 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
205         Concretize gimple_call_set_fntype
207         * gimple-fold.c (gimple_fold_builtin_sprintf_chk): Strengthen
208         local "stmt" from gimple to gimple_call.
210         * gimple.h (gimple_call_set_fntype): Require a gimple_call.
212         * omp-low.c (lower_omp_1): Add a new local gimple_call "call_stmt",
213         from a checked cast to gimple_call within the "case GIMPLE_CALL",
214         for the regions where "stmt" is not subsequently overwritten.
216 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
218         Concretize gimple_call_set_fn
220         * gimple.h (gimple_call_set_fn): Require a gimple_call.
222         * trans-mem.c (dump_tm_memopt_transform): Likewise.
223         (tm_memopt_transform_blocks): Add checked casts to gimple_call in
224         suites guarded by is_tm_simple_{load|store}, which enforce that
225         the statement must be a GIMPLE_CALL; use this when invoking
226         dump_tm_memopt_transform.
228 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
230         Tweak to gimplify_modify_expr
232         * gimplify.c (gimplify_modify_expr): Introduce local "call_stmt".
234 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
236         Concretize gimple_call_nothrow_p
238         * gimple.h (gimple_call_nothrow_p): Require a gimple_call.
240         * tree-eh.c (stmt_could_throw_p): Add checked cast to gimple_call.
242         * tree-vect-slp.c (vect_build_slp_tree_1): Replace call to
243         is_gimple_call with dyn_cast<gimple_call>, introducing a local.
245 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
247         Concretize gimple_call_set_nothrow
249         * gimple.h (gimple_call_set_nothrow): Require a gimple_call.
251         * trans-mem.c (ipa_tm_insert_gettmclone_call): Likewise.
252         (ipa_tm_transform_calls_redirect): Add checked cast to gimple call; this
253         is only called for gsi on a GIMPLE_CALL statement.
255 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
257         Concretize various expressions from gimple to gimple_cond
259         * ipa-split.c (check_forbidden_calls): Replace check against
260         GIMPLE_COND with a dyn_cast<gimple_cond>, introducing a
261         gimple_cond local.
262         * predict.c (predict_extra_loop_exits): Likewise.
263         * tree-vrp.c (fold_predicate_in): Likewise.
264         (simplify_stmt_for_jump_threading): Likewise.
266         * predict.c (is_comparison_with_loop_invariant_p): Require a
267         gimple_cond.
268         (predict_iv_comparison): Add checked cast to gimple_cond once we
269         know the code is GIMPLE_COND.
270         (predict_loops): Change type of "stmt" to gimple_cond,
271         adding checked casts to its assignments (which are both guarded by
272         checks against GIMPLE_COND).
274         * tree-vrp.c (find_conditional_asserts): Require a gimple_cond.
275         (vrp_evaluate_conditional): Likewise.
276         (find_assert_locations_1): Add checked cast to gimple_cond.
277         (vrp_visit_stmt): Likewise.
279 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
281         Concretize gimple_cond_{lhs|rhs}_ptr
283         * gimple.h (gimple_cond_lhs_ptr): Require a const_gimple_cond
284         rather than just a const_gimple_cond.
285         (gimple_cond_rhs_ptr): Likewise.
287         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
288         to gimple_cond within "case GIMPLE_COND".
289         * omp-low.c (lower_omp_1): Likewise.
291         * omp-low.c (expand_omp_simd): Introduce a new local cond_stmt
292         to express that the conditional is indeed a gimple_cond.
294         * tree-ssa-loop-ivopts.c (extract_cond_operands): Add a checked
295         cast to gimple_cond within a region where the code is known to
296         be GIMPLE_COND.
298 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
300         Concretize gimple_cond_set_{lhs|rhs}
302         * gimple.h (gimple_cond_set_lhs): Require a gimple_cond.
303         (gimple_cond_set_rhs): Likewise.
305         * tree-parloops.c (transform_to_exit_first_loop): Convert locals
306         "cond_stmt" and "cond_nit" to gimple_cond, adding checked casts,
307         since the existing code assumes that code is GIMPLE_COND.  Convert
308         "stmt" to a gimple_assign.
309         (create_parallel_loop): Likewise for "cond_stmt".
311         * tree-ssa-loop-im.c (rewrite_bittest): Replace check for code
312         GIMPLE_COND with a dyn_cast, adding new local "cond_stmt".
314 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
316         Concretize gimple_cond_set_code
318         * gimple.h (gimple_cond_set_code): Require a gimple_cond.
320         * tree-complex.c (expand_complex_comparison): Add a checked cast to
321         gimple_cond within "case GIMPLE_COND".
323         * tree-ssa-loop-ivcanon.c (create_canonical_iv): Convert local "cond"
324         to a gimple_cond, adding a checked cast.  The existing code requires
325         that the last statement before the exit edge have code GIMPLE_COND,
326         though it's not clear to me where this is verified.
328         * tree-ssa-loop-ivopts.c (rewrite_use_compare): Add a checked cast
329         to gimple_cond on "use->stmt".
331         * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Convert
332         local "exit_if" to gimple_cond, adding a checked cast.  It's not
333         clear to me exactly where the GIMPLE_COND-ness of this is
334         established, but the existing code requires it.
335         (canonicalize_loop_ivs): Similarly for "stmt".
337         * tree-ssa-propagate.c (propagate_tree_value_into_stmt): Replace
338         a check against GIMPLE_COND with a dyn_cast<gimple_cond>.
340 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
342         Concretize gimple_cond_{true|false}_label
344         * gimple.h (gimple_cond_true_label): Require a const_gimple_cond
345         rather than just a const_gimple.
346         (gimple_cond_false_label): Likewise.
348         * omp-low.c (diagnose_sb_2): Add checked cast to gimple_cond within
349         case GIMPLE_COND.
350         * tree-eh.c (maybe_record_in_goto_queue): Likewise.
352         * tree-cfg.c (verify_gimple_stmt): Add a checked cast to gimple_cond
353         within "case GIMPLE_COND", splitting it out into...
354         (verify_gimple_label): New.
356 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
358         Concretize gimple_switch_index and gimple_switch_index_ptr
360         * gimple.h (gimple_switch_index): Require a const_gimple_switch rather
361         than a plain const_gimple.
362         (gimple_switch_index_ptr): Likewise.
364         * gimplify-me.c (gimple_regimplify_operands): Add checked cast to
365         gimple_switch within "case GIMPLE_SWITCH".
366         * tree-cfgcleanup.c (cleanup_control_expr_graph): Likewise.
367         * tree-ssa-ccp.c (ccp_fold): Likewise.
368         * tree-ssa-dom.c (optimize_stmt): Likewise.
370         * tree-ssa-ccp.c (evaluate_stmt): Add checked cast to
371         gimple_switch within region guarded by check for GIMPLE_SWITCH.
372         * tree-ssa-dom.c (record_edge_info): Likewise.
373         (eliminate_redundant_computations): Likewise.
374         * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Likewise.
375         * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
377         * tree-ssa-dom.c (initialize_hash_element): Replace check for
378         code GIMPLE_SWITCH with a dyn_cast<gimple_switch>.
379         (propagate_rhs_into_lhs): Likewise.
380         * tree-ssa-propagate.c (may_propagate_copy_into_stmt): Likewise.
381         (propagate_tree_value_into_stmt): Likewise.
383 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
385         Concretize gimple_cond_make_{false|true}
387         * gimple.h (gimple_cond_make_false): Require a gimple_cond.
388         (gimple_cond_make_true): Likewise.
390         * tree-cfg.c (fold_cond_expr_cond): Add a checked cast to
391         gimple_cond within region guarded by check for GIMPLE_COND.
392         * tree-ssa-ccp.c (ccp_fold_stmt): Likewise.
394         * tree-loop-distribution.c (generate_loops_for_partition): Replace
395         a check for GIMPLE_COND with a dyn_cast<gimple_cond>.
396         * tree-ssa-ccp.c (optimize_unreachable): Likewise.
397         * tree-ssa-loop-niter.c (number_of_iterations_exit): Likewise.
398         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
399         Likewise.
401         * tree-vrp.c (fold_predicate_in): Add a checked cast to
402         gimple_cond.  We must be dealing with a GIMPLE_COND since logic
403         at top of the function ensures we only act on GIMPLE_ASSIGN and
404         GIMPLE_COND statements, and we're now within a "not a GIMPLE_ASSIGN"
405         clause.
407         * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts): Add
408         checked cast of elt->stmt to gimple_cond.  The existing code requires
409         this to be a GIMPLE_COND, though it's not clear to me how this
410         requirement is enforced.
411         (remove_redundant_iv_tests): Likewise.
412         (try_unroll_loop_completely): Likewise, for the last_stmt of the
413         preceding bb along edge_to_cancel.
414         * tree-ssa-reassoc.c (maybe_optimize_range_tests): Likewise, for the
415         last_stmt of bb.
417 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
419         Concretize locals within expand_omp_for_init_counts
421         * omp-low.c (expand_omp_for_init_counts): Eliminate local "stmt"
422         in favor of new locals "cond_stmt" and "assign_stmt" with more
423         concrete types.
425 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
427         Make gimple_cond_set_{true|false}_label require gimple_cond.
429         * gimple.h (gimple_cond_set_true_label): Require a gimple_cond.
430         (gimple_cond_set_false_label): Likewise.
432         * tree-cfg.c (make_cond_expr_edges): Convert "entry" from gimple to
433         a gimple_cond.
434         (cleanup_dead_labels): Introduce a checked cast to a gimple_cond within
435         the GIMPLE_COND case.
437 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
439         Concretize three gimple_return_ accessors
441         * gimple.h (gimple_return_retval_ptr): Require a const_gimple_return
442         rather than a const_gimple.
443         (gimple_return_retval): Likewise.
444         (gimple_return_set_retval): Require a gimple_return.
446         * cfgexpand.c (expand_gimple_stmt_1): Add a checked cast to
447         gimple_return.
448         (expand_gimple_basic_block): Likewise.
449         * tree-complex.c (expand_complex_move): Likewise.
450         (expand_complex_comparison): Likewise.
451         * tree-inline.c (remap_gimple_stmt): Likewise.
452         * tree-sra.c (scan_function): Likewise.
453         (sra_modify_function_body): Likewise.
454         (ipa_sra_modify_function_body): Likewise.
455         * tree-ssa-structalias.c (find_func_aliases): Likewise.
457         * gimple-ssa-isolate-paths.c (isolate_path): Strengthen local
458         "ret" from gimple to gimple_return.
459         (find_implicit_erroneous_behaviour): Replace a check for code
460         GIMPLE_RETURN with a dyn_cast and a new local.
461         (find_explicit_erroneous_behaviour): Likewise.
462         * gimple-walk.c (walk_stmt_load_store_addr_ops): Likewise.
463         * gimple.c (infer_nonnull_range): Likewise.
464         * ipa-split.c (find_return_bb): Likewise.
465         (find_retval): Likewise.
466         (split_function): Likewise.
467         * omp-low.c (ipa_simd_modify_function_body): Likewise.
468         * tree-cfg.c (pass_warn_function_return::execute): Likewise.
469         * tree-nrv.c (tree_nrv): Likewise.
470         * tree-ssa-alias.c (ref_maybe_used_by_stmt_p): Likewise.
471         * tree-ssa-dce.c (propagate_necessity): Likewise.
472         * tree-ssa-structalias.c (find_func_clobbers): Likewise.
473         * tree-tailcall.c (find_tail_calls): Likewise.
475         * predict.c (apply_return_prediction): Rework the search for
476         return_stmt so that the latter can have type gimple_return.
478 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
480         Make gimple_phi_arg_location require a gimple_phi.
482         * gimple.h (gimple_phi_arg_location): Require a gimple_phi.
484         * tree-into-ssa.c (rewrite_update_phi_arguments): Replace a check
485         for code GIMPLE_PHI with a dyn_cast and a new local.
486         * tree-ssa-ter.c (ter_is_replaceable_p): Likewise.
488         * tree-ssa-live.c (remove_unused_locals): Replace a
489         gimple_stmt_iterator with a gimple_phi_iterator, using it to make
490         local "phi" be a gimple_phi.
491         * tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Likewise.
493         * tree-ssa-phiopt.c (conditional_replacement): Require a gimple_phi.
494         (single_non_singleton_phi_for_edges): Return a gimple_phi; update
495         local to be a gimple_phi, adding checked casts since we're working
496         on a sequence of gimple_phi.
497         (conditional_replacement): Require a gimple_phi.
499         * tree-ssa-threadupdate.c (get_value_locus_in_path): Strengthen
500         type of local "def_phi" to gimple_phi by replacing a check of the
501         code for GIMPLE_PHI with a dyn_cast<gimple_phi>.
503 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
505         Make gimple_phi_arg_location_from_edge require a gimple_phi
507         * gimple.h (gimple_phi_arg_location_from_edge): Require a
508         gimple_phi.
510         * tree-parloops.c (create_parallel_loop): Split up local variable
511         "stmt", introducing other locals for the various statements created
512         by this function.  Reuse "stmt" within the phi-handling code, and
513         change to type gimple_phi, since this is the only remaining
514         "non-phi" user of gimple_phi_arg_location_from_edge.
516 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
518         Concretize three gimple_try_set_ accessors
520         * gimple.c (gimple_copy): Add checked casts to gimple_try.
522         * gimple.h (gimple_try_set_kind): Require a gimple_try.
523         (gimple_try_set_eval): Likewise.
524         (gimple_try_set_cleanup): Likewise.
526         * tree-eh.c (optimize_double_finally): Require a pair of gimple_try
527         statements.
528         (refactor_eh_r): Convert code comparisons to dynamic casts.
530 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
532         Concretize gimple_try_set_catch_is_cleanup
534         * gimple.h (gimple_try_set_catch_is_cleanup): Require a gimple_try.
536         * gimplify.c (gimplify_expr): Convert local "try_" from a gimple
537         to a gimple_try.
539 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
541         Concretize gimple_eh_filter_set_types and gimple_eh_filter_set_failure
543         * gimple.h (gimple_eh_filter_set_types): Require a gimple_eh_filter.
544         (gimple_eh_filter_set_failure): Likewise.
545         * gimple.c (gimple_copy): Add checked casts to gimple_eh_filter
546         within GIMPLE_EH_FILTER case.
548 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
550         Concretize gimple_label_label
552         * gimple.h (gimple_label_label): Require a const_gimple_label
553         rather than just a const_gimple.
555         * cfgexpand.c (label_rtx_for_bb): Convert local from gimple to
556         gimple_label, replacing a check against GIMPLE_LABEL with a
557         dyn_cast<gimple_label>.
558         * predict.c (tree_estimate_probability_bb): Likewise.
559         * tree-cfg.c (make_edges): Likewise.
560         (cleanup_dead_labels): Likewise (twice).
561         (gimple_can_merge_blocks_p): Likewise.
562         (gimple_block_label): Likewise.
563         * tree-eh.c (unsplit_eh): Likewise.
564         (cleanup_empty_eh_unsplit): Likewise.
565         * tree-inline.c (mark_local_labels_stmt): Likewise.
566         * tree-nested.c (convert_nl_goto_receiver): Likewise.
568         * cfgexpand.c (expand_gimple_stmt_1): Add a checked cast to
569         gimple_label when invoking gimple_label_label in a region where
570         we've checked the code is GIMPLE_LABEL.
571         * gimple-pretty-print.c (pp_cfg_jump): Likewise.
572         * gimple.c (gimple_set_bb): Likewise.
573         * ipa-pure-const.c (check_stmt): Likewise.
574         * omp-low.c (diagnose_sb_1): Likewise.
575         * tree-cfg.c (gimple_verify_flow_info): Likewise.
576         * tree-cfgcleanup.c (tree_forwarder_block_p): Likewise.
577         (remove_forwarder_block): Likewise.
578         * tree-eh.c (collect_finally_tree): Likewise.
580         * ipa-split.c (verify_non_ssa_vars): Replace a check against
581         GIMPLE_LABEL with a dyn_cast<gimple_label>, introducing a
582         gimple_label local.
583         * tree-cfg.c (gimple_can_merge_blocks_p): Likewise.
584         (gimple_merge_blocks): Likewise.
585         (remove_bb): Likewise.
586         (stmt_starts_bb_p): Likewise.
587         (gimple_verify_flow_info): Likewise.
588         (move_block_to_fn): Likewise.
589         * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
590         (remove_forwarder_block_with_phi): Likewise.
591         * tree-ssa-ccp.c (optimize_unreachable): Likewise.
593 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
595         Concretize gimple_call_use_set and gimple_call_clobber_set
597         * gimple.h (gimple_call_use_set): Require a gimple_call.
598         (gimple_call_clobber_set): Likewise.
600 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
602         Concretize gimple_catch_types
604         * gimple.h (gimple_catch_types): Require a const_gimple_catch
605         rather than a const_gimple.
607 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
609         Make gimple_goto_set_dest require a gimple_goto
611         * gimple.h (gimple_goto_set_dest): Require a gimple_goto.
613         * tree-cfg.c (factor_computed_gotos): Add checked cast to
614         gimple_goto.
615         (cleanup_dead_labels): Likewise.
617 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
619         Make gimple_label_set_label require a gimple_label
621         * gimple.h (gimple_label_set_label): Require a gimple_label.
623 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
625         Concretize parameter to gimple_call_copy_skip_args
627         * gimple.c (gimple_call_copy_skip_args): Require a gimple_call.
628         * gimple.h (gimple_call_copy_skip_args): Likewise.
630 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
632         Various gimple to gimple_call conversions in IPA
634         * ipa-prop.c (detect_type_change_from_memory_writes): Require a
635         gimple_call rather than a plain gimple.
636         (detect_type_change): Likewise.
637         (detect_type_change_ssa): Likewise.
638         (compute_complex_assign_jump_func): Likewise.
639         (compute_complex_ancestor_jump_func): Likewise.
640         (compute_known_type_jump_func): Likewise.
641         (determine_locally_known_aggregate_parts): Likewise.
642         (ipa_compute_jump_functions_for_edge): Strengthen local "call" to
643         a gimple_call; add checked cast to gimple_phi.
644         (ipa_note_param_call): Require a gimple_call rather than a plain
645         gimple.
646         (ipa_analyze_indirect_call_uses): Likewise.
647         (ipa_analyze_virtual_call_uses): Likewise.
648         (ipa_analyze_call_uses): Likewise.
649         (ipa_analyze_stmt_uses):Add checked cast to gimple_call.
651         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
652         Replace use of is_gimple_call with dyn_cast<gimple_call> and a
653         new local "call_stmt".
655 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
657         Use gimple_call for callgraph edges
659         * cgraph.h (cgraph_edge::call_stmt): Strengthen field from plain
660         gimple to a gimple_call.
661         (cgraph_node::set_call_stmt_including_clones): Likewise for param
662         "new_stmt".
663         (cgraph_node::create_edge): Likewise for param "call_stmt".
664         (cgraph_node::create_indirect_edge): Likewise.
665         (cgraph_node::create_edge_including_clones): Likewise for param
666         "stmt".
667         (cgraph_edge::set_call_stmt): Likewise for param "new_stmt".
668         (cgraph_edge::clone): Likewise for param "call_stmt".
669         (symbol_table::create_edge): Likewise.
671         * cgraph.c (cgraph_edge::set_call_stmt): Require a gimple_call
672         rather than a plain gimple.
673         (symbol_table::create_edge): Likewise.
674         (cgraph_node::create_edge): Likewise.
675         (cgraph_node::create_indirect_edge): Likewise.
676         (cgraph_edge::redirect_call_stmt_to_callee): Strengthen local
677         "new_stmt" from gimple to gimple_call.
678         (cgraph_update_edges_for_call_stmt_node): Add checked casts to
679         gimple_call.
681         * cgraphbuild.c (pass_build_cgraph_edges::execute): Replace
682         is_gimple_call with dyn_cast<gimple_call> and new local
683         "call_stmt".
684         (cgraph_edge::rebuild_edges): Likewise.
686         * cgraphclones.c (cgraph_edge::clone): Require a gimple_call
687         rather than a plain gimple.
688         (cgraph_node::set_call_stmt_including_clones): Likewise.
689         (cgraph_node::create_edge_including_clones): Likewise.
691         * lto-streamer-in.c (fixup_call_stmt_edges_1): Add checked casts
692         to gimple_call.
694         * omp-low.c (simd_clone_adjust): Strengthen local "call" from
695         gimple to gimple_call.
697         * trans-mem.c (ipa_tm_insert_irr_call): Likewise for "g".
698         (ipa_tm_insert_gettmclone_call): Likewise; also strengthen "g2"
699         to gimple_assign.
701         * tree-emutls.c (gen_emutls_addr): Strengthen local "x" from
702         gimple to gimple_call.
704         * tree-inline.c (copy_bb): Replace is_gimple_call with
705         dyn_cast<gimple_call> and new local "call_stmt".
707         * value-prof.c (gimple_ic): Require and return a gimple_call,
708         rather than a plain gimple.
709         * value-prof.h (gimple_ic): Likewise.
711 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
713         Make gimple_call_return_slot_opt_p require a gimple_call.
715         * gimple.h (gimple_call_return_slot_opt_p): Require a gimple_call
716         rather than a plain gimple.
718         * gimple-walk.c (walk_stmt_load_store_addr_ops): Convert usage of
719         is_gimple_call to dyn_cast<gimple_call>, introducing a new local
720         "call_stmt".
722         * trans-mem.c (expand_call_tm): Split local "stmt", strengthening
723         from plain gimple to a gimple_call, and introducing new local
724         gimple_assign "assign_stmt".
726         * tree-inline.c (expand_call_inline):  Convert check of code against
727         GIMPLE_CALL to dyn_cast<gimple_call>, introducing a new local
728         "call_stmt".
730 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
732         More gimple_phi
734         * gimple.h (gimple_phi_set_result): Require a gimple_phi rather
735         than a plain gimple.
736         (gimple_phi_set_arg): Likewise.
738         * tree-outof-ssa.c (remove_gimple_phi_args): Likewise; add a checked
739         cast to gimple_phi.
741         * tree-sra.c (replace_removed_params_ssa_names): Add a checked
742         cast to gimple_phi.
744 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
746         Make gimple_phi_arg_edge require a gimple_phi
748         * gimple.h (gimple_phi_arg_edge): Require a gimple_phi rather
749         than a plain gimple.
751         * gimple-ssa-strength-reduction.c (ncd_with_phi): Strengthen
752         param "phi" from gimple to gimple_phi.  Add a checked cast.
753         (ncd_of_cand_and_phis): Add a checked cast.
755         * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Require a
756         gimple_phi_iterator; strengthen local "phi" from gimple to a
757         gimple_phi.
758         (rewrite_cross_bb_scalar_deps): Strengthen local "psi" from
759         a gimple_stmt_iterator to a gimple_phi_iterator.
760         (edge_initial_value_for_loop_phi): Require a gimple phi.
761         (initial_value_for_loop_phi): Likewise.
763         * ipa-split.c (consider_split): Convert "bsi" to a
764         gimple_phi_iterator and "stmt" to a gimple_phi.
766         * predict.c (predict_extra_loop_exits): Convert "phi_stmt" to be
767         a gimple_phi; introduce "lhs_def_stmt" as plain gimple.
768         (apply_return_prediction): Convert "phi" to be a gimple_phi.
770         * tree-cfg.c (replace_uses_by): Add checked cast to gimple_phi.
771         (verify_gimple_in_cfg): Introduce gimple_phi_iterator "gpi" and use
772         it to convert "phi" to a gimple_phi.
774         * tree-eh.c (cleanup_empty_eh_merge_phis): Convert "ngsi", "ogsi"
775         to be gimple_phi_iterators.  Convert "ophi", "nphi" to be
776         gimple_phi.
778         * tree-into-ssa.c (prepare_use_sites_for): Add checked cast to
779         gimple_phi.
781         * tree-ssa-coalesce.c (create_outofssa_var_map): Introduce
782         gimple_phi_iterator "gpi" and use it to convert "phi" to a
783         gimple_phi.
785         * tree-ssa-dce.c (propagate_necessity): Introduce local "phi",
786         from checked cast to gimple_phi.
788         * tree-ssa-live.c (set_var_live_on_entry): Add checked cast to
789         gimple_phi.
791         * tree-ssa-propagate.c (replace_phi_args_in): Require a gimple_phi
792         rather than a plain gimple.
793         (substitute_and_fold_dom_walker::before_dom_children): Introduce
794         gimple_phi_iterator "gpi".
796         * tree-ssa-sink.c (find_bb_for_arg): Require a gimple_phi rather
797         than a plain gimple.
798         (nearest_common_dominator_of_uses): Replace check of code against
799         GIMPLE_PHI with a dyn_cast<gimple_phi>, introducing a new local.
800         (statement_sink_location): Add checked cast to gimple_phi.
802         * tree-ssa-uninit.c (compute_uninit_opnds_pos): Require a
803         gimple_phi rather than a plain gimple.
804         (collect_phi_def_edges): Likewise.  Add a checked cast.
805         (find_def_preds): Strengthen param "phi" from gimple to
806         gimple_phi.
807         (prune_uninit_phi_opnds_in_unrealizable_paths): Likewise for
808         params "phi" and "flag_def".  Strenghen param "visited_phis" from
809         hash_set<gimple> * to hash_set<gimple_phi> *.  Convert
810         "flag_arg_def", "phi_arg_def" to gimple_phi using
811         dyn_cast<gimple_phi>.  Similarly, introduce new local
812         "opnd_def_phi".
813         (use_pred_not_overlap_with_undef_path_pred): Strengthen param
814         "phi" from gimple to gimple_phi, and param "visited_phis" from
815         hash_set<gimple> * to hash_set<gimple_phi> *.  Add a checked cast.
816         (is_use_properly_guarded): Likewise for params.
817         (find_uninit_use): Replace check of code against GIMPLE_PHI with
818         a dyn_cast<gimple_phi>, introducing a new local "use_phi".
819         Strengthen local "visited_phis" from hash_set<gimple> to
820         hash_set<gimple_phi>.
822 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
824         Update GRAPHITE to use more concrete gimple statement classes
826         * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
827         Strengthen local "psi" to be a gimple_phi_iterator and "phi" to
828         a gimple_phi.
830         * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Require
831         a gimple_phi rathen than a plain gimple.
832         (remove_simple_copy_phi): Require a gimple_phi_iterator;
833         strengthen local "phi" to be a gimple_phi and "stmt" to be a
834         gimple_assign.
835         (remove_invariant_phi): Likewise.
836         (simple_copy_phi_p): Require a gimple_phi.
837         (reduction_phi_p): Require a gimple_phi_iterator; strengthen
838         local "phi" to be a gimple_phi.
839         (add_condition_to_pbb): Require a gimple_cond rather than a
840         plain gimple.
841         (add_conditions_to_domain): Add checked cast to gimple_cond
842         within GIMPLE_COND case of switch statement.
843         (single_pred_cond_non_loop_exit): Return a gimple_cond rather
844         than a plain gimple, via a checked cast.
845         (sese_dom_walker::before_dom_children): Strengthen local "stmt"
846         from gimple to gimple_cond.
847         (gsi_for_phi_node): Require a gimple_phi, and return a
848         gimple_phi_iterator.
849         (insert_out_of_ssa_copy): Strengthen local "stmt" from gimple to
850         gimple_assign.
851         (rewrite_reductions_out_of_ssa): Strengthen "psi" to be a
852         gimple_phi_iterator, and "phi" to be a gimple_phi.
853         (phi_contains_arg): Require a gimple_phi.
854         (follow_ssa_with_commutative_ops): Strengthen return type from
855         gimple to gimple_phi, by converting a check for code GIMPLE_PHI to
856         a dyn_cast<gimple_phi>, and strengthening local "res" from gimple
857         to gimple_phi.
858         (detect_commutative_reduction_arg): Strengthen return type from
859         gimple to gimple_phi, and strengthen local "phi" to be a
860         gimple_phi.
861         (detect_commutative_reduction_assign): Strengthen return type from
862         gimple to gimple_phi, and strengthen local "res" to be a
863         gimple_phi.
864         (follow_inital_value_to_phi): Strengthen return type from
865         gimple to gimple_phi.  Replace check for code GIMPLE_PHI with
866         a dyn_cast<gimple_phi>.
867         (detect_commutative_reduction): Strengthen return type and locals
868         "loop_phi", "phi", "close_phi" from gimple to gimple_phi,
869         introducing a checked cast of "stmt" in region guarded by
870         scalar_close_phi_node_p (stmt).
871         (translate_scalar_reduction_to_array_for_stmt): Require param
872         "loop_phi" to be a gimple_phi.  Strengthen local "assign" from
873         gimple to gimple_assign.
874         (remove_phi): Require a gimple_phi.
875         (close_phi_written_to_memory): Likewise.
876         (translate_scalar_reduction_to_array): We expect the first element
877         in each vector to be an arbitrary statement, but all of the
878         subsequent elements to be phi nodes.  Hence the decls of gimple
879         locals "loop_phi" and "close_phi" are replaced with decls of gimple
880         "loop_stmt" and "close_stmt", with decls of the more-strongly typed
881         gimple_phi "loop_phi" and "close_phi" occurring lower down, within
882         the region where we're dealing with i > 0 and hence where we can
883         safely assign them using the checked cast as_a <gimple_phi>.
884         This allows many of the strengthenings from gimple to gimple_phi
885         above.  We eliminate the local "stmt", since we can simply use
886         "loop_stmt".
887         (rewrite_commutative_reductions_out_of_ssa_close_phi): Strengthen
888         param "close_phi" from gimple to gimple_phi, and local "gsi" from
889         gimple_stmt_iterator to gimple_phi_iterator, converting uses of
890         gsi_stmt to gsi.phi for type-safety.
891         (scop_ivs_can_be_represented): Strengthen local "gsi" from
892         gimple_stmt_iterator to gimple_phi_iterator, and "phi" from gimple
893         to gimple_phi.
895 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
897         Make gimple_phi_arg_set_location require a gimple_phi
899         * gimple.h (gimple_phi_arg_set_location): Require a gimple_phi
900         rather than a plain gimple.
902 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
904         Make add_phi_arg require a gimple_phi
906         * tree-phinodes.h (add_phi_arg): Require a gimple_phi rather than
907         a plain gimple.
908         * tree-phinodes.c (add_phi_arg): Likewise.
910         * gimple-ssa-strength-reduction.c (create_phi_basis): Strengthen
911         local "phi" from plain gimple to gimple_phi.
913         * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
914         Likewise for "close_phi".
916         * ipa-split.c (split_function): Convert "psi" to
917         gimple_phi_iterator.
919         * omp-low.c (expand_omp_for_static_nochunk): Introduce
920         gimple_phi_iterator gpi, using it to strengthen "phi" to be a
921         gimple_phi.
922         (expand_omp_for_static_chunk): Likewise.
924         * tree-cfg.c (gimple_duplicate_bb): Make topmost "gsi" decl more
925         tightly-scoped, and eliminate decls "phis", "phi", "stmt", "copy"
926         in favor of more tightly-scoped gimple_phi_iterator gpi and
927         gimple_phi decls "phi" and "copy", and gimple decls "stmt" and
928         "copy".
930         * tree-parloops.c (create_parallel_loop): Introduce
931         gimple_phi_iterator gpi, using it to strengthen "phi" to be a
932         gimple_phi.
934         * tree-ssa-loop-im.c (execute_sm_if_changed): Likewise.
936         * tree-ssa-loop-manip.c (create_iv): Split out new gimple_phi
937         local "phi" from "stmt", and convert the latter into being a
938         gimple_assign.
940         * tree-ssa-pre.c (insert_into_preds_of_block): Strengthen local
941         "phi" to be a gimple_phi.
943         * tree-ssa-tail-merge.c (vop_phi): Require a gimple_phi rather
944         than a plain gimple.
945         (replace_block_by): Strengthen local "bb2_phi" to be a gimple_phi.
947         * tree-tailcall.c (add_successor_phi_arg): Use gsi.phi when
948         invoking add_phi_arg.
949         (eliminate_tail_call): Introduce gimple_phi_iterator gpi, using it
950         to strengthen "phi" to be a gimple_phi.
951         (create_tailcall_accumulator): Strengthen local "phi" to be a
952         gimple_phi.
953         (tree_optimize_tail_calls_1): Likewise.
955         * tree-vect-data-refs.c (vect_setup_realignment): Strengthen
956         local "phi_stmt" to be a gimple_phi.
958         * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg):
959         Strengthen "gsi", "gsi_orig", "gsi_new" to be
960         gimple_phi_iterators, and "phi" "orig_phi", "new_phi" to be
961         gimple_phi instances.
962         (slpeel_tree_peel_loop_to_edge): Strengthen local "new_phi" to be
963         a gimple_phi.
965         * tree-vect-loop.c (get_initial_def_for_induction): Likewise for
966         "induction_phi".
967         (vect_create_epilog_for_reduction): Add checked casts to
968         gimple_phi; strengthen local "outer_phi" to gimple_phi and
969         "new_vec_stmt" to gimple_assign.
970         (vect_finalize_reduction): Strengthen local "vect_phi" to
971         gimple_phi.
972         (vectorizable_reduction): Likewise for "new_phi".
974         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
975         (vectorizable_load): Likewise for "phi".
977 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
979         Make gimple_phi_arg_def_ptr and gimple_phi_arg_has_location require a gimple_phi
981         * gimple.h (gimple_phi_arg_def_ptr): Require a gimple_phi rather
982         than a plain gimple.
983         (gimple_phi_arg_has_location): Likewise.
985         * gimple-streamer-in.c (input_phi): Return a gimple_phi rather
986         than a plain gimple.
987         * gimple-streamer-out.c (output_phi): Require a gimple_phi rather
988         than a plain gimple.
989         (output_bb): Convert iteration to a gimple_phi_iterator, and local
990         "phi" to gimple_phi.
992         * omp-low.c (expand_omp_for_static_chunk): Convert iterator "psi"
993         to a gimple_phi_iterator; convert locals "phi" and "nphi" to be
994         gimple_phi.
996         * tree-cfg.c (gimple_duplicate_sese_tail): Likewise for "psi" and
997         "phi".
998         (move_block_to_fn): Introduce new gimple_phi_iterator "psi", using
999         it in place of "gsi" where necessary.  Convert "phi" to be a
1000         gimple_phi.
1002         * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
1004         * tree-vect-loop-manip.c (vect_loop_versioning): Convert "gsi" to
1005         a gimple_phi_iterator, and "orig_phi" and "new_phi" to be
1006         gimple_phi.
1008         * tree.c (find_decls_types_in_node): Introduce new
1009         gimple_phi_iterator "psi", using it in place of "si" where
1010         necessary.  Convert "phi" to be a gimple_phi.
1012 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1014         omp-low.c: Use more concrete types of gimple statement for various locals
1016         * omp-low.c (finalize_task_copyfn): Strengthen local "bind" from
1017         plain gimple to gimple_bind.
1018         (lower_rec_input_clauses): Strengthen local "g" from
1019         plain gimple to gimple_assign.
1020         (lower_lastprivate_clauses): Likewise for "stmt" to gimple_cond
1021         and "g" to gimple_call.
1022         (expand_omp_for_init_vars): Likewise, for two decls of "stmt" to
1023         gimple_assign.
1024         (expand_omp_atomic_pipeline): Likewise for one decl of "stmt".
1025         (expand_omp_atomic_mutex): Likewise.
1026         (lower_omp_master): Likewise for "x" to gimple_call.
1027         (lower_omp_ordered): Likewise.
1029 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1031         tree-parloops.c: Use gimple_phi in various places
1033         * tree-parloops.c (reduction_info::keep_res): Strengthen field
1034         from plain gimple to gimple_phi.
1035         (transform_to_exit_first_loop): Strengthen locals "phi", "nphi"
1036         to gimple_phi.  Eliminate early decl of gimple_stmt_iterator gsi
1037         in favor of more tightly scoped gimple_phi_iterators, and a final
1038         later decl as a gimple_stmt_iterator.
1040 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1042         Introduce gimple_omp_sections
1044         * coretypes.h (gimple_omp_sections): New typedef.
1045         (const_gimple_omp_sections): New typedef.
1047         * gimple-pretty-print.c (dump_gimple_omp_sections): Require a
1048         gimple_omp_sections rather than a plain gimple.
1049         (pp_gimple_stmt_1): Add checked cast to gimple_omp_sections within
1050         GIMPLE_OMP_SECTIONS case of switch statement.
1052         * gimple.c (gimple_build_omp_sections): Return a
1053         gimple_omp_sections rather than a plain gimple.
1055         * gimple.h (gimple_build_omp_sections): Return a
1056         gimple_omp_sections rather than a plain gimple.
1058         * omp-low.c (scan_omp_sections): Require a gimple_omp_sections
1059         rather than a plain gimple.
1060         (scan_omp_1_stmt): Add checked cast to gimple_omp_sections within
1061         GIMPLE_OMP_SECTIONS case of switch statement.
1062         (expand_omp_sections): Strengthen local "sections_stmt" from gimple
1063         to gimple_omp_sections.
1064         (lower_omp_sections): Likewise for "stmt".
1066 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1068         Introduce gimple_omp_teams
1070         * coretypes.h (gimple_omp_teams): New typedef.
1071         (const_gimple_omp_teams): New typedef.
1073         * gimple.h (gimple_build_omp_teams): Return a gimple_omp_teams
1074         rather than a plain gimple.
1075         (gimple_omp_teams_set_clauses): Require a gimple_omp_teams rather
1076         than a plain gimple.
1078         * gimple-pretty-print.c (dump_gimple_omp_teams): Require a
1079         gimple_omp_teams rather than a plain gimple.
1080         (pp_gimple_stmt_1): Add checked cast to gimple_omp_teams within
1081         GIMPLE_OMP_TEAMS case of switch statement.
1083         * gimple.c (gimple_build_omp_teams): Return a gimple_omp_teams
1084         rather than a plain gimple.
1086         * omp-low.c (scan_omp_teams): Likewise.
1087         (scan_omp_1_stmt): Add checked cast to gimple_omp_teams within
1088         GIMPLE_OMP_TEAMS case of switch statement.
1089         (lower_omp_teams): Strengthen local "teams_stmt" from gimple to
1090         gimple_omp_teams.
1092 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1094         Introduce gimple_omp_target
1096         * coretypes.h (gimple_omp_target): New typedef.
1097         (const_gimple_omp_target): New typedef.
1099         * gimple.h (gimple_build_omp_target): Return a gimple_omp_target
1100         rather than a plain gimple.
1101         (gimple_omp_target_set_clauses): Require a gimple_omp_target
1102         rather than a plain gimple.
1103         (gimple_omp_target_set_kind): Likewise.
1104         (gimple_omp_target_child_fn_ptr): Likewise.
1105         (gimple_omp_target_set_child_fn): Likewise.
1106         (gimple_omp_target_data_arg_ptr): Likewise.
1107         (gimple_omp_target_set_data_arg): Likewise.
1108         (gimple_omp_target_child_fn): Require a const_gimple_omp_target
1109         rather than a plain const_gimple.
1110         (gimple_omp_target_data_arg): Likewise.
1112         * gimple-pretty-print.c (dump_gimple_omp_target): Require a
1113         gimple_omp_target rather than a plain gimple.
1114         (pp_gimple_stmt_1): Add checked cast to gimple_omp_target within
1115         GIMPLE_OMP_TARGET case of switch statement.
1117         * gimple.c (gimple_build_omp_target): Return a gimple_omp_target
1118         rather than a plain gimple.
1120         * gimplify.c (gimplify_omp_target_update): Strengthen local "stmt"
1121         from gimple to gimple_omp_target.
1123         * omp-low.c (scan_omp_target): Require a gimple_omp_target rather
1124         than a plain gimple.
1125         (scan_omp_1_stmt): Add checked cast to gimple_omp_target within
1126         GIMPLE_OMP_TARGET case of switch statement.
1127         (expand_omp_target): Strengthen local "entry_stmt" from gimple to
1128         gimple_omp_target.
1129         (lower_omp_target): Likewise for "stmt".
1131         * tree-nested.c (convert_nonlocal_reference_stmt): Add checked
1132         cast to gimple_omp_target.
1133         (convert_local_reference_stmt): Likewise.
1134         (convert_gimple_call): Likewise.
1136 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1138         Introduce gimple_omp_single
1140         * coretypes.h (gimple_omp_single): New typedef.
1141         (const_gimple_omp_single): New typedef.
1143         * gimple.h (gimple_build_omp_single): Return a gimple_omp_single
1144         rather than a plain gimple.
1145         (gimple_omp_single_set_clauses): Require a gimple_omp_single
1146         rather than a plain gimple.
1148         * gimple-pretty-print.c (dump_gimple_omp_single): Require a
1149         gimple_omp_single rather than a plain gimple.
1150         (pp_gimple_stmt_1): Add checked cast to gimple_omp_single within
1151         GIMPLE_OMP_SINGLE case of switch statement.
1153         * gimple.c (gimple_build_omp_single): Return a gimple_omp_single
1154         rather than a plain gimple.
1156         * omp-low.c (scan_omp_single): Require a gimple_omp_single rather
1157         than a plain gimple.
1158         (scan_omp_1_stmt): Add checked cast to gimple_omp_single within
1159         GIMPLE_OMP_SINGLE case of switch statement.
1160         (lower_omp_single_simple): Require a gimple_omp_single rather
1161         than a plain gimple.
1162         (lower_omp_single_copy): Likewise.
1163         (lower_omp_single): Strengthen local "single_stmt" from gimple to
1164         gimple_omp_single.
1166 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1168         Introduce gimple_omp_task
1170         * coretypes.h (gimple_omp_task): New typedef.
1171         (const_gimple_omp_task): New typedef.
1173         * gimple.h (gimple_build_omp_task): Return a gimple_omp_task
1174         rather than a plain gimple.
1176         * gimple-pretty-print.c (dump_gimple_omp_task): Require a
1177         gimple_omp_task rather than a plain gimple.
1178         (pp_gimple_stmt_1): Add checked cast to gimple_omp_task within
1179         GIMPLE_OMP_TASK case of switch statement.
1181         * gimple.c (gimple_build_omp_task): Return a gimple_omp_task
1182         rather than a plain gimple.
1184         * omp-low.c (finalize_task_copyfn): Require a gimple_omp_task
1185         rather than a plain gimple.
1186         (delete_omp_context): Add checked cast to gimple_omp_task.
1187         (scan_omp_task): Strengthen local "stmt" from gimple to
1188         gimple_omp_task.
1189         (expand_task_call): Require a gimple_omp_task rather than a plain
1190         gimple.
1191         (expand_omp_taskreg): Add checked cast to gimple_omp_task.
1192         (create_task_copyfn): Require a gimple_omp_task rather than a
1193         plain gimple.
1194         (lower_omp_taskreg): Add checked cast to gimple_omp_task.
1196 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1198         tree-cfg.c: Make verify_gimple_call require a gimple_call
1200         * tree-cfg.c (verify_gimple_call): Require a gimple_call rather
1201         than a plain gimple.
1202         (verify_gimple_stmt): Add checked cast to gimple_call within
1203         GIMPLE_CALL case of switch statement.
1205 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1207         Introduce gimple_omp_parallel
1209         * coretypes.h (gimple_omp_parallel): New typedef.
1210         (const_gimple_omp_parallel): New typedef.
1212         * cgraphbuild.c (build_cgraph_edges): Convert check of code
1213         against GIMPLE_OMP_PARALLEL to a dyn_cast <gimple_omp_parallel>
1214         and new local.
1216         * gimple-pretty-print.c (dump_gimple_omp_parallel): Require a
1217         gimple_omp_parallel rather than a plain gimple.
1218         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_parallel
1219         within GIMPLE_OMP_PARALLEL case of switch statement.
1221         * gimple-walk.c (walk_gimple_op): Likewise, introducing a local.
1223         * gimple.c (gimple_build_omp_parallel): Return a
1224         gimple_omp_parallel rather than a plain gimple.
1225         (gimple_copy): Add checked casts to gimple_omp_parallel within
1226         GIMPLE_OMP_PARALLEL case of switch statement, introducing locals.
1228         * gimple.h (gimple_build_omp_parallel): Return a
1229         gimple_omp_parallel rather than a plain gimple.
1230         (gimple_omp_parallel_clauses_ptr): Require a gimple_omp_parallel
1231         rather than a plain gimple.
1232         (gimple_omp_parallel_set_clauses): Likewise.
1233         (gimple_omp_parallel_data_arg_ptr): Likewise.
1234         (gimple_omp_parallel_set_data_arg): Likewise.
1235         (gimple_omp_parallel_child_fn_ptr): Likewise.
1236         (gimple_omp_parallel_set_child_fn): Likewise.
1237         (gimple_omp_parallel_child_fn): Require a
1238         const_gimple_omp_parallel rather than a plain const_gimple.
1239         (gimple_omp_parallel_data_arg): Likewise.
1241         * omp-low.c (scan_omp_parallel): Strengthen local "stmt" from
1242         gimple to gimple_omp_parallel.
1243         (expand_parallel_call): Require a gimple_omp_parallel for
1244         "entry_stmt" rather than a plain gimple.
1245         (remove_exit_barrier):  Strengthen local "parallel_stmt" from
1246         gimple to gimple_omp_parallel.
1247         (expand_omp_taskreg): Add checked casts to gimple_omp_parallel.
1249         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1250         gimple_omp_parallel within GIMPLE_OMP_PARALLEL case of switch
1251         statement, introducing local.
1253 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1255         Introduce gimple_omp_for
1257         * coretypes.h (gimple_omp_for): New.
1258         (const_gimple_omp_for): New.
1260         * gimple.h (gimple_build_omp_for): Return a gimple_omp_for rather
1261         than a plain gimple.
1262         (gimple_omp_for_set_kind): Require a gimple_omp_for rather than a
1263         plain gimple.
1264         (gimple_omp_for_set_combined_p): Likewise.
1265         (gimple_omp_for_set_combined_into_p): Likewise.
1267         * gimple-pretty-print.c (dump_gimple_omp_for): Require a
1268         gimple_omp_for rather than a plain gimple.
1269         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_for in
1270         GIMPLE_OMP_FOR case of switch statement.
1272         * gimple.c (gimple_build_omp_for): Return a gimple_omp_for rather
1273         than a plain gimple.
1274         (gimple_copy): Add a checked cast to gimple_omp_for and a new local.
1276         * gimplify.c (gimplify_omp_for): Strengthen local "gfor" from
1277         gimple to gimple_omp_for.
1279         * omp-low.c (omp_for_data::for_stmt): Strengthen field from gimple
1280         to gimple_omp_for.
1281         (extract_omp_for_data): Require a gimple_omp_for rather than a
1282         plain gimple.
1283         (workshare_safe_to_combine_p): Add a checked cast to
1284         gimple_omp_for.
1285         (get_ws_args_for): Convert check of code against GIMPLE_OMP_FOR
1286         with a dyn_cast<gimple_omp_for> and a new local.
1287         (scan_omp_parallel): Add a checked cast to gimple_omp_for and a
1288         new local.
1289         (scan_omp_for): Require a gimple_omp_for rather than a plain
1290         gimple.
1291         (scan_omp_1_stmt): Add a checked cast to gimple_omp_for in
1292         GIMPLE_OMP_FOR case of switch statement.
1293         (expand_omp_for): Add a checked cast to gimple_omp_for.
1294         (lower_omp_for): Strengthen local "stmt" from gimple to
1295         gimple_omp_for.
1297         * tree-nested.c (walk_gimple_omp_for): Require a gimple_omp_for
1298         rather than a plain gimple.
1299         (convert_nonlocal_reference_stmt): Add a checked cast to
1300         gimple_omp_for in GIMPLE_OMP_FOR case of switch statement.
1301         (convert_local_reference_stmt): Likewise.
1303         * tree-parloops.c (create_parallel_loop): Strengthen local
1304         "for_stmt" from gimple to gimple_omp_for.
1306 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1308         Introduce gimple_omp_critical
1310         * coretypes.h (gimple_omp_critical): New typedef.
1311         (const_gimple_omp_critical): New typedef.
1313         * gimple-pretty-print.c (dump_gimple_omp_critical): Require a
1314         gimple_omp_critical rather than a plain gimple.
1315         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_critical
1316         within GIMPLE_OMP_CRITICAL case of switch statement.
1318         * gimple-walk.c (walk_gimple_op): Likewise.
1320         * gimple.c (gimple_build_omp_critical): Return a gimple_omp_critical
1321         rather than a plain gimple.
1322         (gimple_copy): Add checked casts to gimple_omp_critical
1323         within GIMPLE_OMP_CRITICAL case of switch statement.
1325         * gimple.h (gimple_debug): Likewise.
1326         (gimple_build_omp_critical): Return a gimple_omp_critical rather
1327         than a plain gimple.
1328         (gimple_omp_critical_name): Require a const_gimple_omp_critical
1329         rather than a plain const_gimple.
1330         (gimple_omp_critical_name_ptr): Require a gimple_omp_critical
1331         rather than a plain gimple.
1332         (gimple_omp_critical_set_name): Likewise.
1334         * omp-low.c (check_omp_nesting_restrictions): Add a checked cast
1335         to gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
1336         statement, introducing a new local "other_crit" for type-safety.
1337         (lower_omp_critical): Strengthen local "stmt" to
1338         gimple_omp_critical.
1340         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1341         gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
1342         statement.
1344 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1346         Introduce gimple_omp_continue
1348         * coretypes.h (gimple_omp_continue): New typedef.
1349         (const_gimple_omp_continue): New typedef.
1351         * gimple.h (gimple_build_omp_continue): Return a
1352         gimple_omp_continue rather than a plain gimple.
1353         (gimple_omp_continue_control_def): Require a
1354         const_gimple_omp_continue rather than a plain const_gimple.
1355         (gimple_omp_continue_control_use): Likewise.
1356         (gimple_omp_continue_control_def_ptr): Require a gimple_omp_continue
1357         rather than a plain gimple.
1358         (gimple_omp_continue_set_control_def): Likewise.
1359         (gimple_omp_continue_control_use_ptr): Likewise.
1360         (gimple_omp_continue_set_control_use): Likewise.
1362         * gimple-pretty-print.c (dump_gimple_omp_continue): Require a
1363         gimple_omp_continue rather than a plain gimple.
1364         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_continue
1365         within GIMPLE_OMP_CONTINUE case of switch statement.
1367         * gimple-walk.c (walk_gimple_op): Likewise, adding a new local.
1369         * gimple.c (gimple_build_omp_continue): Return a
1370         gimple_omp_continue rather than a plain gimple.
1372         * omp-low.c (gimple_build_cond_empty): Return a gimple_cond
1373         rather than a plain gimple.
1374         (expand_omp_for_generic): Split local "stmt" into "assign_stmt",
1375         "cont_stmt", "cond_stmt", "call_stmt" of types gimple_assign,
1376         gimple_omp_continue, gimple_cond, gimple_call respectively.
1377         (expand_omp_for_static_nochunk): Likewise, splitting into two
1378         "cond_stmt" decls. "assign_stmt", "cont_stmt"
1379         (expand_omp_for_static_chunk): Likewise, splitting into
1380         "cond_stmt", "assign_stmt", "cont_stmt".
1381         (expand_omp_sections): Strengthen local "cont" from gimple to
1382         gimple_omp_continue.
1384 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1386         Introduce gimple_omp_atomic_store
1388         * coretypes.h (gimple_omp_atomic_store): New typedef.
1389         (const_gimple_omp_atomic_store): New typedef.
1391         * gimple-pretty-print.c (dump_gimple_omp_atomic_store): Require
1392         a gimple_omp_atomic_store rather than a plain gimple.
1393         (pp_gimple_stmt_1): Add checked cast to gimple_omp_atomic_store
1394         within GIMPLE_OMP_ATOMIC_STORE case of switch statement.
1395         * gimple-walk.c (walk_gimple_op): Likewise.
1397         * gimple.c (gimple_build_omp_atomic_store): Return a
1398         gimple_omp_atomic_store rather than a plain gimple.
1400         * gimple.h (gimple_build_omp_atomic_store): Return a
1401         gimple_omp_atomic_store rather than a plain gimple.
1402         (gimple_omp_atomic_store_set_val): Require a gimple_omp_atomic_store
1403         rather than a plain gimple.
1404         (gimple_omp_atomic_store_val_ptr): Likewise.
1405         (gimple_omp_atomic_store_val): Require a
1406         const_gimple_omp_atomic_store rather than a plain const_gimple.
1408         * gimplify.c (gimplify_omp_atomic): Strengthen locals "loadstmt" and
1409         "storestmt" from gimple to gimple_omp_atomic_load loadstmt and
1410         gimple_omp_atomic_store storestmt respectively.
1412         * omp-low.c (expand_omp_atomic): Strengthen local "store" from
1413         gimple to gimple_omp_atomic_store.
1415 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1417         Introduce gimple_omp_atomic_load
1419         * coretypes.h (gimple_omp_atomic_load): New typedef.
1420         (const_gimple_omp_atomic_load): New typedef.
1422         * gimple-pretty-print.c (dump_gimple_omp_atomic_load): Require a
1423         gimple_omp_atomic_load rather than a plain gimple.
1424         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_atomic_load
1425         within GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
1427         * gimple-walk.c (walk_gimple_op): Likewise, introducing a new local.
1429         * gimple.c (gimple_build_omp_atomic_load): Return a
1430         gimple_omp_atomic_load rather than a plain gimple.
1432         * gimple.h (gimple_build_omp_atomic_load): Return a
1433         gimple_omp_atomic_load rather than a plain gimple.
1434         (gimple_omp_atomic_load_set_lhs): Require a
1435         gimple_omp_atomic_load rather than a plain gimple.
1436         (gimple_omp_atomic_load_lhs_ptr): Likewise.
1437         (gimple_omp_atomic_load_set_rhs): Likewise.
1438         (gimple_omp_atomic_load_rhs_ptr): Likewise.
1439         (gimple_omp_atomic_load_lhs): Require a
1440         const_gimple_omp_atomic_load rather than a plain const_gimple.
1441         (gimple_omp_atomic_load_rhs): Likewise.
1443         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
1444         to gimple_omp_atomic_load within GIMPLE_OMP_ATOMIC_LOAD case of
1445         switch statement.
1447         * omp-low.c (expand_omp_atomic): Strengthen type of local "load"
1448         from gimple to gimple_omp_atomic_load.
1449         (lower_omp_1): Add a checked cast to gimple_omp_atomic_load within
1450         GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
1452 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1454         Use more concrete types for various gimple statements
1456         * cgraphunit.c (thunk_adjust): Strengthen local "stmt" from gimple
1457         to gimple_assign.
1459         * gimple-ssa-isolate-paths.c
1460         (insert_trap_and_remove_trailing_statements): Strengthen local
1461         "new_stmt" from gimple to gimple_call.
1463         * gimple-ssa-strength-reduction.c (replace_mult_candidate):
1464         Strengthen local "copy_stmt" from gimple to gimple_assign.
1465         (create_add_on_incoming_edge): Likewise, for "new_stmt".
1466         (insert_initializers): Likewise, for "init_stmt".
1467         (introduce_cast_before_cand): Likewise, for "cast_stmt".
1468         (replace_one_candidate): Likewise, for "copy_stmt" and
1469         "cast_stmt".
1471         * gimplify.c (build_stack_save_restore): Require gimple_calls
1472         rather than plain gimples.
1473         (gimplify_bind_expr): Strengthen locals "stack_save" and
1474         "stack_restore" from gimple to gimple_call.  Strengthen "gs"
1475         to gimple_try.
1476         (gimplify_switch_expr): Strengthen local "gimple_switch" from
1477         gimple to gimple_switch, and "new_default" to gimple_label.
1478         (gimplify_cond_expr): Strengthen local "gimple_cond" from gimple
1479         to gimple_cond.
1480         (gimplify_init_constructor): Strengthen local "init" from gimple
1481         to gimple_assign.
1482         (gimplify_cleanup_point_expr): Strengthen local "gtry" from gimple
1483         to gimple_try.
1484         (gimple_push_cleanup): Strengthen locals "ffalse" and "ftrue" from
1485         gimple to gimple_assign.
1487         * tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
1488         (emit_post_landing_pad): Strengthen local to gimple_label.
1490         * tree-outof-ssa.c (insert_backedge_copies): Strengthen local
1491         "stmt" from gimple to gimple_assign.
1493         * tree-parloops.c (take_address_of): Likewise.
1495         * tree-predcom.c (replace_ref_with): Likewise, for "new_stmt".
1496         (initialize_root_vars_lm): Likewise, for "init_stmt".
1497         (reassociate_to_the_same_stmt): Likewise, for "new_stmt" and "tmp_stmt".
1499         * tree-profile.c (gimple_gen_edge_profiler): Likewise, for "stmt1",
1500         "stmt2", "stmt3".
1501         (gimple_gen_ic_profiler): Likewise.
1502         (gimple_gen_ic_func_profiler): Strengthen local "stmt1" from
1503         gimple to gimple_call, and "stmt2" to gimple_assign.
1505         * tree-scalar-evolution.c (scev_const_prop): Strengthen local
1506         "ass" from gimple to gimple_assign.
1508         * tree-sra.c (build_ref_for_offset): Likewise for "stmt".
1509         (generate_subtree_copies): Likewise; also strengthen "ds" to
1510         gimple_debug.
1511         (init_subtree_with_zero): Likewise.
1512         (sra_modify_expr): Likewise.
1513         (load_assign_lhs_subreplacements): Likewise.
1514         (sra_modify_assign): Strengthen "ds" to gimple_debug.
1515         (sra_ipa_reset_debug_stmts): Likewise for "def_temp".
1517         * tree-ssa-ccp.c (insert_clobber_before_stack_restore):
1518         Strengthen local "clobber_stmt" from gimple to gimple_assign.
1520         * tree-ssa-dce.c (remove_dead_stmt): Strengthen "note" to
1521         gimple_debug.
1523         * tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
1524         local "new_stmt" from gimple to gimple_assign.
1525         (optimize_stmt): Likewise.
1527         * tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
1528         4 declarations of "newop".
1529         (simplify_rotate): Likewise for "g".
1531         * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
1532         (rewrite_bittest): Likewise for "stmt" and "stmt2".
1533         (move_computations_dom_walker::before_dom_children): Likewise for
1534         "new_stmt".
1535         (execute_sm): Likewise for "load" and "store".
1537         * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
1538         Strengthen local "stmt" from gimple to gimple_call.
1539         (unloop_loops): Likewise.
1541         * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
1542         local "ass" from gimple to gimple_assign.
1543         (remove_unused_ivs): Strengthen "def_temp" to gimple_debug.
1545         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local "stmt"
1546         from gimple to gimple_assign.
1548         * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
1549         "prefetch" from gimple to gimple_call.
1551         * tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
1552         "new_stmt" from gimple to gimple_assign.
1553         (powi_as_mults_1): Likewise for "mult_stmt".
1554         (powi_as_mults): Likewise for "div_stmt".
1555         (build_and_insert_binop): Likewise for "stmt".
1556         (build_and_insert_cast): Likewise.
1557         (pass_cse_sincos::execute): Likewise for "stmt" and various decls
1558         of "new_stmt".
1559         (convert_mult_to_fma): Likewise for "fma_stmt".
1561         * tree-ssa-phiopt.c (conditional_replacement): Likewise for "new_stmt".
1562         (abs_replacement): Likewise.
1564         * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for "tmp".
1566         * tree-ssa-pre.c (create_expression_by_pieces): Likewise for "newstmt".
1567         (eliminate_insert): Likewise for "tem".
1569         * tree-ssa-propagate.c (update_gimple_call): Strengthen locals
1570         "new_stmt" and "stmt" from gimple to gimple_call.
1571         (update_call_from_tree): Likewise for "new_stmt".
1573         * tree-ssa-reassoc.c (build_and_add_sum): Likewise for "sum".
1574         (update_ops): Likewise for "g".
1575         (maybe_optimize_range_tests): Likewise.
1576         (rewrite_expr_tree_parallel): Require a gimple_assign rather than
1577         a plain gimple.
1578         (reassociate_bb): Add a checked cast to gimple_assign.
1580         * tree-ssa.c (insert_debug_temp_for_var_def): Strengthen local
1581         "def_temp" from gimple to gimple_debug.
1583         * tree-switch-conversion.c (emit_case_bit_tests): Strengthen local
1584         "shift_stmt" from gimple to gimple_assign.
1586         * tree-tailcall.c (adjust_return_value_with_ops): Likewise for
1587         "stmt".
1588         (update_accumulator_with_ops): Likewise.
1590         * tree-vect-data-refs.c (bump_vector_ptr): Likewise for
1591         "incr_stmt".
1593         * tree-vect-stmts.c (vectorizable_condition): Likewise for
1594         "new_stmt".
1596         * tree-vrp.c (build_assert_expr_for): Likewise for "assertion".
1597         (simplify_truth_ops_using_ranges): Likewise for "newop".
1598         (simplify_float_conversion_using_ranges): Likewise for "conv".
1600         * ubsan.c (instrument_mem_ref): Strengthen local "g" from gimple
1601         to gimple_call.
1603         * value-prof.c (gimple_divmod_fixed_value): Require a
1604         gimple_assign rather than a plain gimple; strengthen types of locals.
1605         (gimple_mod_pow2): Likewise.
1606         (gimple_mod_subtract): Likewise.
1607         (gimple_divmod_fixed_value_transform): Strengthen local
1608         "stmt" from gimple to gimple_assign.
1609         (gimple_mod_pow2_value_transform): Likewise.
1610         (gimple_mod_subtract_transform): Likewise.
1611         (gimple_ic): Strengthen types of locals.
1613 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1615         Introduce gimple_try
1617         * coretypes.h (gimple_try): New typedef.
1618         (const_gimple_try): New typedef.
1620         * gimple-low.c (gimple_try_catch_may_fallthru): Require a
1621         gimple_try rather than a plain gimple.
1622         (gimple_stmt_may_fallthru): Add checked cast to gimple_try.
1624         * gimple-pretty-print.c (dump_gimple_try): Require a gimple_try
1625         rather than a plain gimple.
1626         (pp_gimple_stmt_1): Add checked cast to gimple_try within
1627         GIMPLE_TRY case of switch statement.
1629         * tree-eh.c (finally_tree_node::parent): Strengthen field from
1630         gimple to gimple_try.
1631         (record_in_finally_tree): Require a gimple_try rather than a plain
1632         gimple.
1633         (collect_finally_tree): Likewise.
1634         (collect_finally_tree_1): Likewise.
1635         (struct leh_tf_state::try_finally_expr): Strengthen field from
1636         gimple to gimple_try.
1637         (struct leh_tf_state::top_p): Likewise.
1638         (lower_eh_must_not_throw): Require a gimple_try rather than a
1639         plain gimple.
1640         (frob_into_branch_around): Likewise.
1641         (lower_try_finally_dup_block): Strengthen local from gimple to
1642         gimple_try.
1643         (honor_protect_cleanup_actions): Split out uses of "x" into new
1644         locals "eh_mnt" and "try_stmt" with stronger types.
1645         (lower_try_finally): Require a gimple_try rather than a plain
1646         gimple.
1647         (lower_catch): Likewise.
1648         (lower_eh_filter): Likewise.
1649         (lower_eh_must_not_throw): Likewise.
1650         (lower_cleanup): Likewise.
1651         (lower_eh_constructs_2): Add checked cast to gimple_try within
1652         GIMPLE_TRY case of switch statement, introducing new local
1653         "try_stmt", using it for type-safety.
1655 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1657         Use subclasses of gimple in various places
1659         * asan.c (insert_if_then_before_iter): Require a gimple cond
1660         rathern than a plain gimple.
1661         (asan_expand_check_ifn): Add a checked cast to gimple_cond.
1663         * cfgloopmanip.c (create_empty_if_region_on_edge): Likewise.
1665         * omp-low.c (simd_clone_adjust): Strengthen local from gimple
1666         to gimple_phi.
1668         * sese.c (set_ifsese_condition): Strengthen local from gimple to
1669         gimple_cond.
1671         * tree-call-cdce.c (gen_one_condition): Strengthen locals from
1672         gimple to gimple_assign and gimple_cond.
1674         * tree-ssa-phiopt.c (minmax_replacement): Likewise.
1675         (cond_store_replacement): Strengthen locals from gimple to
1676         gimple_phi and gimple_assign.
1677         (cond_if_else_store_replacement_1): Likewise.
1679         * tree-ssa-pre.c (do_regular_insertion): Strengthen local from
1680         gimple to gimple_assign.
1682         * tree-switch-conversion.c (hoist_edge_and_branch_if_true):
1683         Strengthen local from gimple to gimple_cond.
1684         (gen_def_assigns): Return a gimple_assign rather than a plain
1685         gimple.
1686         (gen_inbound_check): Strengthen locals from gimple to gimple_cond
1687         and gimple_assign.
1689         * tree-vect-loop-manip.c (slpeel_add_loop_guard): Strengthen local
1690         from gimple to gimple_cond.
1691         (set_prologue_iterations): Strengthen locals from gimple to
1692         gimple_phi and gimple_cond.
1694         * value-prof.c (gimple_ic): Strengthen local from gimple to
1695         gimple_phi.
1696         (gimple_stringop_fixed_value): Strengthen locals from gimple to
1697         gimple_assign, gimple_cond, gimple_call, and gimple_phi.
1699 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1701         Introduce gimple_eh_dispatch
1703         * coretypes.h (gimple_eh_dispatch): New typedef.
1704         (const_gimple_eh_dispatch): New typedef.
1706         * gimple-pretty-print.c (dump_gimple_eh_dispatch): Require a
1707         gimple_eh_dispatch rather than a plain gimple.
1708         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_dispatch
1709         within GIMPLE_EH_DISPATCH case of switch statement.
1711         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1713         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1715         * gimple.c (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
1716         rather than a plain gimple.
1718         * gimple.h (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
1719         rather than a plain gimple.
1720         (gimple_eh_dispatch_region): Require a const_gimple_eh_dispatch
1721         rather than a plain const_gimple.
1722         (gimple_eh_dispatch_set_region): Require a gimple_eh_dispatch
1723         rather than a plain gimple.
1725         * tree-cfg.c (make_edges): Add a checked cast to gimple_eh_dispatch
1726         within GIMPLE_EH_DISPATCH case of switch statement.
1727         (gimple_verify_flow_info): Likewise.
1728         (gimple_redirect_edge_and_branch): Likewise.
1729         (move_stmt_r): Likewise, adding a local.
1731         * tree-eh.c (emit_eh_dispatch): Convert local from gimple to
1732         gimple_eh_dispatch.
1733         (make_eh_dispatch_edges): Require a gimple_eh_dispatch rather than
1734         a plain gimple.
1735         (redirect_eh_dispatch_edge): Likewise.
1736         (lower_eh_dispatch): Likewise.
1737         (execute_lower_eh_dispatch): Add a checked cast to
1738         gimple_eh_dispatch.
1739         (mark_reachable_handlers): Likewise.
1740         (verify_eh_dispatch_edge): Require a gimple_eh_dispatch rather
1741         than a plain gimple.
1743         * tree-eh.h (make_eh_dispatch_edges): Likewise.
1744         (redirect_eh_dispatch_edge): Likewise.
1745         (verify_eh_dispatch_edge): Likewise.
1747         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1748         gimple_eh_dispatch within GIMPLE_EH_DISPATCH case of switch
1749         statement, adding a local.
1750         (copy_edges_for_bb): Add a checked cast to gimple_eh_dispatch.
1752 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1754         Introduce gimple_resx
1756         * coretypes.h (gimple_resx): New typedef.
1757         (const_gimple_resx): New typedef.
1759         * gimple.h (gimple_build_resx): Return a gimple_resx rather than a
1760         plain gimple.
1761         (gimple_resx_region): Require a const_gimple_resx rather than a
1762         plain const_gimple.
1763         (gimple_resx_set_region): Require a gimple_resx rather than a
1764         plain gimple.
1766         * gimple-pretty-print.c (dump_gimple_resx): Require a gimple_resx
1767         rather than a plain gimple.
1768         (pp_gimple_stmt_1): Add a checked cast to gimple_resx within
1769         GIMPLE_RESX case of switch statement.
1771         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1773         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1775         * gimple.c (gimple_build_resx): Return a gimple_resx rather than
1776         a plain gimple.
1778         * tree-cfg.c (move_stmt_r): Add a checked cast to gimple_resx
1779         within GIMPLE_RESX case of switch statement, adding a new local.
1781         * tree-eh.c (emit_resx): Convert local "x" from gimple to
1782         gimple_resx.
1783         (lower_resx): Require a gimple_resx rather than a plain gimple.
1784         (pass_lower_resx::execute): Add a checked cast to gimple_resx.
1785         (mark_reachable_handlers): Likewise.
1787         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1788         gimple_resx within GIMPLE_RESX case of switch statement, adding
1789         a new local.
1791 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1793         Introduce gimple_eh_else
1795         * coretypes.h (gimple_eh_else): New typedef.
1796         (const_gimple_eh_else): New typedef.
1798         * gimple.h (gimple_build_eh_else): Return a gimple_eh_else rather
1799         than a plain gimple.
1800         (gimple_eh_else_n_body_ptr): Require a gimple_eh_else rather than
1801         a plain gimple.
1802         (gimple_eh_else_n_body): Likewise.
1803         (gimple_eh_else_e_body_ptr): Likewise.
1804         (gimple_eh_else_e_body): Likewise.
1805         (gimple_eh_else_set_n_body): Likewise.
1806         (gimple_eh_else_set_e_body): Likewise.
1808         * gimple-low.c (lower_stmt): Add checked cast to gimple_eh_else
1809         within GIMPLE_EH_ELSE case of switch statement, introducing a new
1810         local.
1811         (gimple_stmt_may_fallthru): Likewise.
1813         * gimple-pretty-print.c (dump_gimple_eh_else): Require a
1814         gimple_eh_else rather than a plain gimple.
1815         (pp_gimple_stmt_1): Add checked cast to gimple_eh_else within
1816         GIMPLE_EH_ELSE case of switch statement
1818         * gimple-walk.c (walk_gimple_stmt): Add checked cast to
1819         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1820         introducing a new local.
1822         * gimple.c (gimple_build_eh_else): Return a gimple_eh_else
1823         rather than a plain gimple.
1824         (gimple_copy): Add checked casts to gimple_eh_else within
1825         GIMPLE_EH_ELSE case of switch statement, introducing new locals.
1827         * tree-cfg.c (verify_gimple_in_seq_2): Add checked cast to
1828         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1829         introducing a new local.
1831         * tree-eh.c (collect_finally_tree): Likewise.
1832         (replace_goto_queue_1): Likewise.
1833         (get_eh_else): Return a gimple_eh_else rather than a plain gimple.
1834         (honor_protect_cleanup_actions): Convert local "eh_else" from
1835         gimple to gimple_eh_else.
1836         (lower_try_finally_nofallthru): Likewise.
1837         (lower_try_finally_onedest): Introduce locals "eh_else" and
1838         "label_stmt", using them in favor of "x" for the gimple_eh_else
1839         and the gimple_label.
1840         (lower_try_finally_copy): Convert local "eh_else" from gimple to
1841         gimple_eh_else.
1842         (lower_try_finally_switch): Likewise.
1843         (decide_copy_try_finally): Likewise.
1844         (refactor_eh_r): Add checked cast to gimple_eh_else within
1845         GIMPLE_EH_ELSE case of switch statement, introducing a new local.
1847 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1849         Introduce gimple_eh_must_not_throw
1851         * coretypes.h (gimple_eh_must_not_throw): New typedef.
1852         (const_gimple_eh_must_not_throw): New typedef.
1854         * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
1855         a gimple_eh_must_not_throw rather than a plain gimple.
1856         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
1857         within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
1859         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1861         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1863         * gimple.c (gimple_build_eh_must_not_throw): Return a
1864         gimple_eh_must_not_throw rather than a plain gimple.
1866         * gimple.h (gimple_build_eh_must_not_throw): Return a
1867         gimple_eh_must_not_throw rather than a plain gimple.
1868         (gimple_eh_must_not_throw_fndecl): Require a
1869         gimple_eh_must_not_throw rather than a plain gimple.
1870         (gimple_eh_must_not_throw_set_fndecl): Likewise.
1872         * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
1874 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1876         Introduce gimple_eh_filter
1878         * coretypes.h (gimple_eh_filter): New typedef.
1879         (const_gimple_eh_filter): New typedef.
1881         * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
1882         rather than a plain gimple.
1884         * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
1885         gimple_eh_filter rather than a plain gimple.
1886         (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
1887         GIMPLE_EH_FILTER case of switch statement.
1889         * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
1890         rather than a plain gimple.
1892 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1894         Introduce gimple_catch
1896         * coretypes.h (gimple_catch): New typedef.
1897         (const_gimple_catch): New typedef.
1899         * gimple-low.c (lower_try_catch): Add checked cast to gimple_catch.
1900         (gimple_try_catch_may_fallthru): Likewise.
1902         * gimple-pretty-print.c (dump_gimple_catch): Require a gimple_catch
1903         rather than a plain gimple.
1904         (pp_gimple_stmt_1): Add checked cast to gimple_catch within
1905         GIMPLE_CATCH case of switch statement.
1907         * gimple-walk.c (walk_gimple_op): Likewise.
1908         (walk_gimple_stmt): Likewise.
1910         * gimple.c (gimple_build_catch): Return a gimple_catch rather than
1911         a plain gimple.
1912         (gimple_copy): Add checked casts to gimple_catch within
1913         GIMPLE_CATCH case of switch statement, introducing new locals.
1915         * gimple.h (gimple_build_catch): Return a gimple_catch rather than
1916         a plain gimple.
1917         (gimple_catch_types_ptr): Require a gimple_catch rather than a
1918         plain gimple.
1919         (gimple_catch_handler_ptr): Likewise.
1920         (gimple_catch_handler): Likewise.
1921         (gimple_catch_set_types): Likewise.
1922         (gimple_catch_set_handler): Likewise.
1924         * omp-low.c (lower_omp_1): Add checked cast to gimple_catch within
1925         GIMPLE_CATCH case of switch statement.
1927         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
1928         (do_warn_unused_result): Likewise.
1930         * tree-eh.c (collect_finally_tree): Likewise.
1931         (replace_goto_queue_1): Likewise.
1932         (lower_catch): Convert local from gimple to gimple_catch.
1933         (refactor_eh_r): Add checked cast to gimple_catch within
1934         GIMPLE_CATCH case of switch statement.
1936         * tree-inline.c (remap_gimple_stmt): Likewise.
1937         (estimate_num_insns): Add checked cast to gimple_catch within
1938         GIMPLE_CATCH case of switch statement, introducing new local.
1940 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1942         Introduce gimple_transaction
1944         * coretypes.h (gimple_transaction): New typedef.
1945         (const_gimple_transaction): New typedef.
1947         * gimple.h (gimple_build_transaction): Return a gimple_transaction
1948         rather than a plain gimple.
1949         (gimple_transaction_body_ptr): Require a gimple_transaction rather
1950         than a plain gimple.
1951         (gimple_transaction_body): Likewise.
1952         (gimple_transaction_label_ptr): Likewise.
1953         (gimple_transaction_set_body): Likewise.
1954         (gimple_transaction_set_label): Likewise.
1955         (gimple_transaction_set_subcode): Likewise.
1956         (gimple_transaction_label): Require a const_gimple_transaction
1957         rather than a plain const_gimple.
1958         (gimple_transaction_subcode): Likewise.
1960         * gimple-low.c (lower_stmt): Add checked cast to
1961         gimple_transaction within GIMPLE_TRANSACTION case of switch
1962         statement.
1964         * gimple-pretty-print.c (dump_gimple_transaction): Require a
1965         gimple_transaction rather than a plain gimple.
1966         (pp_gimple_stmt_1): Add checked cast to gimple_transaction within
1967         GIMPLE_TRANSACTION case of switch statement.
1968         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1969         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1970         * gimple-walk.c (walk_gimple_op): Likewise.
1971         (walk_gimple_stmt): Likewise.
1973         * gimple.c (gimple_build_transaction): Return a gimple_transaction
1974         rather than a plain gimple.
1975         (gimple_copy): Add checked casts to gimple_transaction within
1976         GIMPLE_TRANSACTION case of switch statement.
1978         * gimplify.c (gimplify_transaction): Split local "g" into
1979         "body_stmt" and "trans_stmt", strengthening the type of the latter
1980         from gimple to gimple_transaction.
1982         * omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
1983         within GIMPLE_TRANSACTION case of switch statement.
1985         * trans-mem.c (diagnose_tm_1): Add checked cast within
1986         GIMPLE_TRANSACTION case of switch statement, introducing a new
1987         local "trans_stmt".  Use it in place of "stmt".
1988         (examine_call_tm): Convert local from gimple to gimple_transaction.
1989         (tm_region::get_transaction_stmt): New method.
1990         (tm_region::transaction_stmt): Add clarification of type to the
1991         comment.
1992         (tm_region_init_0): Require a gimple_transaction rather than a
1993         plain gimple.
1994         (tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
1995         dyn_cast<gimple_transaction> and new local.
1996         (transaction_subcode_ior): Add a new local, using the new
1997         get_transaction_stmt method to perform a checked cast.
1998         (propagate_tm_flags_out): Likewise.
1999         (expand_transaction): Add a checked cast using the new
2000         get_transaction_stmt method.
2001         (generate_tm_state): Likewise.
2002         (execute_tm_mark): Likewise.
2003         (ipa_tm_diagnose_transaction): Likewise.
2005         * tree-cfg.c (verify_gimple_transaction): Require a
2006         gimple_transaction rather than a plain gimple.
2007         (make_edges): Add checked cast within GIMPLE_TRANSACTION case of
2008         switch statement
2009         (cleanup_dead_labels): Likewise.
2010         (verify_gimple_stmt): Likewise.
2011         (verify_gimple_in_seq_2): Likewise.
2012         (verify_gimple_in_seq_2): Likewise.
2013         (gimple_redirect_edge_and_branch): Add checked cast.
2015         * tree-inline.c (remap_gimple_stmt): Add checked cast within
2016         GIMPLE_TRANSACTION case of switch statement, introducing a new
2017         local "old_trans_stmt".  Use it in place of "stmt".  Add new
2018         local "new_trans_stmt", using it to initialize "copy", and for
2019         type-safe operations as a transaction.
2020         (estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
2021         case of switch statement.
2023 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2025         Introduce gimple_asm
2027         * coretypes.h (gimple_asm): New typedef.
2028         (const_gimple_asm): New typedef.
2030         * gimple.h (gimple_build_asm_vec): Return a gimple_asm rather than
2031         just a gimple.
2032         (gimple_asm_clobbers_memory_p): Require a const_gimple_asm rather
2033         than just a const_gimple.
2034         (gimple_asm_ninputs): Likewise.
2035         (gimple_asm_noutputs): Likewise.
2036         (gimple_asm_nclobbers): Likewise.
2037         (gimple_asm_nlabels): Likewise.
2038         (gimple_asm_input_op): Likewise.
2039         (gimple_asm_input_op_ptr): Likewise.
2040         (gimple_asm_output_op): Likewise.
2041         (gimple_asm_output_op_ptr): Likewise.
2042         (gimple_asm_clobber_op): Likewise.
2043         (gimple_asm_label_op): Likewise.
2044         (gimple_asm_string): Likewise.
2045         (gimple_asm_volatile_p): Likewise.
2046         (gimple_asm_input_p): Likewise.
2047         (gimple_asm_set_input_op): Require a gimple_asm rather than a plain
2048         gimple.
2049         (gimple_asm_set_output_op): Likewise.
2050         (gimple_asm_set_clobber_op): Likewise.
2051         (gimple_asm_set_label_op): Likewise.
2052         (gimple_asm_set_volatile): Likewise.
2053         (gimple_asm_set_input): Likewise.
2055         * cfgexpand.c (expand_asm_stmt): Require a gimple_asm rather than
2056         a plain gimple.
2057         (expand_gimple_stmt_1): Add checked cast to gimple_asm within
2058         GIMPLE_ASM case of switch statement.
2060         * gimple-fold.c (fold_stmt_1): Add new local from checked cast to
2061         gimple_asm within case GIMPLE_ASM.
2063         * gimple-pretty-print.c (dump_gimple_asm): Require a gimple_asm
2064         rather than a plain gimple.
2065         (pp_gimple_stmt_1): Add checked cast to gimple_asm within
2066         GIMPLE_ASM case of switch statement.
2068         * gimple-streamer-in.c (input_gimple_stmt): Rework existing
2069         checked cast to gimple_asm; add a new one.
2071         * gimple-streamer-out.c (output_gimple_stmt): Add new local from
2072         checked cast to gimple_asm within case GIMPLE_ASM.
2074         * gimple-walk.c (walk_gimple_asm): Require a gimple_asm rather
2075         than a plain gimple.
2076         (walk_gimple_op): Add checked cast to gimple_asm within GIMPLE_ASM
2077         case of switch statement.
2078         (walk_stmt_load_store_addr_ops): Use dyn_cast<gimple_asm> in place
2079         of a code check against GIMPLE_ASM to introduce a new gimple_asm
2080         local.
2082         * gimple.c (gimple_build_asm_1): Return a gimple_asm rather than
2083         a plain gimple.
2084         (gimple_build_asm_vec): Likewise.
2085         (gimple_has_side_effects): Add a checked cast to gimple_asm.
2086         (gimple_could_trap_p_1): Likewise.
2087         (gimple_call_builtin_p): Require a const_gimple_asm rather then
2088         a const_gimple.
2090         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
2091         and a new local of type gimple_asm within GIMPLE_ASM case.
2093         * gimplify.c (gimplify_asm_expr): Convert a local from gimple to
2094         gimple_asm.
2096         * ipa-pure-const.c (check_stmt): Add checked casts within
2097         GIMPLE_ASM case.
2099         * ssa-iterators.h (op_iter_init): Likewise.
2101         * tree-cfg.c (make_goto_expr_edges): Convert a local from gimple
2102         to gimple_asm.
2103         (cleanup_dead_labels): Add a checked cast and a new local of type
2104         gimple_asm within GIMPLE_ASM case.
2105         (gimple_redirect_edge_and_branch): Likewise.
2106         (is_ctrl_altering_stmt): Add a checked cast.
2107         (need_fake_edge_p): Replace a code check against GIMPLE_ASM with a
2108         dyn_cast<gimple_asm>.
2110         * tree-complex.c (expand_complex_comparison): Convert a local from
2111         gimple to gimple_asm.
2113         * tree-data-ref.c (get_references_in_stmt): Add a checked cast to
2114         gimple_asm.
2116         * tree-eh.c (stmt_could_throw_p): Likewise.
2118         * tree-inline.c (estimate_num_insns): Likewise.
2120         * tree-sra.c (scan_function): Add a checked cast and a new local
2121         of type gimple_asm within GIMPLE_ASM case.
2122         (sra_modify_function_body): Likewise.
2123         (ipa_sra_modify_function_body): Likewise.
2125         * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
2127         * tree-ssa-dce.c (propagate_necessity): Replace a code check
2128         against GIMPLE_ASM with a dyn_cast<gimple_asm>.
2130         * tree-ssa-operands.c (maybe_add_call_vops): Require a gimple_asm
2131         rather than a plain gimple.
2132         (parse_ssa_operands): Add a checked cast to gimple_asm.
2134         * tree-ssa-structalias.c (find_func_aliases): Replace a check for
2135         GIMPLE_ASM with a dyn_cast<gimple_asm>, introducing  a new local
2136         "asm_stmt", using it in place of "t" for typesafety.
2138         * tree-ssa-threadedge.c
2139         (record_temporary_equivalences_from_stmts_at_dest): Add a checked
2140         cast to gimple_asm.
2142         * tree-ssa.c (execute_update_addresses_taken): Add checked casts
2143         and new locals of type gimple_asm within clauses guarded by code
2144         check.
2146 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2148         Introduce gimple_goto
2150         * coretypes.h (gimple_goto): New typedef.
2151         (const_gimple_goto): New typedef.
2153         * gimple.h (gimple_statement_goto): New subclass of
2154         gimple_statement_with_ops, adding the invariant that
2155         stmt->code == GIMPLE_GOTO.
2156         (is_a_helper <gimple_statement_goto>::test): New.
2157         (gimple_build_goto): Return a gimple_goto rather than a
2158         plain gimple.
2160         * gimple-pretty-print.c (dump_gimple_goto): Require a gimple_goto
2161         rather than a plain gimple.
2162         (pp_gimple_stmt_1): Add a checked cast to gimple_goto within
2163         GIMPLE_GOTO case of switch statement.
2165         * gimple.c (gimple_build_goto): Return a gimple_goto rather than a
2166         plain gimple.
2168         * tree-cfg.c (verify_gimple_goto): Require a gimple_goto rather
2169         than a plain gimple.
2170         (verify_gimple_stmt): Add a checked cast to gimple_goto within
2171         GIMPLE_GOTO case of switch statement.
2173 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2175         Introduce gimple_return
2177         * coretypes.h (gimple_return): New typedef.
2178         (const_gimple_return): New typedef.
2180         * gimple.h (gimple_statement_return): New subclass of
2181         gimple_statement_with_memory_ops, adding the invariant that
2182         stmt->code == GIMPLE_RETURN.
2183         (is_a_helper <gimple_statement_return>::test): New.
2184         (gimple_build_return): Return a gimple_return rather
2185         than a plain gimple.
2187         * gimple.c (gimple_build_return): Return a gimple_return rather
2188         than a plain gimple.
2190         * cgraphunit.c (expand_thunk): Convert local from a gimple to
2191         a gimple_return.
2193         * gimple-low.c (struct return_statements_t): Convert field "stmt"
2194         from a gimple to a gimple_return.
2195         (lower_gimple_return): Convert local from a gimple to a
2196         gimple_return.
2198         * gimple-pretty-print.c (dump_gimple_return): Require a
2199         gimple_return rather than a plain gimple.
2200         (pp_gimple_stmt_1): Add a checked cast to gimple_return within
2201         case GIMPLE_RETURN of switch statement.
2203         * gimplify.c (gimplify_return_expr): Convert locals from
2204         gimple to gimple_return.
2206         * ipa-split.c (split_function): Likewise.
2208         * tree-cfg.c (verify_gimple_assign): Require a gimple_return
2209         rather than a plain gimple.
2210         (verify_gimple_stmt): Add checked cast to gimple_return within
2211         case GIMPLE_RETURN of switch statement.
2213         * tree-tailcall.c (adjust_return_value): Convert local from
2214         gimple to gimple_return.
2216 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2218         Introduce gimple_call
2220         * coretypes.h (gimple_call): New typedef.
2221         (const_gimple_call): New typedef.
2223         * asan.c (get_mem_refs_of_builtin_call): Require a
2224         const_gimple_call rather than a const gimple.
2225         (has_stmt_been_instrumented_p): Add a checked cast to
2226         gimple_call.
2227         (instrument_strlen_call): Likewise.
2228         (instrument_builtin_call): Likewise.
2229         * builtins.c (validate_gimple_arglist): Require a
2230         const_gimple_call rather than a const gimple.
2231         (fold_call_stmt): Require a gimple_call rather than a gimple.
2232         * builtins.h (validate_gimple_arglist): Require a
2233         const_gimple_call rather than a const gimple.
2234         (fold_call_stmt): Require a gimple_call rather than a gimple.
2235         * cfgexpand.c (expand_call_stmt): Likewise.
2236         (expand_gimple_stmt_1): Add a checked cast to gimple_call within
2237         GIMPLE_CALL case.
2238         * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Strengthen
2239         local "new_stmt" from gimple to gimple_call, adding a checked
2240         cast.
2241         * cgraphunit.c (cgraph_node::expand_thunk): Likewise for local
2242         "call".
2243         * gimple-fold.c (gimple_fold_builtin_snprintf_chk): Likewise for
2244         local "stmt".
2245         (gimple_fold_builtin_snprintf): Likewise.
2246         (gimple_fold_builtin): Likewise.
2247         (gimple_fold_call): Likewise.
2248         (gimple_fold_stmt_to_constant_1): Introduce local "call_stmt" via
2249         checked cast of "stmt" to gimple_call, using it in various places
2250         for typesafety.
2251         * gimple-pretty-print.c (dump_gimple_call_args): Strengthen param
2252         2 from gimple to gimple_call.
2253         (dump_gimple_call): Likewise.
2254         (pp_gimple_stmt_1): Add a checked cast to gimple_call within
2255         GIMPLE_CALL case.
2256         * gimple-streamer-in.c (input_gimple_stmt): Replace is_gimple_call
2257         with a dyn_cast<gimple_call>, introducing local "call_stmt", and
2258         using it in place of "stmt" for typesafety.  Add a checked cast
2259         in statement guarded by check for GIMPLE_CALL.
2260         * gimple-walk.c (walk_gimple_op): Add a checked cast to
2261         gimple_call.
2262         * gimple.c (gimple_call_reset_alias_info): Strengthen param from
2263         gimple to gimple_call.
2264         (gimple_build_call_1): Strengthen return type and local from
2265         gimple to gimple_call.
2266         (gimple_build_call_vec): Likewise.
2267         (gimple_build_call): Likewise.
2268         (gimple_build_call_valist): Likewise.
2269         (gimple_build_call_internal_1): Likewise.
2270         (gimple_build_call_internal): Likewise.
2271         (gimple_build_call_internal_vec): Likewise.
2272         (gimple_build_call_from_tree): Likewise.
2273         (gimple_call_return_flags): Strengthen param from
2274         const_gimple to const_gimple_call.
2275         (gimple_call_copy_skip_args): Strengthen return type and local from
2276         gimple to gimple_call.
2277         * gimple.h (gimple_call_reset_alias_info): Strengthen param from
2278         gimple to gimple_call.
2279         (gimple_build_call_vec): Strengthen return type from gimple to
2280         gimple_call.
2281         (gimple_build_call): Likewise.
2282         (gimple_build_call_valist): Likewise.
2283         (gimple_build_call_internal): Likewise.
2284         (gimple_build_call_internal_vec): Likewise.
2285         (gimple_build_call_from_tree): Likewise.
2286         (gimple_call_return_flags): Strengthen param from const_gimple to
2287         const_gimple_call.
2288         (gimple_call_copy_skip_args): Strengthen return type from gimple
2289         to gimple_call.
2290         (gimple_call_set_internal_fn): Strengthen param "call_stmt" from
2291         gimple to gimple_call.
2292         (gimple_call_return_type): Strengthen param from const_gimple to
2293         const_gimple_call.
2294         (gimple_call_chain_ptr): Likewise.
2295         (gimple_call_set_chain): Strengthen param from gimple to
2296         gimple_call.
2297         (gimple_call_set_return_slot_opt): Likewise.
2298         (gimple_call_set_from_thunk): Likewise.
2299         (gimple_call_from_thunk_p): Likewise.
2300         (gimple_call_set_va_arg_pack): Likewise.
2301         (gimple_call_va_arg_pack_p): Likewise.
2302         (gimple_call_set_alloca_for_var): Likewise.
2303         (gimple_call_alloca_for_var_p): Likewise.
2304         (gimple_expr_type): Introduce local "call_stmt" via a checked cast
2305         and use it for typesafety.
2306         * gimplify.c (gimplify_call_expr): Strengthen local "call" from
2307         gimple to gimple_call.
2308         (gimplify_modify_expr_to_memcpy): Likewise for local "gs".
2309         (gimplify_modify_expr_to_memset): Likewise.
2310         (gimplify_modify_expr): Add a checked cast to gimple_call.
2311         (gimplify_expr): Strengthen local "call" from gimple to
2312         gimple_call.
2313         (gimplify_function_tree): Likewise.
2314         * internal-fn.c (expand_LOAD_LANES): Strengthen param from gimple
2315         to gimple_call.
2316         (expand_STORE_LANES): Likewise.
2317         (expand_ANNOTATE): Likewise.
2318         (expand_GOMP_SIMD_LANE): Likewise.
2319         (expand_GOMP_SIMD_VF): Likewise.
2320         (expand_GOMP_SIMD_LAST_LANE): Likewise.
2321         (expand_UBSAN_NULL): Likewise.
2322         (expand_UBSAN_BOUNDS): Likewise.
2323         (expand_UBSAN_OBJECT_SIZE): Likewise.
2324         (expand_ASAN_CHECK): Likewise.
2325         (ubsan_expand_si_overflow_addsub_check): Likewise.
2326         (ubsan_expand_si_overflow_neg_check): Likewise.
2327         (ubsan_expand_si_overflow_mul_check): Likewise.
2328         (expand_UBSAN_CHECK_ADD): Likewise.
2329         (expand_UBSAN_CHECK_SUB): Likewise.
2330         (expand_UBSAN_CHECK_MUL): Likewise.
2331         (expand_LOOP_VECTORIZED): Likewise.
2332         (expand_MASK_LOAD): Likewise.
2333         (expand_MASK_STORE): Likewise.
2334         (expand_ABNORMAL_DISPATCHER): Likewise.
2335         (expand_BUILTIN_EXPECT): Likewise.
2336         (internal_fn_expanders): Likewise for entries in this table.
2337         (expand_internal_call): Likewise.
2338         * internal-fn.def: Update comment to reflect strengthening of
2339         param of expanders.
2340         * internal-fn.h (expand_internal_call): Strengthen param from
2341         gimple to gimple_call.
2342         * ipa-prop.c (ipa_modify_call_arguments): Likewise for local
2343         "new_stmt".
2344         * ipa-pure-const.c (check_call): Likewise for param "call".
2345         (check_stmt): Add a checked cast to gimple_call within GIMPLE_CALL
2346         case.
2347         * ipa-split.c (split_function): Strengthen local "call" from
2348         gimple to gimple_call.
2349         * omp-low.c (build_omp_barrier): Likewise for local "g".
2350         (lower_rec_input_clauses): Likewise for local "stmt".
2351         * trans-mem.c (build_tm_load): Likewise for return type and local
2352         "gcall".
2353         (build_tm_store): Likewise.
2354         (expand_transaction): Likewise for local "call".
2355         * tree-call-cdce.c (check_pow): Likewise for param.
2356         (check_builtin_call): Likewise.
2357         (is_call_dce_candidate): Likewise.
2358         (gen_conditions_for_pow): Likewise.
2359         (gen_shrink_wrap_conditions): Likewise.
2360         (shrink_wrap_one_built_in_call): Likewise.
2361         (shrink_wrap_conditional_dead_built_in_calls): Strengthen param
2362         from vec<gimple> to vec<gimple_call>, and local "bi_call" from
2363         gimple to gimple_call.
2364         (pass_call_cdce::execute): Strengthen local
2365         "cond_dead_built_in_calls" from auto_vec<gimple> to
2366         auto_vec<gimple_call> and local "stmt" from gimple to gimple_call,
2367         * tree-cfg.c (notice_special_calls): Strengthen param from gimple
2368         to gimple_call.
2369         * tree-cfg.h (notice_special_calls): Likewise.
2370         * tree-complex.c (expand_complex_libcall): Likewise for local
2371         "stmt".
2372         * tree-inline.c (remap_gimple_stmt): Add checked cast to
2373         gimple_call.
2374         (copy_bb): Likewise.  Strengthen local "new_call" from gimple to
2375         gimple_call.
2376         (inline_forbidden_p_stmt): Add checked cast to gimple_call.
2377         * tree-nested.c (init_tmp_var_with_call): Strengthen param "call"
2378         from gimple to gimple_call.
2379         (convert_nl_goto_reference): Likewise for local "call".
2380         (convert_tramp_reference_op): Likewise.
2381         (convert_gimple_call): Add checked cast to gimple_call.
2382         * tree-nrv.c (dest_safe_for_nrv_p): Strengthen param "call" from
2383         gimple to gimple_call.
2384         (pass_return_slot::execute): Likewise for local "stmt", using a
2385         dyn_cast<gimple_call> rather than an is_gimple_call call.
2386         * tree-object-size.c (alloc_object_size): Strengthen param "call"
2387         from const_gimple to const_gimple_call.
2388         (pass_through_call): Likewise.
2389         (call_object_size): Strengthen param "call" from gimple to
2390         gimple_call.
2391         (collect_object_sizes_for): Introduce local "call_stmt" via a
2392         checked cast, using it for typesafety.
2393         (check_for_plus_in_loops_1): Likewise.
2394         (pass_object_sizes::execute): Add a checked cast to gimple_call.
2395         * tree-profile.c (gimple_gen_interval_profiler): Strengthen local
2396         "call" from gimple to gimple_call.
2397         (gimple_gen_pow2_profiler): Likewise.
2398         (gimple_gen_one_value_profiler): Likewise.
2399         (gimple_gen_time_profiler): Likewise.
2400         (gimple_gen_average_profiler): Likewise.
2401         (gimple_gen_ior_profiler): Likewise.
2402         * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise for
2403         param "call".
2404         (ref_maybe_used_by_call_p): Likewise.
2405         (ref_maybe_used_by_stmt_p): Add a checked cast to gimple_call.
2406         (call_may_clobber_ref_p_1): Strengthen param "call" from gimple to
2407         gimple_call.
2408         (call_may_clobber_ref_p): Likewise.
2409         (stmt_may_clobber_ref_p_1): Add a checked cast to gimple_call.
2410         * tree-ssa-alias.h (call_may_clobber_ref_p): Strengthen param 1
2411         from gimple to gimple_call.
2412         (call_may_clobber_ref_p_1): Likewise.
2413         * tree-ssa-dce.c (eliminate_unnecessary_stmts): Add a checked cast
2414         to gimple_call.
2415         * tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Strengthen
2416         local "call" from gimple to gimple_call.
2417         * tree-ssa-math-opts.c (build_and_insert_call): Likewise for local
2418         "call_stmt".
2419         * tree-ssa-operands.c (maybe_add_call_vops): Likewise for param
2420         "stmt".
2421         (parse_ssa_operands): Add a checked cast to gimple_call within
2422         GIMPLE_CALL case.
2423         * tree-ssa-pre.c (compute_avail): Add a checked cast to
2424         gimple_call.
2425         * tree-ssa-sccvn.c (copy_reference_ops_from_call): Strengthen
2426         param "call" from gimple to gimple_call.
2427         (valueize_shared_reference_ops_from_call): Likewise.
2428         (vn_reference_lookup_3): Add a checked cast to gimple_call.
2429         (vn_reference_lookup_call): Strengthen param "call" from gimple to
2430         gimple_call.
2431         (visit_reference_op_call): Likewise for param "stmt".
2432         (visit_use): Replace is_gimple_call with a dyn_cast, introducing
2433         local "call_stmt", using it in place of "stmt" for type-safety.
2434         * tree-ssa-sccvn.h (vn_reference_lookup_call): Strengthen param 1
2435         from gimple to gimple_call.
2436         * tree-ssa-structalias.c (get_call_vi): Likewise.
2437         (lookup_call_use_vi): Likewise.
2438         (lookup_call_clobber_vi): Likewise.
2439         (get_call_use_vi): Likewise.
2440         (get_call_clobber_vi): Likewise.
2441         (handle_rhs_call): Likewise.
2442         (handle_lhs_call): Likewise.
2443         (handle_const_call): Likewise.
2444         (handle_pure_call): Likewise.
2445         (get_fi_for_callee): Likewise.
2446         (find_func_aliases_for_builtin_call): Likewise for param 2.
2447         (find_func_aliases_for_call): Likewise.
2448         (find_func_aliases): Add a checked cast to gimple_call.
2449         (find_func_clobbers): Replace is_gimple_call with a dyn_cast,
2450         introducing local "call_stmt", using it in place of "stmt" for
2451         type-safety.
2452         (compute_points_to_sets): Strengthen local "stmt" from gimple to
2453         gimple_call, replacing is_gimple_call with a
2454         dyn_cast <gimple_call>.
2455         (ipa_pta_execute): Likewise.
2456         * tree-ssa-threadedge.c
2457         (record_temporary_equivalences_from_stmts_at_dest): Add checked
2458         cast to gimple_call.
2459         * tree-tailcall.c (find_tail_calls): Strengthen local "call" from
2460         gimple to gimple_call, adding a checked cast.
2461         * tree-vect-data-refs.c (vect_setup_realignment): Eliminate
2462         top-level local "new_stmt" in favor of more tightly-scoped locals
2463         "new_stmt" of type gimple_assign and gimple_call.
2464         * tree-vect-patterns.c (vect_recog_pow_pattern): Strenghthen local
2465         "stmt" from gimple to gimple_call.
2466         * tree-vect-stmts.c (vectorizable_function): Likewise for param
2467         "call".
2468         (vectorizable_call): Rename param 1 from "stmt" to "gs",
2469         reintroducing "stmt" as a gimple_call once we've established that
2470         we're working with a GIMPLE_CALL.
2471         * tree-vectorizer.h (vectorizable_function): Strengthen param 1
2472         from gimple to gimple_call.
2473         * value-prof.c (check_ic_target): Likewise.
2474         (gimple_ic_transform): Likewise for local "stmt", replacing a
2475         check for GIMPLE_CALL with a dyn_cast.
2476         (interesting_stringop_to_profile_p): Strengthen param "call"
2477         from gimple to gimple_call.
2478         (gimple_stringop_fixed_value): Likewise for param "vcall_stmt".
2479         (gimple_stringops_transform): Likewise for local "stmt",
2480         replacing a check for GIMPLE_CALL with a dyn_cast.
2481         (gimple_stringops_values_to_profile): Rename param 1 from "stmt"
2482         to "gs", reintroducing "stmt" as a gimple_call once we've
2483         established that we're working with a GIMPLE_CALL.
2484         * vtable-verify.c (verify_bb_vtables): Strengthen local
2485         "call_stmt" from gimple to gimple_call.
2487 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2489         Concretize get_loop_exit_condition et al to working on gimple_cond
2491         * tree-scalar-evolution.h (get_loop_exit_condition): Return a
2492         gimple_cond.
2493         * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
2494         concretizing local "res" from gimple to gimple_cond.
2495         * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
2496         locals from gimple to gimple_cond.
2497         (slpeel_can_duplicate_loop_p): Likewise.
2498         * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
2499         (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
2501 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2503         Update various expressions within tree-scalar-evolution.c to be gimple_phi
2505         * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
2506         rather than a gimple.
2507         (follow_ssa_edge_binary): Likewise.
2508         (follow_ssa_edge_expr): Likewise.
2509         (follow_ssa_edge_in_rhs): Likewise.
2510         (backedge_phi_arg_p): Likewise.
2511         (follow_ssa_edge_in_condition_phi_branch): Likewise.
2512         (follow_ssa_edge_in_condition_phi): Likewise.
2513         (follow_ssa_edge_inner_loop_phi): Likewise.
2514         (analyze_evolution_in_loop): Likewise.
2515         (analyze_initial_condition): Likewise.
2516         (interpret_loop_phi): Likewise.
2517         (interpret_condition_phi): Likewise.
2518         (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
2520         (analyze_scalar_evolution_1): Add checked casts to gimple_phi
2521         within "case GIMPLE_PHI".
2523 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2525         tree-ssa-loop-ivopts.c: use gimple_phi in a few places
2527         * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
2528         (find_bivs): Convert local "phi" into a gimple_phi.
2529         (mark_bivs): Likewise.
2531 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2533         tree-ssa-loop-manip.c: use gimple_phi in three places
2535         * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
2536         gimple_phi.
2537         (split_loop_exit_edge): Likewise for "phi" and "new_phi".
2539 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2541         tree-ssa-loop-niter.c: use gimple_phi in a few places
2543         * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
2544         rather than a gimple.
2545         (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
2546         (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
2548 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2550         tree-ssa-phiprop.c: use gimple_phi
2552         * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
2553         parameter "phi" and local "new_phi" from gimple to gimple_phi.
2555 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2557         tree-predcom.c: use gimple_phi in various places
2559         * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
2560         than just a gimple.
2561         (insert_looparound_copy): Require a gimple_phi rather than just a
2562         gimple.
2563         (add_looparound_copies): Convert local "phi" to be a gimple_phi.
2564         (initialize_root_vars): Likewise.
2565         (initialize_root_vars_lm): Likewise.
2567 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2569         tree-parloops.c: use gimple_phi in various places
2571         * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
2572         from gimple to gimple_phi.
2573         (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
2574         (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
2575         (gather_scalar_reductions): Convert to a gimple_phi_iterator and
2576         gimple_phi.
2577         (try_create_reduction_list): Likewise.
2579 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2581         Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
2583         * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
2584         type of parameter from gimple to gimple_phi.
2586         * tree-complex.c (complex_visit_phi): Update signature of callback
2587         implementation accordingly.
2588         * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
2589         * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
2590         * tree-vrp.c (vrp_visit_phi_node): Likewise.
2592         * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
2593         gimple_phi when invoking the ssa_prop_visit_phi callback.
2595 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2597         Introduce gimple_phi_iterator
2599         * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
2600         gimple_stmt_iterator with identical layout, but adding...
2601         (gimple_phi_iterator::phi): ...new method, equivalent to
2602         gsi_stmt (), but casting the underlying gimple to gimple_phi,
2603         checking that code == GIMPLE_PHI in a checked build.
2604         (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
2605         gimple_stmt_iterator.
2607         * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
2608         than just a gimple.
2609         (if_convertible_phi_p): Likewise.
2610         * tree-phinodes.h (add_phi_node_to_bb): Likewise.
2611         * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
2613         * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
2614         and a vec<gimple_phi> *, rather than just a gimple and
2615         vec<gimple> *, and a hash_set<gimple_phi> * rather than a
2616         hash_set<gimple> *.
2617         (find_uninit_use): Likewise; add checked cast to gimple_phi when
2618         adding to worklist.
2619         (pass_late_warn_uninitialized::execute): Strengthen types of
2620         various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
2621         "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
2622         gimple_phi, "added_to_worklist" from hash_set<gimple> to
2623         hash_set<gimple_phi>.
2625         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
2626         gimple_phi_iterator * rather than a gimple_stmt_iterator *;
2627         use it to strengthen local from a gimple to a gimple_phi.
2629         * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
2630         gimple_stmt_iterator to a gimple_phi_iterator.  Use the iterator's
2631         "phi" method rather than gsi_stmt.  Use this checked cast to convert
2632         the type of related local from a plain gimple to a gimple_phi.
2633         * gimple-pretty-print.c (dump_phi_nodes): Likewise.
2634         * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
2635         Likewise.
2636         * sese.c (sese_add_exit_phis_edge): Likewise.
2637         * tree-cfg.c (reinstall_phi_args): Likewise.
2638         (gimple_make_forwarder_block): Likewise.
2639         (add_phi_args_after_copy_edge): Likewise.
2640         (gimple_lv_adjust_loop_header_phi): Likewise.
2641         * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
2642         (remove_forwarder_block_with_phi): Likewise.
2643         (merge_phi_nodes): Likewise.
2644         * tree-complex.c (update_phi_components): Likewise.
2645         * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
2646         * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
2647         (copy_phis_for_bb): Likewise.
2648         * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
2649         * tree-outof-ssa.c (eliminate_build): Likewise.
2650         (eliminate_useless_phis): Likewise.
2651         (rewrite_trees): Likewise.
2652         (insert_backedge_copies): Likewise.
2653         * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
2654         (remove_phi_args): Likewise.
2655         (remove_phi_nodes): Likewise.
2656         * tree-predcom.c (find_looparound_phi): Likewise.
2657         (eliminate_temp_copies): Likewise.
2658         * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
2659         (scev_const_prop): Likewise; also, add checked cast to phi.
2660         * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
2661         * tree-ssa-dce.c (remove_dead_phis): Likewise.
2662         (forward_edge_to_pdom): Likewise.
2663         * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
2664         (cprop_into_successor_phis): Likewise.
2665         (propagate_rhs_into_lhs): Likewise.
2666         (eliminate_degenerate_phis_1): Likewise.
2667         * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
2668         * tree-ssa-live.c (calculate_live_on_exit): Likewise.
2669         (verify_live_on_entry): Likewise.
2670         * tree-ssa-loop-im.c
2671         (move_computations_dom_walker::before_dom_children): Likewise.
2672         * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
2673         (mark_bivs): Likewise.
2674         (find_interesting_uses_outside): Likewise.
2675         (determine_set_costs): Likewise.
2676         * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
2677         (tree_transform_and_unroll_loop): Likewise.
2678         (rewrite_all_phi_nodes_with_iv): Likewise.
2679         (canonicalize_loop_ivs): Likewise.
2680         * tree-ssa-loop-niter.c (determine_value_range): Likewise.
2681         * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
2682         * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
2683         * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
2684         * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
2685         (vop_phi): Likewise.
2686         * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
2687         Likewise.
2688         * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
2689         (copy_phi_args): Likewise.
2690         (phi_args_equal_on_edges): Likewise.
2691         * tree-ssa.c (ssa_redirect_edge): Likewise.
2692         (flush_pending_stmts): Likewise.
2693         * tree-switch-conversion.c (check_final_bb): Likewise.
2694         (gather_default_values): Likewise.
2695         (build_constructors): Likewise.
2696         (fix_phi_nodes): Likewise.
2697         * tree-tailcall.c (propagate_through_phis): Likewise.
2698         (add_successor_phi_arg): Likewise.
2699         * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
2700         Likewise.
2701         (slpeel_update_phi_nodes_for_guard2): Likewise.
2702         (slpeel_tree_peel_loop_to_edge): Likewise.
2703         (vect_can_advance_ivs_p): Likewise.
2704         (vect_update_ivs_after_vectorizer): Likewise.
2705         * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
2706         * tree-vrp.c (find_assert_locations): Likewise.
2707         * value-prof.c (gimple_ic): Likewise.
2709         * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
2711 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2713         Introduce gimple_phi and use it in various places
2715         * coretypes.h (gimple_phi): New typedef.
2716         (const_gimple_phi): New typedef.
2718         * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
2719         variants, using the gimple printer.
2721         * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
2722         vecs of more concrete gimple subclasses as appropriate; also the
2723         comment is about to become misleading.
2725         * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
2726         rather than spelling out the full type.
2727         (gimple_phi_num_args): Likewise.
2728         (gimple_phi_result): Likewise.
2729         (gimple_phi_result_ptr): Use gimple_phi typedef.
2730         (gimple_phi_set_result): Likewise.
2731         (gimple_phi_arg): Likewise.
2732         (gimple_phi_set_arg): Likewise.
2733         * tree-phinodes.c (allocate_phi_node): Likewise.
2734         (resize_phi_node): Likewise.
2735         (reserve_phi_args_for_new_edge): Likewise.
2736         (remove_phi_arg_num): Likewise.
2738         * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
2739         rather than just a gimple.
2740         * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
2742         * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
2743         just a gimple.
2744         (create_phi_node): Likewise.
2745         * tree-phinodes.h (create_phi_node): Likewise.
2747         * trans-mem.c (struct struct tm_log_entry): Replace use of
2748         now-removed gimple_vec with a plain vec<gimple>.
2750         * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
2751         vec<gimple_vec> to a vec< vec<gimple_phi> >.
2753         * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
2754         gimple_phi.
2755         * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
2756         "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
2757         a gimple_phi.
2758         * tree-into-ssa.c (delete_update_ssa): Strengthen local
2759         "phis" from a gimple_vec to a vec<gimple_phi>.
2761         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2762         gimple_phi in regions where a stmt is known to have code
2763         GIMPLE_PHI.
2764         * tree-into-ssa.c (mark_use_interesting): Likewise.
2766 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2768         Introduce gimple_debug and use it in a few places
2770         * coretypes.h (gimple_debug): New typedef.
2771         (const_gimple_debug): New typedef.
2773         * gimple.h (struct gimple_statement_debug): New subclass of
2774         gimple_statement_with_ops, adding the invariant that
2775         stmt->code == GIMPLE_DEBUG.
2776         (is_a_helper <gimple_statement_debug>::test): New.
2778         * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
2779         variants, using the gimple printer.
2781         * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
2782         rather than just a gimple.
2783         * tree-inline.c (copy_debug_stmt): Likewise.
2785         * tree-inline.h (struct copy_body_data): Strengthen field
2786         "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
2788         * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
2789         rather than just a gimple.
2790         (gimple_build_debug_source_bind_stat): Likewise.
2791         * gimple.h (gimple_build_debug_bind_stat): Likewise.
2792         (gimple_build_debug_source_bind_stat): Likewise.
2794         * tree-inline.c (remap_gimple_stmt): Update locals to be a
2795         gimple_debug.
2796         (maybe_move_debug_stmts_to_successors): Likewise.
2797         (copy_debug_stmts): Likewise.
2799         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2800         gimple_debug in regions where a stmt is known to have code
2801         GIMPLE_DEBUG.
2803 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2805         Introduce gimple_label and use it in a few places
2807         * coretypes.h (gimple_label): New typedef.
2808         (const_gimple_label): New typedef.
2810         * gimple.h (struct gimple_statement_label): New subclass of
2811         gimple_statement_with_ops, adding the invariant that
2812         stmt->code == GIMPLE_LABEL.
2813         (is_a_helper <gimple_statement_label>::test): New.
2815         * gdbhooks.py (build_pretty_printer): Add gimple_label and its
2816         variants, reusing the gimple printer.
2818         * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
2819         rather than just a gimple.
2820         * tree-cfg.c (verify_gimple_label): Likewise.
2822         * gimple.c (gimple_build_label): Return a gimple_label rather than
2823         just a gimple.
2824         * gimple.h (gimple_build_label): Likewise.
2826         * gimplify.c (gimplify_case_label_expr): Update local to be a
2827         gimple_label.
2828         * tree-switch-conversion.c (gen_inbound_check): Likewise.
2830         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2831         gimple_label in regions where a stmt is known to have code
2832         GIMPLE_LABEL.
2833         * tree-cfg.c (verify_gimple_stmt): Likewise.
2835 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2837         Introduce gimple_assign and use it in various places
2839         * coretypes.h (gimple_assign): New typedef.
2840         (const_gimple_assign): New typedef.
2842         * gimple.h (struct gimple_statement_assign): New subclass of
2843         gimple_statement_with_memory_ops, adding the invariant that
2844         stmt->code == GIMPLE_ASSIGN.
2845         (is_a_helper <gimple_statement_assign>::test): New.
2847         * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
2848         variants, using the gimple printer.
2850         * gimple-builder.c (build_assign): Return a gimple_assign rather
2851         than just a gimple from each of the overloaded variants.
2852         (build_type_cast): Likewise.
2853         * gimple-builder.h (build_assign): Likewise.
2854         (build_type_cast): Likewise.
2855         * gimple.c (gimple_build_assign_stat): Likewise.
2856         (gimple_build_assign_with_ops): Likewise.
2857         * gimple.h (gimple_build_assign_stat): Likewise.
2858         (gimple_build_assign_with_ops): Likewise.
2860         * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
2861         rather than just a "const gimple" (the latter is not a
2862         "const_gimple").
2863         * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
2864         rather than just a gimple.
2865         (dump_binary_rhs): Likewise.
2866         (dump_ternary_rhs): Likewise.
2867         * tree-cfg.c (verify_gimple_assign_unary): Likewise.
2868         (verify_gimple_assign_binary): Likewise.
2869         (verify_gimple_assign_ternary): Likewise.
2870         (verify_gimple_assign_single): Likewise.
2871         (verify_gimple_assign): Likewise.
2872         * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
2873         (try_to_simplify): Likewise.
2874         * tree-tailcall.c (process_assignment): Likewise.
2875         * tree-vect-generic.c (expand_vector_operation): Likewise.
2876         * tree-vrp.c (extract_range_from_cond_expr): Likewise.
2877         (extract_range_from_assignment): Likewise.
2879         * asan.c (has_stmt_been_instrumented_p): Add checked cast to
2880         gimple_assign in regions where a stmt is known to have code
2881         GIMPLE_ASSIGN.
2882         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2883         * tree-cfg.c (verify_gimple_stmt): Likewise.
2884         * tree-ssa-sccvn.c (visit_use): Likewise.
2885         * tree-tailcall.c (find_tail_calls): Likewise.
2886         * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
2888         * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
2889         against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
2890         a gimple_assign local.
2892         * tree-vect-generic.c (expand_vector_condition): Convert local to a
2893         gimple_assign, adding a checked cast when extracting from gsi, since
2894         this is only called when  underlying stmt has code GIMPLE_ASSIGN.
2895         (optimize_vector_constructor): Likewise.
2896         (lower_vec_perm): Likewise.
2897         (expand_vector_operations_1): Convert local to a gimple_assign,
2898         introducing a dyn_cast.
2900 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2902         Introduce gimple_cond and use it in various places
2904         * coretypes.h (gimple_cond): New typedef.
2905         (const_gimple_cond): Likewise.
2907         * gimple.h (struct gimple_statement_cond): New subclass of
2908         gimple_statement_with_ops, adding the invariant that
2909         stmt->code == GIMPLE_COND.
2910         (is_a_helper <gimple_statement_cond>::test): New.
2911         (gimple_build_cond): Return a gimple_cond, rather than just
2912         a gimple.
2913         (gimple_build_cond_from_tree): Likewise.
2915         * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
2916         variants, using the gimple printer.
2918         * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
2919         than just a gimple.
2920         * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
2921         (gimple_cond_true_p): Likewise.
2922         (gimple_cond_false_p): Likewise.
2923         (gimple_cond_set_condition): Likewise.
2924         * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
2925         * gimple-fold.c (fold_gimple_cond): Likewise.
2926         * gimple-pretty-print.c (dump_gimple_cond): Likewise.
2927         * tree-ssa-dom.c (canonicalize_comparison): Likewise.
2928         * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
2929         * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
2930         (recognize_bits_test): Likewise.
2931         * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
2932         (thread_around_empty_blocks): Likewise.
2933         (thread_through_normal_block): Likewise.
2934         (thread_across_edge): Likewise.
2935         * tree-ssa-threadedge.h (thread_across_edge): Likewise.
2936         * tree-vrp.c (range_fits_type_p): Likewise.
2938         * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
2939         gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
2940         * gimple-fold.c (fold_stmt_1): Likewise.
2941         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2942         * tree-ssa-dom.c (optimize_stmt): Likewise.
2943         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2944         * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
2945         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
2946         Likewise.
2947         * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
2949         * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
2950         gimple_cond.
2951         * tree-vrp.c (identify_jump_threads): Likewise.
2953         * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
2954         just a gimple.
2955         (gimple_build_cond_from_tree): Likewise.
2957         * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
2958         field "m_dummy_cond" from a plain gimple to a gimple_cond.
2960         * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
2961         inner_stmt and outer_stmt so that inner_cond and outer_cond can be
2962         of type gimple_cond once we know that we have code == GIMPLE_COND.
2963         * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
2964         "last" so that stmt can be of type gimple_cond.
2966 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2968         Introduce gimple_bind and use it for accessors.
2970         * coretypes.h (gimple_bind): New typedef.
2971         (const_gimple_bind): New typedef.
2973         * gdbhooks.py (build_pretty_printer): Add gimple_bind
2974         and its variants, using the gimple printer.
2976         * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
2977         require a gimple_bind rather than just a gimple.
2979         * gimple.c (gimple_build_bind): Return a gimple_bind rather than
2980         just a gimple.
2981         * gimple.h (gimple_build_bind): Likewise.
2983         * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
2985         * gimple.h (gimple_bind_vars): Update type-signature to
2986         require a gimple_bind rather than just a gimple, removing
2987         as_a and hence run-time check.
2988         (gimple_bind_set_vars): Likewise.
2989         (gimple_bind_append_vars): Likewise.
2990         (gimple_bind_body_ptr): Likewise.
2991         (gimple_bind_body): Likewise.
2992         (gimple_bind_set_body): Likewise.
2993         (gimple_bind_add_stmt): Likewise.
2994         (gimple_bind_add_seq): Likewise.
2995         (gimple_bind_block): Likewise.
2996         (gimple_bind_set_block): Likewise.
2997         * gimplify.c (gimple_push_bind_expr): Likewise.
2998         (gimple_current_bind_expr): Likewise.
2999         * tree-inline.c (copy_gimple_bind): Likewise.
3001         * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
3002         rather than a plain gimple.
3003         (gimplify_body): Likewise.
3004         (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
3005         a vec<gimple>.
3007         * gimplify.c (struct gimplify_ctx): Strengthen field
3008         "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
3009         (gimple_bind_expr_stack): Likewise for type of returned value.
3011         * gimplify.c (gimplify_body): Strengthen various types from gimple
3012         to gimple_bind, including the return type.
3014         * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
3015         so that local "scope" can be of type gimple_bind once we've reached
3016         the region where it must be of code GIMPLE_BIND.
3018         * gimple-low.c (lower_gimple_bind): Add checked cast to
3019         gimple_bind, since both callers (lower_function_body and
3020         lower_stmt) have checked the code for us.
3022         * gimple.c (gimple_copy): Add checked cast to gimple_bind in
3023         region guarded by check for code GIMPLE_BIND.
3024         * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
3025         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
3026         * gimple-walk.c (walk_gimple_stmt): Likewise.
3027         * omp-low.c (scan_omp_1_stmt): Likewise.
3028         (lower_omp_1): Likewise.
3029         (lower_omp_for): Likewise.
3030         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
3031         (do_warn_unused_result): Likewise.
3032         * tree-inline.c (remap_gimple_stmt): Likewise.
3033         (estimate_num_insns): Likewise.
3034         * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
3036         * gimplify.c (gimplify_bind_expr): Update local(s) to be a
3037         gimple_bind rather than just a gimple.
3038         (gimplify_function_tree): Likewise.
3039         * omp-low.c (lower_omp_sections): Likewise.
3040         (lower_omp_single): Likewise.
3041         (lower_omp_master): Likewise.
3042         (lower_omp_taskgroup): Likewise.
3043         (lower_omp_ordered): Likewise.
3044         (lower_omp_critical): Likewise.
3045         (lower_omp_taskreg): Likewise.
3046         (lower_omp_teams): Likewise.
3047         * omp-low.c (lower_omp_for): Likewise; use
3048         gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
3049         (lower_omp_target): Likewise.
3050         * tree-nested.c (finalize_nesting_tree_1): Likewise.
3052         * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
3053         * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
3055 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
3057         Introduce gimple_switch and use it in various places
3059         * gimple.h (gimple_statement_switch): New subclass of
3060         gimple_statement_with_ops, adding the invariant that
3061         stmt->code == GIMPLE_SWITCH.
3062         (is_a_helper <gimple_statement_switch>::test (gimple)): New.
3064         * coretypes.h (gimple_switch): New typedef
3065         (const_gimple_switch): Likewise.
3067         * gdbhooks.py (build_pretty_printer): Add gimple_switch
3068         and its variants, using the gimple printer.
3070         * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
3071         rather than just a gimple.
3072         (gimple_build_switch): Likewise.
3073         * gimple.h (gimple_build_switch_nlabels): Likewise.
3074         (gimple_build_switch): Likewise.
3076         * gimple.h (gimple_switch_num_labels): Update type-signature to
3077         require a gimple_switch rather than just a gimple.
3078         (gimple_switch_set_num_labels): Likewise.
3079         (gimple_switch_set_index): Likewise.
3080         (gimple_switch_label): Likewise.
3081         (gimple_switch_set_label): Likewise.
3082         (gimple_switch_default_label): Likewise.
3083         (gimple_switch_set_default_label): Likewise.
3084         * expr.h (expand_case): Likewise.
3085         * gimple-pretty-print.c (dump_gimple_call): Likewise.
3086         * stmt.c (compute_cases_per_edge): Likewise.
3087         (expand_case): Likewise.
3088         * tree-cfg.h (group_case_labels_stmt): Likewise.
3089         * tree-cfg.c (make_gimple_switch_edges): Likewise.
3090         (find_taken_edge_switch_expr) Likewise.
3091         (find_case_label_for_value) Likewise.
3092         (get_cases_for_edge): Likewise.
3093         (group_case_labels_stmt): Likewise.
3094         (verify_gimple_switch): Likewise.
3095         * tree-eh.c (verify_norecord_switch_expr): Likewise.
3096         * tree-eh.c (lower_eh_constructs_2): Likewise.
3097         * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
3098         * tree-ssa-dom.c (record_edge_info): Likewise.
3099         * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
3100         (simplify_gimple_switch): Likewise.
3101         * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
3102         (collect_switch_conv_info): Likewise.
3103         (build_constructors): Likewise.
3104         (array_value_type): Likewise.
3105         (build_one_array): Likewise.
3106         (build_arrays): Likewise.
3107         (gen_inbound_check): Likewise.
3108         * tree-vrp.c (find_switch_asserts): Likewise.
3109         (find_case_label_range): Likewise.
3110         (find_case_label_ranges): Likewise.
3111         (vrp_visit_switch_stmt): Likewise.
3112         (simplify_switch_using_ranges): Likewise.
3114         * tree-vrp.c (switch_update): Strengthen field "stmt" from being
3115         merely a gimple to being a gimple_switch.
3117         * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
3118         gimple_switch in regions where the stmt code has been tested as
3119         GIMPLE_SWITCH.
3120         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
3121         * tree-cfg.c (make_edges): Likewise.
3122         (end_recording_case_labels): Likewise.
3123         (cleanup_dead_labels): Likewise.
3124         (cleanup_dead_labels): Likewise.
3125         (group_case_labels): Likewise.
3126         (find_taken_edge): Likewise.
3127         (find_case_label_for_value): Likewise.
3128         (verify_gimple_stmt): Likewise.
3129         (gimple_verify_flow_info): Likewise.
3130         (gimple_redirect_edge_and_branch): Likewise.
3131         * tree-inline.c (estimate_num_insns): Likewise.
3132         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
3133         * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
3134         * tree-switch-conversion.c (do_switchconv): Likewise.
3135         * tree-vrp.c  (find_assert_locations_1): Likewise.
3136         (vrp_visit_stmt): Likewise.
3137         (simplify_stmt_using_ranges): Likewise.
3139         * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
3140         Introduce local "lastg" as a generic gimple, so that local "last"
3141         can be of type gimple_switch once lastg's code has been verified.
3143         * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
3144         the GIMPLE_SWITCH case.
3146         * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
3147         argument, since the caller (find_taken_edge) has checked that
3148         last_stmt is a switch.
3150 Copyright (C) 2014 Free Software Foundation, Inc.
3152 Copying and distribution of this file, with or without modification,
3153 are permitted in any medium without royalty provided the copyright
3154 notice and this notice are preserved.