Make gimple_phi_arg_edge require a gimple_phi
[official-gcc.git] / gcc / ChangeLog.gimple-classes
blob4a78ca00eae174788636c382d0a70ec7e5fd20d7
1 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
3         Make gimple_phi_arg_edge require a gimple_phi
5         * gimple.h (gimple_phi_arg_edge): Require a gimple_phi rather
6         than a plain gimple.
8         * gimple-ssa-strength-reduction.c (ncd_with_phi): Strengthen
9         param "phi" from gimple to gimple_phi.  Add a checked cast.
10         (ncd_of_cand_and_phis): Add a checked cast.
12         * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Require a
13         gimple_phi_iterator; strengthen local "phi" from gimple to a
14         gimple_phi.
15         (rewrite_cross_bb_scalar_deps): Strengthen local "psi" from
16         a gimple_stmt_iterator to a gimple_phi_iterator.
17         (edge_initial_value_for_loop_phi): Require a gimple phi.
18         (initial_value_for_loop_phi): Likewise.
20         * ipa-split.c (consider_split): Convert "bsi" to a
21         gimple_phi_iterator and "stmt" to a gimple_phi.
23         * predict.c (predict_extra_loop_exits): Convert "phi_stmt" to be
24         a gimple_phi; introduce "lhs_def_stmt" as plain gimple.
25         (apply_return_prediction): Convert "phi" to be a gimple_phi.
27         * tree-cfg.c (replace_uses_by): Add checked cast to gimple_phi.
28         (verify_gimple_in_cfg): Introduce gimple_phi_iterator "gpi" and use
29         it to convert "phi" to a gimple_phi.
31         * tree-eh.c (cleanup_empty_eh_merge_phis): Convert "ngsi", "ogsi"
32         to be gimple_phi_iterators.  Convert "ophi", "nphi" to be
33         gimple_phi.
35         * tree-into-ssa.c (prepare_use_sites_for): Add checked cast to
36         gimple_phi.
38         * tree-ssa-coalesce.c (create_outofssa_var_map): Introduce
39         gimple_phi_iterator "gpi" and use it to convert "phi" to a
40         gimple_phi.
42         * tree-ssa-dce.c (propagate_necessity): Introduce local "phi",
43         from checked cast to gimple_phi.
45         * tree-ssa-live.c (set_var_live_on_entry): Add checked cast to
46         gimple_phi.
48         * tree-ssa-propagate.c (replace_phi_args_in): Require a gimple_phi
49         rather than a plain gimple.
50         (substitute_and_fold_dom_walker::before_dom_children): Introduce
51         gimple_phi_iterator "gpi".
53         * tree-ssa-sink.c (find_bb_for_arg): Require a gimple_phi rather
54         than a plain gimple.
55         (nearest_common_dominator_of_uses): Replace check of code against
56         GIMPLE_PHI with a dyn_cast<gimple_phi>, introducing a new local.
57         (statement_sink_location): Add checked cast to gimple_phi.
59         * tree-ssa-uninit.c (compute_uninit_opnds_pos): Require a
60         gimple_phi rather than a plain gimple.
61         (collect_phi_def_edges): Likewise.  Add a checked cast.
62         (find_def_preds): Strengthen param "phi" from gimple to
63         gimple_phi.
64         (prune_uninit_phi_opnds_in_unrealizable_paths): Likewise for
65         params "phi" and "flag_def".  Strenghen param "visited_phis" from
66         hash_set<gimple> * to hash_set<gimple_phi> *.  Convert
67         "flag_arg_def", "phi_arg_def" to gimple_phi using
68         dyn_cast<gimple_phi>.  Similarly, introduce new local
69         "opnd_def_phi".
70         (use_pred_not_overlap_with_undef_path_pred): Strengthen param
71         "phi" from gimple to gimple_phi, and param "visited_phis" from
72         hash_set<gimple> * to hash_set<gimple_phi> *.  Add a checked cast.
73         (is_use_properly_guarded): Likewise for params.
74         (find_uninit_use): Replace check of code against GIMPLE_PHI with
75         a dyn_cast<gimple_phi>, introducing a new local "use_phi".
76         Strengthen local "visited_phis" from hash_set<gimple> to
77         hash_set<gimple_phi>.
79 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
81         Update GRAPHITE to use more concrete gimple statement classes
83         * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
84         Strengthen local "psi" to be a gimple_phi_iterator and "phi" to
85         a gimple_phi.
87         * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Require
88         a gimple_phi rathen than a plain gimple.
89         (remove_simple_copy_phi): Require a gimple_phi_iterator;
90         strengthen local "phi" to be a gimple_phi and "stmt" to be a
91         gimple_assign.
92         (remove_invariant_phi): Likewise.
93         (simple_copy_phi_p): Require a gimple_phi.
94         (reduction_phi_p): Require a gimple_phi_iterator; strengthen
95         local "phi" to be a gimple_phi.
96         (add_condition_to_pbb): Require a gimple_cond rather than a
97         plain gimple.
98         (add_conditions_to_domain): Add checked cast to gimple_cond
99         within GIMPLE_COND case of switch statement.
100         (single_pred_cond_non_loop_exit): Return a gimple_cond rather
101         than a plain gimple, via a checked cast.
102         (sese_dom_walker::before_dom_children): Strengthen local "stmt"
103         from gimple to gimple_cond.
104         (gsi_for_phi_node): Require a gimple_phi, and return a
105         gimple_phi_iterator.
106         (insert_out_of_ssa_copy): Strengthen local "stmt" from gimple to
107         gimple_assign.
108         (rewrite_reductions_out_of_ssa): Strengthen "psi" to be a
109         gimple_phi_iterator, and "phi" to be a gimple_phi.
110         (phi_contains_arg): Require a gimple_phi.
111         (follow_ssa_with_commutative_ops): Strengthen return type from
112         gimple to gimple_phi, by converting a check for code GIMPLE_PHI to
113         a dyn_cast<gimple_phi>, and strengthening local "res" from gimple
114         to gimple_phi.
115         (detect_commutative_reduction_arg): Strengthen return type from
116         gimple to gimple_phi, and strengthen local "phi" to be a
117         gimple_phi.
118         (detect_commutative_reduction_assign): Strengthen return type from
119         gimple to gimple_phi, and strengthen local "res" to be a
120         gimple_phi.
121         (follow_inital_value_to_phi): Strengthen return type from
122         gimple to gimple_phi.  Replace check for code GIMPLE_PHI with
123         a dyn_cast<gimple_phi>.
124         (detect_commutative_reduction): Strengthen return type and locals
125         "loop_phi", "phi", "close_phi" from gimple to gimple_phi,
126         introducing a checked cast of "stmt" in region guarded by
127         scalar_close_phi_node_p (stmt).
128         (translate_scalar_reduction_to_array_for_stmt): Require param
129         "loop_phi" to be a gimple_phi.  Strengthen local "assign" from
130         gimple to gimple_assign.
131         (remove_phi): Require a gimple_phi.
132         (close_phi_written_to_memory): Likewise.
133         (translate_scalar_reduction_to_array): We expect the first element
134         in each vector to be an arbitrary statement, but all of the
135         subsequent elements to be phi nodes.  Hence the decls of gimple
136         locals "loop_phi" and "close_phi" are replaced with decls of gimple
137         "loop_stmt" and "close_stmt", with decls of the more-strongly typed
138         gimple_phi "loop_phi" and "close_phi" occurring lower down, within
139         the region where we're dealing with i > 0 and hence where we can
140         safely assign them using the checked cast as_a <gimple_phi>.
141         This allows many of the strengthenings from gimple to gimple_phi
142         above.  We eliminate the local "stmt", since we can simply use
143         "loop_stmt".
144         (rewrite_commutative_reductions_out_of_ssa_close_phi): Strengthen
145         param "close_phi" from gimple to gimple_phi, and local "gsi" from
146         gimple_stmt_iterator to gimple_phi_iterator, converting uses of
147         gsi_stmt to gsi.phi for type-safety.
148         (scop_ivs_can_be_represented): Strengthen local "gsi" from
149         gimple_stmt_iterator to gimple_phi_iterator, and "phi" from gimple
150         to gimple_phi.
152 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
154         Make gimple_phi_arg_set_location require a gimple_phi
156         * gimple.h (gimple_phi_arg_set_location): Require a gimple_phi
157         rather than a plain gimple.
159 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
161         Make add_phi_arg require a gimple_phi
163         * tree-phinodes.h (add_phi_arg): Require a gimple_phi rather than
164         a plain gimple.
165         * tree-phinodes.c (add_phi_arg): Likewise.
167         * gimple-ssa-strength-reduction.c (create_phi_basis): Strengthen
168         local "phi" from plain gimple to gimple_phi.
170         * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
171         Likewise for "close_phi".
173         * ipa-split.c (split_function): Convert "psi" to
174         gimple_phi_iterator.
176         * omp-low.c (expand_omp_for_static_nochunk): Introduce
177         gimple_phi_iterator gpi, using it to strengthen "phi" to be a
178         gimple_phi.
179         (expand_omp_for_static_chunk): Likewise.
181         * tree-cfg.c (gimple_duplicate_bb): Make topmost "gsi" decl more
182         tightly-scoped, and eliminate decls "phis", "phi", "stmt", "copy"
183         in favor of more tightly-scoped gimple_phi_iterator gpi and
184         gimple_phi decls "phi" and "copy", and gimple decls "stmt" and
185         "copy".
187         * tree-parloops.c (create_parallel_loop): Introduce
188         gimple_phi_iterator gpi, using it to strengthen "phi" to be a
189         gimple_phi.
191         * tree-ssa-loop-im.c (execute_sm_if_changed): Likewise.
193         * tree-ssa-loop-manip.c (create_iv): Split out new gimple_phi
194         local "phi" from "stmt", and convert the latter into being a
195         gimple_assign.
197         * tree-ssa-pre.c (insert_into_preds_of_block): Strengthen local
198         "phi" to be a gimple_phi.
200         * tree-ssa-tail-merge.c (vop_phi): Require a gimple_phi rather
201         than a plain gimple.
202         (replace_block_by): Strengthen local "bb2_phi" to be a gimple_phi.
204         * tree-tailcall.c (add_successor_phi_arg): Use gsi.phi when
205         invoking add_phi_arg.
206         (eliminate_tail_call): Introduce gimple_phi_iterator gpi, using it
207         to strengthen "phi" to be a gimple_phi.
208         (create_tailcall_accumulator): Strengthen local "phi" to be a
209         gimple_phi.
210         (tree_optimize_tail_calls_1): Likewise.
212         * tree-vect-data-refs.c (vect_setup_realignment): Strengthen
213         local "phi_stmt" to be a gimple_phi.
215         * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg):
216         Strengthen "gsi", "gsi_orig", "gsi_new" to be
217         gimple_phi_iterators, and "phi" "orig_phi", "new_phi" to be
218         gimple_phi instances.
219         (slpeel_tree_peel_loop_to_edge): Strengthen local "new_phi" to be
220         a gimple_phi.
222         * tree-vect-loop.c (get_initial_def_for_induction): Likewise for
223         "induction_phi".
224         (vect_create_epilog_for_reduction): Add checked casts to
225         gimple_phi; strengthen local "outer_phi" to gimple_phi and
226         "new_vec_stmt" to gimple_assign.
227         (vect_finalize_reduction): Strengthen local "vect_phi" to
228         gimple_phi.
229         (vectorizable_reduction): Likewise for "new_phi".
231         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
232         (vectorizable_load): Likewise for "phi".
234 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
236         Make gimple_phi_arg_def_ptr and gimple_phi_arg_has_location require a gimple_phi
238         * gimple.h (gimple_phi_arg_def_ptr): Require a gimple_phi rather
239         than a plain gimple.
240         (gimple_phi_arg_has_location): Likewise.
242         * gimple-streamer-in.c (input_phi): Return a gimple_phi rather
243         than a plain gimple.
244         * gimple-streamer-out.c (output_phi): Require a gimple_phi rather
245         than a plain gimple.
246         (output_bb): Convert iteration to a gimple_phi_iterator, and local
247         "phi" to gimple_phi.
249         * omp-low.c (expand_omp_for_static_chunk): Convert iterator "psi"
250         to a gimple_phi_iterator; convert locals "phi" and "nphi" to be
251         gimple_phi.
253         * tree-cfg.c (gimple_duplicate_sese_tail): Likewise for "psi" and
254         "phi".
255         (move_block_to_fn): Introduce new gimple_phi_iterator "psi", using
256         it in place of "gsi" where necessary.  Convert "phi" to be a
257         gimple_phi.
259         * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
261         * tree-vect-loop-manip.c (vect_loop_versioning): Convert "gsi" to
262         a gimple_phi_iterator, and "orig_phi" and "new_phi" to be
263         gimple_phi.
265         * tree.c (find_decls_types_in_node): Introduce new
266         gimple_phi_iterator "psi", using it in place of "si" where
267         necessary.  Convert "phi" to be a gimple_phi.
269 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
271         omp-low.c: Use more concrete types of gimple statement for various locals
273         * omp-low.c (finalize_task_copyfn): Strengthen local "bind" from
274         plain gimple to gimple_bind.
275         (lower_rec_input_clauses): Strengthen local "g" from
276         plain gimple to gimple_assign.
277         (lower_lastprivate_clauses): Likewise for "stmt" to gimple_cond
278         and "g" to gimple_call.
279         (expand_omp_for_init_vars): Likewise, for two decls of "stmt" to
280         gimple_assign.
281         (expand_omp_atomic_pipeline): Likewise for one decl of "stmt".
282         (expand_omp_atomic_mutex): Likewise.
283         (lower_omp_master): Likewise for "x" to gimple_call.
284         (lower_omp_ordered): Likewise.
286 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
288         tree-parloops.c: Use gimple_phi in various places
290         * tree-parloops.c (reduction_info::keep_res): Strengthen field
291         from plain gimple to gimple_phi.
292         (transform_to_exit_first_loop): Strengthen locals "phi", "nphi"
293         to gimple_phi.  Eliminate early decl of gimple_stmt_iterator gsi
294         in favor of more tightly scoped gimple_phi_iterators, and a final
295         later decl as a gimple_stmt_iterator.
297 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
299         Introduce gimple_omp_sections
301         * coretypes.h (gimple_omp_sections): New typedef.
302         (const_gimple_omp_sections): New typedef.
304         * gimple-pretty-print.c (dump_gimple_omp_sections): Require a
305         gimple_omp_sections rather than a plain gimple.
306         (pp_gimple_stmt_1): Add checked cast to gimple_omp_sections within
307         GIMPLE_OMP_SECTIONS case of switch statement.
309         * gimple.c (gimple_build_omp_sections): Return a
310         gimple_omp_sections rather than a plain gimple.
312         * gimple.h (gimple_build_omp_sections): Return a
313         gimple_omp_sections rather than a plain gimple.
315         * omp-low.c (scan_omp_sections): Require a gimple_omp_sections
316         rather than a plain gimple.
317         (scan_omp_1_stmt): Add checked cast to gimple_omp_sections within
318         GIMPLE_OMP_SECTIONS case of switch statement.
319         (expand_omp_sections): Strengthen local "sections_stmt" from gimple
320         to gimple_omp_sections.
321         (lower_omp_sections): Likewise for "stmt".
323 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
325         Introduce gimple_omp_teams
327         * coretypes.h (gimple_omp_teams): New typedef.
328         (const_gimple_omp_teams): New typedef.
330         * gimple.h (gimple_build_omp_teams): Return a gimple_omp_teams
331         rather than a plain gimple.
332         (gimple_omp_teams_set_clauses): Require a gimple_omp_teams rather
333         than a plain gimple.
335         * gimple-pretty-print.c (dump_gimple_omp_teams): Require a
336         gimple_omp_teams rather than a plain gimple.
337         (pp_gimple_stmt_1): Add checked cast to gimple_omp_teams within
338         GIMPLE_OMP_TEAMS case of switch statement.
340         * gimple.c (gimple_build_omp_teams): Return a gimple_omp_teams
341         rather than a plain gimple.
343         * omp-low.c (scan_omp_teams): Likewise.
344         (scan_omp_1_stmt): Add checked cast to gimple_omp_teams within
345         GIMPLE_OMP_TEAMS case of switch statement.
346         (lower_omp_teams): Strengthen local "teams_stmt" from gimple to
347         gimple_omp_teams.
349 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
351         Introduce gimple_omp_target
353         * coretypes.h (gimple_omp_target): New typedef.
354         (const_gimple_omp_target): New typedef.
356         * gimple.h (gimple_build_omp_target): Return a gimple_omp_target
357         rather than a plain gimple.
358         (gimple_omp_target_set_clauses): Require a gimple_omp_target
359         rather than a plain gimple.
360         (gimple_omp_target_set_kind): Likewise.
361         (gimple_omp_target_child_fn_ptr): Likewise.
362         (gimple_omp_target_set_child_fn): Likewise.
363         (gimple_omp_target_data_arg_ptr): Likewise.
364         (gimple_omp_target_set_data_arg): Likewise.
365         (gimple_omp_target_child_fn): Require a const_gimple_omp_target
366         rather than a plain const_gimple.
367         (gimple_omp_target_data_arg): Likewise.
369         * gimple-pretty-print.c (dump_gimple_omp_target): Require a
370         gimple_omp_target rather than a plain gimple.
371         (pp_gimple_stmt_1): Add checked cast to gimple_omp_target within
372         GIMPLE_OMP_TARGET case of switch statement.
374         * gimple.c (gimple_build_omp_target): Return a gimple_omp_target
375         rather than a plain gimple.
377         * gimplify.c (gimplify_omp_target_update): Strengthen local "stmt"
378         from gimple to gimple_omp_target.
380         * omp-low.c (scan_omp_target): Require a gimple_omp_target rather
381         than a plain gimple.
382         (scan_omp_1_stmt): Add checked cast to gimple_omp_target within
383         GIMPLE_OMP_TARGET case of switch statement.
384         (expand_omp_target): Strengthen local "entry_stmt" from gimple to
385         gimple_omp_target.
386         (lower_omp_target): Likewise for "stmt".
388         * tree-nested.c (convert_nonlocal_reference_stmt): Add checked
389         cast to gimple_omp_target.
390         (convert_local_reference_stmt): Likewise.
391         (convert_gimple_call): Likewise.
393 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
395         Introduce gimple_omp_single
397         * coretypes.h (gimple_omp_single): New typedef.
398         (const_gimple_omp_single): New typedef.
400         * gimple.h (gimple_build_omp_single): Return a gimple_omp_single
401         rather than a plain gimple.
402         (gimple_omp_single_set_clauses): Require a gimple_omp_single
403         rather than a plain gimple.
405         * gimple-pretty-print.c (dump_gimple_omp_single): Require a
406         gimple_omp_single rather than a plain gimple.
407         (pp_gimple_stmt_1): Add checked cast to gimple_omp_single within
408         GIMPLE_OMP_SINGLE case of switch statement.
410         * gimple.c (gimple_build_omp_single): Return a gimple_omp_single
411         rather than a plain gimple.
413         * omp-low.c (scan_omp_single): Require a gimple_omp_single rather
414         than a plain gimple.
415         (scan_omp_1_stmt): Add checked cast to gimple_omp_single within
416         GIMPLE_OMP_SINGLE case of switch statement.
417         (lower_omp_single_simple): Require a gimple_omp_single rather
418         than a plain gimple.
419         (lower_omp_single_copy): Likewise.
420         (lower_omp_single): Strengthen local "single_stmt" from gimple to
421         gimple_omp_single.
423 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
425         Introduce gimple_omp_task
427         * coretypes.h (gimple_omp_task): New typedef.
428         (const_gimple_omp_task): New typedef.
430         * gimple.h (gimple_build_omp_task): Return a gimple_omp_task
431         rather than a plain gimple.
433         * gimple-pretty-print.c (dump_gimple_omp_task): Require a
434         gimple_omp_task rather than a plain gimple.
435         (pp_gimple_stmt_1): Add checked cast to gimple_omp_task within
436         GIMPLE_OMP_TASK case of switch statement.
438         * gimple.c (gimple_build_omp_task): Return a gimple_omp_task
439         rather than a plain gimple.
441         * omp-low.c (finalize_task_copyfn): Require a gimple_omp_task
442         rather than a plain gimple.
443         (delete_omp_context): Add checked cast to gimple_omp_task.
444         (scan_omp_task): Strengthen local "stmt" from gimple to
445         gimple_omp_task.
446         (expand_task_call): Require a gimple_omp_task rather than a plain
447         gimple.
448         (expand_omp_taskreg): Add checked cast to gimple_omp_task.
449         (create_task_copyfn): Require a gimple_omp_task rather than a
450         plain gimple.
451         (lower_omp_taskreg): Add checked cast to gimple_omp_task.
453 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
455         tree-cfg.c: Make verify_gimple_call require a gimple_call
457         * tree-cfg.c (verify_gimple_call): Require a gimple_call rather
458         than a plain gimple.
459         (verify_gimple_stmt): Add checked cast to gimple_call within
460         GIMPLE_CALL case of switch statement.
462 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
464         Introduce gimple_omp_parallel
466         * coretypes.h (gimple_omp_parallel): New typedef.
467         (const_gimple_omp_parallel): New typedef.
469         * cgraphbuild.c (build_cgraph_edges): Convert check of code
470         against GIMPLE_OMP_PARALLEL to a dyn_cast <gimple_omp_parallel>
471         and new local.
473         * gimple-pretty-print.c (dump_gimple_omp_parallel): Require a
474         gimple_omp_parallel rather than a plain gimple.
475         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_parallel
476         within GIMPLE_OMP_PARALLEL case of switch statement.
478         * gimple-walk.c (walk_gimple_op): Likewise, introducing a local.
480         * gimple.c (gimple_build_omp_parallel): Return a
481         gimple_omp_parallel rather than a plain gimple.
482         (gimple_copy): Add checked casts to gimple_omp_parallel within
483         GIMPLE_OMP_PARALLEL case of switch statement, introducing locals.
485         * gimple.h (gimple_build_omp_parallel): Return a
486         gimple_omp_parallel rather than a plain gimple.
487         (gimple_omp_parallel_clauses_ptr): Require a gimple_omp_parallel
488         rather than a plain gimple.
489         (gimple_omp_parallel_set_clauses): Likewise.
490         (gimple_omp_parallel_data_arg_ptr): Likewise.
491         (gimple_omp_parallel_set_data_arg): Likewise.
492         (gimple_omp_parallel_child_fn_ptr): Likewise.
493         (gimple_omp_parallel_set_child_fn): Likewise.
494         (gimple_omp_parallel_child_fn): Require a
495         const_gimple_omp_parallel rather than a plain const_gimple.
496         (gimple_omp_parallel_data_arg): Likewise.
498         * omp-low.c (scan_omp_parallel): Strengthen local "stmt" from
499         gimple to gimple_omp_parallel.
500         (expand_parallel_call): Require a gimple_omp_parallel for
501         "entry_stmt" rather than a plain gimple.
502         (remove_exit_barrier):  Strengthen local "parallel_stmt" from
503         gimple to gimple_omp_parallel.
504         (expand_omp_taskreg): Add checked casts to gimple_omp_parallel.
506         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
507         gimple_omp_parallel within GIMPLE_OMP_PARALLEL case of switch
508         statement, introducing local.
510 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
512         Introduce gimple_omp_for
514         * coretypes.h (gimple_omp_for): New.
515         (const_gimple_omp_for): New.
517         * gimple.h (gimple_build_omp_for): Return a gimple_omp_for rather
518         than a plain gimple.
519         (gimple_omp_for_set_kind): Require a gimple_omp_for rather than a
520         plain gimple.
521         (gimple_omp_for_set_combined_p): Likewise.
522         (gimple_omp_for_set_combined_into_p): Likewise.
524         * gimple-pretty-print.c (dump_gimple_omp_for): Require a
525         gimple_omp_for rather than a plain gimple.
526         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_for in
527         GIMPLE_OMP_FOR case of switch statement.
529         * gimple.c (gimple_build_omp_for): Return a gimple_omp_for rather
530         than a plain gimple.
531         (gimple_copy): Add a checked cast to gimple_omp_for and a new local.
533         * gimplify.c (gimplify_omp_for): Strengthen local "gfor" from
534         gimple to gimple_omp_for.
536         * omp-low.c (omp_for_data::for_stmt): Strengthen field from gimple
537         to gimple_omp_for.
538         (extract_omp_for_data): Require a gimple_omp_for rather than a
539         plain gimple.
540         (workshare_safe_to_combine_p): Add a checked cast to
541         gimple_omp_for.
542         (get_ws_args_for): Convert check of code against GIMPLE_OMP_FOR
543         with a dyn_cast<gimple_omp_for> and a new local.
544         (scan_omp_parallel): Add a checked cast to gimple_omp_for and a
545         new local.
546         (scan_omp_for): Require a gimple_omp_for rather than a plain
547         gimple.
548         (scan_omp_1_stmt): Add a checked cast to gimple_omp_for in
549         GIMPLE_OMP_FOR case of switch statement.
550         (expand_omp_for): Add a checked cast to gimple_omp_for.
551         (lower_omp_for): Strengthen local "stmt" from gimple to
552         gimple_omp_for.
554         * tree-nested.c (walk_gimple_omp_for): Require a gimple_omp_for
555         rather than a plain gimple.
556         (convert_nonlocal_reference_stmt): Add a checked cast to
557         gimple_omp_for in GIMPLE_OMP_FOR case of switch statement.
558         (convert_local_reference_stmt): Likewise.
560         * tree-parloops.c (create_parallel_loop): Strengthen local
561         "for_stmt" from gimple to gimple_omp_for.
563 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
565         Introduce gimple_omp_critical
567         * coretypes.h (gimple_omp_critical): New typedef.
568         (const_gimple_omp_critical): New typedef.
570         * gimple-pretty-print.c (dump_gimple_omp_critical): Require a
571         gimple_omp_critical rather than a plain gimple.
572         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_critical
573         within GIMPLE_OMP_CRITICAL case of switch statement.
575         * gimple-walk.c (walk_gimple_op): Likewise.
577         * gimple.c (gimple_build_omp_critical): Return a gimple_omp_critical
578         rather than a plain gimple.
579         (gimple_copy): Add checked casts to gimple_omp_critical
580         within GIMPLE_OMP_CRITICAL case of switch statement.
582         * gimple.h (gimple_debug): Likewise.
583         (gimple_build_omp_critical): Return a gimple_omp_critical rather
584         than a plain gimple.
585         (gimple_omp_critical_name): Require a const_gimple_omp_critical
586         rather than a plain const_gimple.
587         (gimple_omp_critical_name_ptr): Require a gimple_omp_critical
588         rather than a plain gimple.
589         (gimple_omp_critical_set_name): Likewise.
591         * omp-low.c (check_omp_nesting_restrictions): Add a checked cast
592         to gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
593         statement, introducing a new local "other_crit" for type-safety.
594         (lower_omp_critical): Strengthen local "stmt" to
595         gimple_omp_critical.
597         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
598         gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
599         statement.
601 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
603         Introduce gimple_omp_continue
605         * coretypes.h (gimple_omp_continue): New typedef.
606         (const_gimple_omp_continue): New typedef.
608         * gimple.h (gimple_build_omp_continue): Return a
609         gimple_omp_continue rather than a plain gimple.
610         (gimple_omp_continue_control_def): Require a
611         const_gimple_omp_continue rather than a plain const_gimple.
612         (gimple_omp_continue_control_use): Likewise.
613         (gimple_omp_continue_control_def_ptr): Require a gimple_omp_continue
614         rather than a plain gimple.
615         (gimple_omp_continue_set_control_def): Likewise.
616         (gimple_omp_continue_control_use_ptr): Likewise.
617         (gimple_omp_continue_set_control_use): Likewise.
619         * gimple-pretty-print.c (dump_gimple_omp_continue): Require a
620         gimple_omp_continue rather than a plain gimple.
621         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_continue
622         within GIMPLE_OMP_CONTINUE case of switch statement.
624         * gimple-walk.c (walk_gimple_op): Likewise, adding a new local.
626         * gimple.c (gimple_build_omp_continue): Return a
627         gimple_omp_continue rather than a plain gimple.
629         * omp-low.c (gimple_build_cond_empty): Return a gimple_cond
630         rather than a plain gimple.
631         (expand_omp_for_generic): Split local "stmt" into "assign_stmt",
632         "cont_stmt", "cond_stmt", "call_stmt" of types gimple_assign,
633         gimple_omp_continue, gimple_cond, gimple_call respectively.
634         (expand_omp_for_static_nochunk): Likewise, splitting into two
635         "cond_stmt" decls. "assign_stmt", "cont_stmt"
636         (expand_omp_for_static_chunk): Likewise, splitting into
637         "cond_stmt", "assign_stmt", "cont_stmt".
638         (expand_omp_sections): Strengthen local "cont" from gimple to
639         gimple_omp_continue.
641 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
643         Introduce gimple_omp_atomic_store
645         * coretypes.h (gimple_omp_atomic_store): New typedef.
646         (const_gimple_omp_atomic_store): New typedef.
648         * gimple-pretty-print.c (dump_gimple_omp_atomic_store): Require
649         a gimple_omp_atomic_store rather than a plain gimple.
650         (pp_gimple_stmt_1): Add checked cast to gimple_omp_atomic_store
651         within GIMPLE_OMP_ATOMIC_STORE case of switch statement.
652         * gimple-walk.c (walk_gimple_op): Likewise.
654         * gimple.c (gimple_build_omp_atomic_store): Return a
655         gimple_omp_atomic_store rather than a plain gimple.
657         * gimple.h (gimple_build_omp_atomic_store): Return a
658         gimple_omp_atomic_store rather than a plain gimple.
659         (gimple_omp_atomic_store_set_val): Require a gimple_omp_atomic_store
660         rather than a plain gimple.
661         (gimple_omp_atomic_store_val_ptr): Likewise.
662         (gimple_omp_atomic_store_val): Require a
663         const_gimple_omp_atomic_store rather than a plain const_gimple.
665         * gimplify.c (gimplify_omp_atomic): Strengthen locals "loadstmt" and
666         "storestmt" from gimple to gimple_omp_atomic_load loadstmt and
667         gimple_omp_atomic_store storestmt respectively.
669         * omp-low.c (expand_omp_atomic): Strengthen local "store" from
670         gimple to gimple_omp_atomic_store.
672 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
674         Introduce gimple_omp_atomic_load
676         * coretypes.h (gimple_omp_atomic_load): New typedef.
677         (const_gimple_omp_atomic_load): New typedef.
679         * gimple-pretty-print.c (dump_gimple_omp_atomic_load): Require a
680         gimple_omp_atomic_load rather than a plain gimple.
681         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_atomic_load
682         within GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
684         * gimple-walk.c (walk_gimple_op): Likewise, introducing a new local.
686         * gimple.c (gimple_build_omp_atomic_load): Return a
687         gimple_omp_atomic_load rather than a plain gimple.
689         * gimple.h (gimple_build_omp_atomic_load): Return a
690         gimple_omp_atomic_load rather than a plain gimple.
691         (gimple_omp_atomic_load_set_lhs): Require a
692         gimple_omp_atomic_load rather than a plain gimple.
693         (gimple_omp_atomic_load_lhs_ptr): Likewise.
694         (gimple_omp_atomic_load_set_rhs): Likewise.
695         (gimple_omp_atomic_load_rhs_ptr): Likewise.
696         (gimple_omp_atomic_load_lhs): Require a
697         const_gimple_omp_atomic_load rather than a plain const_gimple.
698         (gimple_omp_atomic_load_rhs): Likewise.
700         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
701         to gimple_omp_atomic_load within GIMPLE_OMP_ATOMIC_LOAD case of
702         switch statement.
704         * omp-low.c (expand_omp_atomic): Strengthen type of local "load"
705         from gimple to gimple_omp_atomic_load.
706         (lower_omp_1): Add a checked cast to gimple_omp_atomic_load within
707         GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
709 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
711         Use more concrete types for various gimple statements
713         * cgraphunit.c (thunk_adjust): Strengthen local "stmt" from gimple
714         to gimple_assign.
716         * gimple-ssa-isolate-paths.c
717         (insert_trap_and_remove_trailing_statements): Strengthen local
718         "new_stmt" from gimple to gimple_call.
720         * gimple-ssa-strength-reduction.c (replace_mult_candidate):
721         Strengthen local "copy_stmt" from gimple to gimple_assign.
722         (create_add_on_incoming_edge): Likewise, for "new_stmt".
723         (insert_initializers): Likewise, for "init_stmt".
724         (introduce_cast_before_cand): Likewise, for "cast_stmt".
725         (replace_one_candidate): Likewise, for "copy_stmt" and
726         "cast_stmt".
728         * gimplify.c (build_stack_save_restore): Require gimple_calls
729         rather than plain gimples.
730         (gimplify_bind_expr): Strengthen locals "stack_save" and
731         "stack_restore" from gimple to gimple_call.  Strengthen "gs"
732         to gimple_try.
733         (gimplify_switch_expr): Strengthen local "gimple_switch" from
734         gimple to gimple_switch, and "new_default" to gimple_label.
735         (gimplify_cond_expr): Strengthen local "gimple_cond" from gimple
736         to gimple_cond.
737         (gimplify_init_constructor): Strengthen local "init" from gimple
738         to gimple_assign.
739         (gimplify_cleanup_point_expr): Strengthen local "gtry" from gimple
740         to gimple_try.
741         (gimple_push_cleanup): Strengthen locals "ffalse" and "ftrue" from
742         gimple to gimple_assign.
744         * tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
745         (emit_post_landing_pad): Strengthen local to gimple_label.
747         * tree-outof-ssa.c (insert_backedge_copies): Strengthen local
748         "stmt" from gimple to gimple_assign.
750         * tree-parloops.c (take_address_of): Likewise.
752         * tree-predcom.c (replace_ref_with): Likewise, for "new_stmt".
753         (initialize_root_vars_lm): Likewise, for "init_stmt".
754         (reassociate_to_the_same_stmt): Likewise, for "new_stmt" and "tmp_stmt".
756         * tree-profile.c (gimple_gen_edge_profiler): Likewise, for "stmt1",
757         "stmt2", "stmt3".
758         (gimple_gen_ic_profiler): Likewise.
759         (gimple_gen_ic_func_profiler): Strengthen local "stmt1" from
760         gimple to gimple_call, and "stmt2" to gimple_assign.
762         * tree-scalar-evolution.c (scev_const_prop): Strengthen local
763         "ass" from gimple to gimple_assign.
765         * tree-sra.c (build_ref_for_offset): Likewise for "stmt".
766         (generate_subtree_copies): Likewise; also strengthen "ds" to
767         gimple_debug.
768         (init_subtree_with_zero): Likewise.
769         (sra_modify_expr): Likewise.
770         (load_assign_lhs_subreplacements): Likewise.
771         (sra_modify_assign): Strengthen "ds" to gimple_debug.
772         (sra_ipa_reset_debug_stmts): Likewise for "def_temp".
774         * tree-ssa-ccp.c (insert_clobber_before_stack_restore):
775         Strengthen local "clobber_stmt" from gimple to gimple_assign.
777         * tree-ssa-dce.c (remove_dead_stmt): Strengthen "note" to
778         gimple_debug.
780         * tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
781         local "new_stmt" from gimple to gimple_assign.
782         (optimize_stmt): Likewise.
784         * tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
785         4 declarations of "newop".
786         (simplify_rotate): Likewise for "g".
788         * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
789         (rewrite_bittest): Likewise for "stmt" and "stmt2".
790         (move_computations_dom_walker::before_dom_children): Likewise for
791         "new_stmt".
792         (execute_sm): Likewise for "load" and "store".
794         * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
795         Strengthen local "stmt" from gimple to gimple_call.
796         (unloop_loops): Likewise.
798         * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
799         local "ass" from gimple to gimple_assign.
800         (remove_unused_ivs): Strengthen "def_temp" to gimple_debug.
802         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local "stmt"
803         from gimple to gimple_assign.
805         * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
806         "prefetch" from gimple to gimple_call.
808         * tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
809         "new_stmt" from gimple to gimple_assign.
810         (powi_as_mults_1): Likewise for "mult_stmt".
811         (powi_as_mults): Likewise for "div_stmt".
812         (build_and_insert_binop): Likewise for "stmt".
813         (build_and_insert_cast): Likewise.
814         (pass_cse_sincos::execute): Likewise for "stmt" and various decls
815         of "new_stmt".
816         (convert_mult_to_fma): Likewise for "fma_stmt".
818         * tree-ssa-phiopt.c (conditional_replacement): Likewise for "new_stmt".
819         (abs_replacement): Likewise.
821         * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for "tmp".
823         * tree-ssa-pre.c (create_expression_by_pieces): Likewise for "newstmt".
824         (eliminate_insert): Likewise for "tem".
826         * tree-ssa-propagate.c (update_gimple_call): Strengthen locals
827         "new_stmt" and "stmt" from gimple to gimple_call.
828         (update_call_from_tree): Likewise for "new_stmt".
830         * tree-ssa-reassoc.c (build_and_add_sum): Likewise for "sum".
831         (update_ops): Likewise for "g".
832         (maybe_optimize_range_tests): Likewise.
833         (rewrite_expr_tree_parallel): Require a gimple_assign rather than
834         a plain gimple.
835         (reassociate_bb): Add a checked cast to gimple_assign.
837         * tree-ssa.c (insert_debug_temp_for_var_def): Strengthen local
838         "def_temp" from gimple to gimple_debug.
840         * tree-switch-conversion.c (emit_case_bit_tests): Strengthen local
841         "shift_stmt" from gimple to gimple_assign.
843         * tree-tailcall.c (adjust_return_value_with_ops): Likewise for
844         "stmt".
845         (update_accumulator_with_ops): Likewise.
847         * tree-vect-data-refs.c (bump_vector_ptr): Likewise for
848         "incr_stmt".
850         * tree-vect-stmts.c (vectorizable_condition): Likewise for
851         "new_stmt".
853         * tree-vrp.c (build_assert_expr_for): Likewise for "assertion".
854         (simplify_truth_ops_using_ranges): Likewise for "newop".
855         (simplify_float_conversion_using_ranges): Likewise for "conv".
857         * ubsan.c (instrument_mem_ref): Strengthen local "g" from gimple
858         to gimple_call.
860         * value-prof.c (gimple_divmod_fixed_value): Require a
861         gimple_assign rather than a plain gimple; strengthen types of locals.
862         (gimple_mod_pow2): Likewise.
863         (gimple_mod_subtract): Likewise.
864         (gimple_divmod_fixed_value_transform): Strengthen local
865         "stmt" from gimple to gimple_assign.
866         (gimple_mod_pow2_value_transform): Likewise.
867         (gimple_mod_subtract_transform): Likewise.
868         (gimple_ic): Strengthen types of locals.
870 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
872         Introduce gimple_try
874         * coretypes.h (gimple_try): New typedef.
875         (const_gimple_try): New typedef.
877         * gimple-low.c (gimple_try_catch_may_fallthru): Require a
878         gimple_try rather than a plain gimple.
879         (gimple_stmt_may_fallthru): Add checked cast to gimple_try.
881         * gimple-pretty-print.c (dump_gimple_try): Require a gimple_try
882         rather than a plain gimple.
883         (pp_gimple_stmt_1): Add checked cast to gimple_try within
884         GIMPLE_TRY case of switch statement.
886         * tree-eh.c (finally_tree_node::parent): Strengthen field from
887         gimple to gimple_try.
888         (record_in_finally_tree): Require a gimple_try rather than a plain
889         gimple.
890         (collect_finally_tree): Likewise.
891         (collect_finally_tree_1): Likewise.
892         (struct leh_tf_state::try_finally_expr): Strengthen field from
893         gimple to gimple_try.
894         (struct leh_tf_state::top_p): Likewise.
895         (lower_eh_must_not_throw): Require a gimple_try rather than a
896         plain gimple.
897         (frob_into_branch_around): Likewise.
898         (lower_try_finally_dup_block): Strengthen local from gimple to
899         gimple_try.
900         (honor_protect_cleanup_actions): Split out uses of "x" into new
901         locals "eh_mnt" and "try_stmt" with stronger types.
902         (lower_try_finally): Require a gimple_try rather than a plain
903         gimple.
904         (lower_catch): Likewise.
905         (lower_eh_filter): Likewise.
906         (lower_eh_must_not_throw): Likewise.
907         (lower_cleanup): Likewise.
908         (lower_eh_constructs_2): Add checked cast to gimple_try within
909         GIMPLE_TRY case of switch statement, introducing new local
910         "try_stmt", using it for type-safety.
912 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
914         Use subclasses of gimple in various places
916         * asan.c (insert_if_then_before_iter): Require a gimple cond
917         rathern than a plain gimple.
918         (asan_expand_check_ifn): Add a checked cast to gimple_cond.
920         * cfgloopmanip.c (create_empty_if_region_on_edge): Likewise.
922         * omp-low.c (simd_clone_adjust): Strengthen local from gimple
923         to gimple_phi.
925         * sese.c (set_ifsese_condition): Strengthen local from gimple to
926         gimple_cond.
928         * tree-call-cdce.c (gen_one_condition): Strengthen locals from
929         gimple to gimple_assign and gimple_cond.
931         * tree-ssa-phiopt.c (minmax_replacement): Likewise.
932         (cond_store_replacement): Strengthen locals from gimple to
933         gimple_phi and gimple_assign.
934         (cond_if_else_store_replacement_1): Likewise.
936         * tree-ssa-pre.c (do_regular_insertion): Strengthen local from
937         gimple to gimple_assign.
939         * tree-switch-conversion.c (hoist_edge_and_branch_if_true):
940         Strengthen local from gimple to gimple_cond.
941         (gen_def_assigns): Return a gimple_assign rather than a plain
942         gimple.
943         (gen_inbound_check): Strengthen locals from gimple to gimple_cond
944         and gimple_assign.
946         * tree-vect-loop-manip.c (slpeel_add_loop_guard): Strengthen local
947         from gimple to gimple_cond.
948         (set_prologue_iterations): Strengthen locals from gimple to
949         gimple_phi and gimple_cond.
951         * value-prof.c (gimple_ic): Strengthen local from gimple to
952         gimple_phi.
953         (gimple_stringop_fixed_value): Strengthen locals from gimple to
954         gimple_assign, gimple_cond, gimple_call, and gimple_phi.
956 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
958         Introduce gimple_eh_dispatch
960         * coretypes.h (gimple_eh_dispatch): New typedef.
961         (const_gimple_eh_dispatch): New typedef.
963         * gimple-pretty-print.c (dump_gimple_eh_dispatch): Require a
964         gimple_eh_dispatch rather than a plain gimple.
965         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_dispatch
966         within GIMPLE_EH_DISPATCH case of switch statement.
968         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
970         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
972         * gimple.c (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
973         rather than a plain gimple.
975         * gimple.h (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
976         rather than a plain gimple.
977         (gimple_eh_dispatch_region): Require a const_gimple_eh_dispatch
978         rather than a plain const_gimple.
979         (gimple_eh_dispatch_set_region): Require a gimple_eh_dispatch
980         rather than a plain gimple.
982         * tree-cfg.c (make_edges): Add a checked cast to gimple_eh_dispatch
983         within GIMPLE_EH_DISPATCH case of switch statement.
984         (gimple_verify_flow_info): Likewise.
985         (gimple_redirect_edge_and_branch): Likewise.
986         (move_stmt_r): Likewise, adding a local.
988         * tree-eh.c (emit_eh_dispatch): Convert local from gimple to
989         gimple_eh_dispatch.
990         (make_eh_dispatch_edges): Require a gimple_eh_dispatch rather than
991         a plain gimple.
992         (redirect_eh_dispatch_edge): Likewise.
993         (lower_eh_dispatch): Likewise.
994         (execute_lower_eh_dispatch): Add a checked cast to
995         gimple_eh_dispatch.
996         (mark_reachable_handlers): Likewise.
997         (verify_eh_dispatch_edge): Require a gimple_eh_dispatch rather
998         than a plain gimple.
1000         * tree-eh.h (make_eh_dispatch_edges): Likewise.
1001         (redirect_eh_dispatch_edge): Likewise.
1002         (verify_eh_dispatch_edge): Likewise.
1004         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1005         gimple_eh_dispatch within GIMPLE_EH_DISPATCH case of switch
1006         statement, adding a local.
1007         (copy_edges_for_bb): Add a checked cast to gimple_eh_dispatch.
1009 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1011         Introduce gimple_resx
1013         * coretypes.h (gimple_resx): New typedef.
1014         (const_gimple_resx): New typedef.
1016         * gimple.h (gimple_build_resx): Return a gimple_resx rather than a
1017         plain gimple.
1018         (gimple_resx_region): Require a const_gimple_resx rather than a
1019         plain const_gimple.
1020         (gimple_resx_set_region): Require a gimple_resx rather than a
1021         plain gimple.
1023         * gimple-pretty-print.c (dump_gimple_resx): Require a gimple_resx
1024         rather than a plain gimple.
1025         (pp_gimple_stmt_1): Add a checked cast to gimple_resx within
1026         GIMPLE_RESX case of switch statement.
1028         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1030         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1032         * gimple.c (gimple_build_resx): Return a gimple_resx rather than
1033         a plain gimple.
1035         * tree-cfg.c (move_stmt_r): Add a checked cast to gimple_resx
1036         within GIMPLE_RESX case of switch statement, adding a new local.
1038         * tree-eh.c (emit_resx): Convert local "x" from gimple to
1039         gimple_resx.
1040         (lower_resx): Require a gimple_resx rather than a plain gimple.
1041         (pass_lower_resx::execute): Add a checked cast to gimple_resx.
1042         (mark_reachable_handlers): Likewise.
1044         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1045         gimple_resx within GIMPLE_RESX case of switch statement, adding
1046         a new local.
1048 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1050         Introduce gimple_eh_else
1052         * coretypes.h (gimple_eh_else): New typedef.
1053         (const_gimple_eh_else): New typedef.
1055         * gimple.h (gimple_build_eh_else): Return a gimple_eh_else rather
1056         than a plain gimple.
1057         (gimple_eh_else_n_body_ptr): Require a gimple_eh_else rather than
1058         a plain gimple.
1059         (gimple_eh_else_n_body): Likewise.
1060         (gimple_eh_else_e_body_ptr): Likewise.
1061         (gimple_eh_else_e_body): Likewise.
1062         (gimple_eh_else_set_n_body): Likewise.
1063         (gimple_eh_else_set_e_body): Likewise.
1065         * gimple-low.c (lower_stmt): Add checked cast to gimple_eh_else
1066         within GIMPLE_EH_ELSE case of switch statement, introducing a new
1067         local.
1068         (gimple_stmt_may_fallthru): Likewise.
1070         * gimple-pretty-print.c (dump_gimple_eh_else): Require a
1071         gimple_eh_else rather than a plain gimple.
1072         (pp_gimple_stmt_1): Add checked cast to gimple_eh_else within
1073         GIMPLE_EH_ELSE case of switch statement
1075         * gimple-walk.c (walk_gimple_stmt): Add checked cast to
1076         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1077         introducing a new local.
1079         * gimple.c (gimple_build_eh_else): Return a gimple_eh_else
1080         rather than a plain gimple.
1081         (gimple_copy): Add checked casts to gimple_eh_else within
1082         GIMPLE_EH_ELSE case of switch statement, introducing new locals.
1084         * tree-cfg.c (verify_gimple_in_seq_2): Add checked cast to
1085         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1086         introducing a new local.
1088         * tree-eh.c (collect_finally_tree): Likewise.
1089         (replace_goto_queue_1): Likewise.
1090         (get_eh_else): Return a gimple_eh_else rather than a plain gimple.
1091         (honor_protect_cleanup_actions): Convert local "eh_else" from
1092         gimple to gimple_eh_else.
1093         (lower_try_finally_nofallthru): Likewise.
1094         (lower_try_finally_onedest): Introduce locals "eh_else" and
1095         "label_stmt", using them in favor of "x" for the gimple_eh_else
1096         and the gimple_label.
1097         (lower_try_finally_copy): Convert local "eh_else" from gimple to
1098         gimple_eh_else.
1099         (lower_try_finally_switch): Likewise.
1100         (decide_copy_try_finally): Likewise.
1101         (refactor_eh_r): Add checked cast to gimple_eh_else within
1102         GIMPLE_EH_ELSE case of switch statement, introducing a new local.
1104 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1106         Introduce gimple_eh_must_not_throw
1108         * coretypes.h (gimple_eh_must_not_throw): New typedef.
1109         (const_gimple_eh_must_not_throw): New typedef.
1111         * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
1112         a gimple_eh_must_not_throw rather than a plain gimple.
1113         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
1114         within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
1116         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1118         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1120         * gimple.c (gimple_build_eh_must_not_throw): Return a
1121         gimple_eh_must_not_throw rather than a plain gimple.
1123         * gimple.h (gimple_build_eh_must_not_throw): Return a
1124         gimple_eh_must_not_throw rather than a plain gimple.
1125         (gimple_eh_must_not_throw_fndecl): Require a
1126         gimple_eh_must_not_throw rather than a plain gimple.
1127         (gimple_eh_must_not_throw_set_fndecl): Likewise.
1129         * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
1131 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1133         Introduce gimple_eh_filter
1135         * coretypes.h (gimple_eh_filter): New typedef.
1136         (const_gimple_eh_filter): New typedef.
1138         * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
1139         rather than a plain gimple.
1141         * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
1142         gimple_eh_filter rather than a plain gimple.
1143         (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
1144         GIMPLE_EH_FILTER case of switch statement.
1146         * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
1147         rather than a plain gimple.
1149 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1151         Introduce gimple_catch
1153         * coretypes.h (gimple_catch): New typedef.
1154         (const_gimple_catch): New typedef.
1156         * gimple-low.c (lower_try_catch): Add checked cast to gimple_catch.
1157         (gimple_try_catch_may_fallthru): Likewise.
1159         * gimple-pretty-print.c (dump_gimple_catch): Require a gimple_catch
1160         rather than a plain gimple.
1161         (pp_gimple_stmt_1): Add checked cast to gimple_catch within
1162         GIMPLE_CATCH case of switch statement.
1164         * gimple-walk.c (walk_gimple_op): Likewise.
1165         (walk_gimple_stmt): Likewise.
1167         * gimple.c (gimple_build_catch): Return a gimple_catch rather than
1168         a plain gimple.
1169         (gimple_copy): Add checked casts to gimple_catch within
1170         GIMPLE_CATCH case of switch statement, introducing new locals.
1172         * gimple.h (gimple_build_catch): Return a gimple_catch rather than
1173         a plain gimple.
1174         (gimple_catch_types_ptr): Require a gimple_catch rather than a
1175         plain gimple.
1176         (gimple_catch_handler_ptr): Likewise.
1177         (gimple_catch_handler): Likewise.
1178         (gimple_catch_set_types): Likewise.
1179         (gimple_catch_set_handler): Likewise.
1181         * omp-low.c (lower_omp_1): Add checked cast to gimple_catch within
1182         GIMPLE_CATCH case of switch statement.
1184         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
1185         (do_warn_unused_result): Likewise.
1187         * tree-eh.c (collect_finally_tree): Likewise.
1188         (replace_goto_queue_1): Likewise.
1189         (lower_catch): Convert local from gimple to gimple_catch.
1190         (refactor_eh_r): Add checked cast to gimple_catch within
1191         GIMPLE_CATCH case of switch statement.
1193         * tree-inline.c (remap_gimple_stmt): Likewise.
1194         (estimate_num_insns): Add checked cast to gimple_catch within
1195         GIMPLE_CATCH case of switch statement, introducing new local.
1197 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1199         Introduce gimple_transaction
1201         * coretypes.h (gimple_transaction): New typedef.
1202         (const_gimple_transaction): New typedef.
1204         * gimple.h (gimple_build_transaction): Return a gimple_transaction
1205         rather than a plain gimple.
1206         (gimple_transaction_body_ptr): Require a gimple_transaction rather
1207         than a plain gimple.
1208         (gimple_transaction_body): Likewise.
1209         (gimple_transaction_label_ptr): Likewise.
1210         (gimple_transaction_set_body): Likewise.
1211         (gimple_transaction_set_label): Likewise.
1212         (gimple_transaction_set_subcode): Likewise.
1213         (gimple_transaction_label): Require a const_gimple_transaction
1214         rather than a plain const_gimple.
1215         (gimple_transaction_subcode): Likewise.
1217         * gimple-low.c (lower_stmt): Add checked cast to
1218         gimple_transaction within GIMPLE_TRANSACTION case of switch
1219         statement.
1221         * gimple-pretty-print.c (dump_gimple_transaction): Require a
1222         gimple_transaction rather than a plain gimple.
1223         (pp_gimple_stmt_1): Add checked cast to gimple_transaction within
1224         GIMPLE_TRANSACTION case of switch statement.
1225         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1226         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1227         * gimple-walk.c (walk_gimple_op): Likewise.
1228         (walk_gimple_stmt): Likewise.
1230         * gimple.c (gimple_build_transaction): Return a gimple_transaction
1231         rather than a plain gimple.
1232         (gimple_copy): Add checked casts to gimple_transaction within
1233         GIMPLE_TRANSACTION case of switch statement.
1235         * gimplify.c (gimplify_transaction): Split local "g" into
1236         "body_stmt" and "trans_stmt", strengthening the type of the latter
1237         from gimple to gimple_transaction.
1239         * omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
1240         within GIMPLE_TRANSACTION case of switch statement.
1242         * trans-mem.c (diagnose_tm_1): Add checked cast within
1243         GIMPLE_TRANSACTION case of switch statement, introducing a new
1244         local "trans_stmt".  Use it in place of "stmt".
1245         (examine_call_tm): Convert local from gimple to gimple_transaction.
1246         (tm_region::get_transaction_stmt): New method.
1247         (tm_region::transaction_stmt): Add clarification of type to the
1248         comment.
1249         (tm_region_init_0): Require a gimple_transaction rather than a
1250         plain gimple.
1251         (tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
1252         dyn_cast<gimple_transaction> and new local.
1253         (transaction_subcode_ior): Add a new local, using the new
1254         get_transaction_stmt method to perform a checked cast.
1255         (propagate_tm_flags_out): Likewise.
1256         (expand_transaction): Add a checked cast using the new
1257         get_transaction_stmt method.
1258         (generate_tm_state): Likewise.
1259         (execute_tm_mark): Likewise.
1260         (ipa_tm_diagnose_transaction): Likewise.
1262         * tree-cfg.c (verify_gimple_transaction): Require a
1263         gimple_transaction rather than a plain gimple.
1264         (make_edges): Add checked cast within GIMPLE_TRANSACTION case of
1265         switch statement
1266         (cleanup_dead_labels): Likewise.
1267         (verify_gimple_stmt): Likewise.
1268         (verify_gimple_in_seq_2): Likewise.
1269         (verify_gimple_in_seq_2): Likewise.
1270         (gimple_redirect_edge_and_branch): Add checked cast.
1272         * tree-inline.c (remap_gimple_stmt): Add checked cast within
1273         GIMPLE_TRANSACTION case of switch statement, introducing a new
1274         local "old_trans_stmt".  Use it in place of "stmt".  Add new
1275         local "new_trans_stmt", using it to initialize "copy", and for
1276         type-safe operations as a transaction.
1277         (estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
1278         case of switch statement.
1280 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1282         Introduce gimple_asm
1284         * coretypes.h (gimple_asm): New typedef.
1285         (const_gimple_asm): New typedef.
1287         * gimple.h (gimple_build_asm_vec): Return a gimple_asm rather than
1288         just a gimple.
1289         (gimple_asm_clobbers_memory_p): Require a const_gimple_asm rather
1290         than just a const_gimple.
1291         (gimple_asm_ninputs): Likewise.
1292         (gimple_asm_noutputs): Likewise.
1293         (gimple_asm_nclobbers): Likewise.
1294         (gimple_asm_nlabels): Likewise.
1295         (gimple_asm_input_op): Likewise.
1296         (gimple_asm_input_op_ptr): Likewise.
1297         (gimple_asm_output_op): Likewise.
1298         (gimple_asm_output_op_ptr): Likewise.
1299         (gimple_asm_clobber_op): Likewise.
1300         (gimple_asm_label_op): Likewise.
1301         (gimple_asm_string): Likewise.
1302         (gimple_asm_volatile_p): Likewise.
1303         (gimple_asm_input_p): Likewise.
1304         (gimple_asm_set_input_op): Require a gimple_asm rather than a plain
1305         gimple.
1306         (gimple_asm_set_output_op): Likewise.
1307         (gimple_asm_set_clobber_op): Likewise.
1308         (gimple_asm_set_label_op): Likewise.
1309         (gimple_asm_set_volatile): Likewise.
1310         (gimple_asm_set_input): Likewise.
1312         * cfgexpand.c (expand_asm_stmt): Require a gimple_asm rather than
1313         a plain gimple.
1314         (expand_gimple_stmt_1): Add checked cast to gimple_asm within
1315         GIMPLE_ASM case of switch statement.
1317         * gimple-fold.c (fold_stmt_1): Add new local from checked cast to
1318         gimple_asm within case GIMPLE_ASM.
1320         * gimple-pretty-print.c (dump_gimple_asm): Require a gimple_asm
1321         rather than a plain gimple.
1322         (pp_gimple_stmt_1): Add checked cast to gimple_asm within
1323         GIMPLE_ASM case of switch statement.
1325         * gimple-streamer-in.c (input_gimple_stmt): Rework existing
1326         checked cast to gimple_asm; add a new one.
1328         * gimple-streamer-out.c (output_gimple_stmt): Add new local from
1329         checked cast to gimple_asm within case GIMPLE_ASM.
1331         * gimple-walk.c (walk_gimple_asm): Require a gimple_asm rather
1332         than a plain gimple.
1333         (walk_gimple_op): Add checked cast to gimple_asm within GIMPLE_ASM
1334         case of switch statement.
1335         (walk_stmt_load_store_addr_ops): Use dyn_cast<gimple_asm> in place
1336         of a code check against GIMPLE_ASM to introduce a new gimple_asm
1337         local.
1339         * gimple.c (gimple_build_asm_1): Return a gimple_asm rather than
1340         a plain gimple.
1341         (gimple_build_asm_vec): Likewise.
1342         (gimple_has_side_effects): Add a checked cast to gimple_asm.
1343         (gimple_could_trap_p_1): Likewise.
1344         (gimple_call_builtin_p): Require a const_gimple_asm rather then
1345         a const_gimple.
1347         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
1348         and a new local of type gimple_asm within GIMPLE_ASM case.
1350         * gimplify.c (gimplify_asm_expr): Convert a local from gimple to
1351         gimple_asm.
1353         * ipa-pure-const.c (check_stmt): Add checked casts within
1354         GIMPLE_ASM case.
1356         * ssa-iterators.h (op_iter_init): Likewise.
1358         * tree-cfg.c (make_goto_expr_edges): Convert a local from gimple
1359         to gimple_asm.
1360         (cleanup_dead_labels): Add a checked cast and a new local of type
1361         gimple_asm within GIMPLE_ASM case.
1362         (gimple_redirect_edge_and_branch): Likewise.
1363         (is_ctrl_altering_stmt): Add a checked cast.
1364         (need_fake_edge_p): Replace a code check against GIMPLE_ASM with a
1365         dyn_cast<gimple_asm>.
1367         * tree-complex.c (expand_complex_comparison): Convert a local from
1368         gimple to gimple_asm.
1370         * tree-data-ref.c (get_references_in_stmt): Add a checked cast to
1371         gimple_asm.
1373         * tree-eh.c (stmt_could_throw_p): Likewise.
1375         * tree-inline.c (estimate_num_insns): Likewise.
1377         * tree-sra.c (scan_function): Add a checked cast and a new local
1378         of type gimple_asm within GIMPLE_ASM case.
1379         (sra_modify_function_body): Likewise.
1380         (ipa_sra_modify_function_body): Likewise.
1382         * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
1384         * tree-ssa-dce.c (propagate_necessity): Replace a code check
1385         against GIMPLE_ASM with a dyn_cast<gimple_asm>.
1387         * tree-ssa-operands.c (maybe_add_call_vops): Require a gimple_asm
1388         rather than a plain gimple.
1389         (parse_ssa_operands): Add a checked cast to gimple_asm.
1391         * tree-ssa-structalias.c (find_func_aliases): Replace a check for
1392         GIMPLE_ASM with a dyn_cast<gimple_asm>, introducing  a new local
1393         "asm_stmt", using it in place of "t" for typesafety.
1395         * tree-ssa-threadedge.c
1396         (record_temporary_equivalences_from_stmts_at_dest): Add a checked
1397         cast to gimple_asm.
1399         * tree-ssa.c (execute_update_addresses_taken): Add checked casts
1400         and new locals of type gimple_asm within clauses guarded by code
1401         check.
1403 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1405         Introduce gimple_goto
1407         * coretypes.h (gimple_goto): New typedef.
1408         (const_gimple_goto): New typedef.
1410         * gimple.h (gimple_statement_goto): New subclass of
1411         gimple_statement_with_ops, adding the invariant that
1412         stmt->code == GIMPLE_GOTO.
1413         (is_a_helper <gimple_statement_goto>::test): New.
1414         (gimple_build_goto): Return a gimple_goto rather than a
1415         plain gimple.
1417         * gimple-pretty-print.c (dump_gimple_goto): Require a gimple_goto
1418         rather than a plain gimple.
1419         (pp_gimple_stmt_1): Add a checked cast to gimple_goto within
1420         GIMPLE_GOTO case of switch statement.
1422         * gimple.c (gimple_build_goto): Return a gimple_goto rather than a
1423         plain gimple.
1425         * tree-cfg.c (verify_gimple_goto): Require a gimple_goto rather
1426         than a plain gimple.
1427         (verify_gimple_stmt): Add a checked cast to gimple_goto within
1428         GIMPLE_GOTO case of switch statement.
1430 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1432         Introduce gimple_return
1434         * coretypes.h (gimple_return): New typedef.
1435         (const_gimple_return): New typedef.
1437         * gimple.h (gimple_statement_return): New subclass of
1438         gimple_statement_with_memory_ops, adding the invariant that
1439         stmt->code == GIMPLE_RETURN.
1440         (is_a_helper <gimple_statement_return>::test): New.
1441         (gimple_build_return): Return a gimple_return rather
1442         than a plain gimple.
1444         * gimple.c (gimple_build_return): Return a gimple_return rather
1445         than a plain gimple.
1447         * cgraphunit.c (expand_thunk): Convert local from a gimple to
1448         a gimple_return.
1450         * gimple-low.c (struct return_statements_t): Convert field "stmt"
1451         from a gimple to a gimple_return.
1452         (lower_gimple_return): Convert local from a gimple to a
1453         gimple_return.
1455         * gimple-pretty-print.c (dump_gimple_return): Require a
1456         gimple_return rather than a plain gimple.
1457         (pp_gimple_stmt_1): Add a checked cast to gimple_return within
1458         case GIMPLE_RETURN of switch statement.
1460         * gimplify.c (gimplify_return_expr): Convert locals from
1461         gimple to gimple_return.
1463         * ipa-split.c (split_function): Likewise.
1465         * tree-cfg.c (verify_gimple_assign): Require a gimple_return
1466         rather than a plain gimple.
1467         (verify_gimple_stmt): Add checked cast to gimple_return within
1468         case GIMPLE_RETURN of switch statement.
1470         * tree-tailcall.c (adjust_return_value): Convert local from
1471         gimple to gimple_return.
1473 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1475         Introduce gimple_call
1477         * coretypes.h (gimple_call): New typedef.
1478         (const_gimple_call): New typedef.
1480         * asan.c (get_mem_refs_of_builtin_call): Require a
1481         const_gimple_call rather than a const gimple.
1482         (has_stmt_been_instrumented_p): Add a checked cast to
1483         gimple_call.
1484         (instrument_strlen_call): Likewise.
1485         (instrument_builtin_call): Likewise.
1486         * builtins.c (validate_gimple_arglist): Require a
1487         const_gimple_call rather than a const gimple.
1488         (fold_call_stmt): Require a gimple_call rather than a gimple.
1489         * builtins.h (validate_gimple_arglist): Require a
1490         const_gimple_call rather than a const gimple.
1491         (fold_call_stmt): Require a gimple_call rather than a gimple.
1492         * cfgexpand.c (expand_call_stmt): Likewise.
1493         (expand_gimple_stmt_1): Add a checked cast to gimple_call within
1494         GIMPLE_CALL case.
1495         * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Strengthen
1496         local "new_stmt" from gimple to gimple_call, adding a checked
1497         cast.
1498         * cgraphunit.c (cgraph_node::expand_thunk): Likewise for local
1499         "call".
1500         * gimple-fold.c (gimple_fold_builtin_snprintf_chk): Likewise for
1501         local "stmt".
1502         (gimple_fold_builtin_snprintf): Likewise.
1503         (gimple_fold_builtin): Likewise.
1504         (gimple_fold_call): Likewise.
1505         (gimple_fold_stmt_to_constant_1): Introduce local "call_stmt" via
1506         checked cast of "stmt" to gimple_call, using it in various places
1507         for typesafety.
1508         * gimple-pretty-print.c (dump_gimple_call_args): Strengthen param
1509         2 from gimple to gimple_call.
1510         (dump_gimple_call): Likewise.
1511         (pp_gimple_stmt_1): Add a checked cast to gimple_call within
1512         GIMPLE_CALL case.
1513         * gimple-streamer-in.c (input_gimple_stmt): Replace is_gimple_call
1514         with a dyn_cast<gimple_call>, introducing local "call_stmt", and
1515         using it in place of "stmt" for typesafety.  Add a checked cast
1516         in statement guarded by check for GIMPLE_CALL.
1517         * gimple-walk.c (walk_gimple_op): Add a checked cast to
1518         gimple_call.
1519         * gimple.c (gimple_call_reset_alias_info): Strengthen param from
1520         gimple to gimple_call.
1521         (gimple_build_call_1): Strengthen return type and local from
1522         gimple to gimple_call.
1523         (gimple_build_call_vec): Likewise.
1524         (gimple_build_call): Likewise.
1525         (gimple_build_call_valist): Likewise.
1526         (gimple_build_call_internal_1): Likewise.
1527         (gimple_build_call_internal): Likewise.
1528         (gimple_build_call_internal_vec): Likewise.
1529         (gimple_build_call_from_tree): Likewise.
1530         (gimple_call_return_flags): Strengthen param from
1531         const_gimple to const_gimple_call.
1532         (gimple_call_copy_skip_args): Strengthen return type and local from
1533         gimple to gimple_call.
1534         * gimple.h (gimple_call_reset_alias_info): Strengthen param from
1535         gimple to gimple_call.
1536         (gimple_build_call_vec): Strengthen return type from gimple to
1537         gimple_call.
1538         (gimple_build_call): Likewise.
1539         (gimple_build_call_valist): Likewise.
1540         (gimple_build_call_internal): Likewise.
1541         (gimple_build_call_internal_vec): Likewise.
1542         (gimple_build_call_from_tree): Likewise.
1543         (gimple_call_return_flags): Strengthen param from const_gimple to
1544         const_gimple_call.
1545         (gimple_call_copy_skip_args): Strengthen return type from gimple
1546         to gimple_call.
1547         (gimple_call_set_internal_fn): Strengthen param "call_stmt" from
1548         gimple to gimple_call.
1549         (gimple_call_return_type): Strengthen param from const_gimple to
1550         const_gimple_call.
1551         (gimple_call_chain_ptr): Likewise.
1552         (gimple_call_set_chain): Strengthen param from gimple to
1553         gimple_call.
1554         (gimple_call_set_return_slot_opt): Likewise.
1555         (gimple_call_set_from_thunk): Likewise.
1556         (gimple_call_from_thunk_p): Likewise.
1557         (gimple_call_set_va_arg_pack): Likewise.
1558         (gimple_call_va_arg_pack_p): Likewise.
1559         (gimple_call_set_alloca_for_var): Likewise.
1560         (gimple_call_alloca_for_var_p): Likewise.
1561         (gimple_expr_type): Introduce local "call_stmt" via a checked cast
1562         and use it for typesafety.
1563         * gimplify.c (gimplify_call_expr): Strengthen local "call" from
1564         gimple to gimple_call.
1565         (gimplify_modify_expr_to_memcpy): Likewise for local "gs".
1566         (gimplify_modify_expr_to_memset): Likewise.
1567         (gimplify_modify_expr): Add a checked cast to gimple_call.
1568         (gimplify_expr): Strengthen local "call" from gimple to
1569         gimple_call.
1570         (gimplify_function_tree): Likewise.
1571         * internal-fn.c (expand_LOAD_LANES): Strengthen param from gimple
1572         to gimple_call.
1573         (expand_STORE_LANES): Likewise.
1574         (expand_ANNOTATE): Likewise.
1575         (expand_GOMP_SIMD_LANE): Likewise.
1576         (expand_GOMP_SIMD_VF): Likewise.
1577         (expand_GOMP_SIMD_LAST_LANE): Likewise.
1578         (expand_UBSAN_NULL): Likewise.
1579         (expand_UBSAN_BOUNDS): Likewise.
1580         (expand_UBSAN_OBJECT_SIZE): Likewise.
1581         (expand_ASAN_CHECK): Likewise.
1582         (ubsan_expand_si_overflow_addsub_check): Likewise.
1583         (ubsan_expand_si_overflow_neg_check): Likewise.
1584         (ubsan_expand_si_overflow_mul_check): Likewise.
1585         (expand_UBSAN_CHECK_ADD): Likewise.
1586         (expand_UBSAN_CHECK_SUB): Likewise.
1587         (expand_UBSAN_CHECK_MUL): Likewise.
1588         (expand_LOOP_VECTORIZED): Likewise.
1589         (expand_MASK_LOAD): Likewise.
1590         (expand_MASK_STORE): Likewise.
1591         (expand_ABNORMAL_DISPATCHER): Likewise.
1592         (expand_BUILTIN_EXPECT): Likewise.
1593         (internal_fn_expanders): Likewise for entries in this table.
1594         (expand_internal_call): Likewise.
1595         * internal-fn.def: Update comment to reflect strengthening of
1596         param of expanders.
1597         * internal-fn.h (expand_internal_call): Strengthen param from
1598         gimple to gimple_call.
1599         * ipa-prop.c (ipa_modify_call_arguments): Likewise for local
1600         "new_stmt".
1601         * ipa-pure-const.c (check_call): Likewise for param "call".
1602         (check_stmt): Add a checked cast to gimple_call within GIMPLE_CALL
1603         case.
1604         * ipa-split.c (split_function): Strengthen local "call" from
1605         gimple to gimple_call.
1606         * omp-low.c (build_omp_barrier): Likewise for local "g".
1607         (lower_rec_input_clauses): Likewise for local "stmt".
1608         * trans-mem.c (build_tm_load): Likewise for return type and local
1609         "gcall".
1610         (build_tm_store): Likewise.
1611         (expand_transaction): Likewise for local "call".
1612         * tree-call-cdce.c (check_pow): Likewise for param.
1613         (check_builtin_call): Likewise.
1614         (is_call_dce_candidate): Likewise.
1615         (gen_conditions_for_pow): Likewise.
1616         (gen_shrink_wrap_conditions): Likewise.
1617         (shrink_wrap_one_built_in_call): Likewise.
1618         (shrink_wrap_conditional_dead_built_in_calls): Strengthen param
1619         from vec<gimple> to vec<gimple_call>, and local "bi_call" from
1620         gimple to gimple_call.
1621         (pass_call_cdce::execute): Strengthen local
1622         "cond_dead_built_in_calls" from auto_vec<gimple> to
1623         auto_vec<gimple_call> and local "stmt" from gimple to gimple_call,
1624         * tree-cfg.c (notice_special_calls): Strengthen param from gimple
1625         to gimple_call.
1626         * tree-cfg.h (notice_special_calls): Likewise.
1627         * tree-complex.c (expand_complex_libcall): Likewise for local
1628         "stmt".
1629         * tree-inline.c (remap_gimple_stmt): Add checked cast to
1630         gimple_call.
1631         (copy_bb): Likewise.  Strengthen local "new_call" from gimple to
1632         gimple_call.
1633         (inline_forbidden_p_stmt): Add checked cast to gimple_call.
1634         * tree-nested.c (init_tmp_var_with_call): Strengthen param "call"
1635         from gimple to gimple_call.
1636         (convert_nl_goto_reference): Likewise for local "call".
1637         (convert_tramp_reference_op): Likewise.
1638         (convert_gimple_call): Add checked cast to gimple_call.
1639         * tree-nrv.c (dest_safe_for_nrv_p): Strengthen param "call" from
1640         gimple to gimple_call.
1641         (pass_return_slot::execute): Likewise for local "stmt", using a
1642         dyn_cast<gimple_call> rather than an is_gimple_call call.
1643         * tree-object-size.c (alloc_object_size): Strengthen param "call"
1644         from const_gimple to const_gimple_call.
1645         (pass_through_call): Likewise.
1646         (call_object_size): Strengthen param "call" from gimple to
1647         gimple_call.
1648         (collect_object_sizes_for): Introduce local "call_stmt" via a
1649         checked cast, using it for typesafety.
1650         (check_for_plus_in_loops_1): Likewise.
1651         (pass_object_sizes::execute): Add a checked cast to gimple_call.
1652         * tree-profile.c (gimple_gen_interval_profiler): Strengthen local
1653         "call" from gimple to gimple_call.
1654         (gimple_gen_pow2_profiler): Likewise.
1655         (gimple_gen_one_value_profiler): Likewise.
1656         (gimple_gen_time_profiler): Likewise.
1657         (gimple_gen_average_profiler): Likewise.
1658         (gimple_gen_ior_profiler): Likewise.
1659         * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise for
1660         param "call".
1661         (ref_maybe_used_by_call_p): Likewise.
1662         (ref_maybe_used_by_stmt_p): Add a checked cast to gimple_call.
1663         (call_may_clobber_ref_p_1): Strengthen param "call" from gimple to
1664         gimple_call.
1665         (call_may_clobber_ref_p): Likewise.
1666         (stmt_may_clobber_ref_p_1): Add a checked cast to gimple_call.
1667         * tree-ssa-alias.h (call_may_clobber_ref_p): Strengthen param 1
1668         from gimple to gimple_call.
1669         (call_may_clobber_ref_p_1): Likewise.
1670         * tree-ssa-dce.c (eliminate_unnecessary_stmts): Add a checked cast
1671         to gimple_call.
1672         * tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Strengthen
1673         local "call" from gimple to gimple_call.
1674         * tree-ssa-math-opts.c (build_and_insert_call): Likewise for local
1675         "call_stmt".
1676         * tree-ssa-operands.c (maybe_add_call_vops): Likewise for param
1677         "stmt".
1678         (parse_ssa_operands): Add a checked cast to gimple_call within
1679         GIMPLE_CALL case.
1680         * tree-ssa-pre.c (compute_avail): Add a checked cast to
1681         gimple_call.
1682         * tree-ssa-sccvn.c (copy_reference_ops_from_call): Strengthen
1683         param "call" from gimple to gimple_call.
1684         (valueize_shared_reference_ops_from_call): Likewise.
1685         (vn_reference_lookup_3): Add a checked cast to gimple_call.
1686         (vn_reference_lookup_call): Strengthen param "call" from gimple to
1687         gimple_call.
1688         (visit_reference_op_call): Likewise for param "stmt".
1689         (visit_use): Replace is_gimple_call with a dyn_cast, introducing
1690         local "call_stmt", using it in place of "stmt" for type-safety.
1691         * tree-ssa-sccvn.h (vn_reference_lookup_call): Strengthen param 1
1692         from gimple to gimple_call.
1693         * tree-ssa-structalias.c (get_call_vi): Likewise.
1694         (lookup_call_use_vi): Likewise.
1695         (lookup_call_clobber_vi): Likewise.
1696         (get_call_use_vi): Likewise.
1697         (get_call_clobber_vi): Likewise.
1698         (handle_rhs_call): Likewise.
1699         (handle_lhs_call): Likewise.
1700         (handle_const_call): Likewise.
1701         (handle_pure_call): Likewise.
1702         (get_fi_for_callee): Likewise.
1703         (find_func_aliases_for_builtin_call): Likewise for param 2.
1704         (find_func_aliases_for_call): Likewise.
1705         (find_func_aliases): Add a checked cast to gimple_call.
1706         (find_func_clobbers): Replace is_gimple_call with a dyn_cast,
1707         introducing local "call_stmt", using it in place of "stmt" for
1708         type-safety.
1709         (compute_points_to_sets): Strengthen local "stmt" from gimple to
1710         gimple_call, replacing is_gimple_call with a
1711         dyn_cast <gimple_call>.
1712         (ipa_pta_execute): Likewise.
1713         * tree-ssa-threadedge.c
1714         (record_temporary_equivalences_from_stmts_at_dest): Add checked
1715         cast to gimple_call.
1716         * tree-tailcall.c (find_tail_calls): Strengthen local "call" from
1717         gimple to gimple_call, adding a checked cast.
1718         * tree-vect-data-refs.c (vect_setup_realignment): Eliminate
1719         top-level local "new_stmt" in favor of more tightly-scoped locals
1720         "new_stmt" of type gimple_assign and gimple_call.
1721         * tree-vect-patterns.c (vect_recog_pow_pattern): Strenghthen local
1722         "stmt" from gimple to gimple_call.
1723         * tree-vect-stmts.c (vectorizable_function): Likewise for param
1724         "call".
1725         (vectorizable_call): Rename param 1 from "stmt" to "gs",
1726         reintroducing "stmt" as a gimple_call once we've established that
1727         we're working with a GIMPLE_CALL.
1728         * tree-vectorizer.h (vectorizable_function): Strengthen param 1
1729         from gimple to gimple_call.
1730         * value-prof.c (check_ic_target): Likewise.
1731         (gimple_ic_transform): Likewise for local "stmt", replacing a
1732         check for GIMPLE_CALL with a dyn_cast.
1733         (interesting_stringop_to_profile_p): Strengthen param "call"
1734         from gimple to gimple_call.
1735         (gimple_stringop_fixed_value): Likewise for param "vcall_stmt".
1736         (gimple_stringops_transform): Likewise for local "stmt",
1737         replacing a check for GIMPLE_CALL with a dyn_cast.
1738         (gimple_stringops_values_to_profile): Rename param 1 from "stmt"
1739         to "gs", reintroducing "stmt" as a gimple_call once we've
1740         established that we're working with a GIMPLE_CALL.
1741         * vtable-verify.c (verify_bb_vtables): Strengthen local
1742         "call_stmt" from gimple to gimple_call.
1744 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1746         Concretize get_loop_exit_condition et al to working on gimple_cond
1748         * tree-scalar-evolution.h (get_loop_exit_condition): Return a
1749         gimple_cond.
1750         * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
1751         concretizing local "res" from gimple to gimple_cond.
1752         * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
1753         locals from gimple to gimple_cond.
1754         (slpeel_can_duplicate_loop_p): Likewise.
1755         * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
1756         (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
1758 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1760         Update various expressions within tree-scalar-evolution.c to be gimple_phi
1762         * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
1763         rather than a gimple.
1764         (follow_ssa_edge_binary): Likewise.
1765         (follow_ssa_edge_expr): Likewise.
1766         (follow_ssa_edge_in_rhs): Likewise.
1767         (backedge_phi_arg_p): Likewise.
1768         (follow_ssa_edge_in_condition_phi_branch): Likewise.
1769         (follow_ssa_edge_in_condition_phi): Likewise.
1770         (follow_ssa_edge_inner_loop_phi): Likewise.
1771         (analyze_evolution_in_loop): Likewise.
1772         (analyze_initial_condition): Likewise.
1773         (interpret_loop_phi): Likewise.
1774         (interpret_condition_phi): Likewise.
1775         (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
1777         (analyze_scalar_evolution_1): Add checked casts to gimple_phi
1778         within "case GIMPLE_PHI".
1780 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1782         tree-ssa-loop-ivopts.c: use gimple_phi in a few places
1784         * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
1785         (find_bivs): Convert local "phi" into a gimple_phi.
1786         (mark_bivs): Likewise.
1788 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1790         tree-ssa-loop-manip.c: use gimple_phi in three places
1792         * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
1793         gimple_phi.
1794         (split_loop_exit_edge): Likewise for "phi" and "new_phi".
1796 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1798         tree-ssa-loop-niter.c: use gimple_phi in a few places
1800         * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
1801         rather than a gimple.
1802         (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
1803         (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
1805 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1807         tree-ssa-phiprop.c: use gimple_phi
1809         * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
1810         parameter "phi" and local "new_phi" from gimple to gimple_phi.
1812 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1814         tree-predcom.c: use gimple_phi in various places
1816         * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
1817         than just a gimple.
1818         (insert_looparound_copy): Require a gimple_phi rather than just a
1819         gimple.
1820         (add_looparound_copies): Convert local "phi" to be a gimple_phi.
1821         (initialize_root_vars): Likewise.
1822         (initialize_root_vars_lm): Likewise.
1824 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1826         tree-parloops.c: use gimple_phi in various places
1828         * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
1829         from gimple to gimple_phi.
1830         (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
1831         (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
1832         (gather_scalar_reductions): Convert to a gimple_phi_iterator and
1833         gimple_phi.
1834         (try_create_reduction_list): Likewise.
1836 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1838         Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
1840         * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
1841         type of parameter from gimple to gimple_phi.
1843         * tree-complex.c (complex_visit_phi): Update signature of callback
1844         implementation accordingly.
1845         * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
1846         * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
1847         * tree-vrp.c (vrp_visit_phi_node): Likewise.
1849         * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
1850         gimple_phi when invoking the ssa_prop_visit_phi callback.
1852 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1854         Introduce gimple_phi_iterator
1856         * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
1857         gimple_stmt_iterator with identical layout, but adding...
1858         (gimple_phi_iterator::phi): ...new method, equivalent to
1859         gsi_stmt (), but casting the underlying gimple to gimple_phi,
1860         checking that code == GIMPLE_PHI in a checked build.
1861         (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
1862         gimple_stmt_iterator.
1864         * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
1865         than just a gimple.
1866         (if_convertible_phi_p): Likewise.
1867         * tree-phinodes.h (add_phi_node_to_bb): Likewise.
1868         * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
1870         * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
1871         and a vec<gimple_phi> *, rather than just a gimple and
1872         vec<gimple> *, and a hash_set<gimple_phi> * rather than a
1873         hash_set<gimple> *.
1874         (find_uninit_use): Likewise; add checked cast to gimple_phi when
1875         adding to worklist.
1876         (pass_late_warn_uninitialized::execute): Strengthen types of
1877         various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
1878         "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
1879         gimple_phi, "added_to_worklist" from hash_set<gimple> to
1880         hash_set<gimple_phi>.
1882         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
1883         gimple_phi_iterator * rather than a gimple_stmt_iterator *;
1884         use it to strengthen local from a gimple to a gimple_phi.
1886         * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
1887         gimple_stmt_iterator to a gimple_phi_iterator.  Use the iterator's
1888         "phi" method rather than gsi_stmt.  Use this checked cast to convert
1889         the type of related local from a plain gimple to a gimple_phi.
1890         * gimple-pretty-print.c (dump_phi_nodes): Likewise.
1891         * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
1892         Likewise.
1893         * sese.c (sese_add_exit_phis_edge): Likewise.
1894         * tree-cfg.c (reinstall_phi_args): Likewise.
1895         (gimple_make_forwarder_block): Likewise.
1896         (add_phi_args_after_copy_edge): Likewise.
1897         (gimple_lv_adjust_loop_header_phi): Likewise.
1898         * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
1899         (remove_forwarder_block_with_phi): Likewise.
1900         (merge_phi_nodes): Likewise.
1901         * tree-complex.c (update_phi_components): Likewise.
1902         * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
1903         * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
1904         (copy_phis_for_bb): Likewise.
1905         * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
1906         * tree-outof-ssa.c (eliminate_build): Likewise.
1907         (eliminate_useless_phis): Likewise.
1908         (rewrite_trees): Likewise.
1909         (insert_backedge_copies): Likewise.
1910         * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
1911         (remove_phi_args): Likewise.
1912         (remove_phi_nodes): Likewise.
1913         * tree-predcom.c (find_looparound_phi): Likewise.
1914         (eliminate_temp_copies): Likewise.
1915         * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
1916         (scev_const_prop): Likewise; also, add checked cast to phi.
1917         * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
1918         * tree-ssa-dce.c (remove_dead_phis): Likewise.
1919         (forward_edge_to_pdom): Likewise.
1920         * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
1921         (cprop_into_successor_phis): Likewise.
1922         (propagate_rhs_into_lhs): Likewise.
1923         (eliminate_degenerate_phis_1): Likewise.
1924         * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
1925         * tree-ssa-live.c (calculate_live_on_exit): Likewise.
1926         (verify_live_on_entry): Likewise.
1927         * tree-ssa-loop-im.c
1928         (move_computations_dom_walker::before_dom_children): Likewise.
1929         * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
1930         (mark_bivs): Likewise.
1931         (find_interesting_uses_outside): Likewise.
1932         (determine_set_costs): Likewise.
1933         * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
1934         (tree_transform_and_unroll_loop): Likewise.
1935         (rewrite_all_phi_nodes_with_iv): Likewise.
1936         (canonicalize_loop_ivs): Likewise.
1937         * tree-ssa-loop-niter.c (determine_value_range): Likewise.
1938         * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
1939         * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
1940         * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
1941         * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
1942         (vop_phi): Likewise.
1943         * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
1944         Likewise.
1945         * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
1946         (copy_phi_args): Likewise.
1947         (phi_args_equal_on_edges): Likewise.
1948         * tree-ssa.c (ssa_redirect_edge): Likewise.
1949         (flush_pending_stmts): Likewise.
1950         * tree-switch-conversion.c (check_final_bb): Likewise.
1951         (gather_default_values): Likewise.
1952         (build_constructors): Likewise.
1953         (fix_phi_nodes): Likewise.
1954         * tree-tailcall.c (propagate_through_phis): Likewise.
1955         (add_successor_phi_arg): Likewise.
1956         * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
1957         Likewise.
1958         (slpeel_update_phi_nodes_for_guard2): Likewise.
1959         (slpeel_tree_peel_loop_to_edge): Likewise.
1960         (vect_can_advance_ivs_p): Likewise.
1961         (vect_update_ivs_after_vectorizer): Likewise.
1962         * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
1963         * tree-vrp.c (find_assert_locations): Likewise.
1964         * value-prof.c (gimple_ic): Likewise.
1966         * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
1968 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1970         Introduce gimple_phi and use it in various places
1972         * coretypes.h (gimple_phi): New typedef.
1973         (const_gimple_phi): New typedef.
1975         * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
1976         variants, using the gimple printer.
1978         * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
1979         vecs of more concrete gimple subclasses as appropriate; also the
1980         comment is about to become misleading.
1982         * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
1983         rather than spelling out the full type.
1984         (gimple_phi_num_args): Likewise.
1985         (gimple_phi_result): Likewise.
1986         (gimple_phi_result_ptr): Use gimple_phi typedef.
1987         (gimple_phi_set_result): Likewise.
1988         (gimple_phi_arg): Likewise.
1989         (gimple_phi_set_arg): Likewise.
1990         * tree-phinodes.c (allocate_phi_node): Likewise.
1991         (resize_phi_node): Likewise.
1992         (reserve_phi_args_for_new_edge): Likewise.
1993         (remove_phi_arg_num): Likewise.
1995         * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
1996         rather than just a gimple.
1997         * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
1999         * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
2000         just a gimple.
2001         (create_phi_node): Likewise.
2002         * tree-phinodes.h (create_phi_node): Likewise.
2004         * trans-mem.c (struct struct tm_log_entry): Replace use of
2005         now-removed gimple_vec with a plain vec<gimple>.
2007         * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
2008         vec<gimple_vec> to a vec< vec<gimple_phi> >.
2010         * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
2011         gimple_phi.
2012         * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
2013         "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
2014         a gimple_phi.
2015         * tree-into-ssa.c (delete_update_ssa): Strengthen local
2016         "phis" from a gimple_vec to a vec<gimple_phi>.
2018         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2019         gimple_phi in regions where a stmt is known to have code
2020         GIMPLE_PHI.
2021         * tree-into-ssa.c (mark_use_interesting): Likewise.
2023 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2025         Introduce gimple_debug and use it in a few places
2027         * coretypes.h (gimple_debug): New typedef.
2028         (const_gimple_debug): New typedef.
2030         * gimple.h (struct gimple_statement_debug): New subclass of
2031         gimple_statement_with_ops, adding the invariant that
2032         stmt->code == GIMPLE_DEBUG.
2033         (is_a_helper <gimple_statement_debug>::test): New.
2035         * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
2036         variants, using the gimple printer.
2038         * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
2039         rather than just a gimple.
2040         * tree-inline.c (copy_debug_stmt): Likewise.
2042         * tree-inline.h (struct copy_body_data): Strengthen field
2043         "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
2045         * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
2046         rather than just a gimple.
2047         (gimple_build_debug_source_bind_stat): Likewise.
2048         * gimple.h (gimple_build_debug_bind_stat): Likewise.
2049         (gimple_build_debug_source_bind_stat): Likewise.
2051         * tree-inline.c (remap_gimple_stmt): Update locals to be a
2052         gimple_debug.
2053         (maybe_move_debug_stmts_to_successors): Likewise.
2054         (copy_debug_stmts): Likewise.
2056         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2057         gimple_debug in regions where a stmt is known to have code
2058         GIMPLE_DEBUG.
2060 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2062         Introduce gimple_label and use it in a few places
2064         * coretypes.h (gimple_label): New typedef.
2065         (const_gimple_label): New typedef.
2067         * gimple.h (struct gimple_statement_label): New subclass of
2068         gimple_statement_with_ops, adding the invariant that
2069         stmt->code == GIMPLE_LABEL.
2070         (is_a_helper <gimple_statement_label>::test): New.
2072         * gdbhooks.py (build_pretty_printer): Add gimple_label and its
2073         variants, reusing the gimple printer.
2075         * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
2076         rather than just a gimple.
2077         * tree-cfg.c (verify_gimple_label): Likewise.
2079         * gimple.c (gimple_build_label): Return a gimple_label rather than
2080         just a gimple.
2081         * gimple.h (gimple_build_label): Likewise.
2083         * gimplify.c (gimplify_case_label_expr): Update local to be a
2084         gimple_label.
2085         * tree-switch-conversion.c (gen_inbound_check): Likewise.
2087         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2088         gimple_label in regions where a stmt is known to have code
2089         GIMPLE_LABEL.
2090         * tree-cfg.c (verify_gimple_stmt): Likewise.
2092 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2094         Introduce gimple_assign and use it in various places
2096         * coretypes.h (gimple_assign): New typedef.
2097         (const_gimple_assign): New typedef.
2099         * gimple.h (struct gimple_statement_assign): New subclass of
2100         gimple_statement_with_memory_ops, adding the invariant that
2101         stmt->code == GIMPLE_ASSIGN.
2102         (is_a_helper <gimple_statement_assign>::test): New.
2104         * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
2105         variants, using the gimple printer.
2107         * gimple-builder.c (build_assign): Return a gimple_assign rather
2108         than just a gimple from each of the overloaded variants.
2109         (build_type_cast): Likewise.
2110         * gimple-builder.h (build_assign): Likewise.
2111         (build_type_cast): Likewise.
2112         * gimple.c (gimple_build_assign_stat): Likewise.
2113         (gimple_build_assign_with_ops): Likewise.
2114         * gimple.h (gimple_build_assign_stat): Likewise.
2115         (gimple_build_assign_with_ops): Likewise.
2117         * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
2118         rather than just a "const gimple" (the latter is not a
2119         "const_gimple").
2120         * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
2121         rather than just a gimple.
2122         (dump_binary_rhs): Likewise.
2123         (dump_ternary_rhs): Likewise.
2124         * tree-cfg.c (verify_gimple_assign_unary): Likewise.
2125         (verify_gimple_assign_binary): Likewise.
2126         (verify_gimple_assign_ternary): Likewise.
2127         (verify_gimple_assign_single): Likewise.
2128         (verify_gimple_assign): Likewise.
2129         * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
2130         (try_to_simplify): Likewise.
2131         * tree-tailcall.c (process_assignment): Likewise.
2132         * tree-vect-generic.c (expand_vector_operation): Likewise.
2133         * tree-vrp.c (extract_range_from_cond_expr): Likewise.
2134         (extract_range_from_assignment): Likewise.
2136         * asan.c (has_stmt_been_instrumented_p): Add checked cast to
2137         gimple_assign in regions where a stmt is known to have code
2138         GIMPLE_ASSIGN.
2139         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2140         * tree-cfg.c (verify_gimple_stmt): Likewise.
2141         * tree-ssa-sccvn.c (visit_use): Likewise.
2142         * tree-tailcall.c (find_tail_calls): Likewise.
2143         * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
2145         * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
2146         against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
2147         a gimple_assign local.
2149         * tree-vect-generic.c (expand_vector_condition): Convert local to a
2150         gimple_assign, adding a checked cast when extracting from gsi, since
2151         this is only called when  underlying stmt has code GIMPLE_ASSIGN.
2152         (optimize_vector_constructor): Likewise.
2153         (lower_vec_perm): Likewise.
2154         (expand_vector_operations_1): Convert local to a gimple_assign,
2155         introducing a dyn_cast.
2157 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2159         Introduce gimple_cond and use it in various places
2161         * coretypes.h (gimple_cond): New typedef.
2162         (const_gimple_cond): Likewise.
2164         * gimple.h (struct gimple_statement_cond): New subclass of
2165         gimple_statement_with_ops, adding the invariant that
2166         stmt->code == GIMPLE_COND.
2167         (is_a_helper <gimple_statement_cond>::test): New.
2168         (gimple_build_cond): Return a gimple_cond, rather than just
2169         a gimple.
2170         (gimple_build_cond_from_tree): Likewise.
2172         * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
2173         variants, using the gimple printer.
2175         * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
2176         than just a gimple.
2177         * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
2178         (gimple_cond_true_p): Likewise.
2179         (gimple_cond_false_p): Likewise.
2180         (gimple_cond_set_condition): Likewise.
2181         * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
2182         * gimple-fold.c (fold_gimple_cond): Likewise.
2183         * gimple-pretty-print.c (dump_gimple_cond): Likewise.
2184         * tree-ssa-dom.c (canonicalize_comparison): Likewise.
2185         * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
2186         * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
2187         (recognize_bits_test): Likewise.
2188         * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
2189         (thread_around_empty_blocks): Likewise.
2190         (thread_through_normal_block): Likewise.
2191         (thread_across_edge): Likewise.
2192         * tree-ssa-threadedge.h (thread_across_edge): Likewise.
2193         * tree-vrp.c (range_fits_type_p): Likewise.
2195         * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
2196         gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
2197         * gimple-fold.c (fold_stmt_1): Likewise.
2198         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2199         * tree-ssa-dom.c (optimize_stmt): Likewise.
2200         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2201         * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
2202         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
2203         Likewise.
2204         * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
2206         * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
2207         gimple_cond.
2208         * tree-vrp.c (identify_jump_threads): Likewise.
2210         * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
2211         just a gimple.
2212         (gimple_build_cond_from_tree): Likewise.
2214         * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
2215         field "m_dummy_cond" from a plain gimple to a gimple_cond.
2217         * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
2218         inner_stmt and outer_stmt so that inner_cond and outer_cond can be
2219         of type gimple_cond once we know that we have code == GIMPLE_COND.
2220         * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
2221         "last" so that stmt can be of type gimple_cond.
2223 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2225         Introduce gimple_bind and use it for accessors.
2227         * coretypes.h (gimple_bind): New typedef.
2228         (const_gimple_bind): New typedef.
2230         * gdbhooks.py (build_pretty_printer): Add gimple_bind
2231         and its variants, using the gimple printer.
2233         * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
2234         require a gimple_bind rather than just a gimple.
2236         * gimple.c (gimple_build_bind): Return a gimple_bind rather than
2237         just a gimple.
2238         * gimple.h (gimple_build_bind): Likewise.
2240         * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
2242         * gimple.h (gimple_bind_vars): Update type-signature to
2243         require a gimple_bind rather than just a gimple, removing
2244         as_a and hence run-time check.
2245         (gimple_bind_set_vars): Likewise.
2246         (gimple_bind_append_vars): Likewise.
2247         (gimple_bind_body_ptr): Likewise.
2248         (gimple_bind_body): Likewise.
2249         (gimple_bind_set_body): Likewise.
2250         (gimple_bind_add_stmt): Likewise.
2251         (gimple_bind_add_seq): Likewise.
2252         (gimple_bind_block): Likewise.
2253         (gimple_bind_set_block): Likewise.
2254         * gimplify.c (gimple_push_bind_expr): Likewise.
2255         (gimple_current_bind_expr): Likewise.
2256         * tree-inline.c (copy_gimple_bind): Likewise.
2258         * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
2259         rather than a plain gimple.
2260         (gimplify_body): Likewise.
2261         (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
2262         a vec<gimple>.
2264         * gimplify.c (struct gimplify_ctx): Strengthen field
2265         "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
2266         (gimple_bind_expr_stack): Likewise for type of returned value.
2268         * gimplify.c (gimplify_body): Strengthen various types from gimple
2269         to gimple_bind, including the return type.
2271         * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
2272         so that local "scope" can be of type gimple_bind once we've reached
2273         the region where it must be of code GIMPLE_BIND.
2275         * gimple-low.c (lower_gimple_bind): Add checked cast to
2276         gimple_bind, since both callers (lower_function_body and
2277         lower_stmt) have checked the code for us.
2279         * gimple.c (gimple_copy): Add checked cast to gimple_bind in
2280         region guarded by check for code GIMPLE_BIND.
2281         * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
2282         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2283         * gimple-walk.c (walk_gimple_stmt): Likewise.
2284         * omp-low.c (scan_omp_1_stmt): Likewise.
2285         (lower_omp_1): Likewise.
2286         (lower_omp_for): Likewise.
2287         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
2288         (do_warn_unused_result): Likewise.
2289         * tree-inline.c (remap_gimple_stmt): Likewise.
2290         (estimate_num_insns): Likewise.
2291         * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
2293         * gimplify.c (gimplify_bind_expr): Update local(s) to be a
2294         gimple_bind rather than just a gimple.
2295         (gimplify_function_tree): Likewise.
2296         * omp-low.c (lower_omp_sections): Likewise.
2297         (lower_omp_single): Likewise.
2298         (lower_omp_master): Likewise.
2299         (lower_omp_taskgroup): Likewise.
2300         (lower_omp_ordered): Likewise.
2301         (lower_omp_critical): Likewise.
2302         (lower_omp_taskreg): Likewise.
2303         (lower_omp_teams): Likewise.
2304         * omp-low.c (lower_omp_for): Likewise; use
2305         gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
2306         (lower_omp_target): Likewise.
2307         * tree-nested.c (finalize_nesting_tree_1): Likewise.
2309         * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
2310         * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
2312 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2314         Introduce gimple_switch and use it in various places
2316         * gimple.h (gimple_statement_switch): New subclass of
2317         gimple_statement_with_ops, adding the invariant that
2318         stmt->code == GIMPLE_SWITCH.
2319         (is_a_helper <gimple_statement_switch>::test (gimple)): New.
2321         * coretypes.h (gimple_switch): New typedef
2322         (const_gimple_switch): Likewise.
2324         * gdbhooks.py (build_pretty_printer): Add gimple_switch
2325         and its variants, using the gimple printer.
2327         * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
2328         rather than just a gimple.
2329         (gimple_build_switch): Likewise.
2330         * gimple.h (gimple_build_switch_nlabels): Likewise.
2331         (gimple_build_switch): Likewise.
2333         * gimple.h (gimple_switch_num_labels): Update type-signature to
2334         require a gimple_switch rather than just a gimple.
2335         (gimple_switch_set_num_labels): Likewise.
2336         (gimple_switch_set_index): Likewise.
2337         (gimple_switch_label): Likewise.
2338         (gimple_switch_set_label): Likewise.
2339         (gimple_switch_default_label): Likewise.
2340         (gimple_switch_set_default_label): Likewise.
2341         * expr.h (expand_case): Likewise.
2342         * gimple-pretty-print.c (dump_gimple_call): Likewise.
2343         * stmt.c (compute_cases_per_edge): Likewise.
2344         (expand_case): Likewise.
2345         * tree-cfg.h (group_case_labels_stmt): Likewise.
2346         * tree-cfg.c (make_gimple_switch_edges): Likewise.
2347         (find_taken_edge_switch_expr) Likewise.
2348         (find_case_label_for_value) Likewise.
2349         (get_cases_for_edge): Likewise.
2350         (group_case_labels_stmt): Likewise.
2351         (verify_gimple_switch): Likewise.
2352         * tree-eh.c (verify_norecord_switch_expr): Likewise.
2353         * tree-eh.c (lower_eh_constructs_2): Likewise.
2354         * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
2355         * tree-ssa-dom.c (record_edge_info): Likewise.
2356         * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
2357         (simplify_gimple_switch): Likewise.
2358         * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
2359         (collect_switch_conv_info): Likewise.
2360         (build_constructors): Likewise.
2361         (array_value_type): Likewise.
2362         (build_one_array): Likewise.
2363         (build_arrays): Likewise.
2364         (gen_inbound_check): Likewise.
2365         * tree-vrp.c (find_switch_asserts): Likewise.
2366         (find_case_label_range): Likewise.
2367         (find_case_label_ranges): Likewise.
2368         (vrp_visit_switch_stmt): Likewise.
2369         (simplify_switch_using_ranges): Likewise.
2371         * tree-vrp.c (switch_update): Strengthen field "stmt" from being
2372         merely a gimple to being a gimple_switch.
2374         * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
2375         gimple_switch in regions where the stmt code has been tested as
2376         GIMPLE_SWITCH.
2377         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2378         * tree-cfg.c (make_edges): Likewise.
2379         (end_recording_case_labels): Likewise.
2380         (cleanup_dead_labels): Likewise.
2381         (cleanup_dead_labels): Likewise.
2382         (group_case_labels): Likewise.
2383         (find_taken_edge): Likewise.
2384         (find_case_label_for_value): Likewise.
2385         (verify_gimple_stmt): Likewise.
2386         (gimple_verify_flow_info): Likewise.
2387         (gimple_redirect_edge_and_branch): Likewise.
2388         * tree-inline.c (estimate_num_insns): Likewise.
2389         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2390         * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
2391         * tree-switch-conversion.c (do_switchconv): Likewise.
2392         * tree-vrp.c  (find_assert_locations_1): Likewise.
2393         (vrp_visit_stmt): Likewise.
2394         (simplify_stmt_using_ranges): Likewise.
2396         * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
2397         Introduce local "lastg" as a generic gimple, so that local "last"
2398         can be of type gimple_switch once lastg's code has been verified.
2400         * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
2401         the GIMPLE_SWITCH case.
2403         * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
2404         argument, since the caller (find_taken_edge) has checked that
2405         last_stmt is a switch.
2407 Copyright (C) 2014 Free Software Foundation, Inc.
2409 Copying and distribution of this file, with or without modification,
2410 are permitted in any medium without royalty provided the copyright
2411 notice and this notice are preserved.