Introduce gimple_omp_continue
[official-gcc.git] / gcc / ChangeLog.gimple-classes
blob5a87159b5434295eeebf8a94b77a0e308922ab66
1 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
3         Introduce gimple_omp_continue
5         * coretypes.h (gimple_omp_continue): New typedef.
6         (const_gimple_omp_continue): New typedef.
8         * gimple.h (gimple_build_omp_continue): Return a
9         gimple_omp_continue rather than a plain gimple.
10         (gimple_omp_continue_control_def): Require a
11         const_gimple_omp_continue rather than a plain const_gimple.
12         (gimple_omp_continue_control_use): Likewise.
13         (gimple_omp_continue_control_def_ptr): Require a gimple_omp_continue
14         rather than a plain gimple.
15         (gimple_omp_continue_set_control_def): Likewise.
16         (gimple_omp_continue_control_use_ptr): Likewise.
17         (gimple_omp_continue_set_control_use): Likewise.
19         * gimple-pretty-print.c (dump_gimple_omp_continue): Require a
20         gimple_omp_continue rather than a plain gimple.
21         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_continue
22         within GIMPLE_OMP_CONTINUE case of switch statement.
24         * gimple-walk.c (walk_gimple_op): Likewise, adding a new local.
26         * gimple.c (gimple_build_omp_continue): Return a
27         gimple_omp_continue rather than a plain gimple.
29         * omp-low.c (gimple_build_cond_empty): Return a gimple_cond
30         rather than a plain gimple.
31         (expand_omp_for_generic): Split local "stmt" into "assign_stmt",
32         "cont_stmt", "cond_stmt", "call_stmt" of types gimple_assign,
33         gimple_omp_continue, gimple_cond, gimple_call respectively.
34         (expand_omp_for_static_nochunk): Likewise, splitting into two
35         "cond_stmt" decls. "assign_stmt", "cont_stmt"
36         (expand_omp_for_static_chunk): Likewise, splitting into
37         "cond_stmt", "assign_stmt", "cont_stmt".
38         (expand_omp_sections): Strengthen local "cont" from gimple to
39         gimple_omp_continue.
41 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
43         Introduce gimple_omp_atomic_store
45         * coretypes.h (gimple_omp_atomic_store): New typedef.
46         (const_gimple_omp_atomic_store): New typedef.
48         * gimple-pretty-print.c (dump_gimple_omp_atomic_store): Require
49         a gimple_omp_atomic_store rather than a plain gimple.
50         (pp_gimple_stmt_1): Add checked cast to gimple_omp_atomic_store
51         within GIMPLE_OMP_ATOMIC_STORE case of switch statement.
52         * gimple-walk.c (walk_gimple_op): Likewise.
54         * gimple.c (gimple_build_omp_atomic_store): Return a
55         gimple_omp_atomic_store rather than a plain gimple.
57         * gimple.h (gimple_build_omp_atomic_store): Return a
58         gimple_omp_atomic_store rather than a plain gimple.
59         (gimple_omp_atomic_store_set_val): Require a gimple_omp_atomic_store
60         rather than a plain gimple.
61         (gimple_omp_atomic_store_val_ptr): Likewise.
62         (gimple_omp_atomic_store_val): Require a
63         const_gimple_omp_atomic_store rather than a plain const_gimple.
65         * gimplify.c (gimplify_omp_atomic): Strengthen locals "loadstmt" and
66         "storestmt" from gimple to gimple_omp_atomic_load loadstmt and
67         gimple_omp_atomic_store storestmt respectively.
69         * omp-low.c (expand_omp_atomic): Strengthen local "store" from
70         gimple to gimple_omp_atomic_store.
72 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
74         Introduce gimple_omp_atomic_load
76         * coretypes.h (gimple_omp_atomic_load): New typedef.
77         (const_gimple_omp_atomic_load): New typedef.
79         * gimple-pretty-print.c (dump_gimple_omp_atomic_load): Require a
80         gimple_omp_atomic_load rather than a plain gimple.
81         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_atomic_load
82         within GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
84         * gimple-walk.c (walk_gimple_op): Likewise, introducing a new local.
86         * gimple.c (gimple_build_omp_atomic_load): Return a
87         gimple_omp_atomic_load rather than a plain gimple.
89         * gimple.h (gimple_build_omp_atomic_load): Return a
90         gimple_omp_atomic_load rather than a plain gimple.
91         (gimple_omp_atomic_load_set_lhs): Require a
92         gimple_omp_atomic_load rather than a plain gimple.
93         (gimple_omp_atomic_load_lhs_ptr): Likewise.
94         (gimple_omp_atomic_load_set_rhs): Likewise.
95         (gimple_omp_atomic_load_rhs_ptr): Likewise.
96         (gimple_omp_atomic_load_lhs): Require a
97         const_gimple_omp_atomic_load rather than a plain const_gimple.
98         (gimple_omp_atomic_load_rhs): Likewise.
100         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
101         to gimple_omp_atomic_load within GIMPLE_OMP_ATOMIC_LOAD case of
102         switch statement.
104         * omp-low.c (expand_omp_atomic): Strengthen type of local "load"
105         from gimple to gimple_omp_atomic_load.
106         (lower_omp_1): Add a checked cast to gimple_omp_atomic_load within
107         GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
109 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
111         Use more concrete types for various gimple statements
113         * cgraphunit.c (thunk_adjust): Strengthen local "stmt" from gimple
114         to gimple_assign.
116         * gimple-ssa-isolate-paths.c
117         (insert_trap_and_remove_trailing_statements): Strengthen local
118         "new_stmt" from gimple to gimple_call.
120         * gimple-ssa-strength-reduction.c (replace_mult_candidate):
121         Strengthen local "copy_stmt" from gimple to gimple_assign.
122         (create_add_on_incoming_edge): Likewise, for "new_stmt".
123         (insert_initializers): Likewise, for "init_stmt".
124         (introduce_cast_before_cand): Likewise, for "cast_stmt".
125         (replace_one_candidate): Likewise, for "copy_stmt" and
126         "cast_stmt".
128         * gimplify.c (build_stack_save_restore): Require gimple_calls
129         rather than plain gimples.
130         (gimplify_bind_expr): Strengthen locals "stack_save" and
131         "stack_restore" from gimple to gimple_call.  Strengthen "gs"
132         to gimple_try.
133         (gimplify_switch_expr): Strengthen local "gimple_switch" from
134         gimple to gimple_switch, and "new_default" to gimple_label.
135         (gimplify_cond_expr): Strengthen local "gimple_cond" from gimple
136         to gimple_cond.
137         (gimplify_init_constructor): Strengthen local "init" from gimple
138         to gimple_assign.
139         (gimplify_cleanup_point_expr): Strengthen local "gtry" from gimple
140         to gimple_try.
141         (gimple_push_cleanup): Strengthen locals "ffalse" and "ftrue" from
142         gimple to gimple_assign.
144         * tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
145         (emit_post_landing_pad): Strengthen local to gimple_label.
147         * tree-outof-ssa.c (insert_backedge_copies): Strengthen local
148         "stmt" from gimple to gimple_assign.
150         * tree-parloops.c (take_address_of): Likewise.
152         * tree-predcom.c (replace_ref_with): Likewise, for "new_stmt".
153         (initialize_root_vars_lm): Likewise, for "init_stmt".
154         (reassociate_to_the_same_stmt): Likewise, for "new_stmt" and "tmp_stmt".
156         * tree-profile.c (gimple_gen_edge_profiler): Likewise, for "stmt1",
157         "stmt2", "stmt3".
158         (gimple_gen_ic_profiler): Likewise.
159         (gimple_gen_ic_func_profiler): Strengthen local "stmt1" from
160         gimple to gimple_call, and "stmt2" to gimple_assign.
162         * tree-scalar-evolution.c (scev_const_prop): Strengthen local
163         "ass" from gimple to gimple_assign.
165         * tree-sra.c (build_ref_for_offset): Likewise for "stmt".
166         (generate_subtree_copies): Likewise; also strengthen "ds" to
167         gimple_debug.
168         (init_subtree_with_zero): Likewise.
169         (sra_modify_expr): Likewise.
170         (load_assign_lhs_subreplacements): Likewise.
171         (sra_modify_assign): Strengthen "ds" to gimple_debug.
172         (sra_ipa_reset_debug_stmts): Likewise for "def_temp".
174         * tree-ssa-ccp.c (insert_clobber_before_stack_restore):
175         Strengthen local "clobber_stmt" from gimple to gimple_assign.
177         * tree-ssa-dce.c (remove_dead_stmt): Strengthen "note" to
178         gimple_debug.
180         * tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
181         local "new_stmt" from gimple to gimple_assign.
182         (optimize_stmt): Likewise.
184         * tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
185         4 declarations of "newop".
186         (simplify_rotate): Likewise for "g".
188         * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
189         (rewrite_bittest): Likewise for "stmt" and "stmt2".
190         (move_computations_dom_walker::before_dom_children): Likewise for
191         "new_stmt".
192         (execute_sm): Likewise for "load" and "store".
194         * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
195         Strengthen local "stmt" from gimple to gimple_call.
196         (unloop_loops): Likewise.
198         * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
199         local "ass" from gimple to gimple_assign.
200         (remove_unused_ivs): Strengthen "def_temp" to gimple_debug.
202         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local "stmt"
203         from gimple to gimple_assign.
205         * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
206         "prefetch" from gimple to gimple_call.
208         * tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
209         "new_stmt" from gimple to gimple_assign.
210         (powi_as_mults_1): Likewise for "mult_stmt".
211         (powi_as_mults): Likewise for "div_stmt".
212         (build_and_insert_binop): Likewise for "stmt".
213         (build_and_insert_cast): Likewise.
214         (pass_cse_sincos::execute): Likewise for "stmt" and various decls
215         of "new_stmt".
216         (convert_mult_to_fma): Likewise for "fma_stmt".
218         * tree-ssa-phiopt.c (conditional_replacement): Likewise for "new_stmt".
219         (abs_replacement): Likewise.
221         * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for "tmp".
223         * tree-ssa-pre.c (create_expression_by_pieces): Likewise for "newstmt".
224         (eliminate_insert): Likewise for "tem".
226         * tree-ssa-propagate.c (update_gimple_call): Strengthen locals
227         "new_stmt" and "stmt" from gimple to gimple_call.
228         (update_call_from_tree): Likewise for "new_stmt".
230         * tree-ssa-reassoc.c (build_and_add_sum): Likewise for "sum".
231         (update_ops): Likewise for "g".
232         (maybe_optimize_range_tests): Likewise.
233         (rewrite_expr_tree_parallel): Require a gimple_assign rather than
234         a plain gimple.
235         (reassociate_bb): Add a checked cast to gimple_assign.
237         * tree-ssa.c (insert_debug_temp_for_var_def): Strengthen local
238         "def_temp" from gimple to gimple_debug.
240         * tree-switch-conversion.c (emit_case_bit_tests): Strengthen local
241         "shift_stmt" from gimple to gimple_assign.
243         * tree-tailcall.c (adjust_return_value_with_ops): Likewise for
244         "stmt".
245         (update_accumulator_with_ops): Likewise.
247         * tree-vect-data-refs.c (bump_vector_ptr): Likewise for
248         "incr_stmt".
250         * tree-vect-stmts.c (vectorizable_condition): Likewise for
251         "new_stmt".
253         * tree-vrp.c (build_assert_expr_for): Likewise for "assertion".
254         (simplify_truth_ops_using_ranges): Likewise for "newop".
255         (simplify_float_conversion_using_ranges): Likewise for "conv".
257         * ubsan.c (instrument_mem_ref): Strengthen local "g" from gimple
258         to gimple_call.
260         * value-prof.c (gimple_divmod_fixed_value): Require a
261         gimple_assign rather than a plain gimple; strengthen types of locals.
262         (gimple_mod_pow2): Likewise.
263         (gimple_mod_subtract): Likewise.
264         (gimple_divmod_fixed_value_transform): Strengthen local
265         "stmt" from gimple to gimple_assign.
266         (gimple_mod_pow2_value_transform): Likewise.
267         (gimple_mod_subtract_transform): Likewise.
268         (gimple_ic): Strengthen types of locals.
270 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
272         Introduce gimple_try
274         * coretypes.h (gimple_try): New typedef.
275         (const_gimple_try): New typedef.
277         * gimple-low.c (gimple_try_catch_may_fallthru): Require a
278         gimple_try rather than a plain gimple.
279         (gimple_stmt_may_fallthru): Add checked cast to gimple_try.
281         * gimple-pretty-print.c (dump_gimple_try): Require a gimple_try
282         rather than a plain gimple.
283         (pp_gimple_stmt_1): Add checked cast to gimple_try within
284         GIMPLE_TRY case of switch statement.
286         * tree-eh.c (finally_tree_node::parent): Strengthen field from
287         gimple to gimple_try.
288         (record_in_finally_tree): Require a gimple_try rather than a plain
289         gimple.
290         (collect_finally_tree): Likewise.
291         (collect_finally_tree_1): Likewise.
292         (struct leh_tf_state::try_finally_expr): Strengthen field from
293         gimple to gimple_try.
294         (struct leh_tf_state::top_p): Likewise.
295         (lower_eh_must_not_throw): Require a gimple_try rather than a
296         plain gimple.
297         (frob_into_branch_around): Likewise.
298         (lower_try_finally_dup_block): Strengthen local from gimple to
299         gimple_try.
300         (honor_protect_cleanup_actions): Split out uses of "x" into new
301         locals "eh_mnt" and "try_stmt" with stronger types.
302         (lower_try_finally): Require a gimple_try rather than a plain
303         gimple.
304         (lower_catch): Likewise.
305         (lower_eh_filter): Likewise.
306         (lower_eh_must_not_throw): Likewise.
307         (lower_cleanup): Likewise.
308         (lower_eh_constructs_2): Add checked cast to gimple_try within
309         GIMPLE_TRY case of switch statement, introducing new local
310         "try_stmt", using it for type-safety.
312 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
314         Use subclasses of gimple in various places
316         * asan.c (insert_if_then_before_iter): Require a gimple cond
317         rathern than a plain gimple.
318         (asan_expand_check_ifn): Add a checked cast to gimple_cond.
320         * cfgloopmanip.c (create_empty_if_region_on_edge): Likewise.
322         * omp-low.c (simd_clone_adjust): Strengthen local from gimple
323         to gimple_phi.
325         * sese.c (set_ifsese_condition): Strengthen local from gimple to
326         gimple_cond.
328         * tree-call-cdce.c (gen_one_condition): Strengthen locals from
329         gimple to gimple_assign and gimple_cond.
331         * tree-ssa-phiopt.c (minmax_replacement): Likewise.
332         (cond_store_replacement): Strengthen locals from gimple to
333         gimple_phi and gimple_assign.
334         (cond_if_else_store_replacement_1): Likewise.
336         * tree-ssa-pre.c (do_regular_insertion): Strengthen local from
337         gimple to gimple_assign.
339         * tree-switch-conversion.c (hoist_edge_and_branch_if_true):
340         Strengthen local from gimple to gimple_cond.
341         (gen_def_assigns): Return a gimple_assign rather than a plain
342         gimple.
343         (gen_inbound_check): Strengthen locals from gimple to gimple_cond
344         and gimple_assign.
346         * tree-vect-loop-manip.c (slpeel_add_loop_guard): Strengthen local
347         from gimple to gimple_cond.
348         (set_prologue_iterations): Strengthen locals from gimple to
349         gimple_phi and gimple_cond.
351         * value-prof.c (gimple_ic): Strengthen local from gimple to
352         gimple_phi.
353         (gimple_stringop_fixed_value): Strengthen locals from gimple to
354         gimple_assign, gimple_cond, gimple_call, and gimple_phi.
356 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
358         Introduce gimple_eh_dispatch
360         * coretypes.h (gimple_eh_dispatch): New typedef.
361         (const_gimple_eh_dispatch): New typedef.
363         * gimple-pretty-print.c (dump_gimple_eh_dispatch): Require a
364         gimple_eh_dispatch rather than a plain gimple.
365         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_dispatch
366         within GIMPLE_EH_DISPATCH case of switch statement.
368         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
370         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
372         * gimple.c (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
373         rather than a plain gimple.
375         * gimple.h (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
376         rather than a plain gimple.
377         (gimple_eh_dispatch_region): Require a const_gimple_eh_dispatch
378         rather than a plain const_gimple.
379         (gimple_eh_dispatch_set_region): Require a gimple_eh_dispatch
380         rather than a plain gimple.
382         * tree-cfg.c (make_edges): Add a checked cast to gimple_eh_dispatch
383         within GIMPLE_EH_DISPATCH case of switch statement.
384         (gimple_verify_flow_info): Likewise.
385         (gimple_redirect_edge_and_branch): Likewise.
386         (move_stmt_r): Likewise, adding a local.
388         * tree-eh.c (emit_eh_dispatch): Convert local from gimple to
389         gimple_eh_dispatch.
390         (make_eh_dispatch_edges): Require a gimple_eh_dispatch rather than
391         a plain gimple.
392         (redirect_eh_dispatch_edge): Likewise.
393         (lower_eh_dispatch): Likewise.
394         (execute_lower_eh_dispatch): Add a checked cast to
395         gimple_eh_dispatch.
396         (mark_reachable_handlers): Likewise.
397         (verify_eh_dispatch_edge): Require a gimple_eh_dispatch rather
398         than a plain gimple.
400         * tree-eh.h (make_eh_dispatch_edges): Likewise.
401         (redirect_eh_dispatch_edge): Likewise.
402         (verify_eh_dispatch_edge): Likewise.
404         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
405         gimple_eh_dispatch within GIMPLE_EH_DISPATCH case of switch
406         statement, adding a local.
407         (copy_edges_for_bb): Add a checked cast to gimple_eh_dispatch.
409 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
411         Introduce gimple_resx
413         * coretypes.h (gimple_resx): New typedef.
414         (const_gimple_resx): New typedef.
416         * gimple.h (gimple_build_resx): Return a gimple_resx rather than a
417         plain gimple.
418         (gimple_resx_region): Require a const_gimple_resx rather than a
419         plain const_gimple.
420         (gimple_resx_set_region): Require a gimple_resx rather than a
421         plain gimple.
423         * gimple-pretty-print.c (dump_gimple_resx): Require a gimple_resx
424         rather than a plain gimple.
425         (pp_gimple_stmt_1): Add a checked cast to gimple_resx within
426         GIMPLE_RESX case of switch statement.
428         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
430         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
432         * gimple.c (gimple_build_resx): Return a gimple_resx rather than
433         a plain gimple.
435         * tree-cfg.c (move_stmt_r): Add a checked cast to gimple_resx
436         within GIMPLE_RESX case of switch statement, adding a new local.
438         * tree-eh.c (emit_resx): Convert local "x" from gimple to
439         gimple_resx.
440         (lower_resx): Require a gimple_resx rather than a plain gimple.
441         (pass_lower_resx::execute): Add a checked cast to gimple_resx.
442         (mark_reachable_handlers): Likewise.
444         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
445         gimple_resx within GIMPLE_RESX case of switch statement, adding
446         a new local.
448 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
450         Introduce gimple_eh_else
452         * coretypes.h (gimple_eh_else): New typedef.
453         (const_gimple_eh_else): New typedef.
455         * gimple.h (gimple_build_eh_else): Return a gimple_eh_else rather
456         than a plain gimple.
457         (gimple_eh_else_n_body_ptr): Require a gimple_eh_else rather than
458         a plain gimple.
459         (gimple_eh_else_n_body): Likewise.
460         (gimple_eh_else_e_body_ptr): Likewise.
461         (gimple_eh_else_e_body): Likewise.
462         (gimple_eh_else_set_n_body): Likewise.
463         (gimple_eh_else_set_e_body): Likewise.
465         * gimple-low.c (lower_stmt): Add checked cast to gimple_eh_else
466         within GIMPLE_EH_ELSE case of switch statement, introducing a new
467         local.
468         (gimple_stmt_may_fallthru): Likewise.
470         * gimple-pretty-print.c (dump_gimple_eh_else): Require a
471         gimple_eh_else rather than a plain gimple.
472         (pp_gimple_stmt_1): Add checked cast to gimple_eh_else within
473         GIMPLE_EH_ELSE case of switch statement
475         * gimple-walk.c (walk_gimple_stmt): Add checked cast to
476         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
477         introducing a new local.
479         * gimple.c (gimple_build_eh_else): Return a gimple_eh_else
480         rather than a plain gimple.
481         (gimple_copy): Add checked casts to gimple_eh_else within
482         GIMPLE_EH_ELSE case of switch statement, introducing new locals.
484         * tree-cfg.c (verify_gimple_in_seq_2): Add checked cast to
485         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
486         introducing a new local.
488         * tree-eh.c (collect_finally_tree): Likewise.
489         (replace_goto_queue_1): Likewise.
490         (get_eh_else): Return a gimple_eh_else rather than a plain gimple.
491         (honor_protect_cleanup_actions): Convert local "eh_else" from
492         gimple to gimple_eh_else.
493         (lower_try_finally_nofallthru): Likewise.
494         (lower_try_finally_onedest): Introduce locals "eh_else" and
495         "label_stmt", using them in favor of "x" for the gimple_eh_else
496         and the gimple_label.
497         (lower_try_finally_copy): Convert local "eh_else" from gimple to
498         gimple_eh_else.
499         (lower_try_finally_switch): Likewise.
500         (decide_copy_try_finally): Likewise.
501         (refactor_eh_r): Add checked cast to gimple_eh_else within
502         GIMPLE_EH_ELSE case of switch statement, introducing a new local.
504 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
506         Introduce gimple_eh_must_not_throw
508         * coretypes.h (gimple_eh_must_not_throw): New typedef.
509         (const_gimple_eh_must_not_throw): New typedef.
511         * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
512         a gimple_eh_must_not_throw rather than a plain gimple.
513         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
514         within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
516         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
518         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
520         * gimple.c (gimple_build_eh_must_not_throw): Return a
521         gimple_eh_must_not_throw rather than a plain gimple.
523         * gimple.h (gimple_build_eh_must_not_throw): Return a
524         gimple_eh_must_not_throw rather than a plain gimple.
525         (gimple_eh_must_not_throw_fndecl): Require a
526         gimple_eh_must_not_throw rather than a plain gimple.
527         (gimple_eh_must_not_throw_set_fndecl): Likewise.
529         * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
531 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
533         Introduce gimple_eh_filter
535         * coretypes.h (gimple_eh_filter): New typedef.
536         (const_gimple_eh_filter): New typedef.
538         * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
539         rather than a plain gimple.
541         * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
542         gimple_eh_filter rather than a plain gimple.
543         (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
544         GIMPLE_EH_FILTER case of switch statement.
546         * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
547         rather than a plain gimple.
549 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
551         Introduce gimple_catch
553         * coretypes.h (gimple_catch): New typedef.
554         (const_gimple_catch): New typedef.
556         * gimple-low.c (lower_try_catch): Add checked cast to gimple_catch.
557         (gimple_try_catch_may_fallthru): Likewise.
559         * gimple-pretty-print.c (dump_gimple_catch): Require a gimple_catch
560         rather than a plain gimple.
561         (pp_gimple_stmt_1): Add checked cast to gimple_catch within
562         GIMPLE_CATCH case of switch statement.
564         * gimple-walk.c (walk_gimple_op): Likewise.
565         (walk_gimple_stmt): Likewise.
567         * gimple.c (gimple_build_catch): Return a gimple_catch rather than
568         a plain gimple.
569         (gimple_copy): Add checked casts to gimple_catch within
570         GIMPLE_CATCH case of switch statement, introducing new locals.
572         * gimple.h (gimple_build_catch): Return a gimple_catch rather than
573         a plain gimple.
574         (gimple_catch_types_ptr): Require a gimple_catch rather than a
575         plain gimple.
576         (gimple_catch_handler_ptr): Likewise.
577         (gimple_catch_handler): Likewise.
578         (gimple_catch_set_types): Likewise.
579         (gimple_catch_set_handler): Likewise.
581         * omp-low.c (lower_omp_1): Add checked cast to gimple_catch within
582         GIMPLE_CATCH case of switch statement.
584         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
585         (do_warn_unused_result): Likewise.
587         * tree-eh.c (collect_finally_tree): Likewise.
588         (replace_goto_queue_1): Likewise.
589         (lower_catch): Convert local from gimple to gimple_catch.
590         (refactor_eh_r): Add checked cast to gimple_catch within
591         GIMPLE_CATCH case of switch statement.
593         * tree-inline.c (remap_gimple_stmt): Likewise.
594         (estimate_num_insns): Add checked cast to gimple_catch within
595         GIMPLE_CATCH case of switch statement, introducing new local.
597 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
599         Introduce gimple_transaction
601         * coretypes.h (gimple_transaction): New typedef.
602         (const_gimple_transaction): New typedef.
604         * gimple.h (gimple_build_transaction): Return a gimple_transaction
605         rather than a plain gimple.
606         (gimple_transaction_body_ptr): Require a gimple_transaction rather
607         than a plain gimple.
608         (gimple_transaction_body): Likewise.
609         (gimple_transaction_label_ptr): Likewise.
610         (gimple_transaction_set_body): Likewise.
611         (gimple_transaction_set_label): Likewise.
612         (gimple_transaction_set_subcode): Likewise.
613         (gimple_transaction_label): Require a const_gimple_transaction
614         rather than a plain const_gimple.
615         (gimple_transaction_subcode): Likewise.
617         * gimple-low.c (lower_stmt): Add checked cast to
618         gimple_transaction within GIMPLE_TRANSACTION case of switch
619         statement.
621         * gimple-pretty-print.c (dump_gimple_transaction): Require a
622         gimple_transaction rather than a plain gimple.
623         (pp_gimple_stmt_1): Add checked cast to gimple_transaction within
624         GIMPLE_TRANSACTION case of switch statement.
625         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
626         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
627         * gimple-walk.c (walk_gimple_op): Likewise.
628         (walk_gimple_stmt): Likewise.
630         * gimple.c (gimple_build_transaction): Return a gimple_transaction
631         rather than a plain gimple.
632         (gimple_copy): Add checked casts to gimple_transaction within
633         GIMPLE_TRANSACTION case of switch statement.
635         * gimplify.c (gimplify_transaction): Split local "g" into
636         "body_stmt" and "trans_stmt", strengthening the type of the latter
637         from gimple to gimple_transaction.
639         * omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
640         within GIMPLE_TRANSACTION case of switch statement.
642         * trans-mem.c (diagnose_tm_1): Add checked cast within
643         GIMPLE_TRANSACTION case of switch statement, introducing a new
644         local "trans_stmt".  Use it in place of "stmt".
645         (examine_call_tm): Convert local from gimple to gimple_transaction.
646         (tm_region::get_transaction_stmt): New method.
647         (tm_region::transaction_stmt): Add clarification of type to the
648         comment.
649         (tm_region_init_0): Require a gimple_transaction rather than a
650         plain gimple.
651         (tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
652         dyn_cast<gimple_transaction> and new local.
653         (transaction_subcode_ior): Add a new local, using the new
654         get_transaction_stmt method to perform a checked cast.
655         (propagate_tm_flags_out): Likewise.
656         (expand_transaction): Add a checked cast using the new
657         get_transaction_stmt method.
658         (generate_tm_state): Likewise.
659         (execute_tm_mark): Likewise.
660         (ipa_tm_diagnose_transaction): Likewise.
662         * tree-cfg.c (verify_gimple_transaction): Require a
663         gimple_transaction rather than a plain gimple.
664         (make_edges): Add checked cast within GIMPLE_TRANSACTION case of
665         switch statement
666         (cleanup_dead_labels): Likewise.
667         (verify_gimple_stmt): Likewise.
668         (verify_gimple_in_seq_2): Likewise.
669         (verify_gimple_in_seq_2): Likewise.
670         (gimple_redirect_edge_and_branch): Add checked cast.
672         * tree-inline.c (remap_gimple_stmt): Add checked cast within
673         GIMPLE_TRANSACTION case of switch statement, introducing a new
674         local "old_trans_stmt".  Use it in place of "stmt".  Add new
675         local "new_trans_stmt", using it to initialize "copy", and for
676         type-safe operations as a transaction.
677         (estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
678         case of switch statement.
680 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
682         Introduce gimple_asm
684         * coretypes.h (gimple_asm): New typedef.
685         (const_gimple_asm): New typedef.
687         * gimple.h (gimple_build_asm_vec): Return a gimple_asm rather than
688         just a gimple.
689         (gimple_asm_clobbers_memory_p): Require a const_gimple_asm rather
690         than just a const_gimple.
691         (gimple_asm_ninputs): Likewise.
692         (gimple_asm_noutputs): Likewise.
693         (gimple_asm_nclobbers): Likewise.
694         (gimple_asm_nlabels): Likewise.
695         (gimple_asm_input_op): Likewise.
696         (gimple_asm_input_op_ptr): Likewise.
697         (gimple_asm_output_op): Likewise.
698         (gimple_asm_output_op_ptr): Likewise.
699         (gimple_asm_clobber_op): Likewise.
700         (gimple_asm_label_op): Likewise.
701         (gimple_asm_string): Likewise.
702         (gimple_asm_volatile_p): Likewise.
703         (gimple_asm_input_p): Likewise.
704         (gimple_asm_set_input_op): Require a gimple_asm rather than a plain
705         gimple.
706         (gimple_asm_set_output_op): Likewise.
707         (gimple_asm_set_clobber_op): Likewise.
708         (gimple_asm_set_label_op): Likewise.
709         (gimple_asm_set_volatile): Likewise.
710         (gimple_asm_set_input): Likewise.
712         * cfgexpand.c (expand_asm_stmt): Require a gimple_asm rather than
713         a plain gimple.
714         (expand_gimple_stmt_1): Add checked cast to gimple_asm within
715         GIMPLE_ASM case of switch statement.
717         * gimple-fold.c (fold_stmt_1): Add new local from checked cast to
718         gimple_asm within case GIMPLE_ASM.
720         * gimple-pretty-print.c (dump_gimple_asm): Require a gimple_asm
721         rather than a plain gimple.
722         (pp_gimple_stmt_1): Add checked cast to gimple_asm within
723         GIMPLE_ASM case of switch statement.
725         * gimple-streamer-in.c (input_gimple_stmt): Rework existing
726         checked cast to gimple_asm; add a new one.
728         * gimple-streamer-out.c (output_gimple_stmt): Add new local from
729         checked cast to gimple_asm within case GIMPLE_ASM.
731         * gimple-walk.c (walk_gimple_asm): Require a gimple_asm rather
732         than a plain gimple.
733         (walk_gimple_op): Add checked cast to gimple_asm within GIMPLE_ASM
734         case of switch statement.
735         (walk_stmt_load_store_addr_ops): Use dyn_cast<gimple_asm> in place
736         of a code check against GIMPLE_ASM to introduce a new gimple_asm
737         local.
739         * gimple.c (gimple_build_asm_1): Return a gimple_asm rather than
740         a plain gimple.
741         (gimple_build_asm_vec): Likewise.
742         (gimple_has_side_effects): Add a checked cast to gimple_asm.
743         (gimple_could_trap_p_1): Likewise.
744         (gimple_call_builtin_p): Require a const_gimple_asm rather then
745         a const_gimple.
747         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
748         and a new local of type gimple_asm within GIMPLE_ASM case.
750         * gimplify.c (gimplify_asm_expr): Convert a local from gimple to
751         gimple_asm.
753         * ipa-pure-const.c (check_stmt): Add checked casts within
754         GIMPLE_ASM case.
756         * ssa-iterators.h (op_iter_init): Likewise.
758         * tree-cfg.c (make_goto_expr_edges): Convert a local from gimple
759         to gimple_asm.
760         (cleanup_dead_labels): Add a checked cast and a new local of type
761         gimple_asm within GIMPLE_ASM case.
762         (gimple_redirect_edge_and_branch): Likewise.
763         (is_ctrl_altering_stmt): Add a checked cast.
764         (need_fake_edge_p): Replace a code check against GIMPLE_ASM with a
765         dyn_cast<gimple_asm>.
767         * tree-complex.c (expand_complex_comparison): Convert a local from
768         gimple to gimple_asm.
770         * tree-data-ref.c (get_references_in_stmt): Add a checked cast to
771         gimple_asm.
773         * tree-eh.c (stmt_could_throw_p): Likewise.
775         * tree-inline.c (estimate_num_insns): Likewise.
777         * tree-sra.c (scan_function): Add a checked cast and a new local
778         of type gimple_asm within GIMPLE_ASM case.
779         (sra_modify_function_body): Likewise.
780         (ipa_sra_modify_function_body): Likewise.
782         * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
784         * tree-ssa-dce.c (propagate_necessity): Replace a code check
785         against GIMPLE_ASM with a dyn_cast<gimple_asm>.
787         * tree-ssa-operands.c (maybe_add_call_vops): Require a gimple_asm
788         rather than a plain gimple.
789         (parse_ssa_operands): Add a checked cast to gimple_asm.
791         * tree-ssa-structalias.c (find_func_aliases): Replace a check for
792         GIMPLE_ASM with a dyn_cast<gimple_asm>, introducing  a new local
793         "asm_stmt", using it in place of "t" for typesafety.
795         * tree-ssa-threadedge.c
796         (record_temporary_equivalences_from_stmts_at_dest): Add a checked
797         cast to gimple_asm.
799         * tree-ssa.c (execute_update_addresses_taken): Add checked casts
800         and new locals of type gimple_asm within clauses guarded by code
801         check.
803 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
805         Introduce gimple_goto
807         * coretypes.h (gimple_goto): New typedef.
808         (const_gimple_goto): New typedef.
810         * gimple.h (gimple_statement_goto): New subclass of
811         gimple_statement_with_ops, adding the invariant that
812         stmt->code == GIMPLE_GOTO.
813         (is_a_helper <gimple_statement_goto>::test): New.
814         (gimple_build_goto): Return a gimple_goto rather than a
815         plain gimple.
817         * gimple-pretty-print.c (dump_gimple_goto): Require a gimple_goto
818         rather than a plain gimple.
819         (pp_gimple_stmt_1): Add a checked cast to gimple_goto within
820         GIMPLE_GOTO case of switch statement.
822         * gimple.c (gimple_build_goto): Return a gimple_goto rather than a
823         plain gimple.
825         * tree-cfg.c (verify_gimple_goto): Require a gimple_goto rather
826         than a plain gimple.
827         (verify_gimple_stmt): Add a checked cast to gimple_goto within
828         GIMPLE_GOTO case of switch statement.
830 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
832         Introduce gimple_return
834         * coretypes.h (gimple_return): New typedef.
835         (const_gimple_return): New typedef.
837         * gimple.h (gimple_statement_return): New subclass of
838         gimple_statement_with_memory_ops, adding the invariant that
839         stmt->code == GIMPLE_RETURN.
840         (is_a_helper <gimple_statement_return>::test): New.
841         (gimple_build_return): Return a gimple_return rather
842         than a plain gimple.
844         * gimple.c (gimple_build_return): Return a gimple_return rather
845         than a plain gimple.
847         * cgraphunit.c (expand_thunk): Convert local from a gimple to
848         a gimple_return.
850         * gimple-low.c (struct return_statements_t): Convert field "stmt"
851         from a gimple to a gimple_return.
852         (lower_gimple_return): Convert local from a gimple to a
853         gimple_return.
855         * gimple-pretty-print.c (dump_gimple_return): Require a
856         gimple_return rather than a plain gimple.
857         (pp_gimple_stmt_1): Add a checked cast to gimple_return within
858         case GIMPLE_RETURN of switch statement.
860         * gimplify.c (gimplify_return_expr): Convert locals from
861         gimple to gimple_return.
863         * ipa-split.c (split_function): Likewise.
865         * tree-cfg.c (verify_gimple_assign): Require a gimple_return
866         rather than a plain gimple.
867         (verify_gimple_stmt): Add checked cast to gimple_return within
868         case GIMPLE_RETURN of switch statement.
870         * tree-tailcall.c (adjust_return_value): Convert local from
871         gimple to gimple_return.
873 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
875         Introduce gimple_call
877         * coretypes.h (gimple_call): New typedef.
878         (const_gimple_call): New typedef.
880         * asan.c (get_mem_refs_of_builtin_call): Require a
881         const_gimple_call rather than a const gimple.
882         (has_stmt_been_instrumented_p): Add a checked cast to
883         gimple_call.
884         (instrument_strlen_call): Likewise.
885         (instrument_builtin_call): Likewise.
886         * builtins.c (validate_gimple_arglist): Require a
887         const_gimple_call rather than a const gimple.
888         (fold_call_stmt): Require a gimple_call rather than a gimple.
889         * builtins.h (validate_gimple_arglist): Require a
890         const_gimple_call rather than a const gimple.
891         (fold_call_stmt): Require a gimple_call rather than a gimple.
892         * cfgexpand.c (expand_call_stmt): Likewise.
893         (expand_gimple_stmt_1): Add a checked cast to gimple_call within
894         GIMPLE_CALL case.
895         * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Strengthen
896         local "new_stmt" from gimple to gimple_call, adding a checked
897         cast.
898         * cgraphunit.c (cgraph_node::expand_thunk): Likewise for local
899         "call".
900         * gimple-fold.c (gimple_fold_builtin_snprintf_chk): Likewise for
901         local "stmt".
902         (gimple_fold_builtin_snprintf): Likewise.
903         (gimple_fold_builtin): Likewise.
904         (gimple_fold_call): Likewise.
905         (gimple_fold_stmt_to_constant_1): Introduce local "call_stmt" via
906         checked cast of "stmt" to gimple_call, using it in various places
907         for typesafety.
908         * gimple-pretty-print.c (dump_gimple_call_args): Strengthen param
909         2 from gimple to gimple_call.
910         (dump_gimple_call): Likewise.
911         (pp_gimple_stmt_1): Add a checked cast to gimple_call within
912         GIMPLE_CALL case.
913         * gimple-streamer-in.c (input_gimple_stmt): Replace is_gimple_call
914         with a dyn_cast<gimple_call>, introducing local "call_stmt", and
915         using it in place of "stmt" for typesafety.  Add a checked cast
916         in statement guarded by check for GIMPLE_CALL.
917         * gimple-walk.c (walk_gimple_op): Add a checked cast to
918         gimple_call.
919         * gimple.c (gimple_call_reset_alias_info): Strengthen param from
920         gimple to gimple_call.
921         (gimple_build_call_1): Strengthen return type and local from
922         gimple to gimple_call.
923         (gimple_build_call_vec): Likewise.
924         (gimple_build_call): Likewise.
925         (gimple_build_call_valist): Likewise.
926         (gimple_build_call_internal_1): Likewise.
927         (gimple_build_call_internal): Likewise.
928         (gimple_build_call_internal_vec): Likewise.
929         (gimple_build_call_from_tree): Likewise.
930         (gimple_call_return_flags): Strengthen param from
931         const_gimple to const_gimple_call.
932         (gimple_call_copy_skip_args): Strengthen return type and local from
933         gimple to gimple_call.
934         * gimple.h (gimple_call_reset_alias_info): Strengthen param from
935         gimple to gimple_call.
936         (gimple_build_call_vec): Strengthen return type from gimple to
937         gimple_call.
938         (gimple_build_call): Likewise.
939         (gimple_build_call_valist): Likewise.
940         (gimple_build_call_internal): Likewise.
941         (gimple_build_call_internal_vec): Likewise.
942         (gimple_build_call_from_tree): Likewise.
943         (gimple_call_return_flags): Strengthen param from const_gimple to
944         const_gimple_call.
945         (gimple_call_copy_skip_args): Strengthen return type from gimple
946         to gimple_call.
947         (gimple_call_set_internal_fn): Strengthen param "call_stmt" from
948         gimple to gimple_call.
949         (gimple_call_return_type): Strengthen param from const_gimple to
950         const_gimple_call.
951         (gimple_call_chain_ptr): Likewise.
952         (gimple_call_set_chain): Strengthen param from gimple to
953         gimple_call.
954         (gimple_call_set_return_slot_opt): Likewise.
955         (gimple_call_set_from_thunk): Likewise.
956         (gimple_call_from_thunk_p): Likewise.
957         (gimple_call_set_va_arg_pack): Likewise.
958         (gimple_call_va_arg_pack_p): Likewise.
959         (gimple_call_set_alloca_for_var): Likewise.
960         (gimple_call_alloca_for_var_p): Likewise.
961         (gimple_expr_type): Introduce local "call_stmt" via a checked cast
962         and use it for typesafety.
963         * gimplify.c (gimplify_call_expr): Strengthen local "call" from
964         gimple to gimple_call.
965         (gimplify_modify_expr_to_memcpy): Likewise for local "gs".
966         (gimplify_modify_expr_to_memset): Likewise.
967         (gimplify_modify_expr): Add a checked cast to gimple_call.
968         (gimplify_expr): Strengthen local "call" from gimple to
969         gimple_call.
970         (gimplify_function_tree): Likewise.
971         * internal-fn.c (expand_LOAD_LANES): Strengthen param from gimple
972         to gimple_call.
973         (expand_STORE_LANES): Likewise.
974         (expand_ANNOTATE): Likewise.
975         (expand_GOMP_SIMD_LANE): Likewise.
976         (expand_GOMP_SIMD_VF): Likewise.
977         (expand_GOMP_SIMD_LAST_LANE): Likewise.
978         (expand_UBSAN_NULL): Likewise.
979         (expand_UBSAN_BOUNDS): Likewise.
980         (expand_UBSAN_OBJECT_SIZE): Likewise.
981         (expand_ASAN_CHECK): Likewise.
982         (ubsan_expand_si_overflow_addsub_check): Likewise.
983         (ubsan_expand_si_overflow_neg_check): Likewise.
984         (ubsan_expand_si_overflow_mul_check): Likewise.
985         (expand_UBSAN_CHECK_ADD): Likewise.
986         (expand_UBSAN_CHECK_SUB): Likewise.
987         (expand_UBSAN_CHECK_MUL): Likewise.
988         (expand_LOOP_VECTORIZED): Likewise.
989         (expand_MASK_LOAD): Likewise.
990         (expand_MASK_STORE): Likewise.
991         (expand_ABNORMAL_DISPATCHER): Likewise.
992         (expand_BUILTIN_EXPECT): Likewise.
993         (internal_fn_expanders): Likewise for entries in this table.
994         (expand_internal_call): Likewise.
995         * internal-fn.def: Update comment to reflect strengthening of
996         param of expanders.
997         * internal-fn.h (expand_internal_call): Strengthen param from
998         gimple to gimple_call.
999         * ipa-prop.c (ipa_modify_call_arguments): Likewise for local
1000         "new_stmt".
1001         * ipa-pure-const.c (check_call): Likewise for param "call".
1002         (check_stmt): Add a checked cast to gimple_call within GIMPLE_CALL
1003         case.
1004         * ipa-split.c (split_function): Strengthen local "call" from
1005         gimple to gimple_call.
1006         * omp-low.c (build_omp_barrier): Likewise for local "g".
1007         (lower_rec_input_clauses): Likewise for local "stmt".
1008         * trans-mem.c (build_tm_load): Likewise for return type and local
1009         "gcall".
1010         (build_tm_store): Likewise.
1011         (expand_transaction): Likewise for local "call".
1012         * tree-call-cdce.c (check_pow): Likewise for param.
1013         (check_builtin_call): Likewise.
1014         (is_call_dce_candidate): Likewise.
1015         (gen_conditions_for_pow): Likewise.
1016         (gen_shrink_wrap_conditions): Likewise.
1017         (shrink_wrap_one_built_in_call): Likewise.
1018         (shrink_wrap_conditional_dead_built_in_calls): Strengthen param
1019         from vec<gimple> to vec<gimple_call>, and local "bi_call" from
1020         gimple to gimple_call.
1021         (pass_call_cdce::execute): Strengthen local
1022         "cond_dead_built_in_calls" from auto_vec<gimple> to
1023         auto_vec<gimple_call> and local "stmt" from gimple to gimple_call,
1024         * tree-cfg.c (notice_special_calls): Strengthen param from gimple
1025         to gimple_call.
1026         * tree-cfg.h (notice_special_calls): Likewise.
1027         * tree-complex.c (expand_complex_libcall): Likewise for local
1028         "stmt".
1029         * tree-inline.c (remap_gimple_stmt): Add checked cast to
1030         gimple_call.
1031         (copy_bb): Likewise.  Strengthen local "new_call" from gimple to
1032         gimple_call.
1033         (inline_forbidden_p_stmt): Add checked cast to gimple_call.
1034         * tree-nested.c (init_tmp_var_with_call): Strengthen param "call"
1035         from gimple to gimple_call.
1036         (convert_nl_goto_reference): Likewise for local "call".
1037         (convert_tramp_reference_op): Likewise.
1038         (convert_gimple_call): Add checked cast to gimple_call.
1039         * tree-nrv.c (dest_safe_for_nrv_p): Strengthen param "call" from
1040         gimple to gimple_call.
1041         (pass_return_slot::execute): Likewise for local "stmt", using a
1042         dyn_cast<gimple_call> rather than an is_gimple_call call.
1043         * tree-object-size.c (alloc_object_size): Strengthen param "call"
1044         from const_gimple to const_gimple_call.
1045         (pass_through_call): Likewise.
1046         (call_object_size): Strengthen param "call" from gimple to
1047         gimple_call.
1048         (collect_object_sizes_for): Introduce local "call_stmt" via a
1049         checked cast, using it for typesafety.
1050         (check_for_plus_in_loops_1): Likewise.
1051         (pass_object_sizes::execute): Add a checked cast to gimple_call.
1052         * tree-profile.c (gimple_gen_interval_profiler): Strengthen local
1053         "call" from gimple to gimple_call.
1054         (gimple_gen_pow2_profiler): Likewise.
1055         (gimple_gen_one_value_profiler): Likewise.
1056         (gimple_gen_time_profiler): Likewise.
1057         (gimple_gen_average_profiler): Likewise.
1058         (gimple_gen_ior_profiler): Likewise.
1059         * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise for
1060         param "call".
1061         (ref_maybe_used_by_call_p): Likewise.
1062         (ref_maybe_used_by_stmt_p): Add a checked cast to gimple_call.
1063         (call_may_clobber_ref_p_1): Strengthen param "call" from gimple to
1064         gimple_call.
1065         (call_may_clobber_ref_p): Likewise.
1066         (stmt_may_clobber_ref_p_1): Add a checked cast to gimple_call.
1067         * tree-ssa-alias.h (call_may_clobber_ref_p): Strengthen param 1
1068         from gimple to gimple_call.
1069         (call_may_clobber_ref_p_1): Likewise.
1070         * tree-ssa-dce.c (eliminate_unnecessary_stmts): Add a checked cast
1071         to gimple_call.
1072         * tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Strengthen
1073         local "call" from gimple to gimple_call.
1074         * tree-ssa-math-opts.c (build_and_insert_call): Likewise for local
1075         "call_stmt".
1076         * tree-ssa-operands.c (maybe_add_call_vops): Likewise for param
1077         "stmt".
1078         (parse_ssa_operands): Add a checked cast to gimple_call within
1079         GIMPLE_CALL case.
1080         * tree-ssa-pre.c (compute_avail): Add a checked cast to
1081         gimple_call.
1082         * tree-ssa-sccvn.c (copy_reference_ops_from_call): Strengthen
1083         param "call" from gimple to gimple_call.
1084         (valueize_shared_reference_ops_from_call): Likewise.
1085         (vn_reference_lookup_3): Add a checked cast to gimple_call.
1086         (vn_reference_lookup_call): Strengthen param "call" from gimple to
1087         gimple_call.
1088         (visit_reference_op_call): Likewise for param "stmt".
1089         (visit_use): Replace is_gimple_call with a dyn_cast, introducing
1090         local "call_stmt", using it in place of "stmt" for type-safety.
1091         * tree-ssa-sccvn.h (vn_reference_lookup_call): Strengthen param 1
1092         from gimple to gimple_call.
1093         * tree-ssa-structalias.c (get_call_vi): Likewise.
1094         (lookup_call_use_vi): Likewise.
1095         (lookup_call_clobber_vi): Likewise.
1096         (get_call_use_vi): Likewise.
1097         (get_call_clobber_vi): Likewise.
1098         (handle_rhs_call): Likewise.
1099         (handle_lhs_call): Likewise.
1100         (handle_const_call): Likewise.
1101         (handle_pure_call): Likewise.
1102         (get_fi_for_callee): Likewise.
1103         (find_func_aliases_for_builtin_call): Likewise for param 2.
1104         (find_func_aliases_for_call): Likewise.
1105         (find_func_aliases): Add a checked cast to gimple_call.
1106         (find_func_clobbers): Replace is_gimple_call with a dyn_cast,
1107         introducing local "call_stmt", using it in place of "stmt" for
1108         type-safety.
1109         (compute_points_to_sets): Strengthen local "stmt" from gimple to
1110         gimple_call, replacing is_gimple_call with a
1111         dyn_cast <gimple_call>.
1112         (ipa_pta_execute): Likewise.
1113         * tree-ssa-threadedge.c
1114         (record_temporary_equivalences_from_stmts_at_dest): Add checked
1115         cast to gimple_call.
1116         * tree-tailcall.c (find_tail_calls): Strengthen local "call" from
1117         gimple to gimple_call, adding a checked cast.
1118         * tree-vect-data-refs.c (vect_setup_realignment): Eliminate
1119         top-level local "new_stmt" in favor of more tightly-scoped locals
1120         "new_stmt" of type gimple_assign and gimple_call.
1121         * tree-vect-patterns.c (vect_recog_pow_pattern): Strenghthen local
1122         "stmt" from gimple to gimple_call.
1123         * tree-vect-stmts.c (vectorizable_function): Likewise for param
1124         "call".
1125         (vectorizable_call): Rename param 1 from "stmt" to "gs",
1126         reintroducing "stmt" as a gimple_call once we've established that
1127         we're working with a GIMPLE_CALL.
1128         * tree-vectorizer.h (vectorizable_function): Strengthen param 1
1129         from gimple to gimple_call.
1130         * value-prof.c (check_ic_target): Likewise.
1131         (gimple_ic_transform): Likewise for local "stmt", replacing a
1132         check for GIMPLE_CALL with a dyn_cast.
1133         (interesting_stringop_to_profile_p): Strengthen param "call"
1134         from gimple to gimple_call.
1135         (gimple_stringop_fixed_value): Likewise for param "vcall_stmt".
1136         (gimple_stringops_transform): Likewise for local "stmt",
1137         replacing a check for GIMPLE_CALL with a dyn_cast.
1138         (gimple_stringops_values_to_profile): Rename param 1 from "stmt"
1139         to "gs", reintroducing "stmt" as a gimple_call once we've
1140         established that we're working with a GIMPLE_CALL.
1141         * vtable-verify.c (verify_bb_vtables): Strengthen local
1142         "call_stmt" from gimple to gimple_call.
1144 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1146         Concretize get_loop_exit_condition et al to working on gimple_cond
1148         * tree-scalar-evolution.h (get_loop_exit_condition): Return a
1149         gimple_cond.
1150         * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
1151         concretizing local "res" from gimple to gimple_cond.
1152         * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
1153         locals from gimple to gimple_cond.
1154         (slpeel_can_duplicate_loop_p): Likewise.
1155         * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
1156         (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
1158 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1160         Update various expressions within tree-scalar-evolution.c to be gimple_phi
1162         * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
1163         rather than a gimple.
1164         (follow_ssa_edge_binary): Likewise.
1165         (follow_ssa_edge_expr): Likewise.
1166         (follow_ssa_edge_in_rhs): Likewise.
1167         (backedge_phi_arg_p): Likewise.
1168         (follow_ssa_edge_in_condition_phi_branch): Likewise.
1169         (follow_ssa_edge_in_condition_phi): Likewise.
1170         (follow_ssa_edge_inner_loop_phi): Likewise.
1171         (analyze_evolution_in_loop): Likewise.
1172         (analyze_initial_condition): Likewise.
1173         (interpret_loop_phi): Likewise.
1174         (interpret_condition_phi): Likewise.
1175         (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
1177         (analyze_scalar_evolution_1): Add checked casts to gimple_phi
1178         within "case GIMPLE_PHI".
1180 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1182         tree-ssa-loop-ivopts.c: use gimple_phi in a few places
1184         * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
1185         (find_bivs): Convert local "phi" into a gimple_phi.
1186         (mark_bivs): Likewise.
1188 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1190         tree-ssa-loop-manip.c: use gimple_phi in three places
1192         * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
1193         gimple_phi.
1194         (split_loop_exit_edge): Likewise for "phi" and "new_phi".
1196 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1198         tree-ssa-loop-niter.c: use gimple_phi in a few places
1200         * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
1201         rather than a gimple.
1202         (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
1203         (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
1205 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1207         tree-ssa-phiprop.c: use gimple_phi
1209         * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
1210         parameter "phi" and local "new_phi" from gimple to gimple_phi.
1212 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1214         tree-predcom.c: use gimple_phi in various places
1216         * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
1217         than just a gimple.
1218         (insert_looparound_copy): Require a gimple_phi rather than just a
1219         gimple.
1220         (add_looparound_copies): Convert local "phi" to be a gimple_phi.
1221         (initialize_root_vars): Likewise.
1222         (initialize_root_vars_lm): Likewise.
1224 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1226         tree-parloops.c: use gimple_phi in various places
1228         * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
1229         from gimple to gimple_phi.
1230         (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
1231         (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
1232         (gather_scalar_reductions): Convert to a gimple_phi_iterator and
1233         gimple_phi.
1234         (try_create_reduction_list): Likewise.
1236 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1238         Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
1240         * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
1241         type of parameter from gimple to gimple_phi.
1243         * tree-complex.c (complex_visit_phi): Update signature of callback
1244         implementation accordingly.
1245         * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
1246         * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
1247         * tree-vrp.c (vrp_visit_phi_node): Likewise.
1249         * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
1250         gimple_phi when invoking the ssa_prop_visit_phi callback.
1252 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1254         Introduce gimple_phi_iterator
1256         * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
1257         gimple_stmt_iterator with identical layout, but adding...
1258         (gimple_phi_iterator::phi): ...new method, equivalent to
1259         gsi_stmt (), but casting the underlying gimple to gimple_phi,
1260         checking that code == GIMPLE_PHI in a checked build.
1261         (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
1262         gimple_stmt_iterator.
1264         * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
1265         than just a gimple.
1266         (if_convertible_phi_p): Likewise.
1267         * tree-phinodes.h (add_phi_node_to_bb): Likewise.
1268         * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
1270         * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
1271         and a vec<gimple_phi> *, rather than just a gimple and
1272         vec<gimple> *, and a hash_set<gimple_phi> * rather than a
1273         hash_set<gimple> *.
1274         (find_uninit_use): Likewise; add checked cast to gimple_phi when
1275         adding to worklist.
1276         (pass_late_warn_uninitialized::execute): Strengthen types of
1277         various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
1278         "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
1279         gimple_phi, "added_to_worklist" from hash_set<gimple> to
1280         hash_set<gimple_phi>.
1282         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
1283         gimple_phi_iterator * rather than a gimple_stmt_iterator *;
1284         use it to strengthen local from a gimple to a gimple_phi.
1286         * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
1287         gimple_stmt_iterator to a gimple_phi_iterator.  Use the iterator's
1288         "phi" method rather than gsi_stmt.  Use this checked cast to convert
1289         the type of related local from a plain gimple to a gimple_phi.
1290         * gimple-pretty-print.c (dump_phi_nodes): Likewise.
1291         * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
1292         Likewise.
1293         * sese.c (sese_add_exit_phis_edge): Likewise.
1294         * tree-cfg.c (reinstall_phi_args): Likewise.
1295         (gimple_make_forwarder_block): Likewise.
1296         (add_phi_args_after_copy_edge): Likewise.
1297         (gimple_lv_adjust_loop_header_phi): Likewise.
1298         * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
1299         (remove_forwarder_block_with_phi): Likewise.
1300         (merge_phi_nodes): Likewise.
1301         * tree-complex.c (update_phi_components): Likewise.
1302         * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
1303         * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
1304         (copy_phis_for_bb): Likewise.
1305         * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
1306         * tree-outof-ssa.c (eliminate_build): Likewise.
1307         (eliminate_useless_phis): Likewise.
1308         (rewrite_trees): Likewise.
1309         (insert_backedge_copies): Likewise.
1310         * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
1311         (remove_phi_args): Likewise.
1312         (remove_phi_nodes): Likewise.
1313         * tree-predcom.c (find_looparound_phi): Likewise.
1314         (eliminate_temp_copies): Likewise.
1315         * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
1316         (scev_const_prop): Likewise; also, add checked cast to phi.
1317         * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
1318         * tree-ssa-dce.c (remove_dead_phis): Likewise.
1319         (forward_edge_to_pdom): Likewise.
1320         * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
1321         (cprop_into_successor_phis): Likewise.
1322         (propagate_rhs_into_lhs): Likewise.
1323         (eliminate_degenerate_phis_1): Likewise.
1324         * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
1325         * tree-ssa-live.c (calculate_live_on_exit): Likewise.
1326         (verify_live_on_entry): Likewise.
1327         * tree-ssa-loop-im.c
1328         (move_computations_dom_walker::before_dom_children): Likewise.
1329         * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
1330         (mark_bivs): Likewise.
1331         (find_interesting_uses_outside): Likewise.
1332         (determine_set_costs): Likewise.
1333         * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
1334         (tree_transform_and_unroll_loop): Likewise.
1335         (rewrite_all_phi_nodes_with_iv): Likewise.
1336         (canonicalize_loop_ivs): Likewise.
1337         * tree-ssa-loop-niter.c (determine_value_range): Likewise.
1338         * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
1339         * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
1340         * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
1341         * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
1342         (vop_phi): Likewise.
1343         * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
1344         Likewise.
1345         * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
1346         (copy_phi_args): Likewise.
1347         (phi_args_equal_on_edges): Likewise.
1348         * tree-ssa.c (ssa_redirect_edge): Likewise.
1349         (flush_pending_stmts): Likewise.
1350         * tree-switch-conversion.c (check_final_bb): Likewise.
1351         (gather_default_values): Likewise.
1352         (build_constructors): Likewise.
1353         (fix_phi_nodes): Likewise.
1354         * tree-tailcall.c (propagate_through_phis): Likewise.
1355         (add_successor_phi_arg): Likewise.
1356         * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
1357         Likewise.
1358         (slpeel_update_phi_nodes_for_guard2): Likewise.
1359         (slpeel_tree_peel_loop_to_edge): Likewise.
1360         (vect_can_advance_ivs_p): Likewise.
1361         (vect_update_ivs_after_vectorizer): Likewise.
1362         * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
1363         * tree-vrp.c (find_assert_locations): Likewise.
1364         * value-prof.c (gimple_ic): Likewise.
1366         * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
1368 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1370         Introduce gimple_phi and use it in various places
1372         * coretypes.h (gimple_phi): New typedef.
1373         (const_gimple_phi): New typedef.
1375         * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
1376         variants, using the gimple printer.
1378         * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
1379         vecs of more concrete gimple subclasses as appropriate; also the
1380         comment is about to become misleading.
1382         * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
1383         rather than spelling out the full type.
1384         (gimple_phi_num_args): Likewise.
1385         (gimple_phi_result): Likewise.
1386         (gimple_phi_result_ptr): Use gimple_phi typedef.
1387         (gimple_phi_set_result): Likewise.
1388         (gimple_phi_arg): Likewise.
1389         (gimple_phi_set_arg): Likewise.
1390         * tree-phinodes.c (allocate_phi_node): Likewise.
1391         (resize_phi_node): Likewise.
1392         (reserve_phi_args_for_new_edge): Likewise.
1393         (remove_phi_arg_num): Likewise.
1395         * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
1396         rather than just a gimple.
1397         * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
1399         * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
1400         just a gimple.
1401         (create_phi_node): Likewise.
1402         * tree-phinodes.h (create_phi_node): Likewise.
1404         * trans-mem.c (struct struct tm_log_entry): Replace use of
1405         now-removed gimple_vec with a plain vec<gimple>.
1407         * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
1408         vec<gimple_vec> to a vec< vec<gimple_phi> >.
1410         * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
1411         gimple_phi.
1412         * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
1413         "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
1414         a gimple_phi.
1415         * tree-into-ssa.c (delete_update_ssa): Strengthen local
1416         "phis" from a gimple_vec to a vec<gimple_phi>.
1418         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
1419         gimple_phi in regions where a stmt is known to have code
1420         GIMPLE_PHI.
1421         * tree-into-ssa.c (mark_use_interesting): Likewise.
1423 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1425         Introduce gimple_debug and use it in a few places
1427         * coretypes.h (gimple_debug): New typedef.
1428         (const_gimple_debug): New typedef.
1430         * gimple.h (struct gimple_statement_debug): New subclass of
1431         gimple_statement_with_ops, adding the invariant that
1432         stmt->code == GIMPLE_DEBUG.
1433         (is_a_helper <gimple_statement_debug>::test): New.
1435         * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
1436         variants, using the gimple printer.
1438         * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
1439         rather than just a gimple.
1440         * tree-inline.c (copy_debug_stmt): Likewise.
1442         * tree-inline.h (struct copy_body_data): Strengthen field
1443         "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
1445         * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
1446         rather than just a gimple.
1447         (gimple_build_debug_source_bind_stat): Likewise.
1448         * gimple.h (gimple_build_debug_bind_stat): Likewise.
1449         (gimple_build_debug_source_bind_stat): Likewise.
1451         * tree-inline.c (remap_gimple_stmt): Update locals to be a
1452         gimple_debug.
1453         (maybe_move_debug_stmts_to_successors): Likewise.
1454         (copy_debug_stmts): Likewise.
1456         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
1457         gimple_debug in regions where a stmt is known to have code
1458         GIMPLE_DEBUG.
1460 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1462         Introduce gimple_label and use it in a few places
1464         * coretypes.h (gimple_label): New typedef.
1465         (const_gimple_label): New typedef.
1467         * gimple.h (struct gimple_statement_label): New subclass of
1468         gimple_statement_with_ops, adding the invariant that
1469         stmt->code == GIMPLE_LABEL.
1470         (is_a_helper <gimple_statement_label>::test): New.
1472         * gdbhooks.py (build_pretty_printer): Add gimple_label and its
1473         variants, reusing the gimple printer.
1475         * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
1476         rather than just a gimple.
1477         * tree-cfg.c (verify_gimple_label): Likewise.
1479         * gimple.c (gimple_build_label): Return a gimple_label rather than
1480         just a gimple.
1481         * gimple.h (gimple_build_label): Likewise.
1483         * gimplify.c (gimplify_case_label_expr): Update local to be a
1484         gimple_label.
1485         * tree-switch-conversion.c (gen_inbound_check): Likewise.
1487         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
1488         gimple_label in regions where a stmt is known to have code
1489         GIMPLE_LABEL.
1490         * tree-cfg.c (verify_gimple_stmt): Likewise.
1492 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1494         Introduce gimple_assign and use it in various places
1496         * coretypes.h (gimple_assign): New typedef.
1497         (const_gimple_assign): New typedef.
1499         * gimple.h (struct gimple_statement_assign): New subclass of
1500         gimple_statement_with_memory_ops, adding the invariant that
1501         stmt->code == GIMPLE_ASSIGN.
1502         (is_a_helper <gimple_statement_assign>::test): New.
1504         * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
1505         variants, using the gimple printer.
1507         * gimple-builder.c (build_assign): Return a gimple_assign rather
1508         than just a gimple from each of the overloaded variants.
1509         (build_type_cast): Likewise.
1510         * gimple-builder.h (build_assign): Likewise.
1511         (build_type_cast): Likewise.
1512         * gimple.c (gimple_build_assign_stat): Likewise.
1513         (gimple_build_assign_with_ops): Likewise.
1514         * gimple.h (gimple_build_assign_stat): Likewise.
1515         (gimple_build_assign_with_ops): Likewise.
1517         * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
1518         rather than just a "const gimple" (the latter is not a
1519         "const_gimple").
1520         * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
1521         rather than just a gimple.
1522         (dump_binary_rhs): Likewise.
1523         (dump_ternary_rhs): Likewise.
1524         * tree-cfg.c (verify_gimple_assign_unary): Likewise.
1525         (verify_gimple_assign_binary): Likewise.
1526         (verify_gimple_assign_ternary): Likewise.
1527         (verify_gimple_assign_single): Likewise.
1528         (verify_gimple_assign): Likewise.
1529         * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
1530         (try_to_simplify): Likewise.
1531         * tree-tailcall.c (process_assignment): Likewise.
1532         * tree-vect-generic.c (expand_vector_operation): Likewise.
1533         * tree-vrp.c (extract_range_from_cond_expr): Likewise.
1534         (extract_range_from_assignment): Likewise.
1536         * asan.c (has_stmt_been_instrumented_p): Add checked cast to
1537         gimple_assign in regions where a stmt is known to have code
1538         GIMPLE_ASSIGN.
1539         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1540         * tree-cfg.c (verify_gimple_stmt): Likewise.
1541         * tree-ssa-sccvn.c (visit_use): Likewise.
1542         * tree-tailcall.c (find_tail_calls): Likewise.
1543         * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
1545         * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
1546         against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
1547         a gimple_assign local.
1549         * tree-vect-generic.c (expand_vector_condition): Convert local to a
1550         gimple_assign, adding a checked cast when extracting from gsi, since
1551         this is only called when  underlying stmt has code GIMPLE_ASSIGN.
1552         (optimize_vector_constructor): Likewise.
1553         (lower_vec_perm): Likewise.
1554         (expand_vector_operations_1): Convert local to a gimple_assign,
1555         introducing a dyn_cast.
1557 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1559         Introduce gimple_cond and use it in various places
1561         * coretypes.h (gimple_cond): New typedef.
1562         (const_gimple_cond): Likewise.
1564         * gimple.h (struct gimple_statement_cond): New subclass of
1565         gimple_statement_with_ops, adding the invariant that
1566         stmt->code == GIMPLE_COND.
1567         (is_a_helper <gimple_statement_cond>::test): New.
1568         (gimple_build_cond): Return a gimple_cond, rather than just
1569         a gimple.
1570         (gimple_build_cond_from_tree): Likewise.
1572         * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
1573         variants, using the gimple printer.
1575         * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
1576         than just a gimple.
1577         * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
1578         (gimple_cond_true_p): Likewise.
1579         (gimple_cond_false_p): Likewise.
1580         (gimple_cond_set_condition): Likewise.
1581         * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
1582         * gimple-fold.c (fold_gimple_cond): Likewise.
1583         * gimple-pretty-print.c (dump_gimple_cond): Likewise.
1584         * tree-ssa-dom.c (canonicalize_comparison): Likewise.
1585         * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
1586         * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
1587         (recognize_bits_test): Likewise.
1588         * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
1589         (thread_around_empty_blocks): Likewise.
1590         (thread_through_normal_block): Likewise.
1591         (thread_across_edge): Likewise.
1592         * tree-ssa-threadedge.h (thread_across_edge): Likewise.
1593         * tree-vrp.c (range_fits_type_p): Likewise.
1595         * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
1596         gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
1597         * gimple-fold.c (fold_stmt_1): Likewise.
1598         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1599         * tree-ssa-dom.c (optimize_stmt): Likewise.
1600         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
1601         * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
1602         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
1603         Likewise.
1604         * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
1606         * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
1607         gimple_cond.
1608         * tree-vrp.c (identify_jump_threads): Likewise.
1610         * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
1611         just a gimple.
1612         (gimple_build_cond_from_tree): Likewise.
1614         * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
1615         field "m_dummy_cond" from a plain gimple to a gimple_cond.
1617         * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
1618         inner_stmt and outer_stmt so that inner_cond and outer_cond can be
1619         of type gimple_cond once we know that we have code == GIMPLE_COND.
1620         * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
1621         "last" so that stmt can be of type gimple_cond.
1623 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1625         Introduce gimple_bind and use it for accessors.
1627         * coretypes.h (gimple_bind): New typedef.
1628         (const_gimple_bind): New typedef.
1630         * gdbhooks.py (build_pretty_printer): Add gimple_bind
1631         and its variants, using the gimple printer.
1633         * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
1634         require a gimple_bind rather than just a gimple.
1636         * gimple.c (gimple_build_bind): Return a gimple_bind rather than
1637         just a gimple.
1638         * gimple.h (gimple_build_bind): Likewise.
1640         * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
1642         * gimple.h (gimple_bind_vars): Update type-signature to
1643         require a gimple_bind rather than just a gimple, removing
1644         as_a and hence run-time check.
1645         (gimple_bind_set_vars): Likewise.
1646         (gimple_bind_append_vars): Likewise.
1647         (gimple_bind_body_ptr): Likewise.
1648         (gimple_bind_body): Likewise.
1649         (gimple_bind_set_body): Likewise.
1650         (gimple_bind_add_stmt): Likewise.
1651         (gimple_bind_add_seq): Likewise.
1652         (gimple_bind_block): Likewise.
1653         (gimple_bind_set_block): Likewise.
1654         * gimplify.c (gimple_push_bind_expr): Likewise.
1655         (gimple_current_bind_expr): Likewise.
1656         * tree-inline.c (copy_gimple_bind): Likewise.
1658         * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
1659         rather than a plain gimple.
1660         (gimplify_body): Likewise.
1661         (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
1662         a vec<gimple>.
1664         * gimplify.c (struct gimplify_ctx): Strengthen field
1665         "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
1666         (gimple_bind_expr_stack): Likewise for type of returned value.
1668         * gimplify.c (gimplify_body): Strengthen various types from gimple
1669         to gimple_bind, including the return type.
1671         * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
1672         so that local "scope" can be of type gimple_bind once we've reached
1673         the region where it must be of code GIMPLE_BIND.
1675         * gimple-low.c (lower_gimple_bind): Add checked cast to
1676         gimple_bind, since both callers (lower_function_body and
1677         lower_stmt) have checked the code for us.
1679         * gimple.c (gimple_copy): Add checked cast to gimple_bind in
1680         region guarded by check for code GIMPLE_BIND.
1681         * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
1682         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1683         * gimple-walk.c (walk_gimple_stmt): Likewise.
1684         * omp-low.c (scan_omp_1_stmt): Likewise.
1685         (lower_omp_1): Likewise.
1686         (lower_omp_for): Likewise.
1687         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
1688         (do_warn_unused_result): Likewise.
1689         * tree-inline.c (remap_gimple_stmt): Likewise.
1690         (estimate_num_insns): Likewise.
1691         * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
1693         * gimplify.c (gimplify_bind_expr): Update local(s) to be a
1694         gimple_bind rather than just a gimple.
1695         (gimplify_function_tree): Likewise.
1696         * omp-low.c (lower_omp_sections): Likewise.
1697         (lower_omp_single): Likewise.
1698         (lower_omp_master): Likewise.
1699         (lower_omp_taskgroup): Likewise.
1700         (lower_omp_ordered): Likewise.
1701         (lower_omp_critical): Likewise.
1702         (lower_omp_taskreg): Likewise.
1703         (lower_omp_teams): Likewise.
1704         * omp-low.c (lower_omp_for): Likewise; use
1705         gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
1706         (lower_omp_target): Likewise.
1707         * tree-nested.c (finalize_nesting_tree_1): Likewise.
1709         * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
1710         * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
1712 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1714         Introduce gimple_switch and use it in various places
1716         * gimple.h (gimple_statement_switch): New subclass of
1717         gimple_statement_with_ops, adding the invariant that
1718         stmt->code == GIMPLE_SWITCH.
1719         (is_a_helper <gimple_statement_switch>::test (gimple)): New.
1721         * coretypes.h (gimple_switch): New typedef
1722         (const_gimple_switch): Likewise.
1724         * gdbhooks.py (build_pretty_printer): Add gimple_switch
1725         and its variants, using the gimple printer.
1727         * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
1728         rather than just a gimple.
1729         (gimple_build_switch): Likewise.
1730         * gimple.h (gimple_build_switch_nlabels): Likewise.
1731         (gimple_build_switch): Likewise.
1733         * gimple.h (gimple_switch_num_labels): Update type-signature to
1734         require a gimple_switch rather than just a gimple.
1735         (gimple_switch_set_num_labels): Likewise.
1736         (gimple_switch_set_index): Likewise.
1737         (gimple_switch_label): Likewise.
1738         (gimple_switch_set_label): Likewise.
1739         (gimple_switch_default_label): Likewise.
1740         (gimple_switch_set_default_label): Likewise.
1741         * expr.h (expand_case): Likewise.
1742         * gimple-pretty-print.c (dump_gimple_call): Likewise.
1743         * stmt.c (compute_cases_per_edge): Likewise.
1744         (expand_case): Likewise.
1745         * tree-cfg.h (group_case_labels_stmt): Likewise.
1746         * tree-cfg.c (make_gimple_switch_edges): Likewise.
1747         (find_taken_edge_switch_expr) Likewise.
1748         (find_case_label_for_value) Likewise.
1749         (get_cases_for_edge): Likewise.
1750         (group_case_labels_stmt): Likewise.
1751         (verify_gimple_switch): Likewise.
1752         * tree-eh.c (verify_norecord_switch_expr): Likewise.
1753         * tree-eh.c (lower_eh_constructs_2): Likewise.
1754         * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
1755         * tree-ssa-dom.c (record_edge_info): Likewise.
1756         * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
1757         (simplify_gimple_switch): Likewise.
1758         * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
1759         (collect_switch_conv_info): Likewise.
1760         (build_constructors): Likewise.
1761         (array_value_type): Likewise.
1762         (build_one_array): Likewise.
1763         (build_arrays): Likewise.
1764         (gen_inbound_check): Likewise.
1765         * tree-vrp.c (find_switch_asserts): Likewise.
1766         (find_case_label_range): Likewise.
1767         (find_case_label_ranges): Likewise.
1768         (vrp_visit_switch_stmt): Likewise.
1769         (simplify_switch_using_ranges): Likewise.
1771         * tree-vrp.c (switch_update): Strengthen field "stmt" from being
1772         merely a gimple to being a gimple_switch.
1774         * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
1775         gimple_switch in regions where the stmt code has been tested as
1776         GIMPLE_SWITCH.
1777         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1778         * tree-cfg.c (make_edges): Likewise.
1779         (end_recording_case_labels): Likewise.
1780         (cleanup_dead_labels): Likewise.
1781         (cleanup_dead_labels): Likewise.
1782         (group_case_labels): Likewise.
1783         (find_taken_edge): Likewise.
1784         (find_case_label_for_value): Likewise.
1785         (verify_gimple_stmt): Likewise.
1786         (gimple_verify_flow_info): Likewise.
1787         (gimple_redirect_edge_and_branch): Likewise.
1788         * tree-inline.c (estimate_num_insns): Likewise.
1789         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
1790         * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
1791         * tree-switch-conversion.c (do_switchconv): Likewise.
1792         * tree-vrp.c  (find_assert_locations_1): Likewise.
1793         (vrp_visit_stmt): Likewise.
1794         (simplify_stmt_using_ranges): Likewise.
1796         * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
1797         Introduce local "lastg" as a generic gimple, so that local "last"
1798         can be of type gimple_switch once lastg's code has been verified.
1800         * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
1801         the GIMPLE_SWITCH case.
1803         * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
1804         argument, since the caller (find_taken_edge) has checked that
1805         last_stmt is a switch.
1807 Copyright (C) 2014 Free Software Foundation, Inc.
1809 Copying and distribution of this file, with or without modification,
1810 are permitted in any medium without royalty provided the copyright
1811 notice and this notice are preserved.