Make gimple_phi_arg_location_from_edge require a gimple_phi
[official-gcc.git] / gcc / ChangeLog.gimple-classes
blob5a271ca5603cd672e06de608041ea90938c8ca9c
1 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
3         Make gimple_phi_arg_location_from_edge require a gimple_phi
5         * gimple.h (gimple_phi_arg_location_from_edge): Require a
6         gimple_phi.
8         * tree-parloops.c (create_parallel_loop): Split up local variable
9         "stmt", introducing other locals for the various statements created
10         by this function.  Reuse "stmt" within the phi-handling code, and
11         change to type gimple_phi, since this is the only remaining
12         "non-phi" user of gimple_phi_arg_location_from_edge.
14 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
16         Concretize three gimple_try_set_ accessors
18         * gimple.c (gimple_copy): Add checked casts to gimple_try.
20         * gimple.h (gimple_try_set_kind): Require a gimple_try.
21         (gimple_try_set_eval): Likewise.
22         (gimple_try_set_cleanup): Likewise.
24         * tree-eh.c (optimize_double_finally): Require a pair of gimple_try
25         statements.
26         (refactor_eh_r): Convert code comparisons to dynamic casts.
28 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
30         Concretize gimple_try_set_catch_is_cleanup
32         * gimple.h (gimple_try_set_catch_is_cleanup): Require a gimple_try.
34         * gimplify.c (gimplify_expr): Convert local "try_" from a gimple
35         to a gimple_try.
37 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
39         Concretize gimple_eh_filter_set_types and gimple_eh_filter_set_failure
41         * gimple.h (gimple_eh_filter_set_types): Require a gimple_eh_filter.
42         (gimple_eh_filter_set_failure): Likewise.
43         * gimple.c (gimple_copy): Add checked casts to gimple_eh_filter
44         within GIMPLE_EH_FILTER case.
46 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
48         Concretize gimple_label_label
50         * gimple.h (gimple_label_label): Require a const_gimple_label
51         rather than just a const_gimple.
53         * cfgexpand.c (label_rtx_for_bb): Convert local from gimple to
54         gimple_label, replacing a check against GIMPLE_LABEL with a
55         dyn_cast<gimple_label>.
56         * predict.c (tree_estimate_probability_bb): Likewise.
57         * tree-cfg.c (make_edges): Likewise.
58         (cleanup_dead_labels): Likewise (twice).
59         (gimple_can_merge_blocks_p): Likewise.
60         (gimple_block_label): Likewise.
61         * tree-eh.c (unsplit_eh): Likewise.
62         (cleanup_empty_eh_unsplit): Likewise.
63         * tree-inline.c (mark_local_labels_stmt): Likewise.
64         * tree-nested.c (convert_nl_goto_receiver): Likewise.
66         * cfgexpand.c (expand_gimple_stmt_1): Add a checked cast to
67         gimple_label when invoking gimple_label_label in a region where
68         we've checked the code is GIMPLE_LABEL.
69         * gimple-pretty-print.c (pp_cfg_jump): Likewise.
70         * gimple.c (gimple_set_bb): Likewise.
71         * ipa-pure-const.c (check_stmt): Likewise.
72         * omp-low.c (diagnose_sb_1): Likewise.
73         * tree-cfg.c (gimple_verify_flow_info): Likewise.
74         * tree-cfgcleanup.c (tree_forwarder_block_p): Likewise.
75         (remove_forwarder_block): Likewise.
76         * tree-eh.c (collect_finally_tree): Likewise.
78         * ipa-split.c (verify_non_ssa_vars): Replace a check against
79         GIMPLE_LABEL with a dyn_cast<gimple_label>, introducing a
80         gimple_label local.
81         * tree-cfg.c (gimple_can_merge_blocks_p): Likewise.
82         (gimple_merge_blocks): Likewise.
83         (remove_bb): Likewise.
84         (stmt_starts_bb_p): Likewise.
85         (gimple_verify_flow_info): Likewise.
86         (move_block_to_fn): Likewise.
87         * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
88         (remove_forwarder_block_with_phi): Likewise.
89         * tree-ssa-ccp.c (optimize_unreachable): Likewise.
91 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
93         Concretize gimple_call_use_set and gimple_call_clobber_set
95         * gimple.h (gimple_call_use_set): Require a gimple_call.
96         (gimple_call_clobber_set): Likewise.
98 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
100         Concretize gimple_catch_types
102         * gimple.h (gimple_catch_types): Require a const_gimple_catch
103         rather than a const_gimple.
105 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
107         Make gimple_goto_set_dest require a gimple_goto
109         * gimple.h (gimple_goto_set_dest): Require a gimple_goto.
111         * tree-cfg.c (factor_computed_gotos): Add checked cast to
112         gimple_goto.
113         (cleanup_dead_labels): Likewise.
115 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
117         Make gimple_label_set_label require a gimple_label
119         * gimple.h (gimple_label_set_label): Require a gimple_label.
121 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
123         Concretize parameter to gimple_call_copy_skip_args
125         * gimple.c (gimple_call_copy_skip_args): Require a gimple_call.
126         * gimple.h (gimple_call_copy_skip_args): Likewise.
128 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
130         Various gimple to gimple_call conversions in IPA
132         * ipa-prop.c (detect_type_change_from_memory_writes): Require a
133         gimple_call rather than a plain gimple.
134         (detect_type_change): Likewise.
135         (detect_type_change_ssa): Likewise.
136         (compute_complex_assign_jump_func): Likewise.
137         (compute_complex_ancestor_jump_func): Likewise.
138         (compute_known_type_jump_func): Likewise.
139         (determine_locally_known_aggregate_parts): Likewise.
140         (ipa_compute_jump_functions_for_edge): Strengthen local "call" to
141         a gimple_call; add checked cast to gimple_phi.
142         (ipa_note_param_call): Require a gimple_call rather than a plain
143         gimple.
144         (ipa_analyze_indirect_call_uses): Likewise.
145         (ipa_analyze_virtual_call_uses): Likewise.
146         (ipa_analyze_call_uses): Likewise.
147         (ipa_analyze_stmt_uses):Add checked cast to gimple_call.
149         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
150         Replace use of is_gimple_call with dyn_cast<gimple_call> and a
151         new local "call_stmt".
153 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
155         Use gimple_call for callgraph edges
157         * cgraph.h (cgraph_edge::call_stmt): Strengthen field from plain
158         gimple to a gimple_call.
159         (cgraph_node::set_call_stmt_including_clones): Likewise for param
160         "new_stmt".
161         (cgraph_node::create_edge): Likewise for param "call_stmt".
162         (cgraph_node::create_indirect_edge): Likewise.
163         (cgraph_node::create_edge_including_clones): Likewise for param
164         "stmt".
165         (cgraph_edge::set_call_stmt): Likewise for param "new_stmt".
166         (cgraph_edge::clone): Likewise for param "call_stmt".
167         (symbol_table::create_edge): Likewise.
169         * cgraph.c (cgraph_edge::set_call_stmt): Require a gimple_call
170         rather than a plain gimple.
171         (symbol_table::create_edge): Likewise.
172         (cgraph_node::create_edge): Likewise.
173         (cgraph_node::create_indirect_edge): Likewise.
174         (cgraph_edge::redirect_call_stmt_to_callee): Strengthen local
175         "new_stmt" from gimple to gimple_call.
176         (cgraph_update_edges_for_call_stmt_node): Add checked casts to
177         gimple_call.
179         * cgraphbuild.c (pass_build_cgraph_edges::execute): Replace
180         is_gimple_call with dyn_cast<gimple_call> and new local
181         "call_stmt".
182         (cgraph_edge::rebuild_edges): Likewise.
184         * cgraphclones.c (cgraph_edge::clone): Require a gimple_call
185         rather than a plain gimple.
186         (cgraph_node::set_call_stmt_including_clones): Likewise.
187         (cgraph_node::create_edge_including_clones): Likewise.
189         * lto-streamer-in.c (fixup_call_stmt_edges_1): Add checked casts
190         to gimple_call.
192         * omp-low.c (simd_clone_adjust): Strengthen local "call" from
193         gimple to gimple_call.
195         * trans-mem.c (ipa_tm_insert_irr_call): Likewise for "g".
196         (ipa_tm_insert_gettmclone_call): Likewise; also strengthen "g2"
197         to gimple_assign.
199         * tree-emutls.c (gen_emutls_addr): Strengthen local "x" from
200         gimple to gimple_call.
202         * tree-inline.c (copy_bb): Replace is_gimple_call with
203         dyn_cast<gimple_call> and new local "call_stmt".
205         * value-prof.c (gimple_ic): Require and return a gimple_call,
206         rather than a plain gimple.
207         * value-prof.h (gimple_ic): Likewise.
209 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
211         Make gimple_call_return_slot_opt_p require a gimple_call.
213         * gimple.h (gimple_call_return_slot_opt_p): Require a gimple_call
214         rather than a plain gimple.
216         * gimple-walk.c (walk_stmt_load_store_addr_ops): Convert usage of
217         is_gimple_call to dyn_cast<gimple_call>, introducing a new local
218         "call_stmt".
220         * trans-mem.c (expand_call_tm): Split local "stmt", strengthening
221         from plain gimple to a gimple_call, and introducing new local
222         gimple_assign "assign_stmt".
224         * tree-inline.c (expand_call_inline):  Convert check of code against
225         GIMPLE_CALL to dyn_cast<gimple_call>, introducing a new local
226         "call_stmt".
228 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
230         More gimple_phi
232         * gimple.h (gimple_phi_set_result): Require a gimple_phi rather
233         than a plain gimple.
234         (gimple_phi_set_arg): Likewise.
236         * tree-outof-ssa.c (remove_gimple_phi_args): Likewise; add a checked
237         cast to gimple_phi.
239         * tree-sra.c (replace_removed_params_ssa_names): Add a checked
240         cast to gimple_phi.
242 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
244         Make gimple_phi_arg_edge require a gimple_phi
246         * gimple.h (gimple_phi_arg_edge): Require a gimple_phi rather
247         than a plain gimple.
249         * gimple-ssa-strength-reduction.c (ncd_with_phi): Strengthen
250         param "phi" from gimple to gimple_phi.  Add a checked cast.
251         (ncd_of_cand_and_phis): Add a checked cast.
253         * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Require a
254         gimple_phi_iterator; strengthen local "phi" from gimple to a
255         gimple_phi.
256         (rewrite_cross_bb_scalar_deps): Strengthen local "psi" from
257         a gimple_stmt_iterator to a gimple_phi_iterator.
258         (edge_initial_value_for_loop_phi): Require a gimple phi.
259         (initial_value_for_loop_phi): Likewise.
261         * ipa-split.c (consider_split): Convert "bsi" to a
262         gimple_phi_iterator and "stmt" to a gimple_phi.
264         * predict.c (predict_extra_loop_exits): Convert "phi_stmt" to be
265         a gimple_phi; introduce "lhs_def_stmt" as plain gimple.
266         (apply_return_prediction): Convert "phi" to be a gimple_phi.
268         * tree-cfg.c (replace_uses_by): Add checked cast to gimple_phi.
269         (verify_gimple_in_cfg): Introduce gimple_phi_iterator "gpi" and use
270         it to convert "phi" to a gimple_phi.
272         * tree-eh.c (cleanup_empty_eh_merge_phis): Convert "ngsi", "ogsi"
273         to be gimple_phi_iterators.  Convert "ophi", "nphi" to be
274         gimple_phi.
276         * tree-into-ssa.c (prepare_use_sites_for): Add checked cast to
277         gimple_phi.
279         * tree-ssa-coalesce.c (create_outofssa_var_map): Introduce
280         gimple_phi_iterator "gpi" and use it to convert "phi" to a
281         gimple_phi.
283         * tree-ssa-dce.c (propagate_necessity): Introduce local "phi",
284         from checked cast to gimple_phi.
286         * tree-ssa-live.c (set_var_live_on_entry): Add checked cast to
287         gimple_phi.
289         * tree-ssa-propagate.c (replace_phi_args_in): Require a gimple_phi
290         rather than a plain gimple.
291         (substitute_and_fold_dom_walker::before_dom_children): Introduce
292         gimple_phi_iterator "gpi".
294         * tree-ssa-sink.c (find_bb_for_arg): Require a gimple_phi rather
295         than a plain gimple.
296         (nearest_common_dominator_of_uses): Replace check of code against
297         GIMPLE_PHI with a dyn_cast<gimple_phi>, introducing a new local.
298         (statement_sink_location): Add checked cast to gimple_phi.
300         * tree-ssa-uninit.c (compute_uninit_opnds_pos): Require a
301         gimple_phi rather than a plain gimple.
302         (collect_phi_def_edges): Likewise.  Add a checked cast.
303         (find_def_preds): Strengthen param "phi" from gimple to
304         gimple_phi.
305         (prune_uninit_phi_opnds_in_unrealizable_paths): Likewise for
306         params "phi" and "flag_def".  Strenghen param "visited_phis" from
307         hash_set<gimple> * to hash_set<gimple_phi> *.  Convert
308         "flag_arg_def", "phi_arg_def" to gimple_phi using
309         dyn_cast<gimple_phi>.  Similarly, introduce new local
310         "opnd_def_phi".
311         (use_pred_not_overlap_with_undef_path_pred): Strengthen param
312         "phi" from gimple to gimple_phi, and param "visited_phis" from
313         hash_set<gimple> * to hash_set<gimple_phi> *.  Add a checked cast.
314         (is_use_properly_guarded): Likewise for params.
315         (find_uninit_use): Replace check of code against GIMPLE_PHI with
316         a dyn_cast<gimple_phi>, introducing a new local "use_phi".
317         Strengthen local "visited_phis" from hash_set<gimple> to
318         hash_set<gimple_phi>.
320 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
322         Update GRAPHITE to use more concrete gimple statement classes
324         * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
325         Strengthen local "psi" to be a gimple_phi_iterator and "phi" to
326         a gimple_phi.
328         * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Require
329         a gimple_phi rathen than a plain gimple.
330         (remove_simple_copy_phi): Require a gimple_phi_iterator;
331         strengthen local "phi" to be a gimple_phi and "stmt" to be a
332         gimple_assign.
333         (remove_invariant_phi): Likewise.
334         (simple_copy_phi_p): Require a gimple_phi.
335         (reduction_phi_p): Require a gimple_phi_iterator; strengthen
336         local "phi" to be a gimple_phi.
337         (add_condition_to_pbb): Require a gimple_cond rather than a
338         plain gimple.
339         (add_conditions_to_domain): Add checked cast to gimple_cond
340         within GIMPLE_COND case of switch statement.
341         (single_pred_cond_non_loop_exit): Return a gimple_cond rather
342         than a plain gimple, via a checked cast.
343         (sese_dom_walker::before_dom_children): Strengthen local "stmt"
344         from gimple to gimple_cond.
345         (gsi_for_phi_node): Require a gimple_phi, and return a
346         gimple_phi_iterator.
347         (insert_out_of_ssa_copy): Strengthen local "stmt" from gimple to
348         gimple_assign.
349         (rewrite_reductions_out_of_ssa): Strengthen "psi" to be a
350         gimple_phi_iterator, and "phi" to be a gimple_phi.
351         (phi_contains_arg): Require a gimple_phi.
352         (follow_ssa_with_commutative_ops): Strengthen return type from
353         gimple to gimple_phi, by converting a check for code GIMPLE_PHI to
354         a dyn_cast<gimple_phi>, and strengthening local "res" from gimple
355         to gimple_phi.
356         (detect_commutative_reduction_arg): Strengthen return type from
357         gimple to gimple_phi, and strengthen local "phi" to be a
358         gimple_phi.
359         (detect_commutative_reduction_assign): Strengthen return type from
360         gimple to gimple_phi, and strengthen local "res" to be a
361         gimple_phi.
362         (follow_inital_value_to_phi): Strengthen return type from
363         gimple to gimple_phi.  Replace check for code GIMPLE_PHI with
364         a dyn_cast<gimple_phi>.
365         (detect_commutative_reduction): Strengthen return type and locals
366         "loop_phi", "phi", "close_phi" from gimple to gimple_phi,
367         introducing a checked cast of "stmt" in region guarded by
368         scalar_close_phi_node_p (stmt).
369         (translate_scalar_reduction_to_array_for_stmt): Require param
370         "loop_phi" to be a gimple_phi.  Strengthen local "assign" from
371         gimple to gimple_assign.
372         (remove_phi): Require a gimple_phi.
373         (close_phi_written_to_memory): Likewise.
374         (translate_scalar_reduction_to_array): We expect the first element
375         in each vector to be an arbitrary statement, but all of the
376         subsequent elements to be phi nodes.  Hence the decls of gimple
377         locals "loop_phi" and "close_phi" are replaced with decls of gimple
378         "loop_stmt" and "close_stmt", with decls of the more-strongly typed
379         gimple_phi "loop_phi" and "close_phi" occurring lower down, within
380         the region where we're dealing with i > 0 and hence where we can
381         safely assign them using the checked cast as_a <gimple_phi>.
382         This allows many of the strengthenings from gimple to gimple_phi
383         above.  We eliminate the local "stmt", since we can simply use
384         "loop_stmt".
385         (rewrite_commutative_reductions_out_of_ssa_close_phi): Strengthen
386         param "close_phi" from gimple to gimple_phi, and local "gsi" from
387         gimple_stmt_iterator to gimple_phi_iterator, converting uses of
388         gsi_stmt to gsi.phi for type-safety.
389         (scop_ivs_can_be_represented): Strengthen local "gsi" from
390         gimple_stmt_iterator to gimple_phi_iterator, and "phi" from gimple
391         to gimple_phi.
393 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
395         Make gimple_phi_arg_set_location require a gimple_phi
397         * gimple.h (gimple_phi_arg_set_location): Require a gimple_phi
398         rather than a plain gimple.
400 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
402         Make add_phi_arg require a gimple_phi
404         * tree-phinodes.h (add_phi_arg): Require a gimple_phi rather than
405         a plain gimple.
406         * tree-phinodes.c (add_phi_arg): Likewise.
408         * gimple-ssa-strength-reduction.c (create_phi_basis): Strengthen
409         local "phi" from plain gimple to gimple_phi.
411         * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
412         Likewise for "close_phi".
414         * ipa-split.c (split_function): Convert "psi" to
415         gimple_phi_iterator.
417         * omp-low.c (expand_omp_for_static_nochunk): Introduce
418         gimple_phi_iterator gpi, using it to strengthen "phi" to be a
419         gimple_phi.
420         (expand_omp_for_static_chunk): Likewise.
422         * tree-cfg.c (gimple_duplicate_bb): Make topmost "gsi" decl more
423         tightly-scoped, and eliminate decls "phis", "phi", "stmt", "copy"
424         in favor of more tightly-scoped gimple_phi_iterator gpi and
425         gimple_phi decls "phi" and "copy", and gimple decls "stmt" and
426         "copy".
428         * tree-parloops.c (create_parallel_loop): Introduce
429         gimple_phi_iterator gpi, using it to strengthen "phi" to be a
430         gimple_phi.
432         * tree-ssa-loop-im.c (execute_sm_if_changed): Likewise.
434         * tree-ssa-loop-manip.c (create_iv): Split out new gimple_phi
435         local "phi" from "stmt", and convert the latter into being a
436         gimple_assign.
438         * tree-ssa-pre.c (insert_into_preds_of_block): Strengthen local
439         "phi" to be a gimple_phi.
441         * tree-ssa-tail-merge.c (vop_phi): Require a gimple_phi rather
442         than a plain gimple.
443         (replace_block_by): Strengthen local "bb2_phi" to be a gimple_phi.
445         * tree-tailcall.c (add_successor_phi_arg): Use gsi.phi when
446         invoking add_phi_arg.
447         (eliminate_tail_call): Introduce gimple_phi_iterator gpi, using it
448         to strengthen "phi" to be a gimple_phi.
449         (create_tailcall_accumulator): Strengthen local "phi" to be a
450         gimple_phi.
451         (tree_optimize_tail_calls_1): Likewise.
453         * tree-vect-data-refs.c (vect_setup_realignment): Strengthen
454         local "phi_stmt" to be a gimple_phi.
456         * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg):
457         Strengthen "gsi", "gsi_orig", "gsi_new" to be
458         gimple_phi_iterators, and "phi" "orig_phi", "new_phi" to be
459         gimple_phi instances.
460         (slpeel_tree_peel_loop_to_edge): Strengthen local "new_phi" to be
461         a gimple_phi.
463         * tree-vect-loop.c (get_initial_def_for_induction): Likewise for
464         "induction_phi".
465         (vect_create_epilog_for_reduction): Add checked casts to
466         gimple_phi; strengthen local "outer_phi" to gimple_phi and
467         "new_vec_stmt" to gimple_assign.
468         (vect_finalize_reduction): Strengthen local "vect_phi" to
469         gimple_phi.
470         (vectorizable_reduction): Likewise for "new_phi".
472         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
473         (vectorizable_load): Likewise for "phi".
475 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
477         Make gimple_phi_arg_def_ptr and gimple_phi_arg_has_location require a gimple_phi
479         * gimple.h (gimple_phi_arg_def_ptr): Require a gimple_phi rather
480         than a plain gimple.
481         (gimple_phi_arg_has_location): Likewise.
483         * gimple-streamer-in.c (input_phi): Return a gimple_phi rather
484         than a plain gimple.
485         * gimple-streamer-out.c (output_phi): Require a gimple_phi rather
486         than a plain gimple.
487         (output_bb): Convert iteration to a gimple_phi_iterator, and local
488         "phi" to gimple_phi.
490         * omp-low.c (expand_omp_for_static_chunk): Convert iterator "psi"
491         to a gimple_phi_iterator; convert locals "phi" and "nphi" to be
492         gimple_phi.
494         * tree-cfg.c (gimple_duplicate_sese_tail): Likewise for "psi" and
495         "phi".
496         (move_block_to_fn): Introduce new gimple_phi_iterator "psi", using
497         it in place of "gsi" where necessary.  Convert "phi" to be a
498         gimple_phi.
500         * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
502         * tree-vect-loop-manip.c (vect_loop_versioning): Convert "gsi" to
503         a gimple_phi_iterator, and "orig_phi" and "new_phi" to be
504         gimple_phi.
506         * tree.c (find_decls_types_in_node): Introduce new
507         gimple_phi_iterator "psi", using it in place of "si" where
508         necessary.  Convert "phi" to be a gimple_phi.
510 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
512         omp-low.c: Use more concrete types of gimple statement for various locals
514         * omp-low.c (finalize_task_copyfn): Strengthen local "bind" from
515         plain gimple to gimple_bind.
516         (lower_rec_input_clauses): Strengthen local "g" from
517         plain gimple to gimple_assign.
518         (lower_lastprivate_clauses): Likewise for "stmt" to gimple_cond
519         and "g" to gimple_call.
520         (expand_omp_for_init_vars): Likewise, for two decls of "stmt" to
521         gimple_assign.
522         (expand_omp_atomic_pipeline): Likewise for one decl of "stmt".
523         (expand_omp_atomic_mutex): Likewise.
524         (lower_omp_master): Likewise for "x" to gimple_call.
525         (lower_omp_ordered): Likewise.
527 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
529         tree-parloops.c: Use gimple_phi in various places
531         * tree-parloops.c (reduction_info::keep_res): Strengthen field
532         from plain gimple to gimple_phi.
533         (transform_to_exit_first_loop): Strengthen locals "phi", "nphi"
534         to gimple_phi.  Eliminate early decl of gimple_stmt_iterator gsi
535         in favor of more tightly scoped gimple_phi_iterators, and a final
536         later decl as a gimple_stmt_iterator.
538 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
540         Introduce gimple_omp_sections
542         * coretypes.h (gimple_omp_sections): New typedef.
543         (const_gimple_omp_sections): New typedef.
545         * gimple-pretty-print.c (dump_gimple_omp_sections): Require a
546         gimple_omp_sections rather than a plain gimple.
547         (pp_gimple_stmt_1): Add checked cast to gimple_omp_sections within
548         GIMPLE_OMP_SECTIONS case of switch statement.
550         * gimple.c (gimple_build_omp_sections): Return a
551         gimple_omp_sections rather than a plain gimple.
553         * gimple.h (gimple_build_omp_sections): Return a
554         gimple_omp_sections rather than a plain gimple.
556         * omp-low.c (scan_omp_sections): Require a gimple_omp_sections
557         rather than a plain gimple.
558         (scan_omp_1_stmt): Add checked cast to gimple_omp_sections within
559         GIMPLE_OMP_SECTIONS case of switch statement.
560         (expand_omp_sections): Strengthen local "sections_stmt" from gimple
561         to gimple_omp_sections.
562         (lower_omp_sections): Likewise for "stmt".
564 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
566         Introduce gimple_omp_teams
568         * coretypes.h (gimple_omp_teams): New typedef.
569         (const_gimple_omp_teams): New typedef.
571         * gimple.h (gimple_build_omp_teams): Return a gimple_omp_teams
572         rather than a plain gimple.
573         (gimple_omp_teams_set_clauses): Require a gimple_omp_teams rather
574         than a plain gimple.
576         * gimple-pretty-print.c (dump_gimple_omp_teams): Require a
577         gimple_omp_teams rather than a plain gimple.
578         (pp_gimple_stmt_1): Add checked cast to gimple_omp_teams within
579         GIMPLE_OMP_TEAMS case of switch statement.
581         * gimple.c (gimple_build_omp_teams): Return a gimple_omp_teams
582         rather than a plain gimple.
584         * omp-low.c (scan_omp_teams): Likewise.
585         (scan_omp_1_stmt): Add checked cast to gimple_omp_teams within
586         GIMPLE_OMP_TEAMS case of switch statement.
587         (lower_omp_teams): Strengthen local "teams_stmt" from gimple to
588         gimple_omp_teams.
590 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
592         Introduce gimple_omp_target
594         * coretypes.h (gimple_omp_target): New typedef.
595         (const_gimple_omp_target): New typedef.
597         * gimple.h (gimple_build_omp_target): Return a gimple_omp_target
598         rather than a plain gimple.
599         (gimple_omp_target_set_clauses): Require a gimple_omp_target
600         rather than a plain gimple.
601         (gimple_omp_target_set_kind): Likewise.
602         (gimple_omp_target_child_fn_ptr): Likewise.
603         (gimple_omp_target_set_child_fn): Likewise.
604         (gimple_omp_target_data_arg_ptr): Likewise.
605         (gimple_omp_target_set_data_arg): Likewise.
606         (gimple_omp_target_child_fn): Require a const_gimple_omp_target
607         rather than a plain const_gimple.
608         (gimple_omp_target_data_arg): Likewise.
610         * gimple-pretty-print.c (dump_gimple_omp_target): Require a
611         gimple_omp_target rather than a plain gimple.
612         (pp_gimple_stmt_1): Add checked cast to gimple_omp_target within
613         GIMPLE_OMP_TARGET case of switch statement.
615         * gimple.c (gimple_build_omp_target): Return a gimple_omp_target
616         rather than a plain gimple.
618         * gimplify.c (gimplify_omp_target_update): Strengthen local "stmt"
619         from gimple to gimple_omp_target.
621         * omp-low.c (scan_omp_target): Require a gimple_omp_target rather
622         than a plain gimple.
623         (scan_omp_1_stmt): Add checked cast to gimple_omp_target within
624         GIMPLE_OMP_TARGET case of switch statement.
625         (expand_omp_target): Strengthen local "entry_stmt" from gimple to
626         gimple_omp_target.
627         (lower_omp_target): Likewise for "stmt".
629         * tree-nested.c (convert_nonlocal_reference_stmt): Add checked
630         cast to gimple_omp_target.
631         (convert_local_reference_stmt): Likewise.
632         (convert_gimple_call): Likewise.
634 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
636         Introduce gimple_omp_single
638         * coretypes.h (gimple_omp_single): New typedef.
639         (const_gimple_omp_single): New typedef.
641         * gimple.h (gimple_build_omp_single): Return a gimple_omp_single
642         rather than a plain gimple.
643         (gimple_omp_single_set_clauses): Require a gimple_omp_single
644         rather than a plain gimple.
646         * gimple-pretty-print.c (dump_gimple_omp_single): Require a
647         gimple_omp_single rather than a plain gimple.
648         (pp_gimple_stmt_1): Add checked cast to gimple_omp_single within
649         GIMPLE_OMP_SINGLE case of switch statement.
651         * gimple.c (gimple_build_omp_single): Return a gimple_omp_single
652         rather than a plain gimple.
654         * omp-low.c (scan_omp_single): Require a gimple_omp_single rather
655         than a plain gimple.
656         (scan_omp_1_stmt): Add checked cast to gimple_omp_single within
657         GIMPLE_OMP_SINGLE case of switch statement.
658         (lower_omp_single_simple): Require a gimple_omp_single rather
659         than a plain gimple.
660         (lower_omp_single_copy): Likewise.
661         (lower_omp_single): Strengthen local "single_stmt" from gimple to
662         gimple_omp_single.
664 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
666         Introduce gimple_omp_task
668         * coretypes.h (gimple_omp_task): New typedef.
669         (const_gimple_omp_task): New typedef.
671         * gimple.h (gimple_build_omp_task): Return a gimple_omp_task
672         rather than a plain gimple.
674         * gimple-pretty-print.c (dump_gimple_omp_task): Require a
675         gimple_omp_task rather than a plain gimple.
676         (pp_gimple_stmt_1): Add checked cast to gimple_omp_task within
677         GIMPLE_OMP_TASK case of switch statement.
679         * gimple.c (gimple_build_omp_task): Return a gimple_omp_task
680         rather than a plain gimple.
682         * omp-low.c (finalize_task_copyfn): Require a gimple_omp_task
683         rather than a plain gimple.
684         (delete_omp_context): Add checked cast to gimple_omp_task.
685         (scan_omp_task): Strengthen local "stmt" from gimple to
686         gimple_omp_task.
687         (expand_task_call): Require a gimple_omp_task rather than a plain
688         gimple.
689         (expand_omp_taskreg): Add checked cast to gimple_omp_task.
690         (create_task_copyfn): Require a gimple_omp_task rather than a
691         plain gimple.
692         (lower_omp_taskreg): Add checked cast to gimple_omp_task.
694 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
696         tree-cfg.c: Make verify_gimple_call require a gimple_call
698         * tree-cfg.c (verify_gimple_call): Require a gimple_call rather
699         than a plain gimple.
700         (verify_gimple_stmt): Add checked cast to gimple_call within
701         GIMPLE_CALL case of switch statement.
703 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
705         Introduce gimple_omp_parallel
707         * coretypes.h (gimple_omp_parallel): New typedef.
708         (const_gimple_omp_parallel): New typedef.
710         * cgraphbuild.c (build_cgraph_edges): Convert check of code
711         against GIMPLE_OMP_PARALLEL to a dyn_cast <gimple_omp_parallel>
712         and new local.
714         * gimple-pretty-print.c (dump_gimple_omp_parallel): Require a
715         gimple_omp_parallel rather than a plain gimple.
716         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_parallel
717         within GIMPLE_OMP_PARALLEL case of switch statement.
719         * gimple-walk.c (walk_gimple_op): Likewise, introducing a local.
721         * gimple.c (gimple_build_omp_parallel): Return a
722         gimple_omp_parallel rather than a plain gimple.
723         (gimple_copy): Add checked casts to gimple_omp_parallel within
724         GIMPLE_OMP_PARALLEL case of switch statement, introducing locals.
726         * gimple.h (gimple_build_omp_parallel): Return a
727         gimple_omp_parallel rather than a plain gimple.
728         (gimple_omp_parallel_clauses_ptr): Require a gimple_omp_parallel
729         rather than a plain gimple.
730         (gimple_omp_parallel_set_clauses): Likewise.
731         (gimple_omp_parallel_data_arg_ptr): Likewise.
732         (gimple_omp_parallel_set_data_arg): Likewise.
733         (gimple_omp_parallel_child_fn_ptr): Likewise.
734         (gimple_omp_parallel_set_child_fn): Likewise.
735         (gimple_omp_parallel_child_fn): Require a
736         const_gimple_omp_parallel rather than a plain const_gimple.
737         (gimple_omp_parallel_data_arg): Likewise.
739         * omp-low.c (scan_omp_parallel): Strengthen local "stmt" from
740         gimple to gimple_omp_parallel.
741         (expand_parallel_call): Require a gimple_omp_parallel for
742         "entry_stmt" rather than a plain gimple.
743         (remove_exit_barrier):  Strengthen local "parallel_stmt" from
744         gimple to gimple_omp_parallel.
745         (expand_omp_taskreg): Add checked casts to gimple_omp_parallel.
747         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
748         gimple_omp_parallel within GIMPLE_OMP_PARALLEL case of switch
749         statement, introducing local.
751 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
753         Introduce gimple_omp_for
755         * coretypes.h (gimple_omp_for): New.
756         (const_gimple_omp_for): New.
758         * gimple.h (gimple_build_omp_for): Return a gimple_omp_for rather
759         than a plain gimple.
760         (gimple_omp_for_set_kind): Require a gimple_omp_for rather than a
761         plain gimple.
762         (gimple_omp_for_set_combined_p): Likewise.
763         (gimple_omp_for_set_combined_into_p): Likewise.
765         * gimple-pretty-print.c (dump_gimple_omp_for): Require a
766         gimple_omp_for rather than a plain gimple.
767         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_for in
768         GIMPLE_OMP_FOR case of switch statement.
770         * gimple.c (gimple_build_omp_for): Return a gimple_omp_for rather
771         than a plain gimple.
772         (gimple_copy): Add a checked cast to gimple_omp_for and a new local.
774         * gimplify.c (gimplify_omp_for): Strengthen local "gfor" from
775         gimple to gimple_omp_for.
777         * omp-low.c (omp_for_data::for_stmt): Strengthen field from gimple
778         to gimple_omp_for.
779         (extract_omp_for_data): Require a gimple_omp_for rather than a
780         plain gimple.
781         (workshare_safe_to_combine_p): Add a checked cast to
782         gimple_omp_for.
783         (get_ws_args_for): Convert check of code against GIMPLE_OMP_FOR
784         with a dyn_cast<gimple_omp_for> and a new local.
785         (scan_omp_parallel): Add a checked cast to gimple_omp_for and a
786         new local.
787         (scan_omp_for): Require a gimple_omp_for rather than a plain
788         gimple.
789         (scan_omp_1_stmt): Add a checked cast to gimple_omp_for in
790         GIMPLE_OMP_FOR case of switch statement.
791         (expand_omp_for): Add a checked cast to gimple_omp_for.
792         (lower_omp_for): Strengthen local "stmt" from gimple to
793         gimple_omp_for.
795         * tree-nested.c (walk_gimple_omp_for): Require a gimple_omp_for
796         rather than a plain gimple.
797         (convert_nonlocal_reference_stmt): Add a checked cast to
798         gimple_omp_for in GIMPLE_OMP_FOR case of switch statement.
799         (convert_local_reference_stmt): Likewise.
801         * tree-parloops.c (create_parallel_loop): Strengthen local
802         "for_stmt" from gimple to gimple_omp_for.
804 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
806         Introduce gimple_omp_critical
808         * coretypes.h (gimple_omp_critical): New typedef.
809         (const_gimple_omp_critical): New typedef.
811         * gimple-pretty-print.c (dump_gimple_omp_critical): Require a
812         gimple_omp_critical rather than a plain gimple.
813         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_critical
814         within GIMPLE_OMP_CRITICAL case of switch statement.
816         * gimple-walk.c (walk_gimple_op): Likewise.
818         * gimple.c (gimple_build_omp_critical): Return a gimple_omp_critical
819         rather than a plain gimple.
820         (gimple_copy): Add checked casts to gimple_omp_critical
821         within GIMPLE_OMP_CRITICAL case of switch statement.
823         * gimple.h (gimple_debug): Likewise.
824         (gimple_build_omp_critical): Return a gimple_omp_critical rather
825         than a plain gimple.
826         (gimple_omp_critical_name): Require a const_gimple_omp_critical
827         rather than a plain const_gimple.
828         (gimple_omp_critical_name_ptr): Require a gimple_omp_critical
829         rather than a plain gimple.
830         (gimple_omp_critical_set_name): Likewise.
832         * omp-low.c (check_omp_nesting_restrictions): Add a checked cast
833         to gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
834         statement, introducing a new local "other_crit" for type-safety.
835         (lower_omp_critical): Strengthen local "stmt" to
836         gimple_omp_critical.
838         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
839         gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
840         statement.
842 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
844         Introduce gimple_omp_continue
846         * coretypes.h (gimple_omp_continue): New typedef.
847         (const_gimple_omp_continue): New typedef.
849         * gimple.h (gimple_build_omp_continue): Return a
850         gimple_omp_continue rather than a plain gimple.
851         (gimple_omp_continue_control_def): Require a
852         const_gimple_omp_continue rather than a plain const_gimple.
853         (gimple_omp_continue_control_use): Likewise.
854         (gimple_omp_continue_control_def_ptr): Require a gimple_omp_continue
855         rather than a plain gimple.
856         (gimple_omp_continue_set_control_def): Likewise.
857         (gimple_omp_continue_control_use_ptr): Likewise.
858         (gimple_omp_continue_set_control_use): Likewise.
860         * gimple-pretty-print.c (dump_gimple_omp_continue): Require a
861         gimple_omp_continue rather than a plain gimple.
862         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_continue
863         within GIMPLE_OMP_CONTINUE case of switch statement.
865         * gimple-walk.c (walk_gimple_op): Likewise, adding a new local.
867         * gimple.c (gimple_build_omp_continue): Return a
868         gimple_omp_continue rather than a plain gimple.
870         * omp-low.c (gimple_build_cond_empty): Return a gimple_cond
871         rather than a plain gimple.
872         (expand_omp_for_generic): Split local "stmt" into "assign_stmt",
873         "cont_stmt", "cond_stmt", "call_stmt" of types gimple_assign,
874         gimple_omp_continue, gimple_cond, gimple_call respectively.
875         (expand_omp_for_static_nochunk): Likewise, splitting into two
876         "cond_stmt" decls. "assign_stmt", "cont_stmt"
877         (expand_omp_for_static_chunk): Likewise, splitting into
878         "cond_stmt", "assign_stmt", "cont_stmt".
879         (expand_omp_sections): Strengthen local "cont" from gimple to
880         gimple_omp_continue.
882 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
884         Introduce gimple_omp_atomic_store
886         * coretypes.h (gimple_omp_atomic_store): New typedef.
887         (const_gimple_omp_atomic_store): New typedef.
889         * gimple-pretty-print.c (dump_gimple_omp_atomic_store): Require
890         a gimple_omp_atomic_store rather than a plain gimple.
891         (pp_gimple_stmt_1): Add checked cast to gimple_omp_atomic_store
892         within GIMPLE_OMP_ATOMIC_STORE case of switch statement.
893         * gimple-walk.c (walk_gimple_op): Likewise.
895         * gimple.c (gimple_build_omp_atomic_store): Return a
896         gimple_omp_atomic_store rather than a plain gimple.
898         * gimple.h (gimple_build_omp_atomic_store): Return a
899         gimple_omp_atomic_store rather than a plain gimple.
900         (gimple_omp_atomic_store_set_val): Require a gimple_omp_atomic_store
901         rather than a plain gimple.
902         (gimple_omp_atomic_store_val_ptr): Likewise.
903         (gimple_omp_atomic_store_val): Require a
904         const_gimple_omp_atomic_store rather than a plain const_gimple.
906         * gimplify.c (gimplify_omp_atomic): Strengthen locals "loadstmt" and
907         "storestmt" from gimple to gimple_omp_atomic_load loadstmt and
908         gimple_omp_atomic_store storestmt respectively.
910         * omp-low.c (expand_omp_atomic): Strengthen local "store" from
911         gimple to gimple_omp_atomic_store.
913 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
915         Introduce gimple_omp_atomic_load
917         * coretypes.h (gimple_omp_atomic_load): New typedef.
918         (const_gimple_omp_atomic_load): New typedef.
920         * gimple-pretty-print.c (dump_gimple_omp_atomic_load): Require a
921         gimple_omp_atomic_load rather than a plain gimple.
922         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_atomic_load
923         within GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
925         * gimple-walk.c (walk_gimple_op): Likewise, introducing a new local.
927         * gimple.c (gimple_build_omp_atomic_load): Return a
928         gimple_omp_atomic_load rather than a plain gimple.
930         * gimple.h (gimple_build_omp_atomic_load): Return a
931         gimple_omp_atomic_load rather than a plain gimple.
932         (gimple_omp_atomic_load_set_lhs): Require a
933         gimple_omp_atomic_load rather than a plain gimple.
934         (gimple_omp_atomic_load_lhs_ptr): Likewise.
935         (gimple_omp_atomic_load_set_rhs): Likewise.
936         (gimple_omp_atomic_load_rhs_ptr): Likewise.
937         (gimple_omp_atomic_load_lhs): Require a
938         const_gimple_omp_atomic_load rather than a plain const_gimple.
939         (gimple_omp_atomic_load_rhs): Likewise.
941         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
942         to gimple_omp_atomic_load within GIMPLE_OMP_ATOMIC_LOAD case of
943         switch statement.
945         * omp-low.c (expand_omp_atomic): Strengthen type of local "load"
946         from gimple to gimple_omp_atomic_load.
947         (lower_omp_1): Add a checked cast to gimple_omp_atomic_load within
948         GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
950 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
952         Use more concrete types for various gimple statements
954         * cgraphunit.c (thunk_adjust): Strengthen local "stmt" from gimple
955         to gimple_assign.
957         * gimple-ssa-isolate-paths.c
958         (insert_trap_and_remove_trailing_statements): Strengthen local
959         "new_stmt" from gimple to gimple_call.
961         * gimple-ssa-strength-reduction.c (replace_mult_candidate):
962         Strengthen local "copy_stmt" from gimple to gimple_assign.
963         (create_add_on_incoming_edge): Likewise, for "new_stmt".
964         (insert_initializers): Likewise, for "init_stmt".
965         (introduce_cast_before_cand): Likewise, for "cast_stmt".
966         (replace_one_candidate): Likewise, for "copy_stmt" and
967         "cast_stmt".
969         * gimplify.c (build_stack_save_restore): Require gimple_calls
970         rather than plain gimples.
971         (gimplify_bind_expr): Strengthen locals "stack_save" and
972         "stack_restore" from gimple to gimple_call.  Strengthen "gs"
973         to gimple_try.
974         (gimplify_switch_expr): Strengthen local "gimple_switch" from
975         gimple to gimple_switch, and "new_default" to gimple_label.
976         (gimplify_cond_expr): Strengthen local "gimple_cond" from gimple
977         to gimple_cond.
978         (gimplify_init_constructor): Strengthen local "init" from gimple
979         to gimple_assign.
980         (gimplify_cleanup_point_expr): Strengthen local "gtry" from gimple
981         to gimple_try.
982         (gimple_push_cleanup): Strengthen locals "ffalse" and "ftrue" from
983         gimple to gimple_assign.
985         * tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
986         (emit_post_landing_pad): Strengthen local to gimple_label.
988         * tree-outof-ssa.c (insert_backedge_copies): Strengthen local
989         "stmt" from gimple to gimple_assign.
991         * tree-parloops.c (take_address_of): Likewise.
993         * tree-predcom.c (replace_ref_with): Likewise, for "new_stmt".
994         (initialize_root_vars_lm): Likewise, for "init_stmt".
995         (reassociate_to_the_same_stmt): Likewise, for "new_stmt" and "tmp_stmt".
997         * tree-profile.c (gimple_gen_edge_profiler): Likewise, for "stmt1",
998         "stmt2", "stmt3".
999         (gimple_gen_ic_profiler): Likewise.
1000         (gimple_gen_ic_func_profiler): Strengthen local "stmt1" from
1001         gimple to gimple_call, and "stmt2" to gimple_assign.
1003         * tree-scalar-evolution.c (scev_const_prop): Strengthen local
1004         "ass" from gimple to gimple_assign.
1006         * tree-sra.c (build_ref_for_offset): Likewise for "stmt".
1007         (generate_subtree_copies): Likewise; also strengthen "ds" to
1008         gimple_debug.
1009         (init_subtree_with_zero): Likewise.
1010         (sra_modify_expr): Likewise.
1011         (load_assign_lhs_subreplacements): Likewise.
1012         (sra_modify_assign): Strengthen "ds" to gimple_debug.
1013         (sra_ipa_reset_debug_stmts): Likewise for "def_temp".
1015         * tree-ssa-ccp.c (insert_clobber_before_stack_restore):
1016         Strengthen local "clobber_stmt" from gimple to gimple_assign.
1018         * tree-ssa-dce.c (remove_dead_stmt): Strengthen "note" to
1019         gimple_debug.
1021         * tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
1022         local "new_stmt" from gimple to gimple_assign.
1023         (optimize_stmt): Likewise.
1025         * tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
1026         4 declarations of "newop".
1027         (simplify_rotate): Likewise for "g".
1029         * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
1030         (rewrite_bittest): Likewise for "stmt" and "stmt2".
1031         (move_computations_dom_walker::before_dom_children): Likewise for
1032         "new_stmt".
1033         (execute_sm): Likewise for "load" and "store".
1035         * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
1036         Strengthen local "stmt" from gimple to gimple_call.
1037         (unloop_loops): Likewise.
1039         * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
1040         local "ass" from gimple to gimple_assign.
1041         (remove_unused_ivs): Strengthen "def_temp" to gimple_debug.
1043         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local "stmt"
1044         from gimple to gimple_assign.
1046         * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
1047         "prefetch" from gimple to gimple_call.
1049         * tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
1050         "new_stmt" from gimple to gimple_assign.
1051         (powi_as_mults_1): Likewise for "mult_stmt".
1052         (powi_as_mults): Likewise for "div_stmt".
1053         (build_and_insert_binop): Likewise for "stmt".
1054         (build_and_insert_cast): Likewise.
1055         (pass_cse_sincos::execute): Likewise for "stmt" and various decls
1056         of "new_stmt".
1057         (convert_mult_to_fma): Likewise for "fma_stmt".
1059         * tree-ssa-phiopt.c (conditional_replacement): Likewise for "new_stmt".
1060         (abs_replacement): Likewise.
1062         * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for "tmp".
1064         * tree-ssa-pre.c (create_expression_by_pieces): Likewise for "newstmt".
1065         (eliminate_insert): Likewise for "tem".
1067         * tree-ssa-propagate.c (update_gimple_call): Strengthen locals
1068         "new_stmt" and "stmt" from gimple to gimple_call.
1069         (update_call_from_tree): Likewise for "new_stmt".
1071         * tree-ssa-reassoc.c (build_and_add_sum): Likewise for "sum".
1072         (update_ops): Likewise for "g".
1073         (maybe_optimize_range_tests): Likewise.
1074         (rewrite_expr_tree_parallel): Require a gimple_assign rather than
1075         a plain gimple.
1076         (reassociate_bb): Add a checked cast to gimple_assign.
1078         * tree-ssa.c (insert_debug_temp_for_var_def): Strengthen local
1079         "def_temp" from gimple to gimple_debug.
1081         * tree-switch-conversion.c (emit_case_bit_tests): Strengthen local
1082         "shift_stmt" from gimple to gimple_assign.
1084         * tree-tailcall.c (adjust_return_value_with_ops): Likewise for
1085         "stmt".
1086         (update_accumulator_with_ops): Likewise.
1088         * tree-vect-data-refs.c (bump_vector_ptr): Likewise for
1089         "incr_stmt".
1091         * tree-vect-stmts.c (vectorizable_condition): Likewise for
1092         "new_stmt".
1094         * tree-vrp.c (build_assert_expr_for): Likewise for "assertion".
1095         (simplify_truth_ops_using_ranges): Likewise for "newop".
1096         (simplify_float_conversion_using_ranges): Likewise for "conv".
1098         * ubsan.c (instrument_mem_ref): Strengthen local "g" from gimple
1099         to gimple_call.
1101         * value-prof.c (gimple_divmod_fixed_value): Require a
1102         gimple_assign rather than a plain gimple; strengthen types of locals.
1103         (gimple_mod_pow2): Likewise.
1104         (gimple_mod_subtract): Likewise.
1105         (gimple_divmod_fixed_value_transform): Strengthen local
1106         "stmt" from gimple to gimple_assign.
1107         (gimple_mod_pow2_value_transform): Likewise.
1108         (gimple_mod_subtract_transform): Likewise.
1109         (gimple_ic): Strengthen types of locals.
1111 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1113         Introduce gimple_try
1115         * coretypes.h (gimple_try): New typedef.
1116         (const_gimple_try): New typedef.
1118         * gimple-low.c (gimple_try_catch_may_fallthru): Require a
1119         gimple_try rather than a plain gimple.
1120         (gimple_stmt_may_fallthru): Add checked cast to gimple_try.
1122         * gimple-pretty-print.c (dump_gimple_try): Require a gimple_try
1123         rather than a plain gimple.
1124         (pp_gimple_stmt_1): Add checked cast to gimple_try within
1125         GIMPLE_TRY case of switch statement.
1127         * tree-eh.c (finally_tree_node::parent): Strengthen field from
1128         gimple to gimple_try.
1129         (record_in_finally_tree): Require a gimple_try rather than a plain
1130         gimple.
1131         (collect_finally_tree): Likewise.
1132         (collect_finally_tree_1): Likewise.
1133         (struct leh_tf_state::try_finally_expr): Strengthen field from
1134         gimple to gimple_try.
1135         (struct leh_tf_state::top_p): Likewise.
1136         (lower_eh_must_not_throw): Require a gimple_try rather than a
1137         plain gimple.
1138         (frob_into_branch_around): Likewise.
1139         (lower_try_finally_dup_block): Strengthen local from gimple to
1140         gimple_try.
1141         (honor_protect_cleanup_actions): Split out uses of "x" into new
1142         locals "eh_mnt" and "try_stmt" with stronger types.
1143         (lower_try_finally): Require a gimple_try rather than a plain
1144         gimple.
1145         (lower_catch): Likewise.
1146         (lower_eh_filter): Likewise.
1147         (lower_eh_must_not_throw): Likewise.
1148         (lower_cleanup): Likewise.
1149         (lower_eh_constructs_2): Add checked cast to gimple_try within
1150         GIMPLE_TRY case of switch statement, introducing new local
1151         "try_stmt", using it for type-safety.
1153 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1155         Use subclasses of gimple in various places
1157         * asan.c (insert_if_then_before_iter): Require a gimple cond
1158         rathern than a plain gimple.
1159         (asan_expand_check_ifn): Add a checked cast to gimple_cond.
1161         * cfgloopmanip.c (create_empty_if_region_on_edge): Likewise.
1163         * omp-low.c (simd_clone_adjust): Strengthen local from gimple
1164         to gimple_phi.
1166         * sese.c (set_ifsese_condition): Strengthen local from gimple to
1167         gimple_cond.
1169         * tree-call-cdce.c (gen_one_condition): Strengthen locals from
1170         gimple to gimple_assign and gimple_cond.
1172         * tree-ssa-phiopt.c (minmax_replacement): Likewise.
1173         (cond_store_replacement): Strengthen locals from gimple to
1174         gimple_phi and gimple_assign.
1175         (cond_if_else_store_replacement_1): Likewise.
1177         * tree-ssa-pre.c (do_regular_insertion): Strengthen local from
1178         gimple to gimple_assign.
1180         * tree-switch-conversion.c (hoist_edge_and_branch_if_true):
1181         Strengthen local from gimple to gimple_cond.
1182         (gen_def_assigns): Return a gimple_assign rather than a plain
1183         gimple.
1184         (gen_inbound_check): Strengthen locals from gimple to gimple_cond
1185         and gimple_assign.
1187         * tree-vect-loop-manip.c (slpeel_add_loop_guard): Strengthen local
1188         from gimple to gimple_cond.
1189         (set_prologue_iterations): Strengthen locals from gimple to
1190         gimple_phi and gimple_cond.
1192         * value-prof.c (gimple_ic): Strengthen local from gimple to
1193         gimple_phi.
1194         (gimple_stringop_fixed_value): Strengthen locals from gimple to
1195         gimple_assign, gimple_cond, gimple_call, and gimple_phi.
1197 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1199         Introduce gimple_eh_dispatch
1201         * coretypes.h (gimple_eh_dispatch): New typedef.
1202         (const_gimple_eh_dispatch): New typedef.
1204         * gimple-pretty-print.c (dump_gimple_eh_dispatch): Require a
1205         gimple_eh_dispatch rather than a plain gimple.
1206         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_dispatch
1207         within GIMPLE_EH_DISPATCH case of switch statement.
1209         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1211         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1213         * gimple.c (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
1214         rather than a plain gimple.
1216         * gimple.h (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
1217         rather than a plain gimple.
1218         (gimple_eh_dispatch_region): Require a const_gimple_eh_dispatch
1219         rather than a plain const_gimple.
1220         (gimple_eh_dispatch_set_region): Require a gimple_eh_dispatch
1221         rather than a plain gimple.
1223         * tree-cfg.c (make_edges): Add a checked cast to gimple_eh_dispatch
1224         within GIMPLE_EH_DISPATCH case of switch statement.
1225         (gimple_verify_flow_info): Likewise.
1226         (gimple_redirect_edge_and_branch): Likewise.
1227         (move_stmt_r): Likewise, adding a local.
1229         * tree-eh.c (emit_eh_dispatch): Convert local from gimple to
1230         gimple_eh_dispatch.
1231         (make_eh_dispatch_edges): Require a gimple_eh_dispatch rather than
1232         a plain gimple.
1233         (redirect_eh_dispatch_edge): Likewise.
1234         (lower_eh_dispatch): Likewise.
1235         (execute_lower_eh_dispatch): Add a checked cast to
1236         gimple_eh_dispatch.
1237         (mark_reachable_handlers): Likewise.
1238         (verify_eh_dispatch_edge): Require a gimple_eh_dispatch rather
1239         than a plain gimple.
1241         * tree-eh.h (make_eh_dispatch_edges): Likewise.
1242         (redirect_eh_dispatch_edge): Likewise.
1243         (verify_eh_dispatch_edge): Likewise.
1245         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1246         gimple_eh_dispatch within GIMPLE_EH_DISPATCH case of switch
1247         statement, adding a local.
1248         (copy_edges_for_bb): Add a checked cast to gimple_eh_dispatch.
1250 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1252         Introduce gimple_resx
1254         * coretypes.h (gimple_resx): New typedef.
1255         (const_gimple_resx): New typedef.
1257         * gimple.h (gimple_build_resx): Return a gimple_resx rather than a
1258         plain gimple.
1259         (gimple_resx_region): Require a const_gimple_resx rather than a
1260         plain const_gimple.
1261         (gimple_resx_set_region): Require a gimple_resx rather than a
1262         plain gimple.
1264         * gimple-pretty-print.c (dump_gimple_resx): Require a gimple_resx
1265         rather than a plain gimple.
1266         (pp_gimple_stmt_1): Add a checked cast to gimple_resx within
1267         GIMPLE_RESX case of switch statement.
1269         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1271         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1273         * gimple.c (gimple_build_resx): Return a gimple_resx rather than
1274         a plain gimple.
1276         * tree-cfg.c (move_stmt_r): Add a checked cast to gimple_resx
1277         within GIMPLE_RESX case of switch statement, adding a new local.
1279         * tree-eh.c (emit_resx): Convert local "x" from gimple to
1280         gimple_resx.
1281         (lower_resx): Require a gimple_resx rather than a plain gimple.
1282         (pass_lower_resx::execute): Add a checked cast to gimple_resx.
1283         (mark_reachable_handlers): Likewise.
1285         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1286         gimple_resx within GIMPLE_RESX case of switch statement, adding
1287         a new local.
1289 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1291         Introduce gimple_eh_else
1293         * coretypes.h (gimple_eh_else): New typedef.
1294         (const_gimple_eh_else): New typedef.
1296         * gimple.h (gimple_build_eh_else): Return a gimple_eh_else rather
1297         than a plain gimple.
1298         (gimple_eh_else_n_body_ptr): Require a gimple_eh_else rather than
1299         a plain gimple.
1300         (gimple_eh_else_n_body): Likewise.
1301         (gimple_eh_else_e_body_ptr): Likewise.
1302         (gimple_eh_else_e_body): Likewise.
1303         (gimple_eh_else_set_n_body): Likewise.
1304         (gimple_eh_else_set_e_body): Likewise.
1306         * gimple-low.c (lower_stmt): Add checked cast to gimple_eh_else
1307         within GIMPLE_EH_ELSE case of switch statement, introducing a new
1308         local.
1309         (gimple_stmt_may_fallthru): Likewise.
1311         * gimple-pretty-print.c (dump_gimple_eh_else): Require a
1312         gimple_eh_else rather than a plain gimple.
1313         (pp_gimple_stmt_1): Add checked cast to gimple_eh_else within
1314         GIMPLE_EH_ELSE case of switch statement
1316         * gimple-walk.c (walk_gimple_stmt): Add checked cast to
1317         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1318         introducing a new local.
1320         * gimple.c (gimple_build_eh_else): Return a gimple_eh_else
1321         rather than a plain gimple.
1322         (gimple_copy): Add checked casts to gimple_eh_else within
1323         GIMPLE_EH_ELSE case of switch statement, introducing new locals.
1325         * tree-cfg.c (verify_gimple_in_seq_2): Add checked cast to
1326         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1327         introducing a new local.
1329         * tree-eh.c (collect_finally_tree): Likewise.
1330         (replace_goto_queue_1): Likewise.
1331         (get_eh_else): Return a gimple_eh_else rather than a plain gimple.
1332         (honor_protect_cleanup_actions): Convert local "eh_else" from
1333         gimple to gimple_eh_else.
1334         (lower_try_finally_nofallthru): Likewise.
1335         (lower_try_finally_onedest): Introduce locals "eh_else" and
1336         "label_stmt", using them in favor of "x" for the gimple_eh_else
1337         and the gimple_label.
1338         (lower_try_finally_copy): Convert local "eh_else" from gimple to
1339         gimple_eh_else.
1340         (lower_try_finally_switch): Likewise.
1341         (decide_copy_try_finally): Likewise.
1342         (refactor_eh_r): Add checked cast to gimple_eh_else within
1343         GIMPLE_EH_ELSE case of switch statement, introducing a new local.
1345 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1347         Introduce gimple_eh_must_not_throw
1349         * coretypes.h (gimple_eh_must_not_throw): New typedef.
1350         (const_gimple_eh_must_not_throw): New typedef.
1352         * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
1353         a gimple_eh_must_not_throw rather than a plain gimple.
1354         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
1355         within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
1357         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1359         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1361         * gimple.c (gimple_build_eh_must_not_throw): Return a
1362         gimple_eh_must_not_throw rather than a plain gimple.
1364         * gimple.h (gimple_build_eh_must_not_throw): Return a
1365         gimple_eh_must_not_throw rather than a plain gimple.
1366         (gimple_eh_must_not_throw_fndecl): Require a
1367         gimple_eh_must_not_throw rather than a plain gimple.
1368         (gimple_eh_must_not_throw_set_fndecl): Likewise.
1370         * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
1372 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1374         Introduce gimple_eh_filter
1376         * coretypes.h (gimple_eh_filter): New typedef.
1377         (const_gimple_eh_filter): New typedef.
1379         * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
1380         rather than a plain gimple.
1382         * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
1383         gimple_eh_filter rather than a plain gimple.
1384         (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
1385         GIMPLE_EH_FILTER case of switch statement.
1387         * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
1388         rather than a plain gimple.
1390 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1392         Introduce gimple_catch
1394         * coretypes.h (gimple_catch): New typedef.
1395         (const_gimple_catch): New typedef.
1397         * gimple-low.c (lower_try_catch): Add checked cast to gimple_catch.
1398         (gimple_try_catch_may_fallthru): Likewise.
1400         * gimple-pretty-print.c (dump_gimple_catch): Require a gimple_catch
1401         rather than a plain gimple.
1402         (pp_gimple_stmt_1): Add checked cast to gimple_catch within
1403         GIMPLE_CATCH case of switch statement.
1405         * gimple-walk.c (walk_gimple_op): Likewise.
1406         (walk_gimple_stmt): Likewise.
1408         * gimple.c (gimple_build_catch): Return a gimple_catch rather than
1409         a plain gimple.
1410         (gimple_copy): Add checked casts to gimple_catch within
1411         GIMPLE_CATCH case of switch statement, introducing new locals.
1413         * gimple.h (gimple_build_catch): Return a gimple_catch rather than
1414         a plain gimple.
1415         (gimple_catch_types_ptr): Require a gimple_catch rather than a
1416         plain gimple.
1417         (gimple_catch_handler_ptr): Likewise.
1418         (gimple_catch_handler): Likewise.
1419         (gimple_catch_set_types): Likewise.
1420         (gimple_catch_set_handler): Likewise.
1422         * omp-low.c (lower_omp_1): Add checked cast to gimple_catch within
1423         GIMPLE_CATCH case of switch statement.
1425         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
1426         (do_warn_unused_result): Likewise.
1428         * tree-eh.c (collect_finally_tree): Likewise.
1429         (replace_goto_queue_1): Likewise.
1430         (lower_catch): Convert local from gimple to gimple_catch.
1431         (refactor_eh_r): Add checked cast to gimple_catch within
1432         GIMPLE_CATCH case of switch statement.
1434         * tree-inline.c (remap_gimple_stmt): Likewise.
1435         (estimate_num_insns): Add checked cast to gimple_catch within
1436         GIMPLE_CATCH case of switch statement, introducing new local.
1438 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1440         Introduce gimple_transaction
1442         * coretypes.h (gimple_transaction): New typedef.
1443         (const_gimple_transaction): New typedef.
1445         * gimple.h (gimple_build_transaction): Return a gimple_transaction
1446         rather than a plain gimple.
1447         (gimple_transaction_body_ptr): Require a gimple_transaction rather
1448         than a plain gimple.
1449         (gimple_transaction_body): Likewise.
1450         (gimple_transaction_label_ptr): Likewise.
1451         (gimple_transaction_set_body): Likewise.
1452         (gimple_transaction_set_label): Likewise.
1453         (gimple_transaction_set_subcode): Likewise.
1454         (gimple_transaction_label): Require a const_gimple_transaction
1455         rather than a plain const_gimple.
1456         (gimple_transaction_subcode): Likewise.
1458         * gimple-low.c (lower_stmt): Add checked cast to
1459         gimple_transaction within GIMPLE_TRANSACTION case of switch
1460         statement.
1462         * gimple-pretty-print.c (dump_gimple_transaction): Require a
1463         gimple_transaction rather than a plain gimple.
1464         (pp_gimple_stmt_1): Add checked cast to gimple_transaction within
1465         GIMPLE_TRANSACTION case of switch statement.
1466         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1467         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1468         * gimple-walk.c (walk_gimple_op): Likewise.
1469         (walk_gimple_stmt): Likewise.
1471         * gimple.c (gimple_build_transaction): Return a gimple_transaction
1472         rather than a plain gimple.
1473         (gimple_copy): Add checked casts to gimple_transaction within
1474         GIMPLE_TRANSACTION case of switch statement.
1476         * gimplify.c (gimplify_transaction): Split local "g" into
1477         "body_stmt" and "trans_stmt", strengthening the type of the latter
1478         from gimple to gimple_transaction.
1480         * omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
1481         within GIMPLE_TRANSACTION case of switch statement.
1483         * trans-mem.c (diagnose_tm_1): Add checked cast within
1484         GIMPLE_TRANSACTION case of switch statement, introducing a new
1485         local "trans_stmt".  Use it in place of "stmt".
1486         (examine_call_tm): Convert local from gimple to gimple_transaction.
1487         (tm_region::get_transaction_stmt): New method.
1488         (tm_region::transaction_stmt): Add clarification of type to the
1489         comment.
1490         (tm_region_init_0): Require a gimple_transaction rather than a
1491         plain gimple.
1492         (tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
1493         dyn_cast<gimple_transaction> and new local.
1494         (transaction_subcode_ior): Add a new local, using the new
1495         get_transaction_stmt method to perform a checked cast.
1496         (propagate_tm_flags_out): Likewise.
1497         (expand_transaction): Add a checked cast using the new
1498         get_transaction_stmt method.
1499         (generate_tm_state): Likewise.
1500         (execute_tm_mark): Likewise.
1501         (ipa_tm_diagnose_transaction): Likewise.
1503         * tree-cfg.c (verify_gimple_transaction): Require a
1504         gimple_transaction rather than a plain gimple.
1505         (make_edges): Add checked cast within GIMPLE_TRANSACTION case of
1506         switch statement
1507         (cleanup_dead_labels): Likewise.
1508         (verify_gimple_stmt): Likewise.
1509         (verify_gimple_in_seq_2): Likewise.
1510         (verify_gimple_in_seq_2): Likewise.
1511         (gimple_redirect_edge_and_branch): Add checked cast.
1513         * tree-inline.c (remap_gimple_stmt): Add checked cast within
1514         GIMPLE_TRANSACTION case of switch statement, introducing a new
1515         local "old_trans_stmt".  Use it in place of "stmt".  Add new
1516         local "new_trans_stmt", using it to initialize "copy", and for
1517         type-safe operations as a transaction.
1518         (estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
1519         case of switch statement.
1521 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1523         Introduce gimple_asm
1525         * coretypes.h (gimple_asm): New typedef.
1526         (const_gimple_asm): New typedef.
1528         * gimple.h (gimple_build_asm_vec): Return a gimple_asm rather than
1529         just a gimple.
1530         (gimple_asm_clobbers_memory_p): Require a const_gimple_asm rather
1531         than just a const_gimple.
1532         (gimple_asm_ninputs): Likewise.
1533         (gimple_asm_noutputs): Likewise.
1534         (gimple_asm_nclobbers): Likewise.
1535         (gimple_asm_nlabels): Likewise.
1536         (gimple_asm_input_op): Likewise.
1537         (gimple_asm_input_op_ptr): Likewise.
1538         (gimple_asm_output_op): Likewise.
1539         (gimple_asm_output_op_ptr): Likewise.
1540         (gimple_asm_clobber_op): Likewise.
1541         (gimple_asm_label_op): Likewise.
1542         (gimple_asm_string): Likewise.
1543         (gimple_asm_volatile_p): Likewise.
1544         (gimple_asm_input_p): Likewise.
1545         (gimple_asm_set_input_op): Require a gimple_asm rather than a plain
1546         gimple.
1547         (gimple_asm_set_output_op): Likewise.
1548         (gimple_asm_set_clobber_op): Likewise.
1549         (gimple_asm_set_label_op): Likewise.
1550         (gimple_asm_set_volatile): Likewise.
1551         (gimple_asm_set_input): Likewise.
1553         * cfgexpand.c (expand_asm_stmt): Require a gimple_asm rather than
1554         a plain gimple.
1555         (expand_gimple_stmt_1): Add checked cast to gimple_asm within
1556         GIMPLE_ASM case of switch statement.
1558         * gimple-fold.c (fold_stmt_1): Add new local from checked cast to
1559         gimple_asm within case GIMPLE_ASM.
1561         * gimple-pretty-print.c (dump_gimple_asm): Require a gimple_asm
1562         rather than a plain gimple.
1563         (pp_gimple_stmt_1): Add checked cast to gimple_asm within
1564         GIMPLE_ASM case of switch statement.
1566         * gimple-streamer-in.c (input_gimple_stmt): Rework existing
1567         checked cast to gimple_asm; add a new one.
1569         * gimple-streamer-out.c (output_gimple_stmt): Add new local from
1570         checked cast to gimple_asm within case GIMPLE_ASM.
1572         * gimple-walk.c (walk_gimple_asm): Require a gimple_asm rather
1573         than a plain gimple.
1574         (walk_gimple_op): Add checked cast to gimple_asm within GIMPLE_ASM
1575         case of switch statement.
1576         (walk_stmt_load_store_addr_ops): Use dyn_cast<gimple_asm> in place
1577         of a code check against GIMPLE_ASM to introduce a new gimple_asm
1578         local.
1580         * gimple.c (gimple_build_asm_1): Return a gimple_asm rather than
1581         a plain gimple.
1582         (gimple_build_asm_vec): Likewise.
1583         (gimple_has_side_effects): Add a checked cast to gimple_asm.
1584         (gimple_could_trap_p_1): Likewise.
1585         (gimple_call_builtin_p): Require a const_gimple_asm rather then
1586         a const_gimple.
1588         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
1589         and a new local of type gimple_asm within GIMPLE_ASM case.
1591         * gimplify.c (gimplify_asm_expr): Convert a local from gimple to
1592         gimple_asm.
1594         * ipa-pure-const.c (check_stmt): Add checked casts within
1595         GIMPLE_ASM case.
1597         * ssa-iterators.h (op_iter_init): Likewise.
1599         * tree-cfg.c (make_goto_expr_edges): Convert a local from gimple
1600         to gimple_asm.
1601         (cleanup_dead_labels): Add a checked cast and a new local of type
1602         gimple_asm within GIMPLE_ASM case.
1603         (gimple_redirect_edge_and_branch): Likewise.
1604         (is_ctrl_altering_stmt): Add a checked cast.
1605         (need_fake_edge_p): Replace a code check against GIMPLE_ASM with a
1606         dyn_cast<gimple_asm>.
1608         * tree-complex.c (expand_complex_comparison): Convert a local from
1609         gimple to gimple_asm.
1611         * tree-data-ref.c (get_references_in_stmt): Add a checked cast to
1612         gimple_asm.
1614         * tree-eh.c (stmt_could_throw_p): Likewise.
1616         * tree-inline.c (estimate_num_insns): Likewise.
1618         * tree-sra.c (scan_function): Add a checked cast and a new local
1619         of type gimple_asm within GIMPLE_ASM case.
1620         (sra_modify_function_body): Likewise.
1621         (ipa_sra_modify_function_body): Likewise.
1623         * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
1625         * tree-ssa-dce.c (propagate_necessity): Replace a code check
1626         against GIMPLE_ASM with a dyn_cast<gimple_asm>.
1628         * tree-ssa-operands.c (maybe_add_call_vops): Require a gimple_asm
1629         rather than a plain gimple.
1630         (parse_ssa_operands): Add a checked cast to gimple_asm.
1632         * tree-ssa-structalias.c (find_func_aliases): Replace a check for
1633         GIMPLE_ASM with a dyn_cast<gimple_asm>, introducing  a new local
1634         "asm_stmt", using it in place of "t" for typesafety.
1636         * tree-ssa-threadedge.c
1637         (record_temporary_equivalences_from_stmts_at_dest): Add a checked
1638         cast to gimple_asm.
1640         * tree-ssa.c (execute_update_addresses_taken): Add checked casts
1641         and new locals of type gimple_asm within clauses guarded by code
1642         check.
1644 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1646         Introduce gimple_goto
1648         * coretypes.h (gimple_goto): New typedef.
1649         (const_gimple_goto): New typedef.
1651         * gimple.h (gimple_statement_goto): New subclass of
1652         gimple_statement_with_ops, adding the invariant that
1653         stmt->code == GIMPLE_GOTO.
1654         (is_a_helper <gimple_statement_goto>::test): New.
1655         (gimple_build_goto): Return a gimple_goto rather than a
1656         plain gimple.
1658         * gimple-pretty-print.c (dump_gimple_goto): Require a gimple_goto
1659         rather than a plain gimple.
1660         (pp_gimple_stmt_1): Add a checked cast to gimple_goto within
1661         GIMPLE_GOTO case of switch statement.
1663         * gimple.c (gimple_build_goto): Return a gimple_goto rather than a
1664         plain gimple.
1666         * tree-cfg.c (verify_gimple_goto): Require a gimple_goto rather
1667         than a plain gimple.
1668         (verify_gimple_stmt): Add a checked cast to gimple_goto within
1669         GIMPLE_GOTO case of switch statement.
1671 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1673         Introduce gimple_return
1675         * coretypes.h (gimple_return): New typedef.
1676         (const_gimple_return): New typedef.
1678         * gimple.h (gimple_statement_return): New subclass of
1679         gimple_statement_with_memory_ops, adding the invariant that
1680         stmt->code == GIMPLE_RETURN.
1681         (is_a_helper <gimple_statement_return>::test): New.
1682         (gimple_build_return): Return a gimple_return rather
1683         than a plain gimple.
1685         * gimple.c (gimple_build_return): Return a gimple_return rather
1686         than a plain gimple.
1688         * cgraphunit.c (expand_thunk): Convert local from a gimple to
1689         a gimple_return.
1691         * gimple-low.c (struct return_statements_t): Convert field "stmt"
1692         from a gimple to a gimple_return.
1693         (lower_gimple_return): Convert local from a gimple to a
1694         gimple_return.
1696         * gimple-pretty-print.c (dump_gimple_return): Require a
1697         gimple_return rather than a plain gimple.
1698         (pp_gimple_stmt_1): Add a checked cast to gimple_return within
1699         case GIMPLE_RETURN of switch statement.
1701         * gimplify.c (gimplify_return_expr): Convert locals from
1702         gimple to gimple_return.
1704         * ipa-split.c (split_function): Likewise.
1706         * tree-cfg.c (verify_gimple_assign): Require a gimple_return
1707         rather than a plain gimple.
1708         (verify_gimple_stmt): Add checked cast to gimple_return within
1709         case GIMPLE_RETURN of switch statement.
1711         * tree-tailcall.c (adjust_return_value): Convert local from
1712         gimple to gimple_return.
1714 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1716         Introduce gimple_call
1718         * coretypes.h (gimple_call): New typedef.
1719         (const_gimple_call): New typedef.
1721         * asan.c (get_mem_refs_of_builtin_call): Require a
1722         const_gimple_call rather than a const gimple.
1723         (has_stmt_been_instrumented_p): Add a checked cast to
1724         gimple_call.
1725         (instrument_strlen_call): Likewise.
1726         (instrument_builtin_call): Likewise.
1727         * builtins.c (validate_gimple_arglist): Require a
1728         const_gimple_call rather than a const gimple.
1729         (fold_call_stmt): Require a gimple_call rather than a gimple.
1730         * builtins.h (validate_gimple_arglist): Require a
1731         const_gimple_call rather than a const gimple.
1732         (fold_call_stmt): Require a gimple_call rather than a gimple.
1733         * cfgexpand.c (expand_call_stmt): Likewise.
1734         (expand_gimple_stmt_1): Add a checked cast to gimple_call within
1735         GIMPLE_CALL case.
1736         * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Strengthen
1737         local "new_stmt" from gimple to gimple_call, adding a checked
1738         cast.
1739         * cgraphunit.c (cgraph_node::expand_thunk): Likewise for local
1740         "call".
1741         * gimple-fold.c (gimple_fold_builtin_snprintf_chk): Likewise for
1742         local "stmt".
1743         (gimple_fold_builtin_snprintf): Likewise.
1744         (gimple_fold_builtin): Likewise.
1745         (gimple_fold_call): Likewise.
1746         (gimple_fold_stmt_to_constant_1): Introduce local "call_stmt" via
1747         checked cast of "stmt" to gimple_call, using it in various places
1748         for typesafety.
1749         * gimple-pretty-print.c (dump_gimple_call_args): Strengthen param
1750         2 from gimple to gimple_call.
1751         (dump_gimple_call): Likewise.
1752         (pp_gimple_stmt_1): Add a checked cast to gimple_call within
1753         GIMPLE_CALL case.
1754         * gimple-streamer-in.c (input_gimple_stmt): Replace is_gimple_call
1755         with a dyn_cast<gimple_call>, introducing local "call_stmt", and
1756         using it in place of "stmt" for typesafety.  Add a checked cast
1757         in statement guarded by check for GIMPLE_CALL.
1758         * gimple-walk.c (walk_gimple_op): Add a checked cast to
1759         gimple_call.
1760         * gimple.c (gimple_call_reset_alias_info): Strengthen param from
1761         gimple to gimple_call.
1762         (gimple_build_call_1): Strengthen return type and local from
1763         gimple to gimple_call.
1764         (gimple_build_call_vec): Likewise.
1765         (gimple_build_call): Likewise.
1766         (gimple_build_call_valist): Likewise.
1767         (gimple_build_call_internal_1): Likewise.
1768         (gimple_build_call_internal): Likewise.
1769         (gimple_build_call_internal_vec): Likewise.
1770         (gimple_build_call_from_tree): Likewise.
1771         (gimple_call_return_flags): Strengthen param from
1772         const_gimple to const_gimple_call.
1773         (gimple_call_copy_skip_args): Strengthen return type and local from
1774         gimple to gimple_call.
1775         * gimple.h (gimple_call_reset_alias_info): Strengthen param from
1776         gimple to gimple_call.
1777         (gimple_build_call_vec): Strengthen return type from gimple to
1778         gimple_call.
1779         (gimple_build_call): Likewise.
1780         (gimple_build_call_valist): Likewise.
1781         (gimple_build_call_internal): Likewise.
1782         (gimple_build_call_internal_vec): Likewise.
1783         (gimple_build_call_from_tree): Likewise.
1784         (gimple_call_return_flags): Strengthen param from const_gimple to
1785         const_gimple_call.
1786         (gimple_call_copy_skip_args): Strengthen return type from gimple
1787         to gimple_call.
1788         (gimple_call_set_internal_fn): Strengthen param "call_stmt" from
1789         gimple to gimple_call.
1790         (gimple_call_return_type): Strengthen param from const_gimple to
1791         const_gimple_call.
1792         (gimple_call_chain_ptr): Likewise.
1793         (gimple_call_set_chain): Strengthen param from gimple to
1794         gimple_call.
1795         (gimple_call_set_return_slot_opt): Likewise.
1796         (gimple_call_set_from_thunk): Likewise.
1797         (gimple_call_from_thunk_p): Likewise.
1798         (gimple_call_set_va_arg_pack): Likewise.
1799         (gimple_call_va_arg_pack_p): Likewise.
1800         (gimple_call_set_alloca_for_var): Likewise.
1801         (gimple_call_alloca_for_var_p): Likewise.
1802         (gimple_expr_type): Introduce local "call_stmt" via a checked cast
1803         and use it for typesafety.
1804         * gimplify.c (gimplify_call_expr): Strengthen local "call" from
1805         gimple to gimple_call.
1806         (gimplify_modify_expr_to_memcpy): Likewise for local "gs".
1807         (gimplify_modify_expr_to_memset): Likewise.
1808         (gimplify_modify_expr): Add a checked cast to gimple_call.
1809         (gimplify_expr): Strengthen local "call" from gimple to
1810         gimple_call.
1811         (gimplify_function_tree): Likewise.
1812         * internal-fn.c (expand_LOAD_LANES): Strengthen param from gimple
1813         to gimple_call.
1814         (expand_STORE_LANES): Likewise.
1815         (expand_ANNOTATE): Likewise.
1816         (expand_GOMP_SIMD_LANE): Likewise.
1817         (expand_GOMP_SIMD_VF): Likewise.
1818         (expand_GOMP_SIMD_LAST_LANE): Likewise.
1819         (expand_UBSAN_NULL): Likewise.
1820         (expand_UBSAN_BOUNDS): Likewise.
1821         (expand_UBSAN_OBJECT_SIZE): Likewise.
1822         (expand_ASAN_CHECK): Likewise.
1823         (ubsan_expand_si_overflow_addsub_check): Likewise.
1824         (ubsan_expand_si_overflow_neg_check): Likewise.
1825         (ubsan_expand_si_overflow_mul_check): Likewise.
1826         (expand_UBSAN_CHECK_ADD): Likewise.
1827         (expand_UBSAN_CHECK_SUB): Likewise.
1828         (expand_UBSAN_CHECK_MUL): Likewise.
1829         (expand_LOOP_VECTORIZED): Likewise.
1830         (expand_MASK_LOAD): Likewise.
1831         (expand_MASK_STORE): Likewise.
1832         (expand_ABNORMAL_DISPATCHER): Likewise.
1833         (expand_BUILTIN_EXPECT): Likewise.
1834         (internal_fn_expanders): Likewise for entries in this table.
1835         (expand_internal_call): Likewise.
1836         * internal-fn.def: Update comment to reflect strengthening of
1837         param of expanders.
1838         * internal-fn.h (expand_internal_call): Strengthen param from
1839         gimple to gimple_call.
1840         * ipa-prop.c (ipa_modify_call_arguments): Likewise for local
1841         "new_stmt".
1842         * ipa-pure-const.c (check_call): Likewise for param "call".
1843         (check_stmt): Add a checked cast to gimple_call within GIMPLE_CALL
1844         case.
1845         * ipa-split.c (split_function): Strengthen local "call" from
1846         gimple to gimple_call.
1847         * omp-low.c (build_omp_barrier): Likewise for local "g".
1848         (lower_rec_input_clauses): Likewise for local "stmt".
1849         * trans-mem.c (build_tm_load): Likewise for return type and local
1850         "gcall".
1851         (build_tm_store): Likewise.
1852         (expand_transaction): Likewise for local "call".
1853         * tree-call-cdce.c (check_pow): Likewise for param.
1854         (check_builtin_call): Likewise.
1855         (is_call_dce_candidate): Likewise.
1856         (gen_conditions_for_pow): Likewise.
1857         (gen_shrink_wrap_conditions): Likewise.
1858         (shrink_wrap_one_built_in_call): Likewise.
1859         (shrink_wrap_conditional_dead_built_in_calls): Strengthen param
1860         from vec<gimple> to vec<gimple_call>, and local "bi_call" from
1861         gimple to gimple_call.
1862         (pass_call_cdce::execute): Strengthen local
1863         "cond_dead_built_in_calls" from auto_vec<gimple> to
1864         auto_vec<gimple_call> and local "stmt" from gimple to gimple_call,
1865         * tree-cfg.c (notice_special_calls): Strengthen param from gimple
1866         to gimple_call.
1867         * tree-cfg.h (notice_special_calls): Likewise.
1868         * tree-complex.c (expand_complex_libcall): Likewise for local
1869         "stmt".
1870         * tree-inline.c (remap_gimple_stmt): Add checked cast to
1871         gimple_call.
1872         (copy_bb): Likewise.  Strengthen local "new_call" from gimple to
1873         gimple_call.
1874         (inline_forbidden_p_stmt): Add checked cast to gimple_call.
1875         * tree-nested.c (init_tmp_var_with_call): Strengthen param "call"
1876         from gimple to gimple_call.
1877         (convert_nl_goto_reference): Likewise for local "call".
1878         (convert_tramp_reference_op): Likewise.
1879         (convert_gimple_call): Add checked cast to gimple_call.
1880         * tree-nrv.c (dest_safe_for_nrv_p): Strengthen param "call" from
1881         gimple to gimple_call.
1882         (pass_return_slot::execute): Likewise for local "stmt", using a
1883         dyn_cast<gimple_call> rather than an is_gimple_call call.
1884         * tree-object-size.c (alloc_object_size): Strengthen param "call"
1885         from const_gimple to const_gimple_call.
1886         (pass_through_call): Likewise.
1887         (call_object_size): Strengthen param "call" from gimple to
1888         gimple_call.
1889         (collect_object_sizes_for): Introduce local "call_stmt" via a
1890         checked cast, using it for typesafety.
1891         (check_for_plus_in_loops_1): Likewise.
1892         (pass_object_sizes::execute): Add a checked cast to gimple_call.
1893         * tree-profile.c (gimple_gen_interval_profiler): Strengthen local
1894         "call" from gimple to gimple_call.
1895         (gimple_gen_pow2_profiler): Likewise.
1896         (gimple_gen_one_value_profiler): Likewise.
1897         (gimple_gen_time_profiler): Likewise.
1898         (gimple_gen_average_profiler): Likewise.
1899         (gimple_gen_ior_profiler): Likewise.
1900         * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise for
1901         param "call".
1902         (ref_maybe_used_by_call_p): Likewise.
1903         (ref_maybe_used_by_stmt_p): Add a checked cast to gimple_call.
1904         (call_may_clobber_ref_p_1): Strengthen param "call" from gimple to
1905         gimple_call.
1906         (call_may_clobber_ref_p): Likewise.
1907         (stmt_may_clobber_ref_p_1): Add a checked cast to gimple_call.
1908         * tree-ssa-alias.h (call_may_clobber_ref_p): Strengthen param 1
1909         from gimple to gimple_call.
1910         (call_may_clobber_ref_p_1): Likewise.
1911         * tree-ssa-dce.c (eliminate_unnecessary_stmts): Add a checked cast
1912         to gimple_call.
1913         * tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Strengthen
1914         local "call" from gimple to gimple_call.
1915         * tree-ssa-math-opts.c (build_and_insert_call): Likewise for local
1916         "call_stmt".
1917         * tree-ssa-operands.c (maybe_add_call_vops): Likewise for param
1918         "stmt".
1919         (parse_ssa_operands): Add a checked cast to gimple_call within
1920         GIMPLE_CALL case.
1921         * tree-ssa-pre.c (compute_avail): Add a checked cast to
1922         gimple_call.
1923         * tree-ssa-sccvn.c (copy_reference_ops_from_call): Strengthen
1924         param "call" from gimple to gimple_call.
1925         (valueize_shared_reference_ops_from_call): Likewise.
1926         (vn_reference_lookup_3): Add a checked cast to gimple_call.
1927         (vn_reference_lookup_call): Strengthen param "call" from gimple to
1928         gimple_call.
1929         (visit_reference_op_call): Likewise for param "stmt".
1930         (visit_use): Replace is_gimple_call with a dyn_cast, introducing
1931         local "call_stmt", using it in place of "stmt" for type-safety.
1932         * tree-ssa-sccvn.h (vn_reference_lookup_call): Strengthen param 1
1933         from gimple to gimple_call.
1934         * tree-ssa-structalias.c (get_call_vi): Likewise.
1935         (lookup_call_use_vi): Likewise.
1936         (lookup_call_clobber_vi): Likewise.
1937         (get_call_use_vi): Likewise.
1938         (get_call_clobber_vi): Likewise.
1939         (handle_rhs_call): Likewise.
1940         (handle_lhs_call): Likewise.
1941         (handle_const_call): Likewise.
1942         (handle_pure_call): Likewise.
1943         (get_fi_for_callee): Likewise.
1944         (find_func_aliases_for_builtin_call): Likewise for param 2.
1945         (find_func_aliases_for_call): Likewise.
1946         (find_func_aliases): Add a checked cast to gimple_call.
1947         (find_func_clobbers): Replace is_gimple_call with a dyn_cast,
1948         introducing local "call_stmt", using it in place of "stmt" for
1949         type-safety.
1950         (compute_points_to_sets): Strengthen local "stmt" from gimple to
1951         gimple_call, replacing is_gimple_call with a
1952         dyn_cast <gimple_call>.
1953         (ipa_pta_execute): Likewise.
1954         * tree-ssa-threadedge.c
1955         (record_temporary_equivalences_from_stmts_at_dest): Add checked
1956         cast to gimple_call.
1957         * tree-tailcall.c (find_tail_calls): Strengthen local "call" from
1958         gimple to gimple_call, adding a checked cast.
1959         * tree-vect-data-refs.c (vect_setup_realignment): Eliminate
1960         top-level local "new_stmt" in favor of more tightly-scoped locals
1961         "new_stmt" of type gimple_assign and gimple_call.
1962         * tree-vect-patterns.c (vect_recog_pow_pattern): Strenghthen local
1963         "stmt" from gimple to gimple_call.
1964         * tree-vect-stmts.c (vectorizable_function): Likewise for param
1965         "call".
1966         (vectorizable_call): Rename param 1 from "stmt" to "gs",
1967         reintroducing "stmt" as a gimple_call once we've established that
1968         we're working with a GIMPLE_CALL.
1969         * tree-vectorizer.h (vectorizable_function): Strengthen param 1
1970         from gimple to gimple_call.
1971         * value-prof.c (check_ic_target): Likewise.
1972         (gimple_ic_transform): Likewise for local "stmt", replacing a
1973         check for GIMPLE_CALL with a dyn_cast.
1974         (interesting_stringop_to_profile_p): Strengthen param "call"
1975         from gimple to gimple_call.
1976         (gimple_stringop_fixed_value): Likewise for param "vcall_stmt".
1977         (gimple_stringops_transform): Likewise for local "stmt",
1978         replacing a check for GIMPLE_CALL with a dyn_cast.
1979         (gimple_stringops_values_to_profile): Rename param 1 from "stmt"
1980         to "gs", reintroducing "stmt" as a gimple_call once we've
1981         established that we're working with a GIMPLE_CALL.
1982         * vtable-verify.c (verify_bb_vtables): Strengthen local
1983         "call_stmt" from gimple to gimple_call.
1985 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1987         Concretize get_loop_exit_condition et al to working on gimple_cond
1989         * tree-scalar-evolution.h (get_loop_exit_condition): Return a
1990         gimple_cond.
1991         * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
1992         concretizing local "res" from gimple to gimple_cond.
1993         * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
1994         locals from gimple to gimple_cond.
1995         (slpeel_can_duplicate_loop_p): Likewise.
1996         * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
1997         (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
1999 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2001         Update various expressions within tree-scalar-evolution.c to be gimple_phi
2003         * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
2004         rather than a gimple.
2005         (follow_ssa_edge_binary): Likewise.
2006         (follow_ssa_edge_expr): Likewise.
2007         (follow_ssa_edge_in_rhs): Likewise.
2008         (backedge_phi_arg_p): Likewise.
2009         (follow_ssa_edge_in_condition_phi_branch): Likewise.
2010         (follow_ssa_edge_in_condition_phi): Likewise.
2011         (follow_ssa_edge_inner_loop_phi): Likewise.
2012         (analyze_evolution_in_loop): Likewise.
2013         (analyze_initial_condition): Likewise.
2014         (interpret_loop_phi): Likewise.
2015         (interpret_condition_phi): Likewise.
2016         (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
2018         (analyze_scalar_evolution_1): Add checked casts to gimple_phi
2019         within "case GIMPLE_PHI".
2021 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2023         tree-ssa-loop-ivopts.c: use gimple_phi in a few places
2025         * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
2026         (find_bivs): Convert local "phi" into a gimple_phi.
2027         (mark_bivs): Likewise.
2029 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2031         tree-ssa-loop-manip.c: use gimple_phi in three places
2033         * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
2034         gimple_phi.
2035         (split_loop_exit_edge): Likewise for "phi" and "new_phi".
2037 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2039         tree-ssa-loop-niter.c: use gimple_phi in a few places
2041         * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
2042         rather than a gimple.
2043         (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
2044         (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
2046 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2048         tree-ssa-phiprop.c: use gimple_phi
2050         * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
2051         parameter "phi" and local "new_phi" from gimple to gimple_phi.
2053 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2055         tree-predcom.c: use gimple_phi in various places
2057         * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
2058         than just a gimple.
2059         (insert_looparound_copy): Require a gimple_phi rather than just a
2060         gimple.
2061         (add_looparound_copies): Convert local "phi" to be a gimple_phi.
2062         (initialize_root_vars): Likewise.
2063         (initialize_root_vars_lm): Likewise.
2065 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2067         tree-parloops.c: use gimple_phi in various places
2069         * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
2070         from gimple to gimple_phi.
2071         (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
2072         (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
2073         (gather_scalar_reductions): Convert to a gimple_phi_iterator and
2074         gimple_phi.
2075         (try_create_reduction_list): Likewise.
2077 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2079         Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
2081         * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
2082         type of parameter from gimple to gimple_phi.
2084         * tree-complex.c (complex_visit_phi): Update signature of callback
2085         implementation accordingly.
2086         * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
2087         * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
2088         * tree-vrp.c (vrp_visit_phi_node): Likewise.
2090         * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
2091         gimple_phi when invoking the ssa_prop_visit_phi callback.
2093 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2095         Introduce gimple_phi_iterator
2097         * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
2098         gimple_stmt_iterator with identical layout, but adding...
2099         (gimple_phi_iterator::phi): ...new method, equivalent to
2100         gsi_stmt (), but casting the underlying gimple to gimple_phi,
2101         checking that code == GIMPLE_PHI in a checked build.
2102         (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
2103         gimple_stmt_iterator.
2105         * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
2106         than just a gimple.
2107         (if_convertible_phi_p): Likewise.
2108         * tree-phinodes.h (add_phi_node_to_bb): Likewise.
2109         * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
2111         * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
2112         and a vec<gimple_phi> *, rather than just a gimple and
2113         vec<gimple> *, and a hash_set<gimple_phi> * rather than a
2114         hash_set<gimple> *.
2115         (find_uninit_use): Likewise; add checked cast to gimple_phi when
2116         adding to worklist.
2117         (pass_late_warn_uninitialized::execute): Strengthen types of
2118         various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
2119         "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
2120         gimple_phi, "added_to_worklist" from hash_set<gimple> to
2121         hash_set<gimple_phi>.
2123         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
2124         gimple_phi_iterator * rather than a gimple_stmt_iterator *;
2125         use it to strengthen local from a gimple to a gimple_phi.
2127         * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
2128         gimple_stmt_iterator to a gimple_phi_iterator.  Use the iterator's
2129         "phi" method rather than gsi_stmt.  Use this checked cast to convert
2130         the type of related local from a plain gimple to a gimple_phi.
2131         * gimple-pretty-print.c (dump_phi_nodes): Likewise.
2132         * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
2133         Likewise.
2134         * sese.c (sese_add_exit_phis_edge): Likewise.
2135         * tree-cfg.c (reinstall_phi_args): Likewise.
2136         (gimple_make_forwarder_block): Likewise.
2137         (add_phi_args_after_copy_edge): Likewise.
2138         (gimple_lv_adjust_loop_header_phi): Likewise.
2139         * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
2140         (remove_forwarder_block_with_phi): Likewise.
2141         (merge_phi_nodes): Likewise.
2142         * tree-complex.c (update_phi_components): Likewise.
2143         * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
2144         * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
2145         (copy_phis_for_bb): Likewise.
2146         * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
2147         * tree-outof-ssa.c (eliminate_build): Likewise.
2148         (eliminate_useless_phis): Likewise.
2149         (rewrite_trees): Likewise.
2150         (insert_backedge_copies): Likewise.
2151         * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
2152         (remove_phi_args): Likewise.
2153         (remove_phi_nodes): Likewise.
2154         * tree-predcom.c (find_looparound_phi): Likewise.
2155         (eliminate_temp_copies): Likewise.
2156         * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
2157         (scev_const_prop): Likewise; also, add checked cast to phi.
2158         * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
2159         * tree-ssa-dce.c (remove_dead_phis): Likewise.
2160         (forward_edge_to_pdom): Likewise.
2161         * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
2162         (cprop_into_successor_phis): Likewise.
2163         (propagate_rhs_into_lhs): Likewise.
2164         (eliminate_degenerate_phis_1): Likewise.
2165         * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
2166         * tree-ssa-live.c (calculate_live_on_exit): Likewise.
2167         (verify_live_on_entry): Likewise.
2168         * tree-ssa-loop-im.c
2169         (move_computations_dom_walker::before_dom_children): Likewise.
2170         * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
2171         (mark_bivs): Likewise.
2172         (find_interesting_uses_outside): Likewise.
2173         (determine_set_costs): Likewise.
2174         * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
2175         (tree_transform_and_unroll_loop): Likewise.
2176         (rewrite_all_phi_nodes_with_iv): Likewise.
2177         (canonicalize_loop_ivs): Likewise.
2178         * tree-ssa-loop-niter.c (determine_value_range): Likewise.
2179         * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
2180         * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
2181         * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
2182         * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
2183         (vop_phi): Likewise.
2184         * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
2185         Likewise.
2186         * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
2187         (copy_phi_args): Likewise.
2188         (phi_args_equal_on_edges): Likewise.
2189         * tree-ssa.c (ssa_redirect_edge): Likewise.
2190         (flush_pending_stmts): Likewise.
2191         * tree-switch-conversion.c (check_final_bb): Likewise.
2192         (gather_default_values): Likewise.
2193         (build_constructors): Likewise.
2194         (fix_phi_nodes): Likewise.
2195         * tree-tailcall.c (propagate_through_phis): Likewise.
2196         (add_successor_phi_arg): Likewise.
2197         * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
2198         Likewise.
2199         (slpeel_update_phi_nodes_for_guard2): Likewise.
2200         (slpeel_tree_peel_loop_to_edge): Likewise.
2201         (vect_can_advance_ivs_p): Likewise.
2202         (vect_update_ivs_after_vectorizer): Likewise.
2203         * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
2204         * tree-vrp.c (find_assert_locations): Likewise.
2205         * value-prof.c (gimple_ic): Likewise.
2207         * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
2209 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2211         Introduce gimple_phi and use it in various places
2213         * coretypes.h (gimple_phi): New typedef.
2214         (const_gimple_phi): New typedef.
2216         * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
2217         variants, using the gimple printer.
2219         * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
2220         vecs of more concrete gimple subclasses as appropriate; also the
2221         comment is about to become misleading.
2223         * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
2224         rather than spelling out the full type.
2225         (gimple_phi_num_args): Likewise.
2226         (gimple_phi_result): Likewise.
2227         (gimple_phi_result_ptr): Use gimple_phi typedef.
2228         (gimple_phi_set_result): Likewise.
2229         (gimple_phi_arg): Likewise.
2230         (gimple_phi_set_arg): Likewise.
2231         * tree-phinodes.c (allocate_phi_node): Likewise.
2232         (resize_phi_node): Likewise.
2233         (reserve_phi_args_for_new_edge): Likewise.
2234         (remove_phi_arg_num): Likewise.
2236         * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
2237         rather than just a gimple.
2238         * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
2240         * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
2241         just a gimple.
2242         (create_phi_node): Likewise.
2243         * tree-phinodes.h (create_phi_node): Likewise.
2245         * trans-mem.c (struct struct tm_log_entry): Replace use of
2246         now-removed gimple_vec with a plain vec<gimple>.
2248         * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
2249         vec<gimple_vec> to a vec< vec<gimple_phi> >.
2251         * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
2252         gimple_phi.
2253         * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
2254         "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
2255         a gimple_phi.
2256         * tree-into-ssa.c (delete_update_ssa): Strengthen local
2257         "phis" from a gimple_vec to a vec<gimple_phi>.
2259         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2260         gimple_phi in regions where a stmt is known to have code
2261         GIMPLE_PHI.
2262         * tree-into-ssa.c (mark_use_interesting): Likewise.
2264 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2266         Introduce gimple_debug and use it in a few places
2268         * coretypes.h (gimple_debug): New typedef.
2269         (const_gimple_debug): New typedef.
2271         * gimple.h (struct gimple_statement_debug): New subclass of
2272         gimple_statement_with_ops, adding the invariant that
2273         stmt->code == GIMPLE_DEBUG.
2274         (is_a_helper <gimple_statement_debug>::test): New.
2276         * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
2277         variants, using the gimple printer.
2279         * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
2280         rather than just a gimple.
2281         * tree-inline.c (copy_debug_stmt): Likewise.
2283         * tree-inline.h (struct copy_body_data): Strengthen field
2284         "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
2286         * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
2287         rather than just a gimple.
2288         (gimple_build_debug_source_bind_stat): Likewise.
2289         * gimple.h (gimple_build_debug_bind_stat): Likewise.
2290         (gimple_build_debug_source_bind_stat): Likewise.
2292         * tree-inline.c (remap_gimple_stmt): Update locals to be a
2293         gimple_debug.
2294         (maybe_move_debug_stmts_to_successors): Likewise.
2295         (copy_debug_stmts): Likewise.
2297         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2298         gimple_debug in regions where a stmt is known to have code
2299         GIMPLE_DEBUG.
2301 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2303         Introduce gimple_label and use it in a few places
2305         * coretypes.h (gimple_label): New typedef.
2306         (const_gimple_label): New typedef.
2308         * gimple.h (struct gimple_statement_label): New subclass of
2309         gimple_statement_with_ops, adding the invariant that
2310         stmt->code == GIMPLE_LABEL.
2311         (is_a_helper <gimple_statement_label>::test): New.
2313         * gdbhooks.py (build_pretty_printer): Add gimple_label and its
2314         variants, reusing the gimple printer.
2316         * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
2317         rather than just a gimple.
2318         * tree-cfg.c (verify_gimple_label): Likewise.
2320         * gimple.c (gimple_build_label): Return a gimple_label rather than
2321         just a gimple.
2322         * gimple.h (gimple_build_label): Likewise.
2324         * gimplify.c (gimplify_case_label_expr): Update local to be a
2325         gimple_label.
2326         * tree-switch-conversion.c (gen_inbound_check): Likewise.
2328         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2329         gimple_label in regions where a stmt is known to have code
2330         GIMPLE_LABEL.
2331         * tree-cfg.c (verify_gimple_stmt): Likewise.
2333 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2335         Introduce gimple_assign and use it in various places
2337         * coretypes.h (gimple_assign): New typedef.
2338         (const_gimple_assign): New typedef.
2340         * gimple.h (struct gimple_statement_assign): New subclass of
2341         gimple_statement_with_memory_ops, adding the invariant that
2342         stmt->code == GIMPLE_ASSIGN.
2343         (is_a_helper <gimple_statement_assign>::test): New.
2345         * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
2346         variants, using the gimple printer.
2348         * gimple-builder.c (build_assign): Return a gimple_assign rather
2349         than just a gimple from each of the overloaded variants.
2350         (build_type_cast): Likewise.
2351         * gimple-builder.h (build_assign): Likewise.
2352         (build_type_cast): Likewise.
2353         * gimple.c (gimple_build_assign_stat): Likewise.
2354         (gimple_build_assign_with_ops): Likewise.
2355         * gimple.h (gimple_build_assign_stat): Likewise.
2356         (gimple_build_assign_with_ops): Likewise.
2358         * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
2359         rather than just a "const gimple" (the latter is not a
2360         "const_gimple").
2361         * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
2362         rather than just a gimple.
2363         (dump_binary_rhs): Likewise.
2364         (dump_ternary_rhs): Likewise.
2365         * tree-cfg.c (verify_gimple_assign_unary): Likewise.
2366         (verify_gimple_assign_binary): Likewise.
2367         (verify_gimple_assign_ternary): Likewise.
2368         (verify_gimple_assign_single): Likewise.
2369         (verify_gimple_assign): Likewise.
2370         * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
2371         (try_to_simplify): Likewise.
2372         * tree-tailcall.c (process_assignment): Likewise.
2373         * tree-vect-generic.c (expand_vector_operation): Likewise.
2374         * tree-vrp.c (extract_range_from_cond_expr): Likewise.
2375         (extract_range_from_assignment): Likewise.
2377         * asan.c (has_stmt_been_instrumented_p): Add checked cast to
2378         gimple_assign in regions where a stmt is known to have code
2379         GIMPLE_ASSIGN.
2380         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2381         * tree-cfg.c (verify_gimple_stmt): Likewise.
2382         * tree-ssa-sccvn.c (visit_use): Likewise.
2383         * tree-tailcall.c (find_tail_calls): Likewise.
2384         * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
2386         * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
2387         against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
2388         a gimple_assign local.
2390         * tree-vect-generic.c (expand_vector_condition): Convert local to a
2391         gimple_assign, adding a checked cast when extracting from gsi, since
2392         this is only called when  underlying stmt has code GIMPLE_ASSIGN.
2393         (optimize_vector_constructor): Likewise.
2394         (lower_vec_perm): Likewise.
2395         (expand_vector_operations_1): Convert local to a gimple_assign,
2396         introducing a dyn_cast.
2398 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2400         Introduce gimple_cond and use it in various places
2402         * coretypes.h (gimple_cond): New typedef.
2403         (const_gimple_cond): Likewise.
2405         * gimple.h (struct gimple_statement_cond): New subclass of
2406         gimple_statement_with_ops, adding the invariant that
2407         stmt->code == GIMPLE_COND.
2408         (is_a_helper <gimple_statement_cond>::test): New.
2409         (gimple_build_cond): Return a gimple_cond, rather than just
2410         a gimple.
2411         (gimple_build_cond_from_tree): Likewise.
2413         * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
2414         variants, using the gimple printer.
2416         * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
2417         than just a gimple.
2418         * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
2419         (gimple_cond_true_p): Likewise.
2420         (gimple_cond_false_p): Likewise.
2421         (gimple_cond_set_condition): Likewise.
2422         * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
2423         * gimple-fold.c (fold_gimple_cond): Likewise.
2424         * gimple-pretty-print.c (dump_gimple_cond): Likewise.
2425         * tree-ssa-dom.c (canonicalize_comparison): Likewise.
2426         * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
2427         * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
2428         (recognize_bits_test): Likewise.
2429         * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
2430         (thread_around_empty_blocks): Likewise.
2431         (thread_through_normal_block): Likewise.
2432         (thread_across_edge): Likewise.
2433         * tree-ssa-threadedge.h (thread_across_edge): Likewise.
2434         * tree-vrp.c (range_fits_type_p): Likewise.
2436         * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
2437         gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
2438         * gimple-fold.c (fold_stmt_1): Likewise.
2439         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2440         * tree-ssa-dom.c (optimize_stmt): Likewise.
2441         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2442         * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
2443         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
2444         Likewise.
2445         * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
2447         * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
2448         gimple_cond.
2449         * tree-vrp.c (identify_jump_threads): Likewise.
2451         * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
2452         just a gimple.
2453         (gimple_build_cond_from_tree): Likewise.
2455         * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
2456         field "m_dummy_cond" from a plain gimple to a gimple_cond.
2458         * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
2459         inner_stmt and outer_stmt so that inner_cond and outer_cond can be
2460         of type gimple_cond once we know that we have code == GIMPLE_COND.
2461         * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
2462         "last" so that stmt can be of type gimple_cond.
2464 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2466         Introduce gimple_bind and use it for accessors.
2468         * coretypes.h (gimple_bind): New typedef.
2469         (const_gimple_bind): New typedef.
2471         * gdbhooks.py (build_pretty_printer): Add gimple_bind
2472         and its variants, using the gimple printer.
2474         * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
2475         require a gimple_bind rather than just a gimple.
2477         * gimple.c (gimple_build_bind): Return a gimple_bind rather than
2478         just a gimple.
2479         * gimple.h (gimple_build_bind): Likewise.
2481         * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
2483         * gimple.h (gimple_bind_vars): Update type-signature to
2484         require a gimple_bind rather than just a gimple, removing
2485         as_a and hence run-time check.
2486         (gimple_bind_set_vars): Likewise.
2487         (gimple_bind_append_vars): Likewise.
2488         (gimple_bind_body_ptr): Likewise.
2489         (gimple_bind_body): Likewise.
2490         (gimple_bind_set_body): Likewise.
2491         (gimple_bind_add_stmt): Likewise.
2492         (gimple_bind_add_seq): Likewise.
2493         (gimple_bind_block): Likewise.
2494         (gimple_bind_set_block): Likewise.
2495         * gimplify.c (gimple_push_bind_expr): Likewise.
2496         (gimple_current_bind_expr): Likewise.
2497         * tree-inline.c (copy_gimple_bind): Likewise.
2499         * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
2500         rather than a plain gimple.
2501         (gimplify_body): Likewise.
2502         (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
2503         a vec<gimple>.
2505         * gimplify.c (struct gimplify_ctx): Strengthen field
2506         "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
2507         (gimple_bind_expr_stack): Likewise for type of returned value.
2509         * gimplify.c (gimplify_body): Strengthen various types from gimple
2510         to gimple_bind, including the return type.
2512         * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
2513         so that local "scope" can be of type gimple_bind once we've reached
2514         the region where it must be of code GIMPLE_BIND.
2516         * gimple-low.c (lower_gimple_bind): Add checked cast to
2517         gimple_bind, since both callers (lower_function_body and
2518         lower_stmt) have checked the code for us.
2520         * gimple.c (gimple_copy): Add checked cast to gimple_bind in
2521         region guarded by check for code GIMPLE_BIND.
2522         * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
2523         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2524         * gimple-walk.c (walk_gimple_stmt): Likewise.
2525         * omp-low.c (scan_omp_1_stmt): Likewise.
2526         (lower_omp_1): Likewise.
2527         (lower_omp_for): Likewise.
2528         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
2529         (do_warn_unused_result): Likewise.
2530         * tree-inline.c (remap_gimple_stmt): Likewise.
2531         (estimate_num_insns): Likewise.
2532         * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
2534         * gimplify.c (gimplify_bind_expr): Update local(s) to be a
2535         gimple_bind rather than just a gimple.
2536         (gimplify_function_tree): Likewise.
2537         * omp-low.c (lower_omp_sections): Likewise.
2538         (lower_omp_single): Likewise.
2539         (lower_omp_master): Likewise.
2540         (lower_omp_taskgroup): Likewise.
2541         (lower_omp_ordered): Likewise.
2542         (lower_omp_critical): Likewise.
2543         (lower_omp_taskreg): Likewise.
2544         (lower_omp_teams): Likewise.
2545         * omp-low.c (lower_omp_for): Likewise; use
2546         gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
2547         (lower_omp_target): Likewise.
2548         * tree-nested.c (finalize_nesting_tree_1): Likewise.
2550         * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
2551         * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
2553 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2555         Introduce gimple_switch and use it in various places
2557         * gimple.h (gimple_statement_switch): New subclass of
2558         gimple_statement_with_ops, adding the invariant that
2559         stmt->code == GIMPLE_SWITCH.
2560         (is_a_helper <gimple_statement_switch>::test (gimple)): New.
2562         * coretypes.h (gimple_switch): New typedef
2563         (const_gimple_switch): Likewise.
2565         * gdbhooks.py (build_pretty_printer): Add gimple_switch
2566         and its variants, using the gimple printer.
2568         * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
2569         rather than just a gimple.
2570         (gimple_build_switch): Likewise.
2571         * gimple.h (gimple_build_switch_nlabels): Likewise.
2572         (gimple_build_switch): Likewise.
2574         * gimple.h (gimple_switch_num_labels): Update type-signature to
2575         require a gimple_switch rather than just a gimple.
2576         (gimple_switch_set_num_labels): Likewise.
2577         (gimple_switch_set_index): Likewise.
2578         (gimple_switch_label): Likewise.
2579         (gimple_switch_set_label): Likewise.
2580         (gimple_switch_default_label): Likewise.
2581         (gimple_switch_set_default_label): Likewise.
2582         * expr.h (expand_case): Likewise.
2583         * gimple-pretty-print.c (dump_gimple_call): Likewise.
2584         * stmt.c (compute_cases_per_edge): Likewise.
2585         (expand_case): Likewise.
2586         * tree-cfg.h (group_case_labels_stmt): Likewise.
2587         * tree-cfg.c (make_gimple_switch_edges): Likewise.
2588         (find_taken_edge_switch_expr) Likewise.
2589         (find_case_label_for_value) Likewise.
2590         (get_cases_for_edge): Likewise.
2591         (group_case_labels_stmt): Likewise.
2592         (verify_gimple_switch): Likewise.
2593         * tree-eh.c (verify_norecord_switch_expr): Likewise.
2594         * tree-eh.c (lower_eh_constructs_2): Likewise.
2595         * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
2596         * tree-ssa-dom.c (record_edge_info): Likewise.
2597         * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
2598         (simplify_gimple_switch): Likewise.
2599         * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
2600         (collect_switch_conv_info): Likewise.
2601         (build_constructors): Likewise.
2602         (array_value_type): Likewise.
2603         (build_one_array): Likewise.
2604         (build_arrays): Likewise.
2605         (gen_inbound_check): Likewise.
2606         * tree-vrp.c (find_switch_asserts): Likewise.
2607         (find_case_label_range): Likewise.
2608         (find_case_label_ranges): Likewise.
2609         (vrp_visit_switch_stmt): Likewise.
2610         (simplify_switch_using_ranges): Likewise.
2612         * tree-vrp.c (switch_update): Strengthen field "stmt" from being
2613         merely a gimple to being a gimple_switch.
2615         * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
2616         gimple_switch in regions where the stmt code has been tested as
2617         GIMPLE_SWITCH.
2618         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2619         * tree-cfg.c (make_edges): Likewise.
2620         (end_recording_case_labels): Likewise.
2621         (cleanup_dead_labels): Likewise.
2622         (cleanup_dead_labels): Likewise.
2623         (group_case_labels): Likewise.
2624         (find_taken_edge): Likewise.
2625         (find_case_label_for_value): Likewise.
2626         (verify_gimple_stmt): Likewise.
2627         (gimple_verify_flow_info): Likewise.
2628         (gimple_redirect_edge_and_branch): Likewise.
2629         * tree-inline.c (estimate_num_insns): Likewise.
2630         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2631         * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
2632         * tree-switch-conversion.c (do_switchconv): Likewise.
2633         * tree-vrp.c  (find_assert_locations_1): Likewise.
2634         (vrp_visit_stmt): Likewise.
2635         (simplify_stmt_using_ranges): Likewise.
2637         * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
2638         Introduce local "lastg" as a generic gimple, so that local "last"
2639         can be of type gimple_switch once lastg's code has been verified.
2641         * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
2642         the GIMPLE_SWITCH case.
2644         * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
2645         argument, since the caller (find_taken_edge) has checked that
2646         last_stmt is a switch.
2648 Copyright (C) 2014 Free Software Foundation, Inc.
2650 Copying and distribution of this file, with or without modification,
2651 are permitted in any medium without royalty provided the copyright
2652 notice and this notice are preserved.