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