tree-cfg.c: Make verify_gimple_call require a gimple_call
[official-gcc.git] / gcc / ChangeLog.gimple-classes
blobb030d20852cea7ae60c5eede1944194e52638ff6
1 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
3         tree-cfg.c: Make verify_gimple_call require a gimple_call
5         * tree-cfg.c (verify_gimple_call): Require a gimple_call rather
6         than a plain gimple.
7         (verify_gimple_stmt): Add checked cast to gimple_call within
8         GIMPLE_CALL case of switch statement.
10 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
12         Introduce gimple_omp_parallel
14         * coretypes.h (gimple_omp_parallel): New typedef.
15         (const_gimple_omp_parallel): New typedef.
17         * cgraphbuild.c (build_cgraph_edges): Convert check of code
18         against GIMPLE_OMP_PARALLEL to a dyn_cast <gimple_omp_parallel>
19         and new local.
21         * gimple-pretty-print.c (dump_gimple_omp_parallel): Require a
22         gimple_omp_parallel rather than a plain gimple.
23         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_parallel
24         within GIMPLE_OMP_PARALLEL case of switch statement.
26         * gimple-walk.c (walk_gimple_op): Likewise, introducing a local.
28         * gimple.c (gimple_build_omp_parallel): Return a
29         gimple_omp_parallel rather than a plain gimple.
30         (gimple_copy): Add checked casts to gimple_omp_parallel within
31         GIMPLE_OMP_PARALLEL case of switch statement, introducing locals.
33         * gimple.h (gimple_build_omp_parallel): Return a
34         gimple_omp_parallel rather than a plain gimple.
35         (gimple_omp_parallel_clauses_ptr): Require a gimple_omp_parallel
36         rather than a plain gimple.
37         (gimple_omp_parallel_set_clauses): Likewise.
38         (gimple_omp_parallel_data_arg_ptr): Likewise.
39         (gimple_omp_parallel_set_data_arg): Likewise.
40         (gimple_omp_parallel_child_fn_ptr): Likewise.
41         (gimple_omp_parallel_set_child_fn): Likewise.
42         (gimple_omp_parallel_child_fn): Require a
43         const_gimple_omp_parallel rather than a plain const_gimple.
44         (gimple_omp_parallel_data_arg): Likewise.
46         * omp-low.c (scan_omp_parallel): Strengthen local "stmt" from
47         gimple to gimple_omp_parallel.
48         (expand_parallel_call): Require a gimple_omp_parallel for
49         "entry_stmt" rather than a plain gimple.
50         (remove_exit_barrier):  Strengthen local "parallel_stmt" from
51         gimple to gimple_omp_parallel.
52         (expand_omp_taskreg): Add checked casts to gimple_omp_parallel.
54         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
55         gimple_omp_parallel within GIMPLE_OMP_PARALLEL case of switch
56         statement, introducing local.
58 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
60         Introduce gimple_omp_for
62         * coretypes.h (gimple_omp_for): New.
63         (const_gimple_omp_for): New.
65         * gimple.h (gimple_build_omp_for): Return a gimple_omp_for rather
66         than a plain gimple.
67         (gimple_omp_for_set_kind): Require a gimple_omp_for rather than a
68         plain gimple.
69         (gimple_omp_for_set_combined_p): Likewise.
70         (gimple_omp_for_set_combined_into_p): Likewise.
72         * gimple-pretty-print.c (dump_gimple_omp_for): Require a
73         gimple_omp_for rather than a plain gimple.
74         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_for in
75         GIMPLE_OMP_FOR case of switch statement.
77         * gimple.c (gimple_build_omp_for): Return a gimple_omp_for rather
78         than a plain gimple.
79         (gimple_copy): Add a checked cast to gimple_omp_for and a new local.
81         * gimplify.c (gimplify_omp_for): Strengthen local "gfor" from
82         gimple to gimple_omp_for.
84         * omp-low.c (omp_for_data::for_stmt): Strengthen field from gimple
85         to gimple_omp_for.
86         (extract_omp_for_data): Require a gimple_omp_for rather than a
87         plain gimple.
88         (workshare_safe_to_combine_p): Add a checked cast to
89         gimple_omp_for.
90         (get_ws_args_for): Convert check of code against GIMPLE_OMP_FOR
91         with a dyn_cast<gimple_omp_for> and a new local.
92         (scan_omp_parallel): Add a checked cast to gimple_omp_for and a
93         new local.
94         (scan_omp_for): Require a gimple_omp_for rather than a plain
95         gimple.
96         (scan_omp_1_stmt): Add a checked cast to gimple_omp_for in
97         GIMPLE_OMP_FOR case of switch statement.
98         (expand_omp_for): Add a checked cast to gimple_omp_for.
99         (lower_omp_for): Strengthen local "stmt" from gimple to
100         gimple_omp_for.
102         * tree-nested.c (walk_gimple_omp_for): Require a gimple_omp_for
103         rather than a plain gimple.
104         (convert_nonlocal_reference_stmt): Add a checked cast to
105         gimple_omp_for in GIMPLE_OMP_FOR case of switch statement.
106         (convert_local_reference_stmt): Likewise.
108         * tree-parloops.c (create_parallel_loop): Strengthen local
109         "for_stmt" from gimple to gimple_omp_for.
111 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
113         Introduce gimple_omp_critical
115         * coretypes.h (gimple_omp_critical): New typedef.
116         (const_gimple_omp_critical): New typedef.
118         * gimple-pretty-print.c (dump_gimple_omp_critical): Require a
119         gimple_omp_critical rather than a plain gimple.
120         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_critical
121         within GIMPLE_OMP_CRITICAL case of switch statement.
123         * gimple-walk.c (walk_gimple_op): Likewise.
125         * gimple.c (gimple_build_omp_critical): Return a gimple_omp_critical
126         rather than a plain gimple.
127         (gimple_copy): Add checked casts to gimple_omp_critical
128         within GIMPLE_OMP_CRITICAL case of switch statement.
130         * gimple.h (gimple_debug): Likewise.
131         (gimple_build_omp_critical): Return a gimple_omp_critical rather
132         than a plain gimple.
133         (gimple_omp_critical_name): Require a const_gimple_omp_critical
134         rather than a plain const_gimple.
135         (gimple_omp_critical_name_ptr): Require a gimple_omp_critical
136         rather than a plain gimple.
137         (gimple_omp_critical_set_name): Likewise.
139         * omp-low.c (check_omp_nesting_restrictions): Add a checked cast
140         to gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
141         statement, introducing a new local "other_crit" for type-safety.
142         (lower_omp_critical): Strengthen local "stmt" to
143         gimple_omp_critical.
145         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
146         gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
147         statement.
149 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
151         Introduce gimple_omp_continue
153         * coretypes.h (gimple_omp_continue): New typedef.
154         (const_gimple_omp_continue): New typedef.
156         * gimple.h (gimple_build_omp_continue): Return a
157         gimple_omp_continue rather than a plain gimple.
158         (gimple_omp_continue_control_def): Require a
159         const_gimple_omp_continue rather than a plain const_gimple.
160         (gimple_omp_continue_control_use): Likewise.
161         (gimple_omp_continue_control_def_ptr): Require a gimple_omp_continue
162         rather than a plain gimple.
163         (gimple_omp_continue_set_control_def): Likewise.
164         (gimple_omp_continue_control_use_ptr): Likewise.
165         (gimple_omp_continue_set_control_use): Likewise.
167         * gimple-pretty-print.c (dump_gimple_omp_continue): Require a
168         gimple_omp_continue rather than a plain gimple.
169         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_continue
170         within GIMPLE_OMP_CONTINUE case of switch statement.
172         * gimple-walk.c (walk_gimple_op): Likewise, adding a new local.
174         * gimple.c (gimple_build_omp_continue): Return a
175         gimple_omp_continue rather than a plain gimple.
177         * omp-low.c (gimple_build_cond_empty): Return a gimple_cond
178         rather than a plain gimple.
179         (expand_omp_for_generic): Split local "stmt" into "assign_stmt",
180         "cont_stmt", "cond_stmt", "call_stmt" of types gimple_assign,
181         gimple_omp_continue, gimple_cond, gimple_call respectively.
182         (expand_omp_for_static_nochunk): Likewise, splitting into two
183         "cond_stmt" decls. "assign_stmt", "cont_stmt"
184         (expand_omp_for_static_chunk): Likewise, splitting into
185         "cond_stmt", "assign_stmt", "cont_stmt".
186         (expand_omp_sections): Strengthen local "cont" from gimple to
187         gimple_omp_continue.
189 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
191         Introduce gimple_omp_atomic_store
193         * coretypes.h (gimple_omp_atomic_store): New typedef.
194         (const_gimple_omp_atomic_store): New typedef.
196         * gimple-pretty-print.c (dump_gimple_omp_atomic_store): Require
197         a gimple_omp_atomic_store rather than a plain gimple.
198         (pp_gimple_stmt_1): Add checked cast to gimple_omp_atomic_store
199         within GIMPLE_OMP_ATOMIC_STORE case of switch statement.
200         * gimple-walk.c (walk_gimple_op): Likewise.
202         * gimple.c (gimple_build_omp_atomic_store): Return a
203         gimple_omp_atomic_store rather than a plain gimple.
205         * gimple.h (gimple_build_omp_atomic_store): Return a
206         gimple_omp_atomic_store rather than a plain gimple.
207         (gimple_omp_atomic_store_set_val): Require a gimple_omp_atomic_store
208         rather than a plain gimple.
209         (gimple_omp_atomic_store_val_ptr): Likewise.
210         (gimple_omp_atomic_store_val): Require a
211         const_gimple_omp_atomic_store rather than a plain const_gimple.
213         * gimplify.c (gimplify_omp_atomic): Strengthen locals "loadstmt" and
214         "storestmt" from gimple to gimple_omp_atomic_load loadstmt and
215         gimple_omp_atomic_store storestmt respectively.
217         * omp-low.c (expand_omp_atomic): Strengthen local "store" from
218         gimple to gimple_omp_atomic_store.
220 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
222         Introduce gimple_omp_atomic_load
224         * coretypes.h (gimple_omp_atomic_load): New typedef.
225         (const_gimple_omp_atomic_load): New typedef.
227         * gimple-pretty-print.c (dump_gimple_omp_atomic_load): Require a
228         gimple_omp_atomic_load rather than a plain gimple.
229         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_atomic_load
230         within GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
232         * gimple-walk.c (walk_gimple_op): Likewise, introducing a new local.
234         * gimple.c (gimple_build_omp_atomic_load): Return a
235         gimple_omp_atomic_load rather than a plain gimple.
237         * gimple.h (gimple_build_omp_atomic_load): Return a
238         gimple_omp_atomic_load rather than a plain gimple.
239         (gimple_omp_atomic_load_set_lhs): Require a
240         gimple_omp_atomic_load rather than a plain gimple.
241         (gimple_omp_atomic_load_lhs_ptr): Likewise.
242         (gimple_omp_atomic_load_set_rhs): Likewise.
243         (gimple_omp_atomic_load_rhs_ptr): Likewise.
244         (gimple_omp_atomic_load_lhs): Require a
245         const_gimple_omp_atomic_load rather than a plain const_gimple.
246         (gimple_omp_atomic_load_rhs): Likewise.
248         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
249         to gimple_omp_atomic_load within GIMPLE_OMP_ATOMIC_LOAD case of
250         switch statement.
252         * omp-low.c (expand_omp_atomic): Strengthen type of local "load"
253         from gimple to gimple_omp_atomic_load.
254         (lower_omp_1): Add a checked cast to gimple_omp_atomic_load within
255         GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
257 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
259         Use more concrete types for various gimple statements
261         * cgraphunit.c (thunk_adjust): Strengthen local "stmt" from gimple
262         to gimple_assign.
264         * gimple-ssa-isolate-paths.c
265         (insert_trap_and_remove_trailing_statements): Strengthen local
266         "new_stmt" from gimple to gimple_call.
268         * gimple-ssa-strength-reduction.c (replace_mult_candidate):
269         Strengthen local "copy_stmt" from gimple to gimple_assign.
270         (create_add_on_incoming_edge): Likewise, for "new_stmt".
271         (insert_initializers): Likewise, for "init_stmt".
272         (introduce_cast_before_cand): Likewise, for "cast_stmt".
273         (replace_one_candidate): Likewise, for "copy_stmt" and
274         "cast_stmt".
276         * gimplify.c (build_stack_save_restore): Require gimple_calls
277         rather than plain gimples.
278         (gimplify_bind_expr): Strengthen locals "stack_save" and
279         "stack_restore" from gimple to gimple_call.  Strengthen "gs"
280         to gimple_try.
281         (gimplify_switch_expr): Strengthen local "gimple_switch" from
282         gimple to gimple_switch, and "new_default" to gimple_label.
283         (gimplify_cond_expr): Strengthen local "gimple_cond" from gimple
284         to gimple_cond.
285         (gimplify_init_constructor): Strengthen local "init" from gimple
286         to gimple_assign.
287         (gimplify_cleanup_point_expr): Strengthen local "gtry" from gimple
288         to gimple_try.
289         (gimple_push_cleanup): Strengthen locals "ffalse" and "ftrue" from
290         gimple to gimple_assign.
292         * tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
293         (emit_post_landing_pad): Strengthen local to gimple_label.
295         * tree-outof-ssa.c (insert_backedge_copies): Strengthen local
296         "stmt" from gimple to gimple_assign.
298         * tree-parloops.c (take_address_of): Likewise.
300         * tree-predcom.c (replace_ref_with): Likewise, for "new_stmt".
301         (initialize_root_vars_lm): Likewise, for "init_stmt".
302         (reassociate_to_the_same_stmt): Likewise, for "new_stmt" and "tmp_stmt".
304         * tree-profile.c (gimple_gen_edge_profiler): Likewise, for "stmt1",
305         "stmt2", "stmt3".
306         (gimple_gen_ic_profiler): Likewise.
307         (gimple_gen_ic_func_profiler): Strengthen local "stmt1" from
308         gimple to gimple_call, and "stmt2" to gimple_assign.
310         * tree-scalar-evolution.c (scev_const_prop): Strengthen local
311         "ass" from gimple to gimple_assign.
313         * tree-sra.c (build_ref_for_offset): Likewise for "stmt".
314         (generate_subtree_copies): Likewise; also strengthen "ds" to
315         gimple_debug.
316         (init_subtree_with_zero): Likewise.
317         (sra_modify_expr): Likewise.
318         (load_assign_lhs_subreplacements): Likewise.
319         (sra_modify_assign): Strengthen "ds" to gimple_debug.
320         (sra_ipa_reset_debug_stmts): Likewise for "def_temp".
322         * tree-ssa-ccp.c (insert_clobber_before_stack_restore):
323         Strengthen local "clobber_stmt" from gimple to gimple_assign.
325         * tree-ssa-dce.c (remove_dead_stmt): Strengthen "note" to
326         gimple_debug.
328         * tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
329         local "new_stmt" from gimple to gimple_assign.
330         (optimize_stmt): Likewise.
332         * tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
333         4 declarations of "newop".
334         (simplify_rotate): Likewise for "g".
336         * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
337         (rewrite_bittest): Likewise for "stmt" and "stmt2".
338         (move_computations_dom_walker::before_dom_children): Likewise for
339         "new_stmt".
340         (execute_sm): Likewise for "load" and "store".
342         * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
343         Strengthen local "stmt" from gimple to gimple_call.
344         (unloop_loops): Likewise.
346         * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
347         local "ass" from gimple to gimple_assign.
348         (remove_unused_ivs): Strengthen "def_temp" to gimple_debug.
350         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local "stmt"
351         from gimple to gimple_assign.
353         * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
354         "prefetch" from gimple to gimple_call.
356         * tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
357         "new_stmt" from gimple to gimple_assign.
358         (powi_as_mults_1): Likewise for "mult_stmt".
359         (powi_as_mults): Likewise for "div_stmt".
360         (build_and_insert_binop): Likewise for "stmt".
361         (build_and_insert_cast): Likewise.
362         (pass_cse_sincos::execute): Likewise for "stmt" and various decls
363         of "new_stmt".
364         (convert_mult_to_fma): Likewise for "fma_stmt".
366         * tree-ssa-phiopt.c (conditional_replacement): Likewise for "new_stmt".
367         (abs_replacement): Likewise.
369         * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for "tmp".
371         * tree-ssa-pre.c (create_expression_by_pieces): Likewise for "newstmt".
372         (eliminate_insert): Likewise for "tem".
374         * tree-ssa-propagate.c (update_gimple_call): Strengthen locals
375         "new_stmt" and "stmt" from gimple to gimple_call.
376         (update_call_from_tree): Likewise for "new_stmt".
378         * tree-ssa-reassoc.c (build_and_add_sum): Likewise for "sum".
379         (update_ops): Likewise for "g".
380         (maybe_optimize_range_tests): Likewise.
381         (rewrite_expr_tree_parallel): Require a gimple_assign rather than
382         a plain gimple.
383         (reassociate_bb): Add a checked cast to gimple_assign.
385         * tree-ssa.c (insert_debug_temp_for_var_def): Strengthen local
386         "def_temp" from gimple to gimple_debug.
388         * tree-switch-conversion.c (emit_case_bit_tests): Strengthen local
389         "shift_stmt" from gimple to gimple_assign.
391         * tree-tailcall.c (adjust_return_value_with_ops): Likewise for
392         "stmt".
393         (update_accumulator_with_ops): Likewise.
395         * tree-vect-data-refs.c (bump_vector_ptr): Likewise for
396         "incr_stmt".
398         * tree-vect-stmts.c (vectorizable_condition): Likewise for
399         "new_stmt".
401         * tree-vrp.c (build_assert_expr_for): Likewise for "assertion".
402         (simplify_truth_ops_using_ranges): Likewise for "newop".
403         (simplify_float_conversion_using_ranges): Likewise for "conv".
405         * ubsan.c (instrument_mem_ref): Strengthen local "g" from gimple
406         to gimple_call.
408         * value-prof.c (gimple_divmod_fixed_value): Require a
409         gimple_assign rather than a plain gimple; strengthen types of locals.
410         (gimple_mod_pow2): Likewise.
411         (gimple_mod_subtract): Likewise.
412         (gimple_divmod_fixed_value_transform): Strengthen local
413         "stmt" from gimple to gimple_assign.
414         (gimple_mod_pow2_value_transform): Likewise.
415         (gimple_mod_subtract_transform): Likewise.
416         (gimple_ic): Strengthen types of locals.
418 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
420         Introduce gimple_try
422         * coretypes.h (gimple_try): New typedef.
423         (const_gimple_try): New typedef.
425         * gimple-low.c (gimple_try_catch_may_fallthru): Require a
426         gimple_try rather than a plain gimple.
427         (gimple_stmt_may_fallthru): Add checked cast to gimple_try.
429         * gimple-pretty-print.c (dump_gimple_try): Require a gimple_try
430         rather than a plain gimple.
431         (pp_gimple_stmt_1): Add checked cast to gimple_try within
432         GIMPLE_TRY case of switch statement.
434         * tree-eh.c (finally_tree_node::parent): Strengthen field from
435         gimple to gimple_try.
436         (record_in_finally_tree): Require a gimple_try rather than a plain
437         gimple.
438         (collect_finally_tree): Likewise.
439         (collect_finally_tree_1): Likewise.
440         (struct leh_tf_state::try_finally_expr): Strengthen field from
441         gimple to gimple_try.
442         (struct leh_tf_state::top_p): Likewise.
443         (lower_eh_must_not_throw): Require a gimple_try rather than a
444         plain gimple.
445         (frob_into_branch_around): Likewise.
446         (lower_try_finally_dup_block): Strengthen local from gimple to
447         gimple_try.
448         (honor_protect_cleanup_actions): Split out uses of "x" into new
449         locals "eh_mnt" and "try_stmt" with stronger types.
450         (lower_try_finally): Require a gimple_try rather than a plain
451         gimple.
452         (lower_catch): Likewise.
453         (lower_eh_filter): Likewise.
454         (lower_eh_must_not_throw): Likewise.
455         (lower_cleanup): Likewise.
456         (lower_eh_constructs_2): Add checked cast to gimple_try within
457         GIMPLE_TRY case of switch statement, introducing new local
458         "try_stmt", using it for type-safety.
460 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
462         Use subclasses of gimple in various places
464         * asan.c (insert_if_then_before_iter): Require a gimple cond
465         rathern than a plain gimple.
466         (asan_expand_check_ifn): Add a checked cast to gimple_cond.
468         * cfgloopmanip.c (create_empty_if_region_on_edge): Likewise.
470         * omp-low.c (simd_clone_adjust): Strengthen local from gimple
471         to gimple_phi.
473         * sese.c (set_ifsese_condition): Strengthen local from gimple to
474         gimple_cond.
476         * tree-call-cdce.c (gen_one_condition): Strengthen locals from
477         gimple to gimple_assign and gimple_cond.
479         * tree-ssa-phiopt.c (minmax_replacement): Likewise.
480         (cond_store_replacement): Strengthen locals from gimple to
481         gimple_phi and gimple_assign.
482         (cond_if_else_store_replacement_1): Likewise.
484         * tree-ssa-pre.c (do_regular_insertion): Strengthen local from
485         gimple to gimple_assign.
487         * tree-switch-conversion.c (hoist_edge_and_branch_if_true):
488         Strengthen local from gimple to gimple_cond.
489         (gen_def_assigns): Return a gimple_assign rather than a plain
490         gimple.
491         (gen_inbound_check): Strengthen locals from gimple to gimple_cond
492         and gimple_assign.
494         * tree-vect-loop-manip.c (slpeel_add_loop_guard): Strengthen local
495         from gimple to gimple_cond.
496         (set_prologue_iterations): Strengthen locals from gimple to
497         gimple_phi and gimple_cond.
499         * value-prof.c (gimple_ic): Strengthen local from gimple to
500         gimple_phi.
501         (gimple_stringop_fixed_value): Strengthen locals from gimple to
502         gimple_assign, gimple_cond, gimple_call, and gimple_phi.
504 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
506         Introduce gimple_eh_dispatch
508         * coretypes.h (gimple_eh_dispatch): New typedef.
509         (const_gimple_eh_dispatch): New typedef.
511         * gimple-pretty-print.c (dump_gimple_eh_dispatch): Require a
512         gimple_eh_dispatch rather than a plain gimple.
513         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_dispatch
514         within GIMPLE_EH_DISPATCH case of switch statement.
516         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
518         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
520         * gimple.c (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
521         rather than a plain gimple.
523         * gimple.h (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
524         rather than a plain gimple.
525         (gimple_eh_dispatch_region): Require a const_gimple_eh_dispatch
526         rather than a plain const_gimple.
527         (gimple_eh_dispatch_set_region): Require a gimple_eh_dispatch
528         rather than a plain gimple.
530         * tree-cfg.c (make_edges): Add a checked cast to gimple_eh_dispatch
531         within GIMPLE_EH_DISPATCH case of switch statement.
532         (gimple_verify_flow_info): Likewise.
533         (gimple_redirect_edge_and_branch): Likewise.
534         (move_stmt_r): Likewise, adding a local.
536         * tree-eh.c (emit_eh_dispatch): Convert local from gimple to
537         gimple_eh_dispatch.
538         (make_eh_dispatch_edges): Require a gimple_eh_dispatch rather than
539         a plain gimple.
540         (redirect_eh_dispatch_edge): Likewise.
541         (lower_eh_dispatch): Likewise.
542         (execute_lower_eh_dispatch): Add a checked cast to
543         gimple_eh_dispatch.
544         (mark_reachable_handlers): Likewise.
545         (verify_eh_dispatch_edge): Require a gimple_eh_dispatch rather
546         than a plain gimple.
548         * tree-eh.h (make_eh_dispatch_edges): Likewise.
549         (redirect_eh_dispatch_edge): Likewise.
550         (verify_eh_dispatch_edge): Likewise.
552         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
553         gimple_eh_dispatch within GIMPLE_EH_DISPATCH case of switch
554         statement, adding a local.
555         (copy_edges_for_bb): Add a checked cast to gimple_eh_dispatch.
557 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
559         Introduce gimple_resx
561         * coretypes.h (gimple_resx): New typedef.
562         (const_gimple_resx): New typedef.
564         * gimple.h (gimple_build_resx): Return a gimple_resx rather than a
565         plain gimple.
566         (gimple_resx_region): Require a const_gimple_resx rather than a
567         plain const_gimple.
568         (gimple_resx_set_region): Require a gimple_resx rather than a
569         plain gimple.
571         * gimple-pretty-print.c (dump_gimple_resx): Require a gimple_resx
572         rather than a plain gimple.
573         (pp_gimple_stmt_1): Add a checked cast to gimple_resx within
574         GIMPLE_RESX case of switch statement.
576         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
578         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
580         * gimple.c (gimple_build_resx): Return a gimple_resx rather than
581         a plain gimple.
583         * tree-cfg.c (move_stmt_r): Add a checked cast to gimple_resx
584         within GIMPLE_RESX case of switch statement, adding a new local.
586         * tree-eh.c (emit_resx): Convert local "x" from gimple to
587         gimple_resx.
588         (lower_resx): Require a gimple_resx rather than a plain gimple.
589         (pass_lower_resx::execute): Add a checked cast to gimple_resx.
590         (mark_reachable_handlers): Likewise.
592         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
593         gimple_resx within GIMPLE_RESX case of switch statement, adding
594         a new local.
596 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
598         Introduce gimple_eh_else
600         * coretypes.h (gimple_eh_else): New typedef.
601         (const_gimple_eh_else): New typedef.
603         * gimple.h (gimple_build_eh_else): Return a gimple_eh_else rather
604         than a plain gimple.
605         (gimple_eh_else_n_body_ptr): Require a gimple_eh_else rather than
606         a plain gimple.
607         (gimple_eh_else_n_body): Likewise.
608         (gimple_eh_else_e_body_ptr): Likewise.
609         (gimple_eh_else_e_body): Likewise.
610         (gimple_eh_else_set_n_body): Likewise.
611         (gimple_eh_else_set_e_body): Likewise.
613         * gimple-low.c (lower_stmt): Add checked cast to gimple_eh_else
614         within GIMPLE_EH_ELSE case of switch statement, introducing a new
615         local.
616         (gimple_stmt_may_fallthru): Likewise.
618         * gimple-pretty-print.c (dump_gimple_eh_else): Require a
619         gimple_eh_else rather than a plain gimple.
620         (pp_gimple_stmt_1): Add checked cast to gimple_eh_else within
621         GIMPLE_EH_ELSE case of switch statement
623         * gimple-walk.c (walk_gimple_stmt): Add checked cast to
624         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
625         introducing a new local.
627         * gimple.c (gimple_build_eh_else): Return a gimple_eh_else
628         rather than a plain gimple.
629         (gimple_copy): Add checked casts to gimple_eh_else within
630         GIMPLE_EH_ELSE case of switch statement, introducing new locals.
632         * tree-cfg.c (verify_gimple_in_seq_2): Add checked cast to
633         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
634         introducing a new local.
636         * tree-eh.c (collect_finally_tree): Likewise.
637         (replace_goto_queue_1): Likewise.
638         (get_eh_else): Return a gimple_eh_else rather than a plain gimple.
639         (honor_protect_cleanup_actions): Convert local "eh_else" from
640         gimple to gimple_eh_else.
641         (lower_try_finally_nofallthru): Likewise.
642         (lower_try_finally_onedest): Introduce locals "eh_else" and
643         "label_stmt", using them in favor of "x" for the gimple_eh_else
644         and the gimple_label.
645         (lower_try_finally_copy): Convert local "eh_else" from gimple to
646         gimple_eh_else.
647         (lower_try_finally_switch): Likewise.
648         (decide_copy_try_finally): Likewise.
649         (refactor_eh_r): Add checked cast to gimple_eh_else within
650         GIMPLE_EH_ELSE case of switch statement, introducing a new local.
652 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
654         Introduce gimple_eh_must_not_throw
656         * coretypes.h (gimple_eh_must_not_throw): New typedef.
657         (const_gimple_eh_must_not_throw): New typedef.
659         * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
660         a gimple_eh_must_not_throw rather than a plain gimple.
661         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
662         within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
664         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
666         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
668         * gimple.c (gimple_build_eh_must_not_throw): Return a
669         gimple_eh_must_not_throw rather than a plain gimple.
671         * gimple.h (gimple_build_eh_must_not_throw): Return a
672         gimple_eh_must_not_throw rather than a plain gimple.
673         (gimple_eh_must_not_throw_fndecl): Require a
674         gimple_eh_must_not_throw rather than a plain gimple.
675         (gimple_eh_must_not_throw_set_fndecl): Likewise.
677         * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
679 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
681         Introduce gimple_eh_filter
683         * coretypes.h (gimple_eh_filter): New typedef.
684         (const_gimple_eh_filter): New typedef.
686         * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
687         rather than a plain gimple.
689         * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
690         gimple_eh_filter rather than a plain gimple.
691         (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
692         GIMPLE_EH_FILTER case of switch statement.
694         * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
695         rather than a plain gimple.
697 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
699         Introduce gimple_catch
701         * coretypes.h (gimple_catch): New typedef.
702         (const_gimple_catch): New typedef.
704         * gimple-low.c (lower_try_catch): Add checked cast to gimple_catch.
705         (gimple_try_catch_may_fallthru): Likewise.
707         * gimple-pretty-print.c (dump_gimple_catch): Require a gimple_catch
708         rather than a plain gimple.
709         (pp_gimple_stmt_1): Add checked cast to gimple_catch within
710         GIMPLE_CATCH case of switch statement.
712         * gimple-walk.c (walk_gimple_op): Likewise.
713         (walk_gimple_stmt): Likewise.
715         * gimple.c (gimple_build_catch): Return a gimple_catch rather than
716         a plain gimple.
717         (gimple_copy): Add checked casts to gimple_catch within
718         GIMPLE_CATCH case of switch statement, introducing new locals.
720         * gimple.h (gimple_build_catch): Return a gimple_catch rather than
721         a plain gimple.
722         (gimple_catch_types_ptr): Require a gimple_catch rather than a
723         plain gimple.
724         (gimple_catch_handler_ptr): Likewise.
725         (gimple_catch_handler): Likewise.
726         (gimple_catch_set_types): Likewise.
727         (gimple_catch_set_handler): Likewise.
729         * omp-low.c (lower_omp_1): Add checked cast to gimple_catch within
730         GIMPLE_CATCH case of switch statement.
732         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
733         (do_warn_unused_result): Likewise.
735         * tree-eh.c (collect_finally_tree): Likewise.
736         (replace_goto_queue_1): Likewise.
737         (lower_catch): Convert local from gimple to gimple_catch.
738         (refactor_eh_r): Add checked cast to gimple_catch within
739         GIMPLE_CATCH case of switch statement.
741         * tree-inline.c (remap_gimple_stmt): Likewise.
742         (estimate_num_insns): Add checked cast to gimple_catch within
743         GIMPLE_CATCH case of switch statement, introducing new local.
745 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
747         Introduce gimple_transaction
749         * coretypes.h (gimple_transaction): New typedef.
750         (const_gimple_transaction): New typedef.
752         * gimple.h (gimple_build_transaction): Return a gimple_transaction
753         rather than a plain gimple.
754         (gimple_transaction_body_ptr): Require a gimple_transaction rather
755         than a plain gimple.
756         (gimple_transaction_body): Likewise.
757         (gimple_transaction_label_ptr): Likewise.
758         (gimple_transaction_set_body): Likewise.
759         (gimple_transaction_set_label): Likewise.
760         (gimple_transaction_set_subcode): Likewise.
761         (gimple_transaction_label): Require a const_gimple_transaction
762         rather than a plain const_gimple.
763         (gimple_transaction_subcode): Likewise.
765         * gimple-low.c (lower_stmt): Add checked cast to
766         gimple_transaction within GIMPLE_TRANSACTION case of switch
767         statement.
769         * gimple-pretty-print.c (dump_gimple_transaction): Require a
770         gimple_transaction rather than a plain gimple.
771         (pp_gimple_stmt_1): Add checked cast to gimple_transaction within
772         GIMPLE_TRANSACTION case of switch statement.
773         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
774         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
775         * gimple-walk.c (walk_gimple_op): Likewise.
776         (walk_gimple_stmt): Likewise.
778         * gimple.c (gimple_build_transaction): Return a gimple_transaction
779         rather than a plain gimple.
780         (gimple_copy): Add checked casts to gimple_transaction within
781         GIMPLE_TRANSACTION case of switch statement.
783         * gimplify.c (gimplify_transaction): Split local "g" into
784         "body_stmt" and "trans_stmt", strengthening the type of the latter
785         from gimple to gimple_transaction.
787         * omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
788         within GIMPLE_TRANSACTION case of switch statement.
790         * trans-mem.c (diagnose_tm_1): Add checked cast within
791         GIMPLE_TRANSACTION case of switch statement, introducing a new
792         local "trans_stmt".  Use it in place of "stmt".
793         (examine_call_tm): Convert local from gimple to gimple_transaction.
794         (tm_region::get_transaction_stmt): New method.
795         (tm_region::transaction_stmt): Add clarification of type to the
796         comment.
797         (tm_region_init_0): Require a gimple_transaction rather than a
798         plain gimple.
799         (tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
800         dyn_cast<gimple_transaction> and new local.
801         (transaction_subcode_ior): Add a new local, using the new
802         get_transaction_stmt method to perform a checked cast.
803         (propagate_tm_flags_out): Likewise.
804         (expand_transaction): Add a checked cast using the new
805         get_transaction_stmt method.
806         (generate_tm_state): Likewise.
807         (execute_tm_mark): Likewise.
808         (ipa_tm_diagnose_transaction): Likewise.
810         * tree-cfg.c (verify_gimple_transaction): Require a
811         gimple_transaction rather than a plain gimple.
812         (make_edges): Add checked cast within GIMPLE_TRANSACTION case of
813         switch statement
814         (cleanup_dead_labels): Likewise.
815         (verify_gimple_stmt): Likewise.
816         (verify_gimple_in_seq_2): Likewise.
817         (verify_gimple_in_seq_2): Likewise.
818         (gimple_redirect_edge_and_branch): Add checked cast.
820         * tree-inline.c (remap_gimple_stmt): Add checked cast within
821         GIMPLE_TRANSACTION case of switch statement, introducing a new
822         local "old_trans_stmt".  Use it in place of "stmt".  Add new
823         local "new_trans_stmt", using it to initialize "copy", and for
824         type-safe operations as a transaction.
825         (estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
826         case of switch statement.
828 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
830         Introduce gimple_asm
832         * coretypes.h (gimple_asm): New typedef.
833         (const_gimple_asm): New typedef.
835         * gimple.h (gimple_build_asm_vec): Return a gimple_asm rather than
836         just a gimple.
837         (gimple_asm_clobbers_memory_p): Require a const_gimple_asm rather
838         than just a const_gimple.
839         (gimple_asm_ninputs): Likewise.
840         (gimple_asm_noutputs): Likewise.
841         (gimple_asm_nclobbers): Likewise.
842         (gimple_asm_nlabels): Likewise.
843         (gimple_asm_input_op): Likewise.
844         (gimple_asm_input_op_ptr): Likewise.
845         (gimple_asm_output_op): Likewise.
846         (gimple_asm_output_op_ptr): Likewise.
847         (gimple_asm_clobber_op): Likewise.
848         (gimple_asm_label_op): Likewise.
849         (gimple_asm_string): Likewise.
850         (gimple_asm_volatile_p): Likewise.
851         (gimple_asm_input_p): Likewise.
852         (gimple_asm_set_input_op): Require a gimple_asm rather than a plain
853         gimple.
854         (gimple_asm_set_output_op): Likewise.
855         (gimple_asm_set_clobber_op): Likewise.
856         (gimple_asm_set_label_op): Likewise.
857         (gimple_asm_set_volatile): Likewise.
858         (gimple_asm_set_input): Likewise.
860         * cfgexpand.c (expand_asm_stmt): Require a gimple_asm rather than
861         a plain gimple.
862         (expand_gimple_stmt_1): Add checked cast to gimple_asm within
863         GIMPLE_ASM case of switch statement.
865         * gimple-fold.c (fold_stmt_1): Add new local from checked cast to
866         gimple_asm within case GIMPLE_ASM.
868         * gimple-pretty-print.c (dump_gimple_asm): Require a gimple_asm
869         rather than a plain gimple.
870         (pp_gimple_stmt_1): Add checked cast to gimple_asm within
871         GIMPLE_ASM case of switch statement.
873         * gimple-streamer-in.c (input_gimple_stmt): Rework existing
874         checked cast to gimple_asm; add a new one.
876         * gimple-streamer-out.c (output_gimple_stmt): Add new local from
877         checked cast to gimple_asm within case GIMPLE_ASM.
879         * gimple-walk.c (walk_gimple_asm): Require a gimple_asm rather
880         than a plain gimple.
881         (walk_gimple_op): Add checked cast to gimple_asm within GIMPLE_ASM
882         case of switch statement.
883         (walk_stmt_load_store_addr_ops): Use dyn_cast<gimple_asm> in place
884         of a code check against GIMPLE_ASM to introduce a new gimple_asm
885         local.
887         * gimple.c (gimple_build_asm_1): Return a gimple_asm rather than
888         a plain gimple.
889         (gimple_build_asm_vec): Likewise.
890         (gimple_has_side_effects): Add a checked cast to gimple_asm.
891         (gimple_could_trap_p_1): Likewise.
892         (gimple_call_builtin_p): Require a const_gimple_asm rather then
893         a const_gimple.
895         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
896         and a new local of type gimple_asm within GIMPLE_ASM case.
898         * gimplify.c (gimplify_asm_expr): Convert a local from gimple to
899         gimple_asm.
901         * ipa-pure-const.c (check_stmt): Add checked casts within
902         GIMPLE_ASM case.
904         * ssa-iterators.h (op_iter_init): Likewise.
906         * tree-cfg.c (make_goto_expr_edges): Convert a local from gimple
907         to gimple_asm.
908         (cleanup_dead_labels): Add a checked cast and a new local of type
909         gimple_asm within GIMPLE_ASM case.
910         (gimple_redirect_edge_and_branch): Likewise.
911         (is_ctrl_altering_stmt): Add a checked cast.
912         (need_fake_edge_p): Replace a code check against GIMPLE_ASM with a
913         dyn_cast<gimple_asm>.
915         * tree-complex.c (expand_complex_comparison): Convert a local from
916         gimple to gimple_asm.
918         * tree-data-ref.c (get_references_in_stmt): Add a checked cast to
919         gimple_asm.
921         * tree-eh.c (stmt_could_throw_p): Likewise.
923         * tree-inline.c (estimate_num_insns): Likewise.
925         * tree-sra.c (scan_function): Add a checked cast and a new local
926         of type gimple_asm within GIMPLE_ASM case.
927         (sra_modify_function_body): Likewise.
928         (ipa_sra_modify_function_body): Likewise.
930         * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
932         * tree-ssa-dce.c (propagate_necessity): Replace a code check
933         against GIMPLE_ASM with a dyn_cast<gimple_asm>.
935         * tree-ssa-operands.c (maybe_add_call_vops): Require a gimple_asm
936         rather than a plain gimple.
937         (parse_ssa_operands): Add a checked cast to gimple_asm.
939         * tree-ssa-structalias.c (find_func_aliases): Replace a check for
940         GIMPLE_ASM with a dyn_cast<gimple_asm>, introducing  a new local
941         "asm_stmt", using it in place of "t" for typesafety.
943         * tree-ssa-threadedge.c
944         (record_temporary_equivalences_from_stmts_at_dest): Add a checked
945         cast to gimple_asm.
947         * tree-ssa.c (execute_update_addresses_taken): Add checked casts
948         and new locals of type gimple_asm within clauses guarded by code
949         check.
951 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
953         Introduce gimple_goto
955         * coretypes.h (gimple_goto): New typedef.
956         (const_gimple_goto): New typedef.
958         * gimple.h (gimple_statement_goto): New subclass of
959         gimple_statement_with_ops, adding the invariant that
960         stmt->code == GIMPLE_GOTO.
961         (is_a_helper <gimple_statement_goto>::test): New.
962         (gimple_build_goto): Return a gimple_goto rather than a
963         plain gimple.
965         * gimple-pretty-print.c (dump_gimple_goto): Require a gimple_goto
966         rather than a plain gimple.
967         (pp_gimple_stmt_1): Add a checked cast to gimple_goto within
968         GIMPLE_GOTO case of switch statement.
970         * gimple.c (gimple_build_goto): Return a gimple_goto rather than a
971         plain gimple.
973         * tree-cfg.c (verify_gimple_goto): Require a gimple_goto rather
974         than a plain gimple.
975         (verify_gimple_stmt): Add a checked cast to gimple_goto within
976         GIMPLE_GOTO case of switch statement.
978 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
980         Introduce gimple_return
982         * coretypes.h (gimple_return): New typedef.
983         (const_gimple_return): New typedef.
985         * gimple.h (gimple_statement_return): New subclass of
986         gimple_statement_with_memory_ops, adding the invariant that
987         stmt->code == GIMPLE_RETURN.
988         (is_a_helper <gimple_statement_return>::test): New.
989         (gimple_build_return): Return a gimple_return rather
990         than a plain gimple.
992         * gimple.c (gimple_build_return): Return a gimple_return rather
993         than a plain gimple.
995         * cgraphunit.c (expand_thunk): Convert local from a gimple to
996         a gimple_return.
998         * gimple-low.c (struct return_statements_t): Convert field "stmt"
999         from a gimple to a gimple_return.
1000         (lower_gimple_return): Convert local from a gimple to a
1001         gimple_return.
1003         * gimple-pretty-print.c (dump_gimple_return): Require a
1004         gimple_return rather than a plain gimple.
1005         (pp_gimple_stmt_1): Add a checked cast to gimple_return within
1006         case GIMPLE_RETURN of switch statement.
1008         * gimplify.c (gimplify_return_expr): Convert locals from
1009         gimple to gimple_return.
1011         * ipa-split.c (split_function): Likewise.
1013         * tree-cfg.c (verify_gimple_assign): Require a gimple_return
1014         rather than a plain gimple.
1015         (verify_gimple_stmt): Add checked cast to gimple_return within
1016         case GIMPLE_RETURN of switch statement.
1018         * tree-tailcall.c (adjust_return_value): Convert local from
1019         gimple to gimple_return.
1021 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1023         Introduce gimple_call
1025         * coretypes.h (gimple_call): New typedef.
1026         (const_gimple_call): New typedef.
1028         * asan.c (get_mem_refs_of_builtin_call): Require a
1029         const_gimple_call rather than a const gimple.
1030         (has_stmt_been_instrumented_p): Add a checked cast to
1031         gimple_call.
1032         (instrument_strlen_call): Likewise.
1033         (instrument_builtin_call): Likewise.
1034         * builtins.c (validate_gimple_arglist): Require a
1035         const_gimple_call rather than a const gimple.
1036         (fold_call_stmt): Require a gimple_call rather than a gimple.
1037         * builtins.h (validate_gimple_arglist): Require a
1038         const_gimple_call rather than a const gimple.
1039         (fold_call_stmt): Require a gimple_call rather than a gimple.
1040         * cfgexpand.c (expand_call_stmt): Likewise.
1041         (expand_gimple_stmt_1): Add a checked cast to gimple_call within
1042         GIMPLE_CALL case.
1043         * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Strengthen
1044         local "new_stmt" from gimple to gimple_call, adding a checked
1045         cast.
1046         * cgraphunit.c (cgraph_node::expand_thunk): Likewise for local
1047         "call".
1048         * gimple-fold.c (gimple_fold_builtin_snprintf_chk): Likewise for
1049         local "stmt".
1050         (gimple_fold_builtin_snprintf): Likewise.
1051         (gimple_fold_builtin): Likewise.
1052         (gimple_fold_call): Likewise.
1053         (gimple_fold_stmt_to_constant_1): Introduce local "call_stmt" via
1054         checked cast of "stmt" to gimple_call, using it in various places
1055         for typesafety.
1056         * gimple-pretty-print.c (dump_gimple_call_args): Strengthen param
1057         2 from gimple to gimple_call.
1058         (dump_gimple_call): Likewise.
1059         (pp_gimple_stmt_1): Add a checked cast to gimple_call within
1060         GIMPLE_CALL case.
1061         * gimple-streamer-in.c (input_gimple_stmt): Replace is_gimple_call
1062         with a dyn_cast<gimple_call>, introducing local "call_stmt", and
1063         using it in place of "stmt" for typesafety.  Add a checked cast
1064         in statement guarded by check for GIMPLE_CALL.
1065         * gimple-walk.c (walk_gimple_op): Add a checked cast to
1066         gimple_call.
1067         * gimple.c (gimple_call_reset_alias_info): Strengthen param from
1068         gimple to gimple_call.
1069         (gimple_build_call_1): Strengthen return type and local from
1070         gimple to gimple_call.
1071         (gimple_build_call_vec): Likewise.
1072         (gimple_build_call): Likewise.
1073         (gimple_build_call_valist): Likewise.
1074         (gimple_build_call_internal_1): Likewise.
1075         (gimple_build_call_internal): Likewise.
1076         (gimple_build_call_internal_vec): Likewise.
1077         (gimple_build_call_from_tree): Likewise.
1078         (gimple_call_return_flags): Strengthen param from
1079         const_gimple to const_gimple_call.
1080         (gimple_call_copy_skip_args): Strengthen return type and local from
1081         gimple to gimple_call.
1082         * gimple.h (gimple_call_reset_alias_info): Strengthen param from
1083         gimple to gimple_call.
1084         (gimple_build_call_vec): Strengthen return type from gimple to
1085         gimple_call.
1086         (gimple_build_call): Likewise.
1087         (gimple_build_call_valist): Likewise.
1088         (gimple_build_call_internal): Likewise.
1089         (gimple_build_call_internal_vec): Likewise.
1090         (gimple_build_call_from_tree): Likewise.
1091         (gimple_call_return_flags): Strengthen param from const_gimple to
1092         const_gimple_call.
1093         (gimple_call_copy_skip_args): Strengthen return type from gimple
1094         to gimple_call.
1095         (gimple_call_set_internal_fn): Strengthen param "call_stmt" from
1096         gimple to gimple_call.
1097         (gimple_call_return_type): Strengthen param from const_gimple to
1098         const_gimple_call.
1099         (gimple_call_chain_ptr): Likewise.
1100         (gimple_call_set_chain): Strengthen param from gimple to
1101         gimple_call.
1102         (gimple_call_set_return_slot_opt): Likewise.
1103         (gimple_call_set_from_thunk): Likewise.
1104         (gimple_call_from_thunk_p): Likewise.
1105         (gimple_call_set_va_arg_pack): Likewise.
1106         (gimple_call_va_arg_pack_p): Likewise.
1107         (gimple_call_set_alloca_for_var): Likewise.
1108         (gimple_call_alloca_for_var_p): Likewise.
1109         (gimple_expr_type): Introduce local "call_stmt" via a checked cast
1110         and use it for typesafety.
1111         * gimplify.c (gimplify_call_expr): Strengthen local "call" from
1112         gimple to gimple_call.
1113         (gimplify_modify_expr_to_memcpy): Likewise for local "gs".
1114         (gimplify_modify_expr_to_memset): Likewise.
1115         (gimplify_modify_expr): Add a checked cast to gimple_call.
1116         (gimplify_expr): Strengthen local "call" from gimple to
1117         gimple_call.
1118         (gimplify_function_tree): Likewise.
1119         * internal-fn.c (expand_LOAD_LANES): Strengthen param from gimple
1120         to gimple_call.
1121         (expand_STORE_LANES): Likewise.
1122         (expand_ANNOTATE): Likewise.
1123         (expand_GOMP_SIMD_LANE): Likewise.
1124         (expand_GOMP_SIMD_VF): Likewise.
1125         (expand_GOMP_SIMD_LAST_LANE): Likewise.
1126         (expand_UBSAN_NULL): Likewise.
1127         (expand_UBSAN_BOUNDS): Likewise.
1128         (expand_UBSAN_OBJECT_SIZE): Likewise.
1129         (expand_ASAN_CHECK): Likewise.
1130         (ubsan_expand_si_overflow_addsub_check): Likewise.
1131         (ubsan_expand_si_overflow_neg_check): Likewise.
1132         (ubsan_expand_si_overflow_mul_check): Likewise.
1133         (expand_UBSAN_CHECK_ADD): Likewise.
1134         (expand_UBSAN_CHECK_SUB): Likewise.
1135         (expand_UBSAN_CHECK_MUL): Likewise.
1136         (expand_LOOP_VECTORIZED): Likewise.
1137         (expand_MASK_LOAD): Likewise.
1138         (expand_MASK_STORE): Likewise.
1139         (expand_ABNORMAL_DISPATCHER): Likewise.
1140         (expand_BUILTIN_EXPECT): Likewise.
1141         (internal_fn_expanders): Likewise for entries in this table.
1142         (expand_internal_call): Likewise.
1143         * internal-fn.def: Update comment to reflect strengthening of
1144         param of expanders.
1145         * internal-fn.h (expand_internal_call): Strengthen param from
1146         gimple to gimple_call.
1147         * ipa-prop.c (ipa_modify_call_arguments): Likewise for local
1148         "new_stmt".
1149         * ipa-pure-const.c (check_call): Likewise for param "call".
1150         (check_stmt): Add a checked cast to gimple_call within GIMPLE_CALL
1151         case.
1152         * ipa-split.c (split_function): Strengthen local "call" from
1153         gimple to gimple_call.
1154         * omp-low.c (build_omp_barrier): Likewise for local "g".
1155         (lower_rec_input_clauses): Likewise for local "stmt".
1156         * trans-mem.c (build_tm_load): Likewise for return type and local
1157         "gcall".
1158         (build_tm_store): Likewise.
1159         (expand_transaction): Likewise for local "call".
1160         * tree-call-cdce.c (check_pow): Likewise for param.
1161         (check_builtin_call): Likewise.
1162         (is_call_dce_candidate): Likewise.
1163         (gen_conditions_for_pow): Likewise.
1164         (gen_shrink_wrap_conditions): Likewise.
1165         (shrink_wrap_one_built_in_call): Likewise.
1166         (shrink_wrap_conditional_dead_built_in_calls): Strengthen param
1167         from vec<gimple> to vec<gimple_call>, and local "bi_call" from
1168         gimple to gimple_call.
1169         (pass_call_cdce::execute): Strengthen local
1170         "cond_dead_built_in_calls" from auto_vec<gimple> to
1171         auto_vec<gimple_call> and local "stmt" from gimple to gimple_call,
1172         * tree-cfg.c (notice_special_calls): Strengthen param from gimple
1173         to gimple_call.
1174         * tree-cfg.h (notice_special_calls): Likewise.
1175         * tree-complex.c (expand_complex_libcall): Likewise for local
1176         "stmt".
1177         * tree-inline.c (remap_gimple_stmt): Add checked cast to
1178         gimple_call.
1179         (copy_bb): Likewise.  Strengthen local "new_call" from gimple to
1180         gimple_call.
1181         (inline_forbidden_p_stmt): Add checked cast to gimple_call.
1182         * tree-nested.c (init_tmp_var_with_call): Strengthen param "call"
1183         from gimple to gimple_call.
1184         (convert_nl_goto_reference): Likewise for local "call".
1185         (convert_tramp_reference_op): Likewise.
1186         (convert_gimple_call): Add checked cast to gimple_call.
1187         * tree-nrv.c (dest_safe_for_nrv_p): Strengthen param "call" from
1188         gimple to gimple_call.
1189         (pass_return_slot::execute): Likewise for local "stmt", using a
1190         dyn_cast<gimple_call> rather than an is_gimple_call call.
1191         * tree-object-size.c (alloc_object_size): Strengthen param "call"
1192         from const_gimple to const_gimple_call.
1193         (pass_through_call): Likewise.
1194         (call_object_size): Strengthen param "call" from gimple to
1195         gimple_call.
1196         (collect_object_sizes_for): Introduce local "call_stmt" via a
1197         checked cast, using it for typesafety.
1198         (check_for_plus_in_loops_1): Likewise.
1199         (pass_object_sizes::execute): Add a checked cast to gimple_call.
1200         * tree-profile.c (gimple_gen_interval_profiler): Strengthen local
1201         "call" from gimple to gimple_call.
1202         (gimple_gen_pow2_profiler): Likewise.
1203         (gimple_gen_one_value_profiler): Likewise.
1204         (gimple_gen_time_profiler): Likewise.
1205         (gimple_gen_average_profiler): Likewise.
1206         (gimple_gen_ior_profiler): Likewise.
1207         * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise for
1208         param "call".
1209         (ref_maybe_used_by_call_p): Likewise.
1210         (ref_maybe_used_by_stmt_p): Add a checked cast to gimple_call.
1211         (call_may_clobber_ref_p_1): Strengthen param "call" from gimple to
1212         gimple_call.
1213         (call_may_clobber_ref_p): Likewise.
1214         (stmt_may_clobber_ref_p_1): Add a checked cast to gimple_call.
1215         * tree-ssa-alias.h (call_may_clobber_ref_p): Strengthen param 1
1216         from gimple to gimple_call.
1217         (call_may_clobber_ref_p_1): Likewise.
1218         * tree-ssa-dce.c (eliminate_unnecessary_stmts): Add a checked cast
1219         to gimple_call.
1220         * tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Strengthen
1221         local "call" from gimple to gimple_call.
1222         * tree-ssa-math-opts.c (build_and_insert_call): Likewise for local
1223         "call_stmt".
1224         * tree-ssa-operands.c (maybe_add_call_vops): Likewise for param
1225         "stmt".
1226         (parse_ssa_operands): Add a checked cast to gimple_call within
1227         GIMPLE_CALL case.
1228         * tree-ssa-pre.c (compute_avail): Add a checked cast to
1229         gimple_call.
1230         * tree-ssa-sccvn.c (copy_reference_ops_from_call): Strengthen
1231         param "call" from gimple to gimple_call.
1232         (valueize_shared_reference_ops_from_call): Likewise.
1233         (vn_reference_lookup_3): Add a checked cast to gimple_call.
1234         (vn_reference_lookup_call): Strengthen param "call" from gimple to
1235         gimple_call.
1236         (visit_reference_op_call): Likewise for param "stmt".
1237         (visit_use): Replace is_gimple_call with a dyn_cast, introducing
1238         local "call_stmt", using it in place of "stmt" for type-safety.
1239         * tree-ssa-sccvn.h (vn_reference_lookup_call): Strengthen param 1
1240         from gimple to gimple_call.
1241         * tree-ssa-structalias.c (get_call_vi): Likewise.
1242         (lookup_call_use_vi): Likewise.
1243         (lookup_call_clobber_vi): Likewise.
1244         (get_call_use_vi): Likewise.
1245         (get_call_clobber_vi): Likewise.
1246         (handle_rhs_call): Likewise.
1247         (handle_lhs_call): Likewise.
1248         (handle_const_call): Likewise.
1249         (handle_pure_call): Likewise.
1250         (get_fi_for_callee): Likewise.
1251         (find_func_aliases_for_builtin_call): Likewise for param 2.
1252         (find_func_aliases_for_call): Likewise.
1253         (find_func_aliases): Add a checked cast to gimple_call.
1254         (find_func_clobbers): Replace is_gimple_call with a dyn_cast,
1255         introducing local "call_stmt", using it in place of "stmt" for
1256         type-safety.
1257         (compute_points_to_sets): Strengthen local "stmt" from gimple to
1258         gimple_call, replacing is_gimple_call with a
1259         dyn_cast <gimple_call>.
1260         (ipa_pta_execute): Likewise.
1261         * tree-ssa-threadedge.c
1262         (record_temporary_equivalences_from_stmts_at_dest): Add checked
1263         cast to gimple_call.
1264         * tree-tailcall.c (find_tail_calls): Strengthen local "call" from
1265         gimple to gimple_call, adding a checked cast.
1266         * tree-vect-data-refs.c (vect_setup_realignment): Eliminate
1267         top-level local "new_stmt" in favor of more tightly-scoped locals
1268         "new_stmt" of type gimple_assign and gimple_call.
1269         * tree-vect-patterns.c (vect_recog_pow_pattern): Strenghthen local
1270         "stmt" from gimple to gimple_call.
1271         * tree-vect-stmts.c (vectorizable_function): Likewise for param
1272         "call".
1273         (vectorizable_call): Rename param 1 from "stmt" to "gs",
1274         reintroducing "stmt" as a gimple_call once we've established that
1275         we're working with a GIMPLE_CALL.
1276         * tree-vectorizer.h (vectorizable_function): Strengthen param 1
1277         from gimple to gimple_call.
1278         * value-prof.c (check_ic_target): Likewise.
1279         (gimple_ic_transform): Likewise for local "stmt", replacing a
1280         check for GIMPLE_CALL with a dyn_cast.
1281         (interesting_stringop_to_profile_p): Strengthen param "call"
1282         from gimple to gimple_call.
1283         (gimple_stringop_fixed_value): Likewise for param "vcall_stmt".
1284         (gimple_stringops_transform): Likewise for local "stmt",
1285         replacing a check for GIMPLE_CALL with a dyn_cast.
1286         (gimple_stringops_values_to_profile): Rename param 1 from "stmt"
1287         to "gs", reintroducing "stmt" as a gimple_call once we've
1288         established that we're working with a GIMPLE_CALL.
1289         * vtable-verify.c (verify_bb_vtables): Strengthen local
1290         "call_stmt" from gimple to gimple_call.
1292 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1294         Concretize get_loop_exit_condition et al to working on gimple_cond
1296         * tree-scalar-evolution.h (get_loop_exit_condition): Return a
1297         gimple_cond.
1298         * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
1299         concretizing local "res" from gimple to gimple_cond.
1300         * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
1301         locals from gimple to gimple_cond.
1302         (slpeel_can_duplicate_loop_p): Likewise.
1303         * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
1304         (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
1306 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1308         Update various expressions within tree-scalar-evolution.c to be gimple_phi
1310         * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
1311         rather than a gimple.
1312         (follow_ssa_edge_binary): Likewise.
1313         (follow_ssa_edge_expr): Likewise.
1314         (follow_ssa_edge_in_rhs): Likewise.
1315         (backedge_phi_arg_p): Likewise.
1316         (follow_ssa_edge_in_condition_phi_branch): Likewise.
1317         (follow_ssa_edge_in_condition_phi): Likewise.
1318         (follow_ssa_edge_inner_loop_phi): Likewise.
1319         (analyze_evolution_in_loop): Likewise.
1320         (analyze_initial_condition): Likewise.
1321         (interpret_loop_phi): Likewise.
1322         (interpret_condition_phi): Likewise.
1323         (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
1325         (analyze_scalar_evolution_1): Add checked casts to gimple_phi
1326         within "case GIMPLE_PHI".
1328 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1330         tree-ssa-loop-ivopts.c: use gimple_phi in a few places
1332         * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
1333         (find_bivs): Convert local "phi" into a gimple_phi.
1334         (mark_bivs): Likewise.
1336 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1338         tree-ssa-loop-manip.c: use gimple_phi in three places
1340         * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
1341         gimple_phi.
1342         (split_loop_exit_edge): Likewise for "phi" and "new_phi".
1344 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1346         tree-ssa-loop-niter.c: use gimple_phi in a few places
1348         * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
1349         rather than a gimple.
1350         (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
1351         (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
1353 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1355         tree-ssa-phiprop.c: use gimple_phi
1357         * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
1358         parameter "phi" and local "new_phi" from gimple to gimple_phi.
1360 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1362         tree-predcom.c: use gimple_phi in various places
1364         * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
1365         than just a gimple.
1366         (insert_looparound_copy): Require a gimple_phi rather than just a
1367         gimple.
1368         (add_looparound_copies): Convert local "phi" to be a gimple_phi.
1369         (initialize_root_vars): Likewise.
1370         (initialize_root_vars_lm): Likewise.
1372 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1374         tree-parloops.c: use gimple_phi in various places
1376         * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
1377         from gimple to gimple_phi.
1378         (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
1379         (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
1380         (gather_scalar_reductions): Convert to a gimple_phi_iterator and
1381         gimple_phi.
1382         (try_create_reduction_list): Likewise.
1384 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1386         Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
1388         * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
1389         type of parameter from gimple to gimple_phi.
1391         * tree-complex.c (complex_visit_phi): Update signature of callback
1392         implementation accordingly.
1393         * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
1394         * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
1395         * tree-vrp.c (vrp_visit_phi_node): Likewise.
1397         * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
1398         gimple_phi when invoking the ssa_prop_visit_phi callback.
1400 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1402         Introduce gimple_phi_iterator
1404         * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
1405         gimple_stmt_iterator with identical layout, but adding...
1406         (gimple_phi_iterator::phi): ...new method, equivalent to
1407         gsi_stmt (), but casting the underlying gimple to gimple_phi,
1408         checking that code == GIMPLE_PHI in a checked build.
1409         (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
1410         gimple_stmt_iterator.
1412         * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
1413         than just a gimple.
1414         (if_convertible_phi_p): Likewise.
1415         * tree-phinodes.h (add_phi_node_to_bb): Likewise.
1416         * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
1418         * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
1419         and a vec<gimple_phi> *, rather than just a gimple and
1420         vec<gimple> *, and a hash_set<gimple_phi> * rather than a
1421         hash_set<gimple> *.
1422         (find_uninit_use): Likewise; add checked cast to gimple_phi when
1423         adding to worklist.
1424         (pass_late_warn_uninitialized::execute): Strengthen types of
1425         various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
1426         "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
1427         gimple_phi, "added_to_worklist" from hash_set<gimple> to
1428         hash_set<gimple_phi>.
1430         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
1431         gimple_phi_iterator * rather than a gimple_stmt_iterator *;
1432         use it to strengthen local from a gimple to a gimple_phi.
1434         * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
1435         gimple_stmt_iterator to a gimple_phi_iterator.  Use the iterator's
1436         "phi" method rather than gsi_stmt.  Use this checked cast to convert
1437         the type of related local from a plain gimple to a gimple_phi.
1438         * gimple-pretty-print.c (dump_phi_nodes): Likewise.
1439         * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
1440         Likewise.
1441         * sese.c (sese_add_exit_phis_edge): Likewise.
1442         * tree-cfg.c (reinstall_phi_args): Likewise.
1443         (gimple_make_forwarder_block): Likewise.
1444         (add_phi_args_after_copy_edge): Likewise.
1445         (gimple_lv_adjust_loop_header_phi): Likewise.
1446         * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
1447         (remove_forwarder_block_with_phi): Likewise.
1448         (merge_phi_nodes): Likewise.
1449         * tree-complex.c (update_phi_components): Likewise.
1450         * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
1451         * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
1452         (copy_phis_for_bb): Likewise.
1453         * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
1454         * tree-outof-ssa.c (eliminate_build): Likewise.
1455         (eliminate_useless_phis): Likewise.
1456         (rewrite_trees): Likewise.
1457         (insert_backedge_copies): Likewise.
1458         * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
1459         (remove_phi_args): Likewise.
1460         (remove_phi_nodes): Likewise.
1461         * tree-predcom.c (find_looparound_phi): Likewise.
1462         (eliminate_temp_copies): Likewise.
1463         * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
1464         (scev_const_prop): Likewise; also, add checked cast to phi.
1465         * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
1466         * tree-ssa-dce.c (remove_dead_phis): Likewise.
1467         (forward_edge_to_pdom): Likewise.
1468         * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
1469         (cprop_into_successor_phis): Likewise.
1470         (propagate_rhs_into_lhs): Likewise.
1471         (eliminate_degenerate_phis_1): Likewise.
1472         * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
1473         * tree-ssa-live.c (calculate_live_on_exit): Likewise.
1474         (verify_live_on_entry): Likewise.
1475         * tree-ssa-loop-im.c
1476         (move_computations_dom_walker::before_dom_children): Likewise.
1477         * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
1478         (mark_bivs): Likewise.
1479         (find_interesting_uses_outside): Likewise.
1480         (determine_set_costs): Likewise.
1481         * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
1482         (tree_transform_and_unroll_loop): Likewise.
1483         (rewrite_all_phi_nodes_with_iv): Likewise.
1484         (canonicalize_loop_ivs): Likewise.
1485         * tree-ssa-loop-niter.c (determine_value_range): Likewise.
1486         * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
1487         * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
1488         * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
1489         * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
1490         (vop_phi): Likewise.
1491         * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
1492         Likewise.
1493         * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
1494         (copy_phi_args): Likewise.
1495         (phi_args_equal_on_edges): Likewise.
1496         * tree-ssa.c (ssa_redirect_edge): Likewise.
1497         (flush_pending_stmts): Likewise.
1498         * tree-switch-conversion.c (check_final_bb): Likewise.
1499         (gather_default_values): Likewise.
1500         (build_constructors): Likewise.
1501         (fix_phi_nodes): Likewise.
1502         * tree-tailcall.c (propagate_through_phis): Likewise.
1503         (add_successor_phi_arg): Likewise.
1504         * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
1505         Likewise.
1506         (slpeel_update_phi_nodes_for_guard2): Likewise.
1507         (slpeel_tree_peel_loop_to_edge): Likewise.
1508         (vect_can_advance_ivs_p): Likewise.
1509         (vect_update_ivs_after_vectorizer): Likewise.
1510         * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
1511         * tree-vrp.c (find_assert_locations): Likewise.
1512         * value-prof.c (gimple_ic): Likewise.
1514         * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
1516 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1518         Introduce gimple_phi and use it in various places
1520         * coretypes.h (gimple_phi): New typedef.
1521         (const_gimple_phi): New typedef.
1523         * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
1524         variants, using the gimple printer.
1526         * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
1527         vecs of more concrete gimple subclasses as appropriate; also the
1528         comment is about to become misleading.
1530         * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
1531         rather than spelling out the full type.
1532         (gimple_phi_num_args): Likewise.
1533         (gimple_phi_result): Likewise.
1534         (gimple_phi_result_ptr): Use gimple_phi typedef.
1535         (gimple_phi_set_result): Likewise.
1536         (gimple_phi_arg): Likewise.
1537         (gimple_phi_set_arg): Likewise.
1538         * tree-phinodes.c (allocate_phi_node): Likewise.
1539         (resize_phi_node): Likewise.
1540         (reserve_phi_args_for_new_edge): Likewise.
1541         (remove_phi_arg_num): Likewise.
1543         * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
1544         rather than just a gimple.
1545         * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
1547         * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
1548         just a gimple.
1549         (create_phi_node): Likewise.
1550         * tree-phinodes.h (create_phi_node): Likewise.
1552         * trans-mem.c (struct struct tm_log_entry): Replace use of
1553         now-removed gimple_vec with a plain vec<gimple>.
1555         * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
1556         vec<gimple_vec> to a vec< vec<gimple_phi> >.
1558         * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
1559         gimple_phi.
1560         * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
1561         "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
1562         a gimple_phi.
1563         * tree-into-ssa.c (delete_update_ssa): Strengthen local
1564         "phis" from a gimple_vec to a vec<gimple_phi>.
1566         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
1567         gimple_phi in regions where a stmt is known to have code
1568         GIMPLE_PHI.
1569         * tree-into-ssa.c (mark_use_interesting): Likewise.
1571 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1573         Introduce gimple_debug and use it in a few places
1575         * coretypes.h (gimple_debug): New typedef.
1576         (const_gimple_debug): New typedef.
1578         * gimple.h (struct gimple_statement_debug): New subclass of
1579         gimple_statement_with_ops, adding the invariant that
1580         stmt->code == GIMPLE_DEBUG.
1581         (is_a_helper <gimple_statement_debug>::test): New.
1583         * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
1584         variants, using the gimple printer.
1586         * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
1587         rather than just a gimple.
1588         * tree-inline.c (copy_debug_stmt): Likewise.
1590         * tree-inline.h (struct copy_body_data): Strengthen field
1591         "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
1593         * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
1594         rather than just a gimple.
1595         (gimple_build_debug_source_bind_stat): Likewise.
1596         * gimple.h (gimple_build_debug_bind_stat): Likewise.
1597         (gimple_build_debug_source_bind_stat): Likewise.
1599         * tree-inline.c (remap_gimple_stmt): Update locals to be a
1600         gimple_debug.
1601         (maybe_move_debug_stmts_to_successors): Likewise.
1602         (copy_debug_stmts): Likewise.
1604         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
1605         gimple_debug in regions where a stmt is known to have code
1606         GIMPLE_DEBUG.
1608 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1610         Introduce gimple_label and use it in a few places
1612         * coretypes.h (gimple_label): New typedef.
1613         (const_gimple_label): New typedef.
1615         * gimple.h (struct gimple_statement_label): New subclass of
1616         gimple_statement_with_ops, adding the invariant that
1617         stmt->code == GIMPLE_LABEL.
1618         (is_a_helper <gimple_statement_label>::test): New.
1620         * gdbhooks.py (build_pretty_printer): Add gimple_label and its
1621         variants, reusing the gimple printer.
1623         * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
1624         rather than just a gimple.
1625         * tree-cfg.c (verify_gimple_label): Likewise.
1627         * gimple.c (gimple_build_label): Return a gimple_label rather than
1628         just a gimple.
1629         * gimple.h (gimple_build_label): Likewise.
1631         * gimplify.c (gimplify_case_label_expr): Update local to be a
1632         gimple_label.
1633         * tree-switch-conversion.c (gen_inbound_check): Likewise.
1635         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
1636         gimple_label in regions where a stmt is known to have code
1637         GIMPLE_LABEL.
1638         * tree-cfg.c (verify_gimple_stmt): Likewise.
1640 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1642         Introduce gimple_assign and use it in various places
1644         * coretypes.h (gimple_assign): New typedef.
1645         (const_gimple_assign): New typedef.
1647         * gimple.h (struct gimple_statement_assign): New subclass of
1648         gimple_statement_with_memory_ops, adding the invariant that
1649         stmt->code == GIMPLE_ASSIGN.
1650         (is_a_helper <gimple_statement_assign>::test): New.
1652         * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
1653         variants, using the gimple printer.
1655         * gimple-builder.c (build_assign): Return a gimple_assign rather
1656         than just a gimple from each of the overloaded variants.
1657         (build_type_cast): Likewise.
1658         * gimple-builder.h (build_assign): Likewise.
1659         (build_type_cast): Likewise.
1660         * gimple.c (gimple_build_assign_stat): Likewise.
1661         (gimple_build_assign_with_ops): Likewise.
1662         * gimple.h (gimple_build_assign_stat): Likewise.
1663         (gimple_build_assign_with_ops): Likewise.
1665         * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
1666         rather than just a "const gimple" (the latter is not a
1667         "const_gimple").
1668         * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
1669         rather than just a gimple.
1670         (dump_binary_rhs): Likewise.
1671         (dump_ternary_rhs): Likewise.
1672         * tree-cfg.c (verify_gimple_assign_unary): Likewise.
1673         (verify_gimple_assign_binary): Likewise.
1674         (verify_gimple_assign_ternary): Likewise.
1675         (verify_gimple_assign_single): Likewise.
1676         (verify_gimple_assign): Likewise.
1677         * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
1678         (try_to_simplify): Likewise.
1679         * tree-tailcall.c (process_assignment): Likewise.
1680         * tree-vect-generic.c (expand_vector_operation): Likewise.
1681         * tree-vrp.c (extract_range_from_cond_expr): Likewise.
1682         (extract_range_from_assignment): Likewise.
1684         * asan.c (has_stmt_been_instrumented_p): Add checked cast to
1685         gimple_assign in regions where a stmt is known to have code
1686         GIMPLE_ASSIGN.
1687         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1688         * tree-cfg.c (verify_gimple_stmt): Likewise.
1689         * tree-ssa-sccvn.c (visit_use): Likewise.
1690         * tree-tailcall.c (find_tail_calls): Likewise.
1691         * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
1693         * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
1694         against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
1695         a gimple_assign local.
1697         * tree-vect-generic.c (expand_vector_condition): Convert local to a
1698         gimple_assign, adding a checked cast when extracting from gsi, since
1699         this is only called when  underlying stmt has code GIMPLE_ASSIGN.
1700         (optimize_vector_constructor): Likewise.
1701         (lower_vec_perm): Likewise.
1702         (expand_vector_operations_1): Convert local to a gimple_assign,
1703         introducing a dyn_cast.
1705 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1707         Introduce gimple_cond and use it in various places
1709         * coretypes.h (gimple_cond): New typedef.
1710         (const_gimple_cond): Likewise.
1712         * gimple.h (struct gimple_statement_cond): New subclass of
1713         gimple_statement_with_ops, adding the invariant that
1714         stmt->code == GIMPLE_COND.
1715         (is_a_helper <gimple_statement_cond>::test): New.
1716         (gimple_build_cond): Return a gimple_cond, rather than just
1717         a gimple.
1718         (gimple_build_cond_from_tree): Likewise.
1720         * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
1721         variants, using the gimple printer.
1723         * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
1724         than just a gimple.
1725         * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
1726         (gimple_cond_true_p): Likewise.
1727         (gimple_cond_false_p): Likewise.
1728         (gimple_cond_set_condition): Likewise.
1729         * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
1730         * gimple-fold.c (fold_gimple_cond): Likewise.
1731         * gimple-pretty-print.c (dump_gimple_cond): Likewise.
1732         * tree-ssa-dom.c (canonicalize_comparison): Likewise.
1733         * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
1734         * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
1735         (recognize_bits_test): Likewise.
1736         * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
1737         (thread_around_empty_blocks): Likewise.
1738         (thread_through_normal_block): Likewise.
1739         (thread_across_edge): Likewise.
1740         * tree-ssa-threadedge.h (thread_across_edge): Likewise.
1741         * tree-vrp.c (range_fits_type_p): Likewise.
1743         * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
1744         gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
1745         * gimple-fold.c (fold_stmt_1): Likewise.
1746         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1747         * tree-ssa-dom.c (optimize_stmt): Likewise.
1748         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
1749         * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
1750         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
1751         Likewise.
1752         * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
1754         * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
1755         gimple_cond.
1756         * tree-vrp.c (identify_jump_threads): Likewise.
1758         * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
1759         just a gimple.
1760         (gimple_build_cond_from_tree): Likewise.
1762         * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
1763         field "m_dummy_cond" from a plain gimple to a gimple_cond.
1765         * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
1766         inner_stmt and outer_stmt so that inner_cond and outer_cond can be
1767         of type gimple_cond once we know that we have code == GIMPLE_COND.
1768         * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
1769         "last" so that stmt can be of type gimple_cond.
1771 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1773         Introduce gimple_bind and use it for accessors.
1775         * coretypes.h (gimple_bind): New typedef.
1776         (const_gimple_bind): New typedef.
1778         * gdbhooks.py (build_pretty_printer): Add gimple_bind
1779         and its variants, using the gimple printer.
1781         * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
1782         require a gimple_bind rather than just a gimple.
1784         * gimple.c (gimple_build_bind): Return a gimple_bind rather than
1785         just a gimple.
1786         * gimple.h (gimple_build_bind): Likewise.
1788         * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
1790         * gimple.h (gimple_bind_vars): Update type-signature to
1791         require a gimple_bind rather than just a gimple, removing
1792         as_a and hence run-time check.
1793         (gimple_bind_set_vars): Likewise.
1794         (gimple_bind_append_vars): Likewise.
1795         (gimple_bind_body_ptr): Likewise.
1796         (gimple_bind_body): Likewise.
1797         (gimple_bind_set_body): Likewise.
1798         (gimple_bind_add_stmt): Likewise.
1799         (gimple_bind_add_seq): Likewise.
1800         (gimple_bind_block): Likewise.
1801         (gimple_bind_set_block): Likewise.
1802         * gimplify.c (gimple_push_bind_expr): Likewise.
1803         (gimple_current_bind_expr): Likewise.
1804         * tree-inline.c (copy_gimple_bind): Likewise.
1806         * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
1807         rather than a plain gimple.
1808         (gimplify_body): Likewise.
1809         (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
1810         a vec<gimple>.
1812         * gimplify.c (struct gimplify_ctx): Strengthen field
1813         "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
1814         (gimple_bind_expr_stack): Likewise for type of returned value.
1816         * gimplify.c (gimplify_body): Strengthen various types from gimple
1817         to gimple_bind, including the return type.
1819         * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
1820         so that local "scope" can be of type gimple_bind once we've reached
1821         the region where it must be of code GIMPLE_BIND.
1823         * gimple-low.c (lower_gimple_bind): Add checked cast to
1824         gimple_bind, since both callers (lower_function_body and
1825         lower_stmt) have checked the code for us.
1827         * gimple.c (gimple_copy): Add checked cast to gimple_bind in
1828         region guarded by check for code GIMPLE_BIND.
1829         * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
1830         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1831         * gimple-walk.c (walk_gimple_stmt): Likewise.
1832         * omp-low.c (scan_omp_1_stmt): Likewise.
1833         (lower_omp_1): Likewise.
1834         (lower_omp_for): Likewise.
1835         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
1836         (do_warn_unused_result): Likewise.
1837         * tree-inline.c (remap_gimple_stmt): Likewise.
1838         (estimate_num_insns): Likewise.
1839         * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
1841         * gimplify.c (gimplify_bind_expr): Update local(s) to be a
1842         gimple_bind rather than just a gimple.
1843         (gimplify_function_tree): Likewise.
1844         * omp-low.c (lower_omp_sections): Likewise.
1845         (lower_omp_single): Likewise.
1846         (lower_omp_master): Likewise.
1847         (lower_omp_taskgroup): Likewise.
1848         (lower_omp_ordered): Likewise.
1849         (lower_omp_critical): Likewise.
1850         (lower_omp_taskreg): Likewise.
1851         (lower_omp_teams): Likewise.
1852         * omp-low.c (lower_omp_for): Likewise; use
1853         gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
1854         (lower_omp_target): Likewise.
1855         * tree-nested.c (finalize_nesting_tree_1): Likewise.
1857         * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
1858         * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
1860 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1862         Introduce gimple_switch and use it in various places
1864         * gimple.h (gimple_statement_switch): New subclass of
1865         gimple_statement_with_ops, adding the invariant that
1866         stmt->code == GIMPLE_SWITCH.
1867         (is_a_helper <gimple_statement_switch>::test (gimple)): New.
1869         * coretypes.h (gimple_switch): New typedef
1870         (const_gimple_switch): Likewise.
1872         * gdbhooks.py (build_pretty_printer): Add gimple_switch
1873         and its variants, using the gimple printer.
1875         * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
1876         rather than just a gimple.
1877         (gimple_build_switch): Likewise.
1878         * gimple.h (gimple_build_switch_nlabels): Likewise.
1879         (gimple_build_switch): Likewise.
1881         * gimple.h (gimple_switch_num_labels): Update type-signature to
1882         require a gimple_switch rather than just a gimple.
1883         (gimple_switch_set_num_labels): Likewise.
1884         (gimple_switch_set_index): Likewise.
1885         (gimple_switch_label): Likewise.
1886         (gimple_switch_set_label): Likewise.
1887         (gimple_switch_default_label): Likewise.
1888         (gimple_switch_set_default_label): Likewise.
1889         * expr.h (expand_case): Likewise.
1890         * gimple-pretty-print.c (dump_gimple_call): Likewise.
1891         * stmt.c (compute_cases_per_edge): Likewise.
1892         (expand_case): Likewise.
1893         * tree-cfg.h (group_case_labels_stmt): Likewise.
1894         * tree-cfg.c (make_gimple_switch_edges): Likewise.
1895         (find_taken_edge_switch_expr) Likewise.
1896         (find_case_label_for_value) Likewise.
1897         (get_cases_for_edge): Likewise.
1898         (group_case_labels_stmt): Likewise.
1899         (verify_gimple_switch): Likewise.
1900         * tree-eh.c (verify_norecord_switch_expr): Likewise.
1901         * tree-eh.c (lower_eh_constructs_2): Likewise.
1902         * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
1903         * tree-ssa-dom.c (record_edge_info): Likewise.
1904         * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
1905         (simplify_gimple_switch): Likewise.
1906         * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
1907         (collect_switch_conv_info): Likewise.
1908         (build_constructors): Likewise.
1909         (array_value_type): Likewise.
1910         (build_one_array): Likewise.
1911         (build_arrays): Likewise.
1912         (gen_inbound_check): Likewise.
1913         * tree-vrp.c (find_switch_asserts): Likewise.
1914         (find_case_label_range): Likewise.
1915         (find_case_label_ranges): Likewise.
1916         (vrp_visit_switch_stmt): Likewise.
1917         (simplify_switch_using_ranges): Likewise.
1919         * tree-vrp.c (switch_update): Strengthen field "stmt" from being
1920         merely a gimple to being a gimple_switch.
1922         * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
1923         gimple_switch in regions where the stmt code has been tested as
1924         GIMPLE_SWITCH.
1925         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1926         * tree-cfg.c (make_edges): Likewise.
1927         (end_recording_case_labels): Likewise.
1928         (cleanup_dead_labels): Likewise.
1929         (cleanup_dead_labels): Likewise.
1930         (group_case_labels): Likewise.
1931         (find_taken_edge): Likewise.
1932         (find_case_label_for_value): Likewise.
1933         (verify_gimple_stmt): Likewise.
1934         (gimple_verify_flow_info): Likewise.
1935         (gimple_redirect_edge_and_branch): Likewise.
1936         * tree-inline.c (estimate_num_insns): Likewise.
1937         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
1938         * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
1939         * tree-switch-conversion.c (do_switchconv): Likewise.
1940         * tree-vrp.c  (find_assert_locations_1): Likewise.
1941         (vrp_visit_stmt): Likewise.
1942         (simplify_stmt_using_ranges): Likewise.
1944         * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
1945         Introduce local "lastg" as a generic gimple, so that local "last"
1946         can be of type gimple_switch once lastg's code has been verified.
1948         * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
1949         the GIMPLE_SWITCH case.
1951         * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
1952         argument, since the caller (find_taken_edge) has checked that
1953         last_stmt is a switch.
1955 Copyright (C) 2014 Free Software Foundation, Inc.
1957 Copying and distribution of this file, with or without modification,
1958 are permitted in any medium without royalty provided the copyright
1959 notice and this notice are preserved.