Concretize gimple_eh_filter_set_types and gimple_eh_filter_set_failure
[official-gcc.git] / gcc / ChangeLog.gimple-classes
blobba0f5c195bcd7c346ba2d6817bead0170117dff9
1 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
3         Concretize gimple_eh_filter_set_types and gimple_eh_filter_set_failure
5         * gimple.h (gimple_eh_filter_set_types): Require a gimple_eh_filter.
6         (gimple_eh_filter_set_failure): Likewise.
7         * gimple.c (gimple_copy): Add checked casts to gimple_eh_filter
8         within GIMPLE_EH_FILTER case.
10 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
12         Concretize gimple_label_label
14         * gimple.h (gimple_label_label): Require a const_gimple_label
15         rather than just a const_gimple.
17         * cfgexpand.c (label_rtx_for_bb): Convert local from gimple to
18         gimple_label, replacing a check against GIMPLE_LABEL with a
19         dyn_cast<gimple_label>.
20         * predict.c (tree_estimate_probability_bb): Likewise.
21         * tree-cfg.c (make_edges): Likewise.
22         (cleanup_dead_labels): Likewise (twice).
23         (gimple_can_merge_blocks_p): Likewise.
24         (gimple_block_label): Likewise.
25         * tree-eh.c (unsplit_eh): Likewise.
26         (cleanup_empty_eh_unsplit): Likewise.
27         * tree-inline.c (mark_local_labels_stmt): Likewise.
28         * tree-nested.c (convert_nl_goto_receiver): Likewise.
30         * cfgexpand.c (expand_gimple_stmt_1): Add a checked cast to
31         gimple_label when invoking gimple_label_label in a region where
32         we've checked the code is GIMPLE_LABEL.
33         * gimple-pretty-print.c (pp_cfg_jump): Likewise.
34         * gimple.c (gimple_set_bb): Likewise.
35         * ipa-pure-const.c (check_stmt): Likewise.
36         * omp-low.c (diagnose_sb_1): Likewise.
37         * tree-cfg.c (gimple_verify_flow_info): Likewise.
38         * tree-cfgcleanup.c (tree_forwarder_block_p): Likewise.
39         (remove_forwarder_block): Likewise.
40         * tree-eh.c (collect_finally_tree): Likewise.
42         * ipa-split.c (verify_non_ssa_vars): Replace a check against
43         GIMPLE_LABEL with a dyn_cast<gimple_label>, introducing a
44         gimple_label local.
45         * tree-cfg.c (gimple_can_merge_blocks_p): Likewise.
46         (gimple_merge_blocks): Likewise.
47         (remove_bb): Likewise.
48         (stmt_starts_bb_p): Likewise.
49         (gimple_verify_flow_info): Likewise.
50         (move_block_to_fn): Likewise.
51         * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
52         (remove_forwarder_block_with_phi): Likewise.
53         * tree-ssa-ccp.c (optimize_unreachable): Likewise.
55 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
57         Concretize gimple_call_use_set and gimple_call_clobber_set
59         * gimple.h (gimple_call_use_set): Require a gimple_call.
60         (gimple_call_clobber_set): Likewise.
62 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
64         Concretize gimple_catch_types
66         * gimple.h (gimple_catch_types): Require a const_gimple_catch
67         rather than a const_gimple.
69 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
71         Make gimple_goto_set_dest require a gimple_goto
73         * gimple.h (gimple_goto_set_dest): Require a gimple_goto.
75         * tree-cfg.c (factor_computed_gotos): Add checked cast to
76         gimple_goto.
77         (cleanup_dead_labels): Likewise.
79 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
81         Make gimple_label_set_label require a gimple_label
83         * gimple.h (gimple_label_set_label): Require a gimple_label.
85 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
87         Concretize parameter to gimple_call_copy_skip_args
89         * gimple.c (gimple_call_copy_skip_args): Require a gimple_call.
90         * gimple.h (gimple_call_copy_skip_args): Likewise.
92 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
94         Various gimple to gimple_call conversions in IPA
96         * ipa-prop.c (detect_type_change_from_memory_writes): Require a
97         gimple_call rather than a plain gimple.
98         (detect_type_change): Likewise.
99         (detect_type_change_ssa): Likewise.
100         (compute_complex_assign_jump_func): Likewise.
101         (compute_complex_ancestor_jump_func): Likewise.
102         (compute_known_type_jump_func): Likewise.
103         (determine_locally_known_aggregate_parts): Likewise.
104         (ipa_compute_jump_functions_for_edge): Strengthen local "call" to
105         a gimple_call; add checked cast to gimple_phi.
106         (ipa_note_param_call): Require a gimple_call rather than a plain
107         gimple.
108         (ipa_analyze_indirect_call_uses): Likewise.
109         (ipa_analyze_virtual_call_uses): Likewise.
110         (ipa_analyze_call_uses): Likewise.
111         (ipa_analyze_stmt_uses):Add checked cast to gimple_call.
113         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
114         Replace use of is_gimple_call with dyn_cast<gimple_call> and a
115         new local "call_stmt".
117 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
119         Use gimple_call for callgraph edges
121         * cgraph.h (cgraph_edge::call_stmt): Strengthen field from plain
122         gimple to a gimple_call.
123         (cgraph_node::set_call_stmt_including_clones): Likewise for param
124         "new_stmt".
125         (cgraph_node::create_edge): Likewise for param "call_stmt".
126         (cgraph_node::create_indirect_edge): Likewise.
127         (cgraph_node::create_edge_including_clones): Likewise for param
128         "stmt".
129         (cgraph_edge::set_call_stmt): Likewise for param "new_stmt".
130         (cgraph_edge::clone): Likewise for param "call_stmt".
131         (symbol_table::create_edge): Likewise.
133         * cgraph.c (cgraph_edge::set_call_stmt): Require a gimple_call
134         rather than a plain gimple.
135         (symbol_table::create_edge): Likewise.
136         (cgraph_node::create_edge): Likewise.
137         (cgraph_node::create_indirect_edge): Likewise.
138         (cgraph_edge::redirect_call_stmt_to_callee): Strengthen local
139         "new_stmt" from gimple to gimple_call.
140         (cgraph_update_edges_for_call_stmt_node): Add checked casts to
141         gimple_call.
143         * cgraphbuild.c (pass_build_cgraph_edges::execute): Replace
144         is_gimple_call with dyn_cast<gimple_call> and new local
145         "call_stmt".
146         (cgraph_edge::rebuild_edges): Likewise.
148         * cgraphclones.c (cgraph_edge::clone): Require a gimple_call
149         rather than a plain gimple.
150         (cgraph_node::set_call_stmt_including_clones): Likewise.
151         (cgraph_node::create_edge_including_clones): Likewise.
153         * lto-streamer-in.c (fixup_call_stmt_edges_1): Add checked casts
154         to gimple_call.
156         * omp-low.c (simd_clone_adjust): Strengthen local "call" from
157         gimple to gimple_call.
159         * trans-mem.c (ipa_tm_insert_irr_call): Likewise for "g".
160         (ipa_tm_insert_gettmclone_call): Likewise; also strengthen "g2"
161         to gimple_assign.
163         * tree-emutls.c (gen_emutls_addr): Strengthen local "x" from
164         gimple to gimple_call.
166         * tree-inline.c (copy_bb): Replace is_gimple_call with
167         dyn_cast<gimple_call> and new local "call_stmt".
169         * value-prof.c (gimple_ic): Require and return a gimple_call,
170         rather than a plain gimple.
171         * value-prof.h (gimple_ic): Likewise.
173 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
175         Make gimple_call_return_slot_opt_p require a gimple_call.
177         * gimple.h (gimple_call_return_slot_opt_p): Require a gimple_call
178         rather than a plain gimple.
180         * gimple-walk.c (walk_stmt_load_store_addr_ops): Convert usage of
181         is_gimple_call to dyn_cast<gimple_call>, introducing a new local
182         "call_stmt".
184         * trans-mem.c (expand_call_tm): Split local "stmt", strengthening
185         from plain gimple to a gimple_call, and introducing new local
186         gimple_assign "assign_stmt".
188         * tree-inline.c (expand_call_inline):  Convert check of code against
189         GIMPLE_CALL to dyn_cast<gimple_call>, introducing a new local
190         "call_stmt".
192 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
194         More gimple_phi
196         * gimple.h (gimple_phi_set_result): Require a gimple_phi rather
197         than a plain gimple.
198         (gimple_phi_set_arg): Likewise.
200         * tree-outof-ssa.c (remove_gimple_phi_args): Likewise; add a checked
201         cast to gimple_phi.
203         * tree-sra.c (replace_removed_params_ssa_names): Add a checked
204         cast to gimple_phi.
206 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
208         Make gimple_phi_arg_edge require a gimple_phi
210         * gimple.h (gimple_phi_arg_edge): Require a gimple_phi rather
211         than a plain gimple.
213         * gimple-ssa-strength-reduction.c (ncd_with_phi): Strengthen
214         param "phi" from gimple to gimple_phi.  Add a checked cast.
215         (ncd_of_cand_and_phis): Add a checked cast.
217         * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Require a
218         gimple_phi_iterator; strengthen local "phi" from gimple to a
219         gimple_phi.
220         (rewrite_cross_bb_scalar_deps): Strengthen local "psi" from
221         a gimple_stmt_iterator to a gimple_phi_iterator.
222         (edge_initial_value_for_loop_phi): Require a gimple phi.
223         (initial_value_for_loop_phi): Likewise.
225         * ipa-split.c (consider_split): Convert "bsi" to a
226         gimple_phi_iterator and "stmt" to a gimple_phi.
228         * predict.c (predict_extra_loop_exits): Convert "phi_stmt" to be
229         a gimple_phi; introduce "lhs_def_stmt" as plain gimple.
230         (apply_return_prediction): Convert "phi" to be a gimple_phi.
232         * tree-cfg.c (replace_uses_by): Add checked cast to gimple_phi.
233         (verify_gimple_in_cfg): Introduce gimple_phi_iterator "gpi" and use
234         it to convert "phi" to a gimple_phi.
236         * tree-eh.c (cleanup_empty_eh_merge_phis): Convert "ngsi", "ogsi"
237         to be gimple_phi_iterators.  Convert "ophi", "nphi" to be
238         gimple_phi.
240         * tree-into-ssa.c (prepare_use_sites_for): Add checked cast to
241         gimple_phi.
243         * tree-ssa-coalesce.c (create_outofssa_var_map): Introduce
244         gimple_phi_iterator "gpi" and use it to convert "phi" to a
245         gimple_phi.
247         * tree-ssa-dce.c (propagate_necessity): Introduce local "phi",
248         from checked cast to gimple_phi.
250         * tree-ssa-live.c (set_var_live_on_entry): Add checked cast to
251         gimple_phi.
253         * tree-ssa-propagate.c (replace_phi_args_in): Require a gimple_phi
254         rather than a plain gimple.
255         (substitute_and_fold_dom_walker::before_dom_children): Introduce
256         gimple_phi_iterator "gpi".
258         * tree-ssa-sink.c (find_bb_for_arg): Require a gimple_phi rather
259         than a plain gimple.
260         (nearest_common_dominator_of_uses): Replace check of code against
261         GIMPLE_PHI with a dyn_cast<gimple_phi>, introducing a new local.
262         (statement_sink_location): Add checked cast to gimple_phi.
264         * tree-ssa-uninit.c (compute_uninit_opnds_pos): Require a
265         gimple_phi rather than a plain gimple.
266         (collect_phi_def_edges): Likewise.  Add a checked cast.
267         (find_def_preds): Strengthen param "phi" from gimple to
268         gimple_phi.
269         (prune_uninit_phi_opnds_in_unrealizable_paths): Likewise for
270         params "phi" and "flag_def".  Strenghen param "visited_phis" from
271         hash_set<gimple> * to hash_set<gimple_phi> *.  Convert
272         "flag_arg_def", "phi_arg_def" to gimple_phi using
273         dyn_cast<gimple_phi>.  Similarly, introduce new local
274         "opnd_def_phi".
275         (use_pred_not_overlap_with_undef_path_pred): Strengthen param
276         "phi" from gimple to gimple_phi, and param "visited_phis" from
277         hash_set<gimple> * to hash_set<gimple_phi> *.  Add a checked cast.
278         (is_use_properly_guarded): Likewise for params.
279         (find_uninit_use): Replace check of code against GIMPLE_PHI with
280         a dyn_cast<gimple_phi>, introducing a new local "use_phi".
281         Strengthen local "visited_phis" from hash_set<gimple> to
282         hash_set<gimple_phi>.
284 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
286         Update GRAPHITE to use more concrete gimple statement classes
288         * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
289         Strengthen local "psi" to be a gimple_phi_iterator and "phi" to
290         a gimple_phi.
292         * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Require
293         a gimple_phi rathen than a plain gimple.
294         (remove_simple_copy_phi): Require a gimple_phi_iterator;
295         strengthen local "phi" to be a gimple_phi and "stmt" to be a
296         gimple_assign.
297         (remove_invariant_phi): Likewise.
298         (simple_copy_phi_p): Require a gimple_phi.
299         (reduction_phi_p): Require a gimple_phi_iterator; strengthen
300         local "phi" to be a gimple_phi.
301         (add_condition_to_pbb): Require a gimple_cond rather than a
302         plain gimple.
303         (add_conditions_to_domain): Add checked cast to gimple_cond
304         within GIMPLE_COND case of switch statement.
305         (single_pred_cond_non_loop_exit): Return a gimple_cond rather
306         than a plain gimple, via a checked cast.
307         (sese_dom_walker::before_dom_children): Strengthen local "stmt"
308         from gimple to gimple_cond.
309         (gsi_for_phi_node): Require a gimple_phi, and return a
310         gimple_phi_iterator.
311         (insert_out_of_ssa_copy): Strengthen local "stmt" from gimple to
312         gimple_assign.
313         (rewrite_reductions_out_of_ssa): Strengthen "psi" to be a
314         gimple_phi_iterator, and "phi" to be a gimple_phi.
315         (phi_contains_arg): Require a gimple_phi.
316         (follow_ssa_with_commutative_ops): Strengthen return type from
317         gimple to gimple_phi, by converting a check for code GIMPLE_PHI to
318         a dyn_cast<gimple_phi>, and strengthening local "res" from gimple
319         to gimple_phi.
320         (detect_commutative_reduction_arg): Strengthen return type from
321         gimple to gimple_phi, and strengthen local "phi" to be a
322         gimple_phi.
323         (detect_commutative_reduction_assign): Strengthen return type from
324         gimple to gimple_phi, and strengthen local "res" to be a
325         gimple_phi.
326         (follow_inital_value_to_phi): Strengthen return type from
327         gimple to gimple_phi.  Replace check for code GIMPLE_PHI with
328         a dyn_cast<gimple_phi>.
329         (detect_commutative_reduction): Strengthen return type and locals
330         "loop_phi", "phi", "close_phi" from gimple to gimple_phi,
331         introducing a checked cast of "stmt" in region guarded by
332         scalar_close_phi_node_p (stmt).
333         (translate_scalar_reduction_to_array_for_stmt): Require param
334         "loop_phi" to be a gimple_phi.  Strengthen local "assign" from
335         gimple to gimple_assign.
336         (remove_phi): Require a gimple_phi.
337         (close_phi_written_to_memory): Likewise.
338         (translate_scalar_reduction_to_array): We expect the first element
339         in each vector to be an arbitrary statement, but all of the
340         subsequent elements to be phi nodes.  Hence the decls of gimple
341         locals "loop_phi" and "close_phi" are replaced with decls of gimple
342         "loop_stmt" and "close_stmt", with decls of the more-strongly typed
343         gimple_phi "loop_phi" and "close_phi" occurring lower down, within
344         the region where we're dealing with i > 0 and hence where we can
345         safely assign them using the checked cast as_a <gimple_phi>.
346         This allows many of the strengthenings from gimple to gimple_phi
347         above.  We eliminate the local "stmt", since we can simply use
348         "loop_stmt".
349         (rewrite_commutative_reductions_out_of_ssa_close_phi): Strengthen
350         param "close_phi" from gimple to gimple_phi, and local "gsi" from
351         gimple_stmt_iterator to gimple_phi_iterator, converting uses of
352         gsi_stmt to gsi.phi for type-safety.
353         (scop_ivs_can_be_represented): Strengthen local "gsi" from
354         gimple_stmt_iterator to gimple_phi_iterator, and "phi" from gimple
355         to gimple_phi.
357 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
359         Make gimple_phi_arg_set_location require a gimple_phi
361         * gimple.h (gimple_phi_arg_set_location): Require a gimple_phi
362         rather than a plain gimple.
364 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
366         Make add_phi_arg require a gimple_phi
368         * tree-phinodes.h (add_phi_arg): Require a gimple_phi rather than
369         a plain gimple.
370         * tree-phinodes.c (add_phi_arg): Likewise.
372         * gimple-ssa-strength-reduction.c (create_phi_basis): Strengthen
373         local "phi" from plain gimple to gimple_phi.
375         * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
376         Likewise for "close_phi".
378         * ipa-split.c (split_function): Convert "psi" to
379         gimple_phi_iterator.
381         * omp-low.c (expand_omp_for_static_nochunk): Introduce
382         gimple_phi_iterator gpi, using it to strengthen "phi" to be a
383         gimple_phi.
384         (expand_omp_for_static_chunk): Likewise.
386         * tree-cfg.c (gimple_duplicate_bb): Make topmost "gsi" decl more
387         tightly-scoped, and eliminate decls "phis", "phi", "stmt", "copy"
388         in favor of more tightly-scoped gimple_phi_iterator gpi and
389         gimple_phi decls "phi" and "copy", and gimple decls "stmt" and
390         "copy".
392         * tree-parloops.c (create_parallel_loop): Introduce
393         gimple_phi_iterator gpi, using it to strengthen "phi" to be a
394         gimple_phi.
396         * tree-ssa-loop-im.c (execute_sm_if_changed): Likewise.
398         * tree-ssa-loop-manip.c (create_iv): Split out new gimple_phi
399         local "phi" from "stmt", and convert the latter into being a
400         gimple_assign.
402         * tree-ssa-pre.c (insert_into_preds_of_block): Strengthen local
403         "phi" to be a gimple_phi.
405         * tree-ssa-tail-merge.c (vop_phi): Require a gimple_phi rather
406         than a plain gimple.
407         (replace_block_by): Strengthen local "bb2_phi" to be a gimple_phi.
409         * tree-tailcall.c (add_successor_phi_arg): Use gsi.phi when
410         invoking add_phi_arg.
411         (eliminate_tail_call): Introduce gimple_phi_iterator gpi, using it
412         to strengthen "phi" to be a gimple_phi.
413         (create_tailcall_accumulator): Strengthen local "phi" to be a
414         gimple_phi.
415         (tree_optimize_tail_calls_1): Likewise.
417         * tree-vect-data-refs.c (vect_setup_realignment): Strengthen
418         local "phi_stmt" to be a gimple_phi.
420         * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg):
421         Strengthen "gsi", "gsi_orig", "gsi_new" to be
422         gimple_phi_iterators, and "phi" "orig_phi", "new_phi" to be
423         gimple_phi instances.
424         (slpeel_tree_peel_loop_to_edge): Strengthen local "new_phi" to be
425         a gimple_phi.
427         * tree-vect-loop.c (get_initial_def_for_induction): Likewise for
428         "induction_phi".
429         (vect_create_epilog_for_reduction): Add checked casts to
430         gimple_phi; strengthen local "outer_phi" to gimple_phi and
431         "new_vec_stmt" to gimple_assign.
432         (vect_finalize_reduction): Strengthen local "vect_phi" to
433         gimple_phi.
434         (vectorizable_reduction): Likewise for "new_phi".
436         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
437         (vectorizable_load): Likewise for "phi".
439 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
441         Make gimple_phi_arg_def_ptr and gimple_phi_arg_has_location require a gimple_phi
443         * gimple.h (gimple_phi_arg_def_ptr): Require a gimple_phi rather
444         than a plain gimple.
445         (gimple_phi_arg_has_location): Likewise.
447         * gimple-streamer-in.c (input_phi): Return a gimple_phi rather
448         than a plain gimple.
449         * gimple-streamer-out.c (output_phi): Require a gimple_phi rather
450         than a plain gimple.
451         (output_bb): Convert iteration to a gimple_phi_iterator, and local
452         "phi" to gimple_phi.
454         * omp-low.c (expand_omp_for_static_chunk): Convert iterator "psi"
455         to a gimple_phi_iterator; convert locals "phi" and "nphi" to be
456         gimple_phi.
458         * tree-cfg.c (gimple_duplicate_sese_tail): Likewise for "psi" and
459         "phi".
460         (move_block_to_fn): Introduce new gimple_phi_iterator "psi", using
461         it in place of "gsi" where necessary.  Convert "phi" to be a
462         gimple_phi.
464         * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
466         * tree-vect-loop-manip.c (vect_loop_versioning): Convert "gsi" to
467         a gimple_phi_iterator, and "orig_phi" and "new_phi" to be
468         gimple_phi.
470         * tree.c (find_decls_types_in_node): Introduce new
471         gimple_phi_iterator "psi", using it in place of "si" where
472         necessary.  Convert "phi" to be a gimple_phi.
474 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
476         omp-low.c: Use more concrete types of gimple statement for various locals
478         * omp-low.c (finalize_task_copyfn): Strengthen local "bind" from
479         plain gimple to gimple_bind.
480         (lower_rec_input_clauses): Strengthen local "g" from
481         plain gimple to gimple_assign.
482         (lower_lastprivate_clauses): Likewise for "stmt" to gimple_cond
483         and "g" to gimple_call.
484         (expand_omp_for_init_vars): Likewise, for two decls of "stmt" to
485         gimple_assign.
486         (expand_omp_atomic_pipeline): Likewise for one decl of "stmt".
487         (expand_omp_atomic_mutex): Likewise.
488         (lower_omp_master): Likewise for "x" to gimple_call.
489         (lower_omp_ordered): Likewise.
491 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
493         tree-parloops.c: Use gimple_phi in various places
495         * tree-parloops.c (reduction_info::keep_res): Strengthen field
496         from plain gimple to gimple_phi.
497         (transform_to_exit_first_loop): Strengthen locals "phi", "nphi"
498         to gimple_phi.  Eliminate early decl of gimple_stmt_iterator gsi
499         in favor of more tightly scoped gimple_phi_iterators, and a final
500         later decl as a gimple_stmt_iterator.
502 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
504         Introduce gimple_omp_sections
506         * coretypes.h (gimple_omp_sections): New typedef.
507         (const_gimple_omp_sections): New typedef.
509         * gimple-pretty-print.c (dump_gimple_omp_sections): Require a
510         gimple_omp_sections rather than a plain gimple.
511         (pp_gimple_stmt_1): Add checked cast to gimple_omp_sections within
512         GIMPLE_OMP_SECTIONS case of switch statement.
514         * gimple.c (gimple_build_omp_sections): Return a
515         gimple_omp_sections rather than a plain gimple.
517         * gimple.h (gimple_build_omp_sections): Return a
518         gimple_omp_sections rather than a plain gimple.
520         * omp-low.c (scan_omp_sections): Require a gimple_omp_sections
521         rather than a plain gimple.
522         (scan_omp_1_stmt): Add checked cast to gimple_omp_sections within
523         GIMPLE_OMP_SECTIONS case of switch statement.
524         (expand_omp_sections): Strengthen local "sections_stmt" from gimple
525         to gimple_omp_sections.
526         (lower_omp_sections): Likewise for "stmt".
528 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
530         Introduce gimple_omp_teams
532         * coretypes.h (gimple_omp_teams): New typedef.
533         (const_gimple_omp_teams): New typedef.
535         * gimple.h (gimple_build_omp_teams): Return a gimple_omp_teams
536         rather than a plain gimple.
537         (gimple_omp_teams_set_clauses): Require a gimple_omp_teams rather
538         than a plain gimple.
540         * gimple-pretty-print.c (dump_gimple_omp_teams): Require a
541         gimple_omp_teams rather than a plain gimple.
542         (pp_gimple_stmt_1): Add checked cast to gimple_omp_teams within
543         GIMPLE_OMP_TEAMS case of switch statement.
545         * gimple.c (gimple_build_omp_teams): Return a gimple_omp_teams
546         rather than a plain gimple.
548         * omp-low.c (scan_omp_teams): Likewise.
549         (scan_omp_1_stmt): Add checked cast to gimple_omp_teams within
550         GIMPLE_OMP_TEAMS case of switch statement.
551         (lower_omp_teams): Strengthen local "teams_stmt" from gimple to
552         gimple_omp_teams.
554 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
556         Introduce gimple_omp_target
558         * coretypes.h (gimple_omp_target): New typedef.
559         (const_gimple_omp_target): New typedef.
561         * gimple.h (gimple_build_omp_target): Return a gimple_omp_target
562         rather than a plain gimple.
563         (gimple_omp_target_set_clauses): Require a gimple_omp_target
564         rather than a plain gimple.
565         (gimple_omp_target_set_kind): Likewise.
566         (gimple_omp_target_child_fn_ptr): Likewise.
567         (gimple_omp_target_set_child_fn): Likewise.
568         (gimple_omp_target_data_arg_ptr): Likewise.
569         (gimple_omp_target_set_data_arg): Likewise.
570         (gimple_omp_target_child_fn): Require a const_gimple_omp_target
571         rather than a plain const_gimple.
572         (gimple_omp_target_data_arg): Likewise.
574         * gimple-pretty-print.c (dump_gimple_omp_target): Require a
575         gimple_omp_target rather than a plain gimple.
576         (pp_gimple_stmt_1): Add checked cast to gimple_omp_target within
577         GIMPLE_OMP_TARGET case of switch statement.
579         * gimple.c (gimple_build_omp_target): Return a gimple_omp_target
580         rather than a plain gimple.
582         * gimplify.c (gimplify_omp_target_update): Strengthen local "stmt"
583         from gimple to gimple_omp_target.
585         * omp-low.c (scan_omp_target): Require a gimple_omp_target rather
586         than a plain gimple.
587         (scan_omp_1_stmt): Add checked cast to gimple_omp_target within
588         GIMPLE_OMP_TARGET case of switch statement.
589         (expand_omp_target): Strengthen local "entry_stmt" from gimple to
590         gimple_omp_target.
591         (lower_omp_target): Likewise for "stmt".
593         * tree-nested.c (convert_nonlocal_reference_stmt): Add checked
594         cast to gimple_omp_target.
595         (convert_local_reference_stmt): Likewise.
596         (convert_gimple_call): Likewise.
598 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
600         Introduce gimple_omp_single
602         * coretypes.h (gimple_omp_single): New typedef.
603         (const_gimple_omp_single): New typedef.
605         * gimple.h (gimple_build_omp_single): Return a gimple_omp_single
606         rather than a plain gimple.
607         (gimple_omp_single_set_clauses): Require a gimple_omp_single
608         rather than a plain gimple.
610         * gimple-pretty-print.c (dump_gimple_omp_single): Require a
611         gimple_omp_single rather than a plain gimple.
612         (pp_gimple_stmt_1): Add checked cast to gimple_omp_single within
613         GIMPLE_OMP_SINGLE case of switch statement.
615         * gimple.c (gimple_build_omp_single): Return a gimple_omp_single
616         rather than a plain gimple.
618         * omp-low.c (scan_omp_single): Require a gimple_omp_single rather
619         than a plain gimple.
620         (scan_omp_1_stmt): Add checked cast to gimple_omp_single within
621         GIMPLE_OMP_SINGLE case of switch statement.
622         (lower_omp_single_simple): Require a gimple_omp_single rather
623         than a plain gimple.
624         (lower_omp_single_copy): Likewise.
625         (lower_omp_single): Strengthen local "single_stmt" from gimple to
626         gimple_omp_single.
628 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
630         Introduce gimple_omp_task
632         * coretypes.h (gimple_omp_task): New typedef.
633         (const_gimple_omp_task): New typedef.
635         * gimple.h (gimple_build_omp_task): Return a gimple_omp_task
636         rather than a plain gimple.
638         * gimple-pretty-print.c (dump_gimple_omp_task): Require a
639         gimple_omp_task rather than a plain gimple.
640         (pp_gimple_stmt_1): Add checked cast to gimple_omp_task within
641         GIMPLE_OMP_TASK case of switch statement.
643         * gimple.c (gimple_build_omp_task): Return a gimple_omp_task
644         rather than a plain gimple.
646         * omp-low.c (finalize_task_copyfn): Require a gimple_omp_task
647         rather than a plain gimple.
648         (delete_omp_context): Add checked cast to gimple_omp_task.
649         (scan_omp_task): Strengthen local "stmt" from gimple to
650         gimple_omp_task.
651         (expand_task_call): Require a gimple_omp_task rather than a plain
652         gimple.
653         (expand_omp_taskreg): Add checked cast to gimple_omp_task.
654         (create_task_copyfn): Require a gimple_omp_task rather than a
655         plain gimple.
656         (lower_omp_taskreg): Add checked cast to gimple_omp_task.
658 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
660         tree-cfg.c: Make verify_gimple_call require a gimple_call
662         * tree-cfg.c (verify_gimple_call): Require a gimple_call rather
663         than a plain gimple.
664         (verify_gimple_stmt): Add checked cast to gimple_call within
665         GIMPLE_CALL case of switch statement.
667 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
669         Introduce gimple_omp_parallel
671         * coretypes.h (gimple_omp_parallel): New typedef.
672         (const_gimple_omp_parallel): New typedef.
674         * cgraphbuild.c (build_cgraph_edges): Convert check of code
675         against GIMPLE_OMP_PARALLEL to a dyn_cast <gimple_omp_parallel>
676         and new local.
678         * gimple-pretty-print.c (dump_gimple_omp_parallel): Require a
679         gimple_omp_parallel rather than a plain gimple.
680         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_parallel
681         within GIMPLE_OMP_PARALLEL case of switch statement.
683         * gimple-walk.c (walk_gimple_op): Likewise, introducing a local.
685         * gimple.c (gimple_build_omp_parallel): Return a
686         gimple_omp_parallel rather than a plain gimple.
687         (gimple_copy): Add checked casts to gimple_omp_parallel within
688         GIMPLE_OMP_PARALLEL case of switch statement, introducing locals.
690         * gimple.h (gimple_build_omp_parallel): Return a
691         gimple_omp_parallel rather than a plain gimple.
692         (gimple_omp_parallel_clauses_ptr): Require a gimple_omp_parallel
693         rather than a plain gimple.
694         (gimple_omp_parallel_set_clauses): Likewise.
695         (gimple_omp_parallel_data_arg_ptr): Likewise.
696         (gimple_omp_parallel_set_data_arg): Likewise.
697         (gimple_omp_parallel_child_fn_ptr): Likewise.
698         (gimple_omp_parallel_set_child_fn): Likewise.
699         (gimple_omp_parallel_child_fn): Require a
700         const_gimple_omp_parallel rather than a plain const_gimple.
701         (gimple_omp_parallel_data_arg): Likewise.
703         * omp-low.c (scan_omp_parallel): Strengthen local "stmt" from
704         gimple to gimple_omp_parallel.
705         (expand_parallel_call): Require a gimple_omp_parallel for
706         "entry_stmt" rather than a plain gimple.
707         (remove_exit_barrier):  Strengthen local "parallel_stmt" from
708         gimple to gimple_omp_parallel.
709         (expand_omp_taskreg): Add checked casts to gimple_omp_parallel.
711         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
712         gimple_omp_parallel within GIMPLE_OMP_PARALLEL case of switch
713         statement, introducing local.
715 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
717         Introduce gimple_omp_for
719         * coretypes.h (gimple_omp_for): New.
720         (const_gimple_omp_for): New.
722         * gimple.h (gimple_build_omp_for): Return a gimple_omp_for rather
723         than a plain gimple.
724         (gimple_omp_for_set_kind): Require a gimple_omp_for rather than a
725         plain gimple.
726         (gimple_omp_for_set_combined_p): Likewise.
727         (gimple_omp_for_set_combined_into_p): Likewise.
729         * gimple-pretty-print.c (dump_gimple_omp_for): Require a
730         gimple_omp_for rather than a plain gimple.
731         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_for in
732         GIMPLE_OMP_FOR case of switch statement.
734         * gimple.c (gimple_build_omp_for): Return a gimple_omp_for rather
735         than a plain gimple.
736         (gimple_copy): Add a checked cast to gimple_omp_for and a new local.
738         * gimplify.c (gimplify_omp_for): Strengthen local "gfor" from
739         gimple to gimple_omp_for.
741         * omp-low.c (omp_for_data::for_stmt): Strengthen field from gimple
742         to gimple_omp_for.
743         (extract_omp_for_data): Require a gimple_omp_for rather than a
744         plain gimple.
745         (workshare_safe_to_combine_p): Add a checked cast to
746         gimple_omp_for.
747         (get_ws_args_for): Convert check of code against GIMPLE_OMP_FOR
748         with a dyn_cast<gimple_omp_for> and a new local.
749         (scan_omp_parallel): Add a checked cast to gimple_omp_for and a
750         new local.
751         (scan_omp_for): Require a gimple_omp_for rather than a plain
752         gimple.
753         (scan_omp_1_stmt): Add a checked cast to gimple_omp_for in
754         GIMPLE_OMP_FOR case of switch statement.
755         (expand_omp_for): Add a checked cast to gimple_omp_for.
756         (lower_omp_for): Strengthen local "stmt" from gimple to
757         gimple_omp_for.
759         * tree-nested.c (walk_gimple_omp_for): Require a gimple_omp_for
760         rather than a plain gimple.
761         (convert_nonlocal_reference_stmt): Add a checked cast to
762         gimple_omp_for in GIMPLE_OMP_FOR case of switch statement.
763         (convert_local_reference_stmt): Likewise.
765         * tree-parloops.c (create_parallel_loop): Strengthen local
766         "for_stmt" from gimple to gimple_omp_for.
768 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
770         Introduce gimple_omp_critical
772         * coretypes.h (gimple_omp_critical): New typedef.
773         (const_gimple_omp_critical): New typedef.
775         * gimple-pretty-print.c (dump_gimple_omp_critical): Require a
776         gimple_omp_critical rather than a plain gimple.
777         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_critical
778         within GIMPLE_OMP_CRITICAL case of switch statement.
780         * gimple-walk.c (walk_gimple_op): Likewise.
782         * gimple.c (gimple_build_omp_critical): Return a gimple_omp_critical
783         rather than a plain gimple.
784         (gimple_copy): Add checked casts to gimple_omp_critical
785         within GIMPLE_OMP_CRITICAL case of switch statement.
787         * gimple.h (gimple_debug): Likewise.
788         (gimple_build_omp_critical): Return a gimple_omp_critical rather
789         than a plain gimple.
790         (gimple_omp_critical_name): Require a const_gimple_omp_critical
791         rather than a plain const_gimple.
792         (gimple_omp_critical_name_ptr): Require a gimple_omp_critical
793         rather than a plain gimple.
794         (gimple_omp_critical_set_name): Likewise.
796         * omp-low.c (check_omp_nesting_restrictions): Add a checked cast
797         to gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
798         statement, introducing a new local "other_crit" for type-safety.
799         (lower_omp_critical): Strengthen local "stmt" to
800         gimple_omp_critical.
802         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
803         gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
804         statement.
806 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
808         Introduce gimple_omp_continue
810         * coretypes.h (gimple_omp_continue): New typedef.
811         (const_gimple_omp_continue): New typedef.
813         * gimple.h (gimple_build_omp_continue): Return a
814         gimple_omp_continue rather than a plain gimple.
815         (gimple_omp_continue_control_def): Require a
816         const_gimple_omp_continue rather than a plain const_gimple.
817         (gimple_omp_continue_control_use): Likewise.
818         (gimple_omp_continue_control_def_ptr): Require a gimple_omp_continue
819         rather than a plain gimple.
820         (gimple_omp_continue_set_control_def): Likewise.
821         (gimple_omp_continue_control_use_ptr): Likewise.
822         (gimple_omp_continue_set_control_use): Likewise.
824         * gimple-pretty-print.c (dump_gimple_omp_continue): Require a
825         gimple_omp_continue rather than a plain gimple.
826         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_continue
827         within GIMPLE_OMP_CONTINUE case of switch statement.
829         * gimple-walk.c (walk_gimple_op): Likewise, adding a new local.
831         * gimple.c (gimple_build_omp_continue): Return a
832         gimple_omp_continue rather than a plain gimple.
834         * omp-low.c (gimple_build_cond_empty): Return a gimple_cond
835         rather than a plain gimple.
836         (expand_omp_for_generic): Split local "stmt" into "assign_stmt",
837         "cont_stmt", "cond_stmt", "call_stmt" of types gimple_assign,
838         gimple_omp_continue, gimple_cond, gimple_call respectively.
839         (expand_omp_for_static_nochunk): Likewise, splitting into two
840         "cond_stmt" decls. "assign_stmt", "cont_stmt"
841         (expand_omp_for_static_chunk): Likewise, splitting into
842         "cond_stmt", "assign_stmt", "cont_stmt".
843         (expand_omp_sections): Strengthen local "cont" from gimple to
844         gimple_omp_continue.
846 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
848         Introduce gimple_omp_atomic_store
850         * coretypes.h (gimple_omp_atomic_store): New typedef.
851         (const_gimple_omp_atomic_store): New typedef.
853         * gimple-pretty-print.c (dump_gimple_omp_atomic_store): Require
854         a gimple_omp_atomic_store rather than a plain gimple.
855         (pp_gimple_stmt_1): Add checked cast to gimple_omp_atomic_store
856         within GIMPLE_OMP_ATOMIC_STORE case of switch statement.
857         * gimple-walk.c (walk_gimple_op): Likewise.
859         * gimple.c (gimple_build_omp_atomic_store): Return a
860         gimple_omp_atomic_store rather than a plain gimple.
862         * gimple.h (gimple_build_omp_atomic_store): Return a
863         gimple_omp_atomic_store rather than a plain gimple.
864         (gimple_omp_atomic_store_set_val): Require a gimple_omp_atomic_store
865         rather than a plain gimple.
866         (gimple_omp_atomic_store_val_ptr): Likewise.
867         (gimple_omp_atomic_store_val): Require a
868         const_gimple_omp_atomic_store rather than a plain const_gimple.
870         * gimplify.c (gimplify_omp_atomic): Strengthen locals "loadstmt" and
871         "storestmt" from gimple to gimple_omp_atomic_load loadstmt and
872         gimple_omp_atomic_store storestmt respectively.
874         * omp-low.c (expand_omp_atomic): Strengthen local "store" from
875         gimple to gimple_omp_atomic_store.
877 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
879         Introduce gimple_omp_atomic_load
881         * coretypes.h (gimple_omp_atomic_load): New typedef.
882         (const_gimple_omp_atomic_load): New typedef.
884         * gimple-pretty-print.c (dump_gimple_omp_atomic_load): Require a
885         gimple_omp_atomic_load rather than a plain gimple.
886         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_atomic_load
887         within GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
889         * gimple-walk.c (walk_gimple_op): Likewise, introducing a new local.
891         * gimple.c (gimple_build_omp_atomic_load): Return a
892         gimple_omp_atomic_load rather than a plain gimple.
894         * gimple.h (gimple_build_omp_atomic_load): Return a
895         gimple_omp_atomic_load rather than a plain gimple.
896         (gimple_omp_atomic_load_set_lhs): Require a
897         gimple_omp_atomic_load rather than a plain gimple.
898         (gimple_omp_atomic_load_lhs_ptr): Likewise.
899         (gimple_omp_atomic_load_set_rhs): Likewise.
900         (gimple_omp_atomic_load_rhs_ptr): Likewise.
901         (gimple_omp_atomic_load_lhs): Require a
902         const_gimple_omp_atomic_load rather than a plain const_gimple.
903         (gimple_omp_atomic_load_rhs): Likewise.
905         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
906         to gimple_omp_atomic_load within GIMPLE_OMP_ATOMIC_LOAD case of
907         switch statement.
909         * omp-low.c (expand_omp_atomic): Strengthen type of local "load"
910         from gimple to gimple_omp_atomic_load.
911         (lower_omp_1): Add a checked cast to gimple_omp_atomic_load within
912         GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
914 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
916         Use more concrete types for various gimple statements
918         * cgraphunit.c (thunk_adjust): Strengthen local "stmt" from gimple
919         to gimple_assign.
921         * gimple-ssa-isolate-paths.c
922         (insert_trap_and_remove_trailing_statements): Strengthen local
923         "new_stmt" from gimple to gimple_call.
925         * gimple-ssa-strength-reduction.c (replace_mult_candidate):
926         Strengthen local "copy_stmt" from gimple to gimple_assign.
927         (create_add_on_incoming_edge): Likewise, for "new_stmt".
928         (insert_initializers): Likewise, for "init_stmt".
929         (introduce_cast_before_cand): Likewise, for "cast_stmt".
930         (replace_one_candidate): Likewise, for "copy_stmt" and
931         "cast_stmt".
933         * gimplify.c (build_stack_save_restore): Require gimple_calls
934         rather than plain gimples.
935         (gimplify_bind_expr): Strengthen locals "stack_save" and
936         "stack_restore" from gimple to gimple_call.  Strengthen "gs"
937         to gimple_try.
938         (gimplify_switch_expr): Strengthen local "gimple_switch" from
939         gimple to gimple_switch, and "new_default" to gimple_label.
940         (gimplify_cond_expr): Strengthen local "gimple_cond" from gimple
941         to gimple_cond.
942         (gimplify_init_constructor): Strengthen local "init" from gimple
943         to gimple_assign.
944         (gimplify_cleanup_point_expr): Strengthen local "gtry" from gimple
945         to gimple_try.
946         (gimple_push_cleanup): Strengthen locals "ffalse" and "ftrue" from
947         gimple to gimple_assign.
949         * tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
950         (emit_post_landing_pad): Strengthen local to gimple_label.
952         * tree-outof-ssa.c (insert_backedge_copies): Strengthen local
953         "stmt" from gimple to gimple_assign.
955         * tree-parloops.c (take_address_of): Likewise.
957         * tree-predcom.c (replace_ref_with): Likewise, for "new_stmt".
958         (initialize_root_vars_lm): Likewise, for "init_stmt".
959         (reassociate_to_the_same_stmt): Likewise, for "new_stmt" and "tmp_stmt".
961         * tree-profile.c (gimple_gen_edge_profiler): Likewise, for "stmt1",
962         "stmt2", "stmt3".
963         (gimple_gen_ic_profiler): Likewise.
964         (gimple_gen_ic_func_profiler): Strengthen local "stmt1" from
965         gimple to gimple_call, and "stmt2" to gimple_assign.
967         * tree-scalar-evolution.c (scev_const_prop): Strengthen local
968         "ass" from gimple to gimple_assign.
970         * tree-sra.c (build_ref_for_offset): Likewise for "stmt".
971         (generate_subtree_copies): Likewise; also strengthen "ds" to
972         gimple_debug.
973         (init_subtree_with_zero): Likewise.
974         (sra_modify_expr): Likewise.
975         (load_assign_lhs_subreplacements): Likewise.
976         (sra_modify_assign): Strengthen "ds" to gimple_debug.
977         (sra_ipa_reset_debug_stmts): Likewise for "def_temp".
979         * tree-ssa-ccp.c (insert_clobber_before_stack_restore):
980         Strengthen local "clobber_stmt" from gimple to gimple_assign.
982         * tree-ssa-dce.c (remove_dead_stmt): Strengthen "note" to
983         gimple_debug.
985         * tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
986         local "new_stmt" from gimple to gimple_assign.
987         (optimize_stmt): Likewise.
989         * tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
990         4 declarations of "newop".
991         (simplify_rotate): Likewise for "g".
993         * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
994         (rewrite_bittest): Likewise for "stmt" and "stmt2".
995         (move_computations_dom_walker::before_dom_children): Likewise for
996         "new_stmt".
997         (execute_sm): Likewise for "load" and "store".
999         * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
1000         Strengthen local "stmt" from gimple to gimple_call.
1001         (unloop_loops): Likewise.
1003         * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
1004         local "ass" from gimple to gimple_assign.
1005         (remove_unused_ivs): Strengthen "def_temp" to gimple_debug.
1007         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local "stmt"
1008         from gimple to gimple_assign.
1010         * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
1011         "prefetch" from gimple to gimple_call.
1013         * tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
1014         "new_stmt" from gimple to gimple_assign.
1015         (powi_as_mults_1): Likewise for "mult_stmt".
1016         (powi_as_mults): Likewise for "div_stmt".
1017         (build_and_insert_binop): Likewise for "stmt".
1018         (build_and_insert_cast): Likewise.
1019         (pass_cse_sincos::execute): Likewise for "stmt" and various decls
1020         of "new_stmt".
1021         (convert_mult_to_fma): Likewise for "fma_stmt".
1023         * tree-ssa-phiopt.c (conditional_replacement): Likewise for "new_stmt".
1024         (abs_replacement): Likewise.
1026         * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for "tmp".
1028         * tree-ssa-pre.c (create_expression_by_pieces): Likewise for "newstmt".
1029         (eliminate_insert): Likewise for "tem".
1031         * tree-ssa-propagate.c (update_gimple_call): Strengthen locals
1032         "new_stmt" and "stmt" from gimple to gimple_call.
1033         (update_call_from_tree): Likewise for "new_stmt".
1035         * tree-ssa-reassoc.c (build_and_add_sum): Likewise for "sum".
1036         (update_ops): Likewise for "g".
1037         (maybe_optimize_range_tests): Likewise.
1038         (rewrite_expr_tree_parallel): Require a gimple_assign rather than
1039         a plain gimple.
1040         (reassociate_bb): Add a checked cast to gimple_assign.
1042         * tree-ssa.c (insert_debug_temp_for_var_def): Strengthen local
1043         "def_temp" from gimple to gimple_debug.
1045         * tree-switch-conversion.c (emit_case_bit_tests): Strengthen local
1046         "shift_stmt" from gimple to gimple_assign.
1048         * tree-tailcall.c (adjust_return_value_with_ops): Likewise for
1049         "stmt".
1050         (update_accumulator_with_ops): Likewise.
1052         * tree-vect-data-refs.c (bump_vector_ptr): Likewise for
1053         "incr_stmt".
1055         * tree-vect-stmts.c (vectorizable_condition): Likewise for
1056         "new_stmt".
1058         * tree-vrp.c (build_assert_expr_for): Likewise for "assertion".
1059         (simplify_truth_ops_using_ranges): Likewise for "newop".
1060         (simplify_float_conversion_using_ranges): Likewise for "conv".
1062         * ubsan.c (instrument_mem_ref): Strengthen local "g" from gimple
1063         to gimple_call.
1065         * value-prof.c (gimple_divmod_fixed_value): Require a
1066         gimple_assign rather than a plain gimple; strengthen types of locals.
1067         (gimple_mod_pow2): Likewise.
1068         (gimple_mod_subtract): Likewise.
1069         (gimple_divmod_fixed_value_transform): Strengthen local
1070         "stmt" from gimple to gimple_assign.
1071         (gimple_mod_pow2_value_transform): Likewise.
1072         (gimple_mod_subtract_transform): Likewise.
1073         (gimple_ic): Strengthen types of locals.
1075 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1077         Introduce gimple_try
1079         * coretypes.h (gimple_try): New typedef.
1080         (const_gimple_try): New typedef.
1082         * gimple-low.c (gimple_try_catch_may_fallthru): Require a
1083         gimple_try rather than a plain gimple.
1084         (gimple_stmt_may_fallthru): Add checked cast to gimple_try.
1086         * gimple-pretty-print.c (dump_gimple_try): Require a gimple_try
1087         rather than a plain gimple.
1088         (pp_gimple_stmt_1): Add checked cast to gimple_try within
1089         GIMPLE_TRY case of switch statement.
1091         * tree-eh.c (finally_tree_node::parent): Strengthen field from
1092         gimple to gimple_try.
1093         (record_in_finally_tree): Require a gimple_try rather than a plain
1094         gimple.
1095         (collect_finally_tree): Likewise.
1096         (collect_finally_tree_1): Likewise.
1097         (struct leh_tf_state::try_finally_expr): Strengthen field from
1098         gimple to gimple_try.
1099         (struct leh_tf_state::top_p): Likewise.
1100         (lower_eh_must_not_throw): Require a gimple_try rather than a
1101         plain gimple.
1102         (frob_into_branch_around): Likewise.
1103         (lower_try_finally_dup_block): Strengthen local from gimple to
1104         gimple_try.
1105         (honor_protect_cleanup_actions): Split out uses of "x" into new
1106         locals "eh_mnt" and "try_stmt" with stronger types.
1107         (lower_try_finally): Require a gimple_try rather than a plain
1108         gimple.
1109         (lower_catch): Likewise.
1110         (lower_eh_filter): Likewise.
1111         (lower_eh_must_not_throw): Likewise.
1112         (lower_cleanup): Likewise.
1113         (lower_eh_constructs_2): Add checked cast to gimple_try within
1114         GIMPLE_TRY case of switch statement, introducing new local
1115         "try_stmt", using it for type-safety.
1117 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1119         Use subclasses of gimple in various places
1121         * asan.c (insert_if_then_before_iter): Require a gimple cond
1122         rathern than a plain gimple.
1123         (asan_expand_check_ifn): Add a checked cast to gimple_cond.
1125         * cfgloopmanip.c (create_empty_if_region_on_edge): Likewise.
1127         * omp-low.c (simd_clone_adjust): Strengthen local from gimple
1128         to gimple_phi.
1130         * sese.c (set_ifsese_condition): Strengthen local from gimple to
1131         gimple_cond.
1133         * tree-call-cdce.c (gen_one_condition): Strengthen locals from
1134         gimple to gimple_assign and gimple_cond.
1136         * tree-ssa-phiopt.c (minmax_replacement): Likewise.
1137         (cond_store_replacement): Strengthen locals from gimple to
1138         gimple_phi and gimple_assign.
1139         (cond_if_else_store_replacement_1): Likewise.
1141         * tree-ssa-pre.c (do_regular_insertion): Strengthen local from
1142         gimple to gimple_assign.
1144         * tree-switch-conversion.c (hoist_edge_and_branch_if_true):
1145         Strengthen local from gimple to gimple_cond.
1146         (gen_def_assigns): Return a gimple_assign rather than a plain
1147         gimple.
1148         (gen_inbound_check): Strengthen locals from gimple to gimple_cond
1149         and gimple_assign.
1151         * tree-vect-loop-manip.c (slpeel_add_loop_guard): Strengthen local
1152         from gimple to gimple_cond.
1153         (set_prologue_iterations): Strengthen locals from gimple to
1154         gimple_phi and gimple_cond.
1156         * value-prof.c (gimple_ic): Strengthen local from gimple to
1157         gimple_phi.
1158         (gimple_stringop_fixed_value): Strengthen locals from gimple to
1159         gimple_assign, gimple_cond, gimple_call, and gimple_phi.
1161 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1163         Introduce gimple_eh_dispatch
1165         * coretypes.h (gimple_eh_dispatch): New typedef.
1166         (const_gimple_eh_dispatch): New typedef.
1168         * gimple-pretty-print.c (dump_gimple_eh_dispatch): Require a
1169         gimple_eh_dispatch rather than a plain gimple.
1170         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_dispatch
1171         within GIMPLE_EH_DISPATCH case of switch statement.
1173         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1175         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1177         * gimple.c (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
1178         rather than a plain gimple.
1180         * gimple.h (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
1181         rather than a plain gimple.
1182         (gimple_eh_dispatch_region): Require a const_gimple_eh_dispatch
1183         rather than a plain const_gimple.
1184         (gimple_eh_dispatch_set_region): Require a gimple_eh_dispatch
1185         rather than a plain gimple.
1187         * tree-cfg.c (make_edges): Add a checked cast to gimple_eh_dispatch
1188         within GIMPLE_EH_DISPATCH case of switch statement.
1189         (gimple_verify_flow_info): Likewise.
1190         (gimple_redirect_edge_and_branch): Likewise.
1191         (move_stmt_r): Likewise, adding a local.
1193         * tree-eh.c (emit_eh_dispatch): Convert local from gimple to
1194         gimple_eh_dispatch.
1195         (make_eh_dispatch_edges): Require a gimple_eh_dispatch rather than
1196         a plain gimple.
1197         (redirect_eh_dispatch_edge): Likewise.
1198         (lower_eh_dispatch): Likewise.
1199         (execute_lower_eh_dispatch): Add a checked cast to
1200         gimple_eh_dispatch.
1201         (mark_reachable_handlers): Likewise.
1202         (verify_eh_dispatch_edge): Require a gimple_eh_dispatch rather
1203         than a plain gimple.
1205         * tree-eh.h (make_eh_dispatch_edges): Likewise.
1206         (redirect_eh_dispatch_edge): Likewise.
1207         (verify_eh_dispatch_edge): Likewise.
1209         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1210         gimple_eh_dispatch within GIMPLE_EH_DISPATCH case of switch
1211         statement, adding a local.
1212         (copy_edges_for_bb): Add a checked cast to gimple_eh_dispatch.
1214 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1216         Introduce gimple_resx
1218         * coretypes.h (gimple_resx): New typedef.
1219         (const_gimple_resx): New typedef.
1221         * gimple.h (gimple_build_resx): Return a gimple_resx rather than a
1222         plain gimple.
1223         (gimple_resx_region): Require a const_gimple_resx rather than a
1224         plain const_gimple.
1225         (gimple_resx_set_region): Require a gimple_resx rather than a
1226         plain gimple.
1228         * gimple-pretty-print.c (dump_gimple_resx): Require a gimple_resx
1229         rather than a plain gimple.
1230         (pp_gimple_stmt_1): Add a checked cast to gimple_resx within
1231         GIMPLE_RESX case of switch statement.
1233         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1235         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1237         * gimple.c (gimple_build_resx): Return a gimple_resx rather than
1238         a plain gimple.
1240         * tree-cfg.c (move_stmt_r): Add a checked cast to gimple_resx
1241         within GIMPLE_RESX case of switch statement, adding a new local.
1243         * tree-eh.c (emit_resx): Convert local "x" from gimple to
1244         gimple_resx.
1245         (lower_resx): Require a gimple_resx rather than a plain gimple.
1246         (pass_lower_resx::execute): Add a checked cast to gimple_resx.
1247         (mark_reachable_handlers): Likewise.
1249         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1250         gimple_resx within GIMPLE_RESX case of switch statement, adding
1251         a new local.
1253 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1255         Introduce gimple_eh_else
1257         * coretypes.h (gimple_eh_else): New typedef.
1258         (const_gimple_eh_else): New typedef.
1260         * gimple.h (gimple_build_eh_else): Return a gimple_eh_else rather
1261         than a plain gimple.
1262         (gimple_eh_else_n_body_ptr): Require a gimple_eh_else rather than
1263         a plain gimple.
1264         (gimple_eh_else_n_body): Likewise.
1265         (gimple_eh_else_e_body_ptr): Likewise.
1266         (gimple_eh_else_e_body): Likewise.
1267         (gimple_eh_else_set_n_body): Likewise.
1268         (gimple_eh_else_set_e_body): Likewise.
1270         * gimple-low.c (lower_stmt): Add checked cast to gimple_eh_else
1271         within GIMPLE_EH_ELSE case of switch statement, introducing a new
1272         local.
1273         (gimple_stmt_may_fallthru): Likewise.
1275         * gimple-pretty-print.c (dump_gimple_eh_else): Require a
1276         gimple_eh_else rather than a plain gimple.
1277         (pp_gimple_stmt_1): Add checked cast to gimple_eh_else within
1278         GIMPLE_EH_ELSE case of switch statement
1280         * gimple-walk.c (walk_gimple_stmt): Add checked cast to
1281         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1282         introducing a new local.
1284         * gimple.c (gimple_build_eh_else): Return a gimple_eh_else
1285         rather than a plain gimple.
1286         (gimple_copy): Add checked casts to gimple_eh_else within
1287         GIMPLE_EH_ELSE case of switch statement, introducing new locals.
1289         * tree-cfg.c (verify_gimple_in_seq_2): Add checked cast to
1290         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1291         introducing a new local.
1293         * tree-eh.c (collect_finally_tree): Likewise.
1294         (replace_goto_queue_1): Likewise.
1295         (get_eh_else): Return a gimple_eh_else rather than a plain gimple.
1296         (honor_protect_cleanup_actions): Convert local "eh_else" from
1297         gimple to gimple_eh_else.
1298         (lower_try_finally_nofallthru): Likewise.
1299         (lower_try_finally_onedest): Introduce locals "eh_else" and
1300         "label_stmt", using them in favor of "x" for the gimple_eh_else
1301         and the gimple_label.
1302         (lower_try_finally_copy): Convert local "eh_else" from gimple to
1303         gimple_eh_else.
1304         (lower_try_finally_switch): Likewise.
1305         (decide_copy_try_finally): Likewise.
1306         (refactor_eh_r): Add checked cast to gimple_eh_else within
1307         GIMPLE_EH_ELSE case of switch statement, introducing a new local.
1309 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1311         Introduce gimple_eh_must_not_throw
1313         * coretypes.h (gimple_eh_must_not_throw): New typedef.
1314         (const_gimple_eh_must_not_throw): New typedef.
1316         * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
1317         a gimple_eh_must_not_throw rather than a plain gimple.
1318         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
1319         within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
1321         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1323         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1325         * gimple.c (gimple_build_eh_must_not_throw): Return a
1326         gimple_eh_must_not_throw rather than a plain gimple.
1328         * gimple.h (gimple_build_eh_must_not_throw): Return a
1329         gimple_eh_must_not_throw rather than a plain gimple.
1330         (gimple_eh_must_not_throw_fndecl): Require a
1331         gimple_eh_must_not_throw rather than a plain gimple.
1332         (gimple_eh_must_not_throw_set_fndecl): Likewise.
1334         * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
1336 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1338         Introduce gimple_eh_filter
1340         * coretypes.h (gimple_eh_filter): New typedef.
1341         (const_gimple_eh_filter): New typedef.
1343         * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
1344         rather than a plain gimple.
1346         * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
1347         gimple_eh_filter rather than a plain gimple.
1348         (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
1349         GIMPLE_EH_FILTER case of switch statement.
1351         * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
1352         rather than a plain gimple.
1354 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1356         Introduce gimple_catch
1358         * coretypes.h (gimple_catch): New typedef.
1359         (const_gimple_catch): New typedef.
1361         * gimple-low.c (lower_try_catch): Add checked cast to gimple_catch.
1362         (gimple_try_catch_may_fallthru): Likewise.
1364         * gimple-pretty-print.c (dump_gimple_catch): Require a gimple_catch
1365         rather than a plain gimple.
1366         (pp_gimple_stmt_1): Add checked cast to gimple_catch within
1367         GIMPLE_CATCH case of switch statement.
1369         * gimple-walk.c (walk_gimple_op): Likewise.
1370         (walk_gimple_stmt): Likewise.
1372         * gimple.c (gimple_build_catch): Return a gimple_catch rather than
1373         a plain gimple.
1374         (gimple_copy): Add checked casts to gimple_catch within
1375         GIMPLE_CATCH case of switch statement, introducing new locals.
1377         * gimple.h (gimple_build_catch): Return a gimple_catch rather than
1378         a plain gimple.
1379         (gimple_catch_types_ptr): Require a gimple_catch rather than a
1380         plain gimple.
1381         (gimple_catch_handler_ptr): Likewise.
1382         (gimple_catch_handler): Likewise.
1383         (gimple_catch_set_types): Likewise.
1384         (gimple_catch_set_handler): Likewise.
1386         * omp-low.c (lower_omp_1): Add checked cast to gimple_catch within
1387         GIMPLE_CATCH case of switch statement.
1389         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
1390         (do_warn_unused_result): Likewise.
1392         * tree-eh.c (collect_finally_tree): Likewise.
1393         (replace_goto_queue_1): Likewise.
1394         (lower_catch): Convert local from gimple to gimple_catch.
1395         (refactor_eh_r): Add checked cast to gimple_catch within
1396         GIMPLE_CATCH case of switch statement.
1398         * tree-inline.c (remap_gimple_stmt): Likewise.
1399         (estimate_num_insns): Add checked cast to gimple_catch within
1400         GIMPLE_CATCH case of switch statement, introducing new local.
1402 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1404         Introduce gimple_transaction
1406         * coretypes.h (gimple_transaction): New typedef.
1407         (const_gimple_transaction): New typedef.
1409         * gimple.h (gimple_build_transaction): Return a gimple_transaction
1410         rather than a plain gimple.
1411         (gimple_transaction_body_ptr): Require a gimple_transaction rather
1412         than a plain gimple.
1413         (gimple_transaction_body): Likewise.
1414         (gimple_transaction_label_ptr): Likewise.
1415         (gimple_transaction_set_body): Likewise.
1416         (gimple_transaction_set_label): Likewise.
1417         (gimple_transaction_set_subcode): Likewise.
1418         (gimple_transaction_label): Require a const_gimple_transaction
1419         rather than a plain const_gimple.
1420         (gimple_transaction_subcode): Likewise.
1422         * gimple-low.c (lower_stmt): Add checked cast to
1423         gimple_transaction within GIMPLE_TRANSACTION case of switch
1424         statement.
1426         * gimple-pretty-print.c (dump_gimple_transaction): Require a
1427         gimple_transaction rather than a plain gimple.
1428         (pp_gimple_stmt_1): Add checked cast to gimple_transaction within
1429         GIMPLE_TRANSACTION case of switch statement.
1430         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1431         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1432         * gimple-walk.c (walk_gimple_op): Likewise.
1433         (walk_gimple_stmt): Likewise.
1435         * gimple.c (gimple_build_transaction): Return a gimple_transaction
1436         rather than a plain gimple.
1437         (gimple_copy): Add checked casts to gimple_transaction within
1438         GIMPLE_TRANSACTION case of switch statement.
1440         * gimplify.c (gimplify_transaction): Split local "g" into
1441         "body_stmt" and "trans_stmt", strengthening the type of the latter
1442         from gimple to gimple_transaction.
1444         * omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
1445         within GIMPLE_TRANSACTION case of switch statement.
1447         * trans-mem.c (diagnose_tm_1): Add checked cast within
1448         GIMPLE_TRANSACTION case of switch statement, introducing a new
1449         local "trans_stmt".  Use it in place of "stmt".
1450         (examine_call_tm): Convert local from gimple to gimple_transaction.
1451         (tm_region::get_transaction_stmt): New method.
1452         (tm_region::transaction_stmt): Add clarification of type to the
1453         comment.
1454         (tm_region_init_0): Require a gimple_transaction rather than a
1455         plain gimple.
1456         (tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
1457         dyn_cast<gimple_transaction> and new local.
1458         (transaction_subcode_ior): Add a new local, using the new
1459         get_transaction_stmt method to perform a checked cast.
1460         (propagate_tm_flags_out): Likewise.
1461         (expand_transaction): Add a checked cast using the new
1462         get_transaction_stmt method.
1463         (generate_tm_state): Likewise.
1464         (execute_tm_mark): Likewise.
1465         (ipa_tm_diagnose_transaction): Likewise.
1467         * tree-cfg.c (verify_gimple_transaction): Require a
1468         gimple_transaction rather than a plain gimple.
1469         (make_edges): Add checked cast within GIMPLE_TRANSACTION case of
1470         switch statement
1471         (cleanup_dead_labels): Likewise.
1472         (verify_gimple_stmt): Likewise.
1473         (verify_gimple_in_seq_2): Likewise.
1474         (verify_gimple_in_seq_2): Likewise.
1475         (gimple_redirect_edge_and_branch): Add checked cast.
1477         * tree-inline.c (remap_gimple_stmt): Add checked cast within
1478         GIMPLE_TRANSACTION case of switch statement, introducing a new
1479         local "old_trans_stmt".  Use it in place of "stmt".  Add new
1480         local "new_trans_stmt", using it to initialize "copy", and for
1481         type-safe operations as a transaction.
1482         (estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
1483         case of switch statement.
1485 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1487         Introduce gimple_asm
1489         * coretypes.h (gimple_asm): New typedef.
1490         (const_gimple_asm): New typedef.
1492         * gimple.h (gimple_build_asm_vec): Return a gimple_asm rather than
1493         just a gimple.
1494         (gimple_asm_clobbers_memory_p): Require a const_gimple_asm rather
1495         than just a const_gimple.
1496         (gimple_asm_ninputs): Likewise.
1497         (gimple_asm_noutputs): Likewise.
1498         (gimple_asm_nclobbers): Likewise.
1499         (gimple_asm_nlabels): Likewise.
1500         (gimple_asm_input_op): Likewise.
1501         (gimple_asm_input_op_ptr): Likewise.
1502         (gimple_asm_output_op): Likewise.
1503         (gimple_asm_output_op_ptr): Likewise.
1504         (gimple_asm_clobber_op): Likewise.
1505         (gimple_asm_label_op): Likewise.
1506         (gimple_asm_string): Likewise.
1507         (gimple_asm_volatile_p): Likewise.
1508         (gimple_asm_input_p): Likewise.
1509         (gimple_asm_set_input_op): Require a gimple_asm rather than a plain
1510         gimple.
1511         (gimple_asm_set_output_op): Likewise.
1512         (gimple_asm_set_clobber_op): Likewise.
1513         (gimple_asm_set_label_op): Likewise.
1514         (gimple_asm_set_volatile): Likewise.
1515         (gimple_asm_set_input): Likewise.
1517         * cfgexpand.c (expand_asm_stmt): Require a gimple_asm rather than
1518         a plain gimple.
1519         (expand_gimple_stmt_1): Add checked cast to gimple_asm within
1520         GIMPLE_ASM case of switch statement.
1522         * gimple-fold.c (fold_stmt_1): Add new local from checked cast to
1523         gimple_asm within case GIMPLE_ASM.
1525         * gimple-pretty-print.c (dump_gimple_asm): Require a gimple_asm
1526         rather than a plain gimple.
1527         (pp_gimple_stmt_1): Add checked cast to gimple_asm within
1528         GIMPLE_ASM case of switch statement.
1530         * gimple-streamer-in.c (input_gimple_stmt): Rework existing
1531         checked cast to gimple_asm; add a new one.
1533         * gimple-streamer-out.c (output_gimple_stmt): Add new local from
1534         checked cast to gimple_asm within case GIMPLE_ASM.
1536         * gimple-walk.c (walk_gimple_asm): Require a gimple_asm rather
1537         than a plain gimple.
1538         (walk_gimple_op): Add checked cast to gimple_asm within GIMPLE_ASM
1539         case of switch statement.
1540         (walk_stmt_load_store_addr_ops): Use dyn_cast<gimple_asm> in place
1541         of a code check against GIMPLE_ASM to introduce a new gimple_asm
1542         local.
1544         * gimple.c (gimple_build_asm_1): Return a gimple_asm rather than
1545         a plain gimple.
1546         (gimple_build_asm_vec): Likewise.
1547         (gimple_has_side_effects): Add a checked cast to gimple_asm.
1548         (gimple_could_trap_p_1): Likewise.
1549         (gimple_call_builtin_p): Require a const_gimple_asm rather then
1550         a const_gimple.
1552         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
1553         and a new local of type gimple_asm within GIMPLE_ASM case.
1555         * gimplify.c (gimplify_asm_expr): Convert a local from gimple to
1556         gimple_asm.
1558         * ipa-pure-const.c (check_stmt): Add checked casts within
1559         GIMPLE_ASM case.
1561         * ssa-iterators.h (op_iter_init): Likewise.
1563         * tree-cfg.c (make_goto_expr_edges): Convert a local from gimple
1564         to gimple_asm.
1565         (cleanup_dead_labels): Add a checked cast and a new local of type
1566         gimple_asm within GIMPLE_ASM case.
1567         (gimple_redirect_edge_and_branch): Likewise.
1568         (is_ctrl_altering_stmt): Add a checked cast.
1569         (need_fake_edge_p): Replace a code check against GIMPLE_ASM with a
1570         dyn_cast<gimple_asm>.
1572         * tree-complex.c (expand_complex_comparison): Convert a local from
1573         gimple to gimple_asm.
1575         * tree-data-ref.c (get_references_in_stmt): Add a checked cast to
1576         gimple_asm.
1578         * tree-eh.c (stmt_could_throw_p): Likewise.
1580         * tree-inline.c (estimate_num_insns): Likewise.
1582         * tree-sra.c (scan_function): Add a checked cast and a new local
1583         of type gimple_asm within GIMPLE_ASM case.
1584         (sra_modify_function_body): Likewise.
1585         (ipa_sra_modify_function_body): Likewise.
1587         * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
1589         * tree-ssa-dce.c (propagate_necessity): Replace a code check
1590         against GIMPLE_ASM with a dyn_cast<gimple_asm>.
1592         * tree-ssa-operands.c (maybe_add_call_vops): Require a gimple_asm
1593         rather than a plain gimple.
1594         (parse_ssa_operands): Add a checked cast to gimple_asm.
1596         * tree-ssa-structalias.c (find_func_aliases): Replace a check for
1597         GIMPLE_ASM with a dyn_cast<gimple_asm>, introducing  a new local
1598         "asm_stmt", using it in place of "t" for typesafety.
1600         * tree-ssa-threadedge.c
1601         (record_temporary_equivalences_from_stmts_at_dest): Add a checked
1602         cast to gimple_asm.
1604         * tree-ssa.c (execute_update_addresses_taken): Add checked casts
1605         and new locals of type gimple_asm within clauses guarded by code
1606         check.
1608 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1610         Introduce gimple_goto
1612         * coretypes.h (gimple_goto): New typedef.
1613         (const_gimple_goto): New typedef.
1615         * gimple.h (gimple_statement_goto): New subclass of
1616         gimple_statement_with_ops, adding the invariant that
1617         stmt->code == GIMPLE_GOTO.
1618         (is_a_helper <gimple_statement_goto>::test): New.
1619         (gimple_build_goto): Return a gimple_goto rather than a
1620         plain gimple.
1622         * gimple-pretty-print.c (dump_gimple_goto): Require a gimple_goto
1623         rather than a plain gimple.
1624         (pp_gimple_stmt_1): Add a checked cast to gimple_goto within
1625         GIMPLE_GOTO case of switch statement.
1627         * gimple.c (gimple_build_goto): Return a gimple_goto rather than a
1628         plain gimple.
1630         * tree-cfg.c (verify_gimple_goto): Require a gimple_goto rather
1631         than a plain gimple.
1632         (verify_gimple_stmt): Add a checked cast to gimple_goto within
1633         GIMPLE_GOTO case of switch statement.
1635 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1637         Introduce gimple_return
1639         * coretypes.h (gimple_return): New typedef.
1640         (const_gimple_return): New typedef.
1642         * gimple.h (gimple_statement_return): New subclass of
1643         gimple_statement_with_memory_ops, adding the invariant that
1644         stmt->code == GIMPLE_RETURN.
1645         (is_a_helper <gimple_statement_return>::test): New.
1646         (gimple_build_return): Return a gimple_return rather
1647         than a plain gimple.
1649         * gimple.c (gimple_build_return): Return a gimple_return rather
1650         than a plain gimple.
1652         * cgraphunit.c (expand_thunk): Convert local from a gimple to
1653         a gimple_return.
1655         * gimple-low.c (struct return_statements_t): Convert field "stmt"
1656         from a gimple to a gimple_return.
1657         (lower_gimple_return): Convert local from a gimple to a
1658         gimple_return.
1660         * gimple-pretty-print.c (dump_gimple_return): Require a
1661         gimple_return rather than a plain gimple.
1662         (pp_gimple_stmt_1): Add a checked cast to gimple_return within
1663         case GIMPLE_RETURN of switch statement.
1665         * gimplify.c (gimplify_return_expr): Convert locals from
1666         gimple to gimple_return.
1668         * ipa-split.c (split_function): Likewise.
1670         * tree-cfg.c (verify_gimple_assign): Require a gimple_return
1671         rather than a plain gimple.
1672         (verify_gimple_stmt): Add checked cast to gimple_return within
1673         case GIMPLE_RETURN of switch statement.
1675         * tree-tailcall.c (adjust_return_value): Convert local from
1676         gimple to gimple_return.
1678 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1680         Introduce gimple_call
1682         * coretypes.h (gimple_call): New typedef.
1683         (const_gimple_call): New typedef.
1685         * asan.c (get_mem_refs_of_builtin_call): Require a
1686         const_gimple_call rather than a const gimple.
1687         (has_stmt_been_instrumented_p): Add a checked cast to
1688         gimple_call.
1689         (instrument_strlen_call): Likewise.
1690         (instrument_builtin_call): Likewise.
1691         * builtins.c (validate_gimple_arglist): Require a
1692         const_gimple_call rather than a const gimple.
1693         (fold_call_stmt): Require a gimple_call rather than a gimple.
1694         * builtins.h (validate_gimple_arglist): Require a
1695         const_gimple_call rather than a const gimple.
1696         (fold_call_stmt): Require a gimple_call rather than a gimple.
1697         * cfgexpand.c (expand_call_stmt): Likewise.
1698         (expand_gimple_stmt_1): Add a checked cast to gimple_call within
1699         GIMPLE_CALL case.
1700         * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Strengthen
1701         local "new_stmt" from gimple to gimple_call, adding a checked
1702         cast.
1703         * cgraphunit.c (cgraph_node::expand_thunk): Likewise for local
1704         "call".
1705         * gimple-fold.c (gimple_fold_builtin_snprintf_chk): Likewise for
1706         local "stmt".
1707         (gimple_fold_builtin_snprintf): Likewise.
1708         (gimple_fold_builtin): Likewise.
1709         (gimple_fold_call): Likewise.
1710         (gimple_fold_stmt_to_constant_1): Introduce local "call_stmt" via
1711         checked cast of "stmt" to gimple_call, using it in various places
1712         for typesafety.
1713         * gimple-pretty-print.c (dump_gimple_call_args): Strengthen param
1714         2 from gimple to gimple_call.
1715         (dump_gimple_call): Likewise.
1716         (pp_gimple_stmt_1): Add a checked cast to gimple_call within
1717         GIMPLE_CALL case.
1718         * gimple-streamer-in.c (input_gimple_stmt): Replace is_gimple_call
1719         with a dyn_cast<gimple_call>, introducing local "call_stmt", and
1720         using it in place of "stmt" for typesafety.  Add a checked cast
1721         in statement guarded by check for GIMPLE_CALL.
1722         * gimple-walk.c (walk_gimple_op): Add a checked cast to
1723         gimple_call.
1724         * gimple.c (gimple_call_reset_alias_info): Strengthen param from
1725         gimple to gimple_call.
1726         (gimple_build_call_1): Strengthen return type and local from
1727         gimple to gimple_call.
1728         (gimple_build_call_vec): Likewise.
1729         (gimple_build_call): Likewise.
1730         (gimple_build_call_valist): Likewise.
1731         (gimple_build_call_internal_1): Likewise.
1732         (gimple_build_call_internal): Likewise.
1733         (gimple_build_call_internal_vec): Likewise.
1734         (gimple_build_call_from_tree): Likewise.
1735         (gimple_call_return_flags): Strengthen param from
1736         const_gimple to const_gimple_call.
1737         (gimple_call_copy_skip_args): Strengthen return type and local from
1738         gimple to gimple_call.
1739         * gimple.h (gimple_call_reset_alias_info): Strengthen param from
1740         gimple to gimple_call.
1741         (gimple_build_call_vec): Strengthen return type from gimple to
1742         gimple_call.
1743         (gimple_build_call): Likewise.
1744         (gimple_build_call_valist): Likewise.
1745         (gimple_build_call_internal): Likewise.
1746         (gimple_build_call_internal_vec): Likewise.
1747         (gimple_build_call_from_tree): Likewise.
1748         (gimple_call_return_flags): Strengthen param from const_gimple to
1749         const_gimple_call.
1750         (gimple_call_copy_skip_args): Strengthen return type from gimple
1751         to gimple_call.
1752         (gimple_call_set_internal_fn): Strengthen param "call_stmt" from
1753         gimple to gimple_call.
1754         (gimple_call_return_type): Strengthen param from const_gimple to
1755         const_gimple_call.
1756         (gimple_call_chain_ptr): Likewise.
1757         (gimple_call_set_chain): Strengthen param from gimple to
1758         gimple_call.
1759         (gimple_call_set_return_slot_opt): Likewise.
1760         (gimple_call_set_from_thunk): Likewise.
1761         (gimple_call_from_thunk_p): Likewise.
1762         (gimple_call_set_va_arg_pack): Likewise.
1763         (gimple_call_va_arg_pack_p): Likewise.
1764         (gimple_call_set_alloca_for_var): Likewise.
1765         (gimple_call_alloca_for_var_p): Likewise.
1766         (gimple_expr_type): Introduce local "call_stmt" via a checked cast
1767         and use it for typesafety.
1768         * gimplify.c (gimplify_call_expr): Strengthen local "call" from
1769         gimple to gimple_call.
1770         (gimplify_modify_expr_to_memcpy): Likewise for local "gs".
1771         (gimplify_modify_expr_to_memset): Likewise.
1772         (gimplify_modify_expr): Add a checked cast to gimple_call.
1773         (gimplify_expr): Strengthen local "call" from gimple to
1774         gimple_call.
1775         (gimplify_function_tree): Likewise.
1776         * internal-fn.c (expand_LOAD_LANES): Strengthen param from gimple
1777         to gimple_call.
1778         (expand_STORE_LANES): Likewise.
1779         (expand_ANNOTATE): Likewise.
1780         (expand_GOMP_SIMD_LANE): Likewise.
1781         (expand_GOMP_SIMD_VF): Likewise.
1782         (expand_GOMP_SIMD_LAST_LANE): Likewise.
1783         (expand_UBSAN_NULL): Likewise.
1784         (expand_UBSAN_BOUNDS): Likewise.
1785         (expand_UBSAN_OBJECT_SIZE): Likewise.
1786         (expand_ASAN_CHECK): Likewise.
1787         (ubsan_expand_si_overflow_addsub_check): Likewise.
1788         (ubsan_expand_si_overflow_neg_check): Likewise.
1789         (ubsan_expand_si_overflow_mul_check): Likewise.
1790         (expand_UBSAN_CHECK_ADD): Likewise.
1791         (expand_UBSAN_CHECK_SUB): Likewise.
1792         (expand_UBSAN_CHECK_MUL): Likewise.
1793         (expand_LOOP_VECTORIZED): Likewise.
1794         (expand_MASK_LOAD): Likewise.
1795         (expand_MASK_STORE): Likewise.
1796         (expand_ABNORMAL_DISPATCHER): Likewise.
1797         (expand_BUILTIN_EXPECT): Likewise.
1798         (internal_fn_expanders): Likewise for entries in this table.
1799         (expand_internal_call): Likewise.
1800         * internal-fn.def: Update comment to reflect strengthening of
1801         param of expanders.
1802         * internal-fn.h (expand_internal_call): Strengthen param from
1803         gimple to gimple_call.
1804         * ipa-prop.c (ipa_modify_call_arguments): Likewise for local
1805         "new_stmt".
1806         * ipa-pure-const.c (check_call): Likewise for param "call".
1807         (check_stmt): Add a checked cast to gimple_call within GIMPLE_CALL
1808         case.
1809         * ipa-split.c (split_function): Strengthen local "call" from
1810         gimple to gimple_call.
1811         * omp-low.c (build_omp_barrier): Likewise for local "g".
1812         (lower_rec_input_clauses): Likewise for local "stmt".
1813         * trans-mem.c (build_tm_load): Likewise for return type and local
1814         "gcall".
1815         (build_tm_store): Likewise.
1816         (expand_transaction): Likewise for local "call".
1817         * tree-call-cdce.c (check_pow): Likewise for param.
1818         (check_builtin_call): Likewise.
1819         (is_call_dce_candidate): Likewise.
1820         (gen_conditions_for_pow): Likewise.
1821         (gen_shrink_wrap_conditions): Likewise.
1822         (shrink_wrap_one_built_in_call): Likewise.
1823         (shrink_wrap_conditional_dead_built_in_calls): Strengthen param
1824         from vec<gimple> to vec<gimple_call>, and local "bi_call" from
1825         gimple to gimple_call.
1826         (pass_call_cdce::execute): Strengthen local
1827         "cond_dead_built_in_calls" from auto_vec<gimple> to
1828         auto_vec<gimple_call> and local "stmt" from gimple to gimple_call,
1829         * tree-cfg.c (notice_special_calls): Strengthen param from gimple
1830         to gimple_call.
1831         * tree-cfg.h (notice_special_calls): Likewise.
1832         * tree-complex.c (expand_complex_libcall): Likewise for local
1833         "stmt".
1834         * tree-inline.c (remap_gimple_stmt): Add checked cast to
1835         gimple_call.
1836         (copy_bb): Likewise.  Strengthen local "new_call" from gimple to
1837         gimple_call.
1838         (inline_forbidden_p_stmt): Add checked cast to gimple_call.
1839         * tree-nested.c (init_tmp_var_with_call): Strengthen param "call"
1840         from gimple to gimple_call.
1841         (convert_nl_goto_reference): Likewise for local "call".
1842         (convert_tramp_reference_op): Likewise.
1843         (convert_gimple_call): Add checked cast to gimple_call.
1844         * tree-nrv.c (dest_safe_for_nrv_p): Strengthen param "call" from
1845         gimple to gimple_call.
1846         (pass_return_slot::execute): Likewise for local "stmt", using a
1847         dyn_cast<gimple_call> rather than an is_gimple_call call.
1848         * tree-object-size.c (alloc_object_size): Strengthen param "call"
1849         from const_gimple to const_gimple_call.
1850         (pass_through_call): Likewise.
1851         (call_object_size): Strengthen param "call" from gimple to
1852         gimple_call.
1853         (collect_object_sizes_for): Introduce local "call_stmt" via a
1854         checked cast, using it for typesafety.
1855         (check_for_plus_in_loops_1): Likewise.
1856         (pass_object_sizes::execute): Add a checked cast to gimple_call.
1857         * tree-profile.c (gimple_gen_interval_profiler): Strengthen local
1858         "call" from gimple to gimple_call.
1859         (gimple_gen_pow2_profiler): Likewise.
1860         (gimple_gen_one_value_profiler): Likewise.
1861         (gimple_gen_time_profiler): Likewise.
1862         (gimple_gen_average_profiler): Likewise.
1863         (gimple_gen_ior_profiler): Likewise.
1864         * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise for
1865         param "call".
1866         (ref_maybe_used_by_call_p): Likewise.
1867         (ref_maybe_used_by_stmt_p): Add a checked cast to gimple_call.
1868         (call_may_clobber_ref_p_1): Strengthen param "call" from gimple to
1869         gimple_call.
1870         (call_may_clobber_ref_p): Likewise.
1871         (stmt_may_clobber_ref_p_1): Add a checked cast to gimple_call.
1872         * tree-ssa-alias.h (call_may_clobber_ref_p): Strengthen param 1
1873         from gimple to gimple_call.
1874         (call_may_clobber_ref_p_1): Likewise.
1875         * tree-ssa-dce.c (eliminate_unnecessary_stmts): Add a checked cast
1876         to gimple_call.
1877         * tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Strengthen
1878         local "call" from gimple to gimple_call.
1879         * tree-ssa-math-opts.c (build_and_insert_call): Likewise for local
1880         "call_stmt".
1881         * tree-ssa-operands.c (maybe_add_call_vops): Likewise for param
1882         "stmt".
1883         (parse_ssa_operands): Add a checked cast to gimple_call within
1884         GIMPLE_CALL case.
1885         * tree-ssa-pre.c (compute_avail): Add a checked cast to
1886         gimple_call.
1887         * tree-ssa-sccvn.c (copy_reference_ops_from_call): Strengthen
1888         param "call" from gimple to gimple_call.
1889         (valueize_shared_reference_ops_from_call): Likewise.
1890         (vn_reference_lookup_3): Add a checked cast to gimple_call.
1891         (vn_reference_lookup_call): Strengthen param "call" from gimple to
1892         gimple_call.
1893         (visit_reference_op_call): Likewise for param "stmt".
1894         (visit_use): Replace is_gimple_call with a dyn_cast, introducing
1895         local "call_stmt", using it in place of "stmt" for type-safety.
1896         * tree-ssa-sccvn.h (vn_reference_lookup_call): Strengthen param 1
1897         from gimple to gimple_call.
1898         * tree-ssa-structalias.c (get_call_vi): Likewise.
1899         (lookup_call_use_vi): Likewise.
1900         (lookup_call_clobber_vi): Likewise.
1901         (get_call_use_vi): Likewise.
1902         (get_call_clobber_vi): Likewise.
1903         (handle_rhs_call): Likewise.
1904         (handle_lhs_call): Likewise.
1905         (handle_const_call): Likewise.
1906         (handle_pure_call): Likewise.
1907         (get_fi_for_callee): Likewise.
1908         (find_func_aliases_for_builtin_call): Likewise for param 2.
1909         (find_func_aliases_for_call): Likewise.
1910         (find_func_aliases): Add a checked cast to gimple_call.
1911         (find_func_clobbers): Replace is_gimple_call with a dyn_cast,
1912         introducing local "call_stmt", using it in place of "stmt" for
1913         type-safety.
1914         (compute_points_to_sets): Strengthen local "stmt" from gimple to
1915         gimple_call, replacing is_gimple_call with a
1916         dyn_cast <gimple_call>.
1917         (ipa_pta_execute): Likewise.
1918         * tree-ssa-threadedge.c
1919         (record_temporary_equivalences_from_stmts_at_dest): Add checked
1920         cast to gimple_call.
1921         * tree-tailcall.c (find_tail_calls): Strengthen local "call" from
1922         gimple to gimple_call, adding a checked cast.
1923         * tree-vect-data-refs.c (vect_setup_realignment): Eliminate
1924         top-level local "new_stmt" in favor of more tightly-scoped locals
1925         "new_stmt" of type gimple_assign and gimple_call.
1926         * tree-vect-patterns.c (vect_recog_pow_pattern): Strenghthen local
1927         "stmt" from gimple to gimple_call.
1928         * tree-vect-stmts.c (vectorizable_function): Likewise for param
1929         "call".
1930         (vectorizable_call): Rename param 1 from "stmt" to "gs",
1931         reintroducing "stmt" as a gimple_call once we've established that
1932         we're working with a GIMPLE_CALL.
1933         * tree-vectorizer.h (vectorizable_function): Strengthen param 1
1934         from gimple to gimple_call.
1935         * value-prof.c (check_ic_target): Likewise.
1936         (gimple_ic_transform): Likewise for local "stmt", replacing a
1937         check for GIMPLE_CALL with a dyn_cast.
1938         (interesting_stringop_to_profile_p): Strengthen param "call"
1939         from gimple to gimple_call.
1940         (gimple_stringop_fixed_value): Likewise for param "vcall_stmt".
1941         (gimple_stringops_transform): Likewise for local "stmt",
1942         replacing a check for GIMPLE_CALL with a dyn_cast.
1943         (gimple_stringops_values_to_profile): Rename param 1 from "stmt"
1944         to "gs", reintroducing "stmt" as a gimple_call once we've
1945         established that we're working with a GIMPLE_CALL.
1946         * vtable-verify.c (verify_bb_vtables): Strengthen local
1947         "call_stmt" from gimple to gimple_call.
1949 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1951         Concretize get_loop_exit_condition et al to working on gimple_cond
1953         * tree-scalar-evolution.h (get_loop_exit_condition): Return a
1954         gimple_cond.
1955         * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
1956         concretizing local "res" from gimple to gimple_cond.
1957         * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
1958         locals from gimple to gimple_cond.
1959         (slpeel_can_duplicate_loop_p): Likewise.
1960         * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
1961         (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
1963 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1965         Update various expressions within tree-scalar-evolution.c to be gimple_phi
1967         * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
1968         rather than a gimple.
1969         (follow_ssa_edge_binary): Likewise.
1970         (follow_ssa_edge_expr): Likewise.
1971         (follow_ssa_edge_in_rhs): Likewise.
1972         (backedge_phi_arg_p): Likewise.
1973         (follow_ssa_edge_in_condition_phi_branch): Likewise.
1974         (follow_ssa_edge_in_condition_phi): Likewise.
1975         (follow_ssa_edge_inner_loop_phi): Likewise.
1976         (analyze_evolution_in_loop): Likewise.
1977         (analyze_initial_condition): Likewise.
1978         (interpret_loop_phi): Likewise.
1979         (interpret_condition_phi): Likewise.
1980         (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
1982         (analyze_scalar_evolution_1): Add checked casts to gimple_phi
1983         within "case GIMPLE_PHI".
1985 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1987         tree-ssa-loop-ivopts.c: use gimple_phi in a few places
1989         * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
1990         (find_bivs): Convert local "phi" into a gimple_phi.
1991         (mark_bivs): Likewise.
1993 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1995         tree-ssa-loop-manip.c: use gimple_phi in three places
1997         * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
1998         gimple_phi.
1999         (split_loop_exit_edge): Likewise for "phi" and "new_phi".
2001 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2003         tree-ssa-loop-niter.c: use gimple_phi in a few places
2005         * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
2006         rather than a gimple.
2007         (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
2008         (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
2010 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2012         tree-ssa-phiprop.c: use gimple_phi
2014         * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
2015         parameter "phi" and local "new_phi" from gimple to gimple_phi.
2017 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2019         tree-predcom.c: use gimple_phi in various places
2021         * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
2022         than just a gimple.
2023         (insert_looparound_copy): Require a gimple_phi rather than just a
2024         gimple.
2025         (add_looparound_copies): Convert local "phi" to be a gimple_phi.
2026         (initialize_root_vars): Likewise.
2027         (initialize_root_vars_lm): Likewise.
2029 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2031         tree-parloops.c: use gimple_phi in various places
2033         * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
2034         from gimple to gimple_phi.
2035         (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
2036         (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
2037         (gather_scalar_reductions): Convert to a gimple_phi_iterator and
2038         gimple_phi.
2039         (try_create_reduction_list): Likewise.
2041 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2043         Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
2045         * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
2046         type of parameter from gimple to gimple_phi.
2048         * tree-complex.c (complex_visit_phi): Update signature of callback
2049         implementation accordingly.
2050         * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
2051         * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
2052         * tree-vrp.c (vrp_visit_phi_node): Likewise.
2054         * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
2055         gimple_phi when invoking the ssa_prop_visit_phi callback.
2057 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2059         Introduce gimple_phi_iterator
2061         * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
2062         gimple_stmt_iterator with identical layout, but adding...
2063         (gimple_phi_iterator::phi): ...new method, equivalent to
2064         gsi_stmt (), but casting the underlying gimple to gimple_phi,
2065         checking that code == GIMPLE_PHI in a checked build.
2066         (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
2067         gimple_stmt_iterator.
2069         * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
2070         than just a gimple.
2071         (if_convertible_phi_p): Likewise.
2072         * tree-phinodes.h (add_phi_node_to_bb): Likewise.
2073         * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
2075         * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
2076         and a vec<gimple_phi> *, rather than just a gimple and
2077         vec<gimple> *, and a hash_set<gimple_phi> * rather than a
2078         hash_set<gimple> *.
2079         (find_uninit_use): Likewise; add checked cast to gimple_phi when
2080         adding to worklist.
2081         (pass_late_warn_uninitialized::execute): Strengthen types of
2082         various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
2083         "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
2084         gimple_phi, "added_to_worklist" from hash_set<gimple> to
2085         hash_set<gimple_phi>.
2087         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
2088         gimple_phi_iterator * rather than a gimple_stmt_iterator *;
2089         use it to strengthen local from a gimple to a gimple_phi.
2091         * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
2092         gimple_stmt_iterator to a gimple_phi_iterator.  Use the iterator's
2093         "phi" method rather than gsi_stmt.  Use this checked cast to convert
2094         the type of related local from a plain gimple to a gimple_phi.
2095         * gimple-pretty-print.c (dump_phi_nodes): Likewise.
2096         * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
2097         Likewise.
2098         * sese.c (sese_add_exit_phis_edge): Likewise.
2099         * tree-cfg.c (reinstall_phi_args): Likewise.
2100         (gimple_make_forwarder_block): Likewise.
2101         (add_phi_args_after_copy_edge): Likewise.
2102         (gimple_lv_adjust_loop_header_phi): Likewise.
2103         * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
2104         (remove_forwarder_block_with_phi): Likewise.
2105         (merge_phi_nodes): Likewise.
2106         * tree-complex.c (update_phi_components): Likewise.
2107         * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
2108         * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
2109         (copy_phis_for_bb): Likewise.
2110         * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
2111         * tree-outof-ssa.c (eliminate_build): Likewise.
2112         (eliminate_useless_phis): Likewise.
2113         (rewrite_trees): Likewise.
2114         (insert_backedge_copies): Likewise.
2115         * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
2116         (remove_phi_args): Likewise.
2117         (remove_phi_nodes): Likewise.
2118         * tree-predcom.c (find_looparound_phi): Likewise.
2119         (eliminate_temp_copies): Likewise.
2120         * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
2121         (scev_const_prop): Likewise; also, add checked cast to phi.
2122         * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
2123         * tree-ssa-dce.c (remove_dead_phis): Likewise.
2124         (forward_edge_to_pdom): Likewise.
2125         * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
2126         (cprop_into_successor_phis): Likewise.
2127         (propagate_rhs_into_lhs): Likewise.
2128         (eliminate_degenerate_phis_1): Likewise.
2129         * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
2130         * tree-ssa-live.c (calculate_live_on_exit): Likewise.
2131         (verify_live_on_entry): Likewise.
2132         * tree-ssa-loop-im.c
2133         (move_computations_dom_walker::before_dom_children): Likewise.
2134         * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
2135         (mark_bivs): Likewise.
2136         (find_interesting_uses_outside): Likewise.
2137         (determine_set_costs): Likewise.
2138         * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
2139         (tree_transform_and_unroll_loop): Likewise.
2140         (rewrite_all_phi_nodes_with_iv): Likewise.
2141         (canonicalize_loop_ivs): Likewise.
2142         * tree-ssa-loop-niter.c (determine_value_range): Likewise.
2143         * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
2144         * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
2145         * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
2146         * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
2147         (vop_phi): Likewise.
2148         * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
2149         Likewise.
2150         * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
2151         (copy_phi_args): Likewise.
2152         (phi_args_equal_on_edges): Likewise.
2153         * tree-ssa.c (ssa_redirect_edge): Likewise.
2154         (flush_pending_stmts): Likewise.
2155         * tree-switch-conversion.c (check_final_bb): Likewise.
2156         (gather_default_values): Likewise.
2157         (build_constructors): Likewise.
2158         (fix_phi_nodes): Likewise.
2159         * tree-tailcall.c (propagate_through_phis): Likewise.
2160         (add_successor_phi_arg): Likewise.
2161         * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
2162         Likewise.
2163         (slpeel_update_phi_nodes_for_guard2): Likewise.
2164         (slpeel_tree_peel_loop_to_edge): Likewise.
2165         (vect_can_advance_ivs_p): Likewise.
2166         (vect_update_ivs_after_vectorizer): Likewise.
2167         * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
2168         * tree-vrp.c (find_assert_locations): Likewise.
2169         * value-prof.c (gimple_ic): Likewise.
2171         * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
2173 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2175         Introduce gimple_phi and use it in various places
2177         * coretypes.h (gimple_phi): New typedef.
2178         (const_gimple_phi): New typedef.
2180         * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
2181         variants, using the gimple printer.
2183         * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
2184         vecs of more concrete gimple subclasses as appropriate; also the
2185         comment is about to become misleading.
2187         * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
2188         rather than spelling out the full type.
2189         (gimple_phi_num_args): Likewise.
2190         (gimple_phi_result): Likewise.
2191         (gimple_phi_result_ptr): Use gimple_phi typedef.
2192         (gimple_phi_set_result): Likewise.
2193         (gimple_phi_arg): Likewise.
2194         (gimple_phi_set_arg): Likewise.
2195         * tree-phinodes.c (allocate_phi_node): Likewise.
2196         (resize_phi_node): Likewise.
2197         (reserve_phi_args_for_new_edge): Likewise.
2198         (remove_phi_arg_num): Likewise.
2200         * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
2201         rather than just a gimple.
2202         * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
2204         * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
2205         just a gimple.
2206         (create_phi_node): Likewise.
2207         * tree-phinodes.h (create_phi_node): Likewise.
2209         * trans-mem.c (struct struct tm_log_entry): Replace use of
2210         now-removed gimple_vec with a plain vec<gimple>.
2212         * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
2213         vec<gimple_vec> to a vec< vec<gimple_phi> >.
2215         * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
2216         gimple_phi.
2217         * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
2218         "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
2219         a gimple_phi.
2220         * tree-into-ssa.c (delete_update_ssa): Strengthen local
2221         "phis" from a gimple_vec to a vec<gimple_phi>.
2223         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2224         gimple_phi in regions where a stmt is known to have code
2225         GIMPLE_PHI.
2226         * tree-into-ssa.c (mark_use_interesting): Likewise.
2228 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2230         Introduce gimple_debug and use it in a few places
2232         * coretypes.h (gimple_debug): New typedef.
2233         (const_gimple_debug): New typedef.
2235         * gimple.h (struct gimple_statement_debug): New subclass of
2236         gimple_statement_with_ops, adding the invariant that
2237         stmt->code == GIMPLE_DEBUG.
2238         (is_a_helper <gimple_statement_debug>::test): New.
2240         * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
2241         variants, using the gimple printer.
2243         * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
2244         rather than just a gimple.
2245         * tree-inline.c (copy_debug_stmt): Likewise.
2247         * tree-inline.h (struct copy_body_data): Strengthen field
2248         "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
2250         * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
2251         rather than just a gimple.
2252         (gimple_build_debug_source_bind_stat): Likewise.
2253         * gimple.h (gimple_build_debug_bind_stat): Likewise.
2254         (gimple_build_debug_source_bind_stat): Likewise.
2256         * tree-inline.c (remap_gimple_stmt): Update locals to be a
2257         gimple_debug.
2258         (maybe_move_debug_stmts_to_successors): Likewise.
2259         (copy_debug_stmts): Likewise.
2261         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2262         gimple_debug in regions where a stmt is known to have code
2263         GIMPLE_DEBUG.
2265 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2267         Introduce gimple_label and use it in a few places
2269         * coretypes.h (gimple_label): New typedef.
2270         (const_gimple_label): New typedef.
2272         * gimple.h (struct gimple_statement_label): New subclass of
2273         gimple_statement_with_ops, adding the invariant that
2274         stmt->code == GIMPLE_LABEL.
2275         (is_a_helper <gimple_statement_label>::test): New.
2277         * gdbhooks.py (build_pretty_printer): Add gimple_label and its
2278         variants, reusing the gimple printer.
2280         * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
2281         rather than just a gimple.
2282         * tree-cfg.c (verify_gimple_label): Likewise.
2284         * gimple.c (gimple_build_label): Return a gimple_label rather than
2285         just a gimple.
2286         * gimple.h (gimple_build_label): Likewise.
2288         * gimplify.c (gimplify_case_label_expr): Update local to be a
2289         gimple_label.
2290         * tree-switch-conversion.c (gen_inbound_check): Likewise.
2292         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2293         gimple_label in regions where a stmt is known to have code
2294         GIMPLE_LABEL.
2295         * tree-cfg.c (verify_gimple_stmt): Likewise.
2297 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2299         Introduce gimple_assign and use it in various places
2301         * coretypes.h (gimple_assign): New typedef.
2302         (const_gimple_assign): New typedef.
2304         * gimple.h (struct gimple_statement_assign): New subclass of
2305         gimple_statement_with_memory_ops, adding the invariant that
2306         stmt->code == GIMPLE_ASSIGN.
2307         (is_a_helper <gimple_statement_assign>::test): New.
2309         * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
2310         variants, using the gimple printer.
2312         * gimple-builder.c (build_assign): Return a gimple_assign rather
2313         than just a gimple from each of the overloaded variants.
2314         (build_type_cast): Likewise.
2315         * gimple-builder.h (build_assign): Likewise.
2316         (build_type_cast): Likewise.
2317         * gimple.c (gimple_build_assign_stat): Likewise.
2318         (gimple_build_assign_with_ops): Likewise.
2319         * gimple.h (gimple_build_assign_stat): Likewise.
2320         (gimple_build_assign_with_ops): Likewise.
2322         * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
2323         rather than just a "const gimple" (the latter is not a
2324         "const_gimple").
2325         * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
2326         rather than just a gimple.
2327         (dump_binary_rhs): Likewise.
2328         (dump_ternary_rhs): Likewise.
2329         * tree-cfg.c (verify_gimple_assign_unary): Likewise.
2330         (verify_gimple_assign_binary): Likewise.
2331         (verify_gimple_assign_ternary): Likewise.
2332         (verify_gimple_assign_single): Likewise.
2333         (verify_gimple_assign): Likewise.
2334         * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
2335         (try_to_simplify): Likewise.
2336         * tree-tailcall.c (process_assignment): Likewise.
2337         * tree-vect-generic.c (expand_vector_operation): Likewise.
2338         * tree-vrp.c (extract_range_from_cond_expr): Likewise.
2339         (extract_range_from_assignment): Likewise.
2341         * asan.c (has_stmt_been_instrumented_p): Add checked cast to
2342         gimple_assign in regions where a stmt is known to have code
2343         GIMPLE_ASSIGN.
2344         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2345         * tree-cfg.c (verify_gimple_stmt): Likewise.
2346         * tree-ssa-sccvn.c (visit_use): Likewise.
2347         * tree-tailcall.c (find_tail_calls): Likewise.
2348         * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
2350         * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
2351         against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
2352         a gimple_assign local.
2354         * tree-vect-generic.c (expand_vector_condition): Convert local to a
2355         gimple_assign, adding a checked cast when extracting from gsi, since
2356         this is only called when  underlying stmt has code GIMPLE_ASSIGN.
2357         (optimize_vector_constructor): Likewise.
2358         (lower_vec_perm): Likewise.
2359         (expand_vector_operations_1): Convert local to a gimple_assign,
2360         introducing a dyn_cast.
2362 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2364         Introduce gimple_cond and use it in various places
2366         * coretypes.h (gimple_cond): New typedef.
2367         (const_gimple_cond): Likewise.
2369         * gimple.h (struct gimple_statement_cond): New subclass of
2370         gimple_statement_with_ops, adding the invariant that
2371         stmt->code == GIMPLE_COND.
2372         (is_a_helper <gimple_statement_cond>::test): New.
2373         (gimple_build_cond): Return a gimple_cond, rather than just
2374         a gimple.
2375         (gimple_build_cond_from_tree): Likewise.
2377         * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
2378         variants, using the gimple printer.
2380         * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
2381         than just a gimple.
2382         * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
2383         (gimple_cond_true_p): Likewise.
2384         (gimple_cond_false_p): Likewise.
2385         (gimple_cond_set_condition): Likewise.
2386         * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
2387         * gimple-fold.c (fold_gimple_cond): Likewise.
2388         * gimple-pretty-print.c (dump_gimple_cond): Likewise.
2389         * tree-ssa-dom.c (canonicalize_comparison): Likewise.
2390         * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
2391         * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
2392         (recognize_bits_test): Likewise.
2393         * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
2394         (thread_around_empty_blocks): Likewise.
2395         (thread_through_normal_block): Likewise.
2396         (thread_across_edge): Likewise.
2397         * tree-ssa-threadedge.h (thread_across_edge): Likewise.
2398         * tree-vrp.c (range_fits_type_p): Likewise.
2400         * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
2401         gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
2402         * gimple-fold.c (fold_stmt_1): Likewise.
2403         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2404         * tree-ssa-dom.c (optimize_stmt): Likewise.
2405         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2406         * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
2407         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
2408         Likewise.
2409         * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
2411         * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
2412         gimple_cond.
2413         * tree-vrp.c (identify_jump_threads): Likewise.
2415         * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
2416         just a gimple.
2417         (gimple_build_cond_from_tree): Likewise.
2419         * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
2420         field "m_dummy_cond" from a plain gimple to a gimple_cond.
2422         * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
2423         inner_stmt and outer_stmt so that inner_cond and outer_cond can be
2424         of type gimple_cond once we know that we have code == GIMPLE_COND.
2425         * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
2426         "last" so that stmt can be of type gimple_cond.
2428 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2430         Introduce gimple_bind and use it for accessors.
2432         * coretypes.h (gimple_bind): New typedef.
2433         (const_gimple_bind): New typedef.
2435         * gdbhooks.py (build_pretty_printer): Add gimple_bind
2436         and its variants, using the gimple printer.
2438         * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
2439         require a gimple_bind rather than just a gimple.
2441         * gimple.c (gimple_build_bind): Return a gimple_bind rather than
2442         just a gimple.
2443         * gimple.h (gimple_build_bind): Likewise.
2445         * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
2447         * gimple.h (gimple_bind_vars): Update type-signature to
2448         require a gimple_bind rather than just a gimple, removing
2449         as_a and hence run-time check.
2450         (gimple_bind_set_vars): Likewise.
2451         (gimple_bind_append_vars): Likewise.
2452         (gimple_bind_body_ptr): Likewise.
2453         (gimple_bind_body): Likewise.
2454         (gimple_bind_set_body): Likewise.
2455         (gimple_bind_add_stmt): Likewise.
2456         (gimple_bind_add_seq): Likewise.
2457         (gimple_bind_block): Likewise.
2458         (gimple_bind_set_block): Likewise.
2459         * gimplify.c (gimple_push_bind_expr): Likewise.
2460         (gimple_current_bind_expr): Likewise.
2461         * tree-inline.c (copy_gimple_bind): Likewise.
2463         * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
2464         rather than a plain gimple.
2465         (gimplify_body): Likewise.
2466         (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
2467         a vec<gimple>.
2469         * gimplify.c (struct gimplify_ctx): Strengthen field
2470         "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
2471         (gimple_bind_expr_stack): Likewise for type of returned value.
2473         * gimplify.c (gimplify_body): Strengthen various types from gimple
2474         to gimple_bind, including the return type.
2476         * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
2477         so that local "scope" can be of type gimple_bind once we've reached
2478         the region where it must be of code GIMPLE_BIND.
2480         * gimple-low.c (lower_gimple_bind): Add checked cast to
2481         gimple_bind, since both callers (lower_function_body and
2482         lower_stmt) have checked the code for us.
2484         * gimple.c (gimple_copy): Add checked cast to gimple_bind in
2485         region guarded by check for code GIMPLE_BIND.
2486         * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
2487         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2488         * gimple-walk.c (walk_gimple_stmt): Likewise.
2489         * omp-low.c (scan_omp_1_stmt): Likewise.
2490         (lower_omp_1): Likewise.
2491         (lower_omp_for): Likewise.
2492         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
2493         (do_warn_unused_result): Likewise.
2494         * tree-inline.c (remap_gimple_stmt): Likewise.
2495         (estimate_num_insns): Likewise.
2496         * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
2498         * gimplify.c (gimplify_bind_expr): Update local(s) to be a
2499         gimple_bind rather than just a gimple.
2500         (gimplify_function_tree): Likewise.
2501         * omp-low.c (lower_omp_sections): Likewise.
2502         (lower_omp_single): Likewise.
2503         (lower_omp_master): Likewise.
2504         (lower_omp_taskgroup): Likewise.
2505         (lower_omp_ordered): Likewise.
2506         (lower_omp_critical): Likewise.
2507         (lower_omp_taskreg): Likewise.
2508         (lower_omp_teams): Likewise.
2509         * omp-low.c (lower_omp_for): Likewise; use
2510         gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
2511         (lower_omp_target): Likewise.
2512         * tree-nested.c (finalize_nesting_tree_1): Likewise.
2514         * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
2515         * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
2517 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2519         Introduce gimple_switch and use it in various places
2521         * gimple.h (gimple_statement_switch): New subclass of
2522         gimple_statement_with_ops, adding the invariant that
2523         stmt->code == GIMPLE_SWITCH.
2524         (is_a_helper <gimple_statement_switch>::test (gimple)): New.
2526         * coretypes.h (gimple_switch): New typedef
2527         (const_gimple_switch): Likewise.
2529         * gdbhooks.py (build_pretty_printer): Add gimple_switch
2530         and its variants, using the gimple printer.
2532         * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
2533         rather than just a gimple.
2534         (gimple_build_switch): Likewise.
2535         * gimple.h (gimple_build_switch_nlabels): Likewise.
2536         (gimple_build_switch): Likewise.
2538         * gimple.h (gimple_switch_num_labels): Update type-signature to
2539         require a gimple_switch rather than just a gimple.
2540         (gimple_switch_set_num_labels): Likewise.
2541         (gimple_switch_set_index): Likewise.
2542         (gimple_switch_label): Likewise.
2543         (gimple_switch_set_label): Likewise.
2544         (gimple_switch_default_label): Likewise.
2545         (gimple_switch_set_default_label): Likewise.
2546         * expr.h (expand_case): Likewise.
2547         * gimple-pretty-print.c (dump_gimple_call): Likewise.
2548         * stmt.c (compute_cases_per_edge): Likewise.
2549         (expand_case): Likewise.
2550         * tree-cfg.h (group_case_labels_stmt): Likewise.
2551         * tree-cfg.c (make_gimple_switch_edges): Likewise.
2552         (find_taken_edge_switch_expr) Likewise.
2553         (find_case_label_for_value) Likewise.
2554         (get_cases_for_edge): Likewise.
2555         (group_case_labels_stmt): Likewise.
2556         (verify_gimple_switch): Likewise.
2557         * tree-eh.c (verify_norecord_switch_expr): Likewise.
2558         * tree-eh.c (lower_eh_constructs_2): Likewise.
2559         * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
2560         * tree-ssa-dom.c (record_edge_info): Likewise.
2561         * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
2562         (simplify_gimple_switch): Likewise.
2563         * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
2564         (collect_switch_conv_info): Likewise.
2565         (build_constructors): Likewise.
2566         (array_value_type): Likewise.
2567         (build_one_array): Likewise.
2568         (build_arrays): Likewise.
2569         (gen_inbound_check): Likewise.
2570         * tree-vrp.c (find_switch_asserts): Likewise.
2571         (find_case_label_range): Likewise.
2572         (find_case_label_ranges): Likewise.
2573         (vrp_visit_switch_stmt): Likewise.
2574         (simplify_switch_using_ranges): Likewise.
2576         * tree-vrp.c (switch_update): Strengthen field "stmt" from being
2577         merely a gimple to being a gimple_switch.
2579         * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
2580         gimple_switch in regions where the stmt code has been tested as
2581         GIMPLE_SWITCH.
2582         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2583         * tree-cfg.c (make_edges): Likewise.
2584         (end_recording_case_labels): Likewise.
2585         (cleanup_dead_labels): Likewise.
2586         (cleanup_dead_labels): Likewise.
2587         (group_case_labels): Likewise.
2588         (find_taken_edge): Likewise.
2589         (find_case_label_for_value): Likewise.
2590         (verify_gimple_stmt): Likewise.
2591         (gimple_verify_flow_info): Likewise.
2592         (gimple_redirect_edge_and_branch): Likewise.
2593         * tree-inline.c (estimate_num_insns): Likewise.
2594         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2595         * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
2596         * tree-switch-conversion.c (do_switchconv): Likewise.
2597         * tree-vrp.c  (find_assert_locations_1): Likewise.
2598         (vrp_visit_stmt): Likewise.
2599         (simplify_stmt_using_ranges): Likewise.
2601         * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
2602         Introduce local "lastg" as a generic gimple, so that local "last"
2603         can be of type gimple_switch once lastg's code has been verified.
2605         * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
2606         the GIMPLE_SWITCH case.
2608         * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
2609         argument, since the caller (find_taken_edge) has checked that
2610         last_stmt is a switch.
2612 Copyright (C) 2014 Free Software Foundation, Inc.
2614 Copying and distribution of this file, with or without modification,
2615 are permitted in any medium without royalty provided the copyright
2616 notice and this notice are preserved.