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