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