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