1 2014-10-24 David Malcolm <dmalcolm@redhat.com>
3 Concretize three gimple_return_ accessors
5 * gimple.h (gimple_return_retval_ptr): Require a const_gimple_return
6 rather than a const_gimple.
7 (gimple_return_retval): Likewise.
8 (gimple_return_set_retval): Require a gimple_return.
10 * cfgexpand.c (expand_gimple_stmt_1): Add a checked cast to
12 (expand_gimple_basic_block): Likewise.
13 * tree-complex.c (expand_complex_move): Likewise.
14 (expand_complex_comparison): Likewise.
15 * tree-inline.c (remap_gimple_stmt): Likewise.
16 * tree-sra.c (scan_function): Likewise.
17 (sra_modify_function_body): Likewise.
18 (ipa_sra_modify_function_body): Likewise.
19 * tree-ssa-structalias.c (find_func_aliases): Likewise.
21 * gimple-ssa-isolate-paths.c (isolate_path): Strengthen local
22 "ret" from gimple to gimple_return.
23 (find_implicit_erroneous_behaviour): Replace a check for code
24 GIMPLE_RETURN with a dyn_cast and a new local.
25 (find_explicit_erroneous_behaviour): Likewise.
26 * gimple-walk.c (walk_stmt_load_store_addr_ops): Likewise.
27 * gimple.c (infer_nonnull_range): Likewise.
28 * ipa-split.c (find_return_bb): Likewise.
29 (find_retval): Likewise.
30 (split_function): Likewise.
31 * omp-low.c (ipa_simd_modify_function_body): Likewise.
32 * tree-cfg.c (pass_warn_function_return::execute): Likewise.
33 * tree-nrv.c (tree_nrv): Likewise.
34 * tree-ssa-alias.c (ref_maybe_used_by_stmt_p): Likewise.
35 * tree-ssa-dce.c (propagate_necessity): Likewise.
36 * tree-ssa-structalias.c (find_func_clobbers): Likewise.
37 * tree-tailcall.c (find_tail_calls): Likewise.
39 * predict.c (apply_return_prediction): Rework the search for
40 return_stmt so that the latter can have type gimple_return.
42 2014-10-24 David Malcolm <dmalcolm@redhat.com>
44 Make gimple_phi_arg_location require a gimple_phi.
46 * gimple.h (gimple_phi_arg_location): Require a gimple_phi.
48 * tree-into-ssa.c (rewrite_update_phi_arguments): Replace a check
49 for code GIMPLE_PHI with a dyn_cast and a new local.
50 * tree-ssa-ter.c (ter_is_replaceable_p): Likewise.
52 * tree-ssa-live.c (remove_unused_locals): Replace a
53 gimple_stmt_iterator with a gimple_phi_iterator, using it to make
54 local "phi" be a gimple_phi.
55 * tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Likewise.
57 * tree-ssa-phiopt.c (conditional_replacement): Require a gimple_phi.
58 (single_non_singleton_phi_for_edges): Return a gimple_phi; update
59 local to be a gimple_phi, adding checked casts since we're working
60 on a sequence of gimple_phi.
61 (conditional_replacement): Require a gimple_phi.
63 * tree-ssa-threadupdate.c (get_value_locus_in_path): Strengthen
64 type of local "def_phi" to gimple_phi by replacing a check of the
65 code for GIMPLE_PHI with a dyn_cast<gimple_phi>.
67 2014-10-24 David Malcolm <dmalcolm@redhat.com>
69 Make gimple_phi_arg_location_from_edge require a gimple_phi
71 * gimple.h (gimple_phi_arg_location_from_edge): Require a
74 * tree-parloops.c (create_parallel_loop): Split up local variable
75 "stmt", introducing other locals for the various statements created
76 by this function. Reuse "stmt" within the phi-handling code, and
77 change to type gimple_phi, since this is the only remaining
78 "non-phi" user of gimple_phi_arg_location_from_edge.
80 2014-10-24 David Malcolm <dmalcolm@redhat.com>
82 Concretize three gimple_try_set_ accessors
84 * gimple.c (gimple_copy): Add checked casts to gimple_try.
86 * gimple.h (gimple_try_set_kind): Require a gimple_try.
87 (gimple_try_set_eval): Likewise.
88 (gimple_try_set_cleanup): Likewise.
90 * tree-eh.c (optimize_double_finally): Require a pair of gimple_try
92 (refactor_eh_r): Convert code comparisons to dynamic casts.
94 2014-10-24 David Malcolm <dmalcolm@redhat.com>
96 Concretize gimple_try_set_catch_is_cleanup
98 * gimple.h (gimple_try_set_catch_is_cleanup): Require a gimple_try.
100 * gimplify.c (gimplify_expr): Convert local "try_" from a gimple
103 2014-10-24 David Malcolm <dmalcolm@redhat.com>
105 Concretize gimple_eh_filter_set_types and gimple_eh_filter_set_failure
107 * gimple.h (gimple_eh_filter_set_types): Require a gimple_eh_filter.
108 (gimple_eh_filter_set_failure): Likewise.
109 * gimple.c (gimple_copy): Add checked casts to gimple_eh_filter
110 within GIMPLE_EH_FILTER case.
112 2014-10-24 David Malcolm <dmalcolm@redhat.com>
114 Concretize gimple_label_label
116 * gimple.h (gimple_label_label): Require a const_gimple_label
117 rather than just a const_gimple.
119 * cfgexpand.c (label_rtx_for_bb): Convert local from gimple to
120 gimple_label, replacing a check against GIMPLE_LABEL with a
121 dyn_cast<gimple_label>.
122 * predict.c (tree_estimate_probability_bb): Likewise.
123 * tree-cfg.c (make_edges): Likewise.
124 (cleanup_dead_labels): Likewise (twice).
125 (gimple_can_merge_blocks_p): Likewise.
126 (gimple_block_label): Likewise.
127 * tree-eh.c (unsplit_eh): Likewise.
128 (cleanup_empty_eh_unsplit): Likewise.
129 * tree-inline.c (mark_local_labels_stmt): Likewise.
130 * tree-nested.c (convert_nl_goto_receiver): Likewise.
132 * cfgexpand.c (expand_gimple_stmt_1): Add a checked cast to
133 gimple_label when invoking gimple_label_label in a region where
134 we've checked the code is GIMPLE_LABEL.
135 * gimple-pretty-print.c (pp_cfg_jump): Likewise.
136 * gimple.c (gimple_set_bb): Likewise.
137 * ipa-pure-const.c (check_stmt): Likewise.
138 * omp-low.c (diagnose_sb_1): Likewise.
139 * tree-cfg.c (gimple_verify_flow_info): Likewise.
140 * tree-cfgcleanup.c (tree_forwarder_block_p): Likewise.
141 (remove_forwarder_block): Likewise.
142 * tree-eh.c (collect_finally_tree): Likewise.
144 * ipa-split.c (verify_non_ssa_vars): Replace a check against
145 GIMPLE_LABEL with a dyn_cast<gimple_label>, introducing a
147 * tree-cfg.c (gimple_can_merge_blocks_p): Likewise.
148 (gimple_merge_blocks): Likewise.
149 (remove_bb): Likewise.
150 (stmt_starts_bb_p): Likewise.
151 (gimple_verify_flow_info): Likewise.
152 (move_block_to_fn): Likewise.
153 * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
154 (remove_forwarder_block_with_phi): Likewise.
155 * tree-ssa-ccp.c (optimize_unreachable): Likewise.
157 2014-10-24 David Malcolm <dmalcolm@redhat.com>
159 Concretize gimple_call_use_set and gimple_call_clobber_set
161 * gimple.h (gimple_call_use_set): Require a gimple_call.
162 (gimple_call_clobber_set): Likewise.
164 2014-10-24 David Malcolm <dmalcolm@redhat.com>
166 Concretize gimple_catch_types
168 * gimple.h (gimple_catch_types): Require a const_gimple_catch
169 rather than a const_gimple.
171 2014-10-24 David Malcolm <dmalcolm@redhat.com>
173 Make gimple_goto_set_dest require a gimple_goto
175 * gimple.h (gimple_goto_set_dest): Require a gimple_goto.
177 * tree-cfg.c (factor_computed_gotos): Add checked cast to
179 (cleanup_dead_labels): Likewise.
181 2014-10-24 David Malcolm <dmalcolm@redhat.com>
183 Make gimple_label_set_label require a gimple_label
185 * gimple.h (gimple_label_set_label): Require a gimple_label.
187 2014-10-24 David Malcolm <dmalcolm@redhat.com>
189 Concretize parameter to gimple_call_copy_skip_args
191 * gimple.c (gimple_call_copy_skip_args): Require a gimple_call.
192 * gimple.h (gimple_call_copy_skip_args): Likewise.
194 2014-10-24 David Malcolm <dmalcolm@redhat.com>
196 Various gimple to gimple_call conversions in IPA
198 * ipa-prop.c (detect_type_change_from_memory_writes): Require a
199 gimple_call rather than a plain gimple.
200 (detect_type_change): Likewise.
201 (detect_type_change_ssa): Likewise.
202 (compute_complex_assign_jump_func): Likewise.
203 (compute_complex_ancestor_jump_func): Likewise.
204 (compute_known_type_jump_func): Likewise.
205 (determine_locally_known_aggregate_parts): Likewise.
206 (ipa_compute_jump_functions_for_edge): Strengthen local "call" to
207 a gimple_call; add checked cast to gimple_phi.
208 (ipa_note_param_call): Require a gimple_call rather than a plain
210 (ipa_analyze_indirect_call_uses): Likewise.
211 (ipa_analyze_virtual_call_uses): Likewise.
212 (ipa_analyze_call_uses): Likewise.
213 (ipa_analyze_stmt_uses):Add checked cast to gimple_call.
215 * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
216 Replace use of is_gimple_call with dyn_cast<gimple_call> and a
217 new local "call_stmt".
219 2014-10-24 David Malcolm <dmalcolm@redhat.com>
221 Use gimple_call for callgraph edges
223 * cgraph.h (cgraph_edge::call_stmt): Strengthen field from plain
224 gimple to a gimple_call.
225 (cgraph_node::set_call_stmt_including_clones): Likewise for param
227 (cgraph_node::create_edge): Likewise for param "call_stmt".
228 (cgraph_node::create_indirect_edge): Likewise.
229 (cgraph_node::create_edge_including_clones): Likewise for param
231 (cgraph_edge::set_call_stmt): Likewise for param "new_stmt".
232 (cgraph_edge::clone): Likewise for param "call_stmt".
233 (symbol_table::create_edge): Likewise.
235 * cgraph.c (cgraph_edge::set_call_stmt): Require a gimple_call
236 rather than a plain gimple.
237 (symbol_table::create_edge): Likewise.
238 (cgraph_node::create_edge): Likewise.
239 (cgraph_node::create_indirect_edge): Likewise.
240 (cgraph_edge::redirect_call_stmt_to_callee): Strengthen local
241 "new_stmt" from gimple to gimple_call.
242 (cgraph_update_edges_for_call_stmt_node): Add checked casts to
245 * cgraphbuild.c (pass_build_cgraph_edges::execute): Replace
246 is_gimple_call with dyn_cast<gimple_call> and new local
248 (cgraph_edge::rebuild_edges): Likewise.
250 * cgraphclones.c (cgraph_edge::clone): Require a gimple_call
251 rather than a plain gimple.
252 (cgraph_node::set_call_stmt_including_clones): Likewise.
253 (cgraph_node::create_edge_including_clones): Likewise.
255 * lto-streamer-in.c (fixup_call_stmt_edges_1): Add checked casts
258 * omp-low.c (simd_clone_adjust): Strengthen local "call" from
259 gimple to gimple_call.
261 * trans-mem.c (ipa_tm_insert_irr_call): Likewise for "g".
262 (ipa_tm_insert_gettmclone_call): Likewise; also strengthen "g2"
265 * tree-emutls.c (gen_emutls_addr): Strengthen local "x" from
266 gimple to gimple_call.
268 * tree-inline.c (copy_bb): Replace is_gimple_call with
269 dyn_cast<gimple_call> and new local "call_stmt".
271 * value-prof.c (gimple_ic): Require and return a gimple_call,
272 rather than a plain gimple.
273 * value-prof.h (gimple_ic): Likewise.
275 2014-10-24 David Malcolm <dmalcolm@redhat.com>
277 Make gimple_call_return_slot_opt_p require a gimple_call.
279 * gimple.h (gimple_call_return_slot_opt_p): Require a gimple_call
280 rather than a plain gimple.
282 * gimple-walk.c (walk_stmt_load_store_addr_ops): Convert usage of
283 is_gimple_call to dyn_cast<gimple_call>, introducing a new local
286 * trans-mem.c (expand_call_tm): Split local "stmt", strengthening
287 from plain gimple to a gimple_call, and introducing new local
288 gimple_assign "assign_stmt".
290 * tree-inline.c (expand_call_inline): Convert check of code against
291 GIMPLE_CALL to dyn_cast<gimple_call>, introducing a new local
294 2014-10-24 David Malcolm <dmalcolm@redhat.com>
298 * gimple.h (gimple_phi_set_result): Require a gimple_phi rather
300 (gimple_phi_set_arg): Likewise.
302 * tree-outof-ssa.c (remove_gimple_phi_args): Likewise; add a checked
305 * tree-sra.c (replace_removed_params_ssa_names): Add a checked
308 2014-10-24 David Malcolm <dmalcolm@redhat.com>
310 Make gimple_phi_arg_edge require a gimple_phi
312 * gimple.h (gimple_phi_arg_edge): Require a gimple_phi rather
315 * gimple-ssa-strength-reduction.c (ncd_with_phi): Strengthen
316 param "phi" from gimple to gimple_phi. Add a checked cast.
317 (ncd_of_cand_and_phis): Add a checked cast.
319 * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Require a
320 gimple_phi_iterator; strengthen local "phi" from gimple to a
322 (rewrite_cross_bb_scalar_deps): Strengthen local "psi" from
323 a gimple_stmt_iterator to a gimple_phi_iterator.
324 (edge_initial_value_for_loop_phi): Require a gimple phi.
325 (initial_value_for_loop_phi): Likewise.
327 * ipa-split.c (consider_split): Convert "bsi" to a
328 gimple_phi_iterator and "stmt" to a gimple_phi.
330 * predict.c (predict_extra_loop_exits): Convert "phi_stmt" to be
331 a gimple_phi; introduce "lhs_def_stmt" as plain gimple.
332 (apply_return_prediction): Convert "phi" to be a gimple_phi.
334 * tree-cfg.c (replace_uses_by): Add checked cast to gimple_phi.
335 (verify_gimple_in_cfg): Introduce gimple_phi_iterator "gpi" and use
336 it to convert "phi" to a gimple_phi.
338 * tree-eh.c (cleanup_empty_eh_merge_phis): Convert "ngsi", "ogsi"
339 to be gimple_phi_iterators. Convert "ophi", "nphi" to be
342 * tree-into-ssa.c (prepare_use_sites_for): Add checked cast to
345 * tree-ssa-coalesce.c (create_outofssa_var_map): Introduce
346 gimple_phi_iterator "gpi" and use it to convert "phi" to a
349 * tree-ssa-dce.c (propagate_necessity): Introduce local "phi",
350 from checked cast to gimple_phi.
352 * tree-ssa-live.c (set_var_live_on_entry): Add checked cast to
355 * tree-ssa-propagate.c (replace_phi_args_in): Require a gimple_phi
356 rather than a plain gimple.
357 (substitute_and_fold_dom_walker::before_dom_children): Introduce
358 gimple_phi_iterator "gpi".
360 * tree-ssa-sink.c (find_bb_for_arg): Require a gimple_phi rather
362 (nearest_common_dominator_of_uses): Replace check of code against
363 GIMPLE_PHI with a dyn_cast<gimple_phi>, introducing a new local.
364 (statement_sink_location): Add checked cast to gimple_phi.
366 * tree-ssa-uninit.c (compute_uninit_opnds_pos): Require a
367 gimple_phi rather than a plain gimple.
368 (collect_phi_def_edges): Likewise. Add a checked cast.
369 (find_def_preds): Strengthen param "phi" from gimple to
371 (prune_uninit_phi_opnds_in_unrealizable_paths): Likewise for
372 params "phi" and "flag_def". Strenghen param "visited_phis" from
373 hash_set<gimple> * to hash_set<gimple_phi> *. Convert
374 "flag_arg_def", "phi_arg_def" to gimple_phi using
375 dyn_cast<gimple_phi>. Similarly, introduce new local
377 (use_pred_not_overlap_with_undef_path_pred): Strengthen param
378 "phi" from gimple to gimple_phi, and param "visited_phis" from
379 hash_set<gimple> * to hash_set<gimple_phi> *. Add a checked cast.
380 (is_use_properly_guarded): Likewise for params.
381 (find_uninit_use): Replace check of code against GIMPLE_PHI with
382 a dyn_cast<gimple_phi>, introducing a new local "use_phi".
383 Strengthen local "visited_phis" from hash_set<gimple> to
384 hash_set<gimple_phi>.
386 2014-10-24 David Malcolm <dmalcolm@redhat.com>
388 Update GRAPHITE to use more concrete gimple statement classes
390 * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
391 Strengthen local "psi" to be a gimple_phi_iterator and "phi" to
394 * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Require
395 a gimple_phi rathen than a plain gimple.
396 (remove_simple_copy_phi): Require a gimple_phi_iterator;
397 strengthen local "phi" to be a gimple_phi and "stmt" to be a
399 (remove_invariant_phi): Likewise.
400 (simple_copy_phi_p): Require a gimple_phi.
401 (reduction_phi_p): Require a gimple_phi_iterator; strengthen
402 local "phi" to be a gimple_phi.
403 (add_condition_to_pbb): Require a gimple_cond rather than a
405 (add_conditions_to_domain): Add checked cast to gimple_cond
406 within GIMPLE_COND case of switch statement.
407 (single_pred_cond_non_loop_exit): Return a gimple_cond rather
408 than a plain gimple, via a checked cast.
409 (sese_dom_walker::before_dom_children): Strengthen local "stmt"
410 from gimple to gimple_cond.
411 (gsi_for_phi_node): Require a gimple_phi, and return a
413 (insert_out_of_ssa_copy): Strengthen local "stmt" from gimple to
415 (rewrite_reductions_out_of_ssa): Strengthen "psi" to be a
416 gimple_phi_iterator, and "phi" to be a gimple_phi.
417 (phi_contains_arg): Require a gimple_phi.
418 (follow_ssa_with_commutative_ops): Strengthen return type from
419 gimple to gimple_phi, by converting a check for code GIMPLE_PHI to
420 a dyn_cast<gimple_phi>, and strengthening local "res" from gimple
422 (detect_commutative_reduction_arg): Strengthen return type from
423 gimple to gimple_phi, and strengthen local "phi" to be a
425 (detect_commutative_reduction_assign): Strengthen return type from
426 gimple to gimple_phi, and strengthen local "res" to be a
428 (follow_inital_value_to_phi): Strengthen return type from
429 gimple to gimple_phi. Replace check for code GIMPLE_PHI with
430 a dyn_cast<gimple_phi>.
431 (detect_commutative_reduction): Strengthen return type and locals
432 "loop_phi", "phi", "close_phi" from gimple to gimple_phi,
433 introducing a checked cast of "stmt" in region guarded by
434 scalar_close_phi_node_p (stmt).
435 (translate_scalar_reduction_to_array_for_stmt): Require param
436 "loop_phi" to be a gimple_phi. Strengthen local "assign" from
437 gimple to gimple_assign.
438 (remove_phi): Require a gimple_phi.
439 (close_phi_written_to_memory): Likewise.
440 (translate_scalar_reduction_to_array): We expect the first element
441 in each vector to be an arbitrary statement, but all of the
442 subsequent elements to be phi nodes. Hence the decls of gimple
443 locals "loop_phi" and "close_phi" are replaced with decls of gimple
444 "loop_stmt" and "close_stmt", with decls of the more-strongly typed
445 gimple_phi "loop_phi" and "close_phi" occurring lower down, within
446 the region where we're dealing with i > 0 and hence where we can
447 safely assign them using the checked cast as_a <gimple_phi>.
448 This allows many of the strengthenings from gimple to gimple_phi
449 above. We eliminate the local "stmt", since we can simply use
451 (rewrite_commutative_reductions_out_of_ssa_close_phi): Strengthen
452 param "close_phi" from gimple to gimple_phi, and local "gsi" from
453 gimple_stmt_iterator to gimple_phi_iterator, converting uses of
454 gsi_stmt to gsi.phi for type-safety.
455 (scop_ivs_can_be_represented): Strengthen local "gsi" from
456 gimple_stmt_iterator to gimple_phi_iterator, and "phi" from gimple
459 2014-10-24 David Malcolm <dmalcolm@redhat.com>
461 Make gimple_phi_arg_set_location require a gimple_phi
463 * gimple.h (gimple_phi_arg_set_location): Require a gimple_phi
464 rather than a plain gimple.
466 2014-10-24 David Malcolm <dmalcolm@redhat.com>
468 Make add_phi_arg require a gimple_phi
470 * tree-phinodes.h (add_phi_arg): Require a gimple_phi rather than
472 * tree-phinodes.c (add_phi_arg): Likewise.
474 * gimple-ssa-strength-reduction.c (create_phi_basis): Strengthen
475 local "phi" from plain gimple to gimple_phi.
477 * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
478 Likewise for "close_phi".
480 * ipa-split.c (split_function): Convert "psi" to
483 * omp-low.c (expand_omp_for_static_nochunk): Introduce
484 gimple_phi_iterator gpi, using it to strengthen "phi" to be a
486 (expand_omp_for_static_chunk): Likewise.
488 * tree-cfg.c (gimple_duplicate_bb): Make topmost "gsi" decl more
489 tightly-scoped, and eliminate decls "phis", "phi", "stmt", "copy"
490 in favor of more tightly-scoped gimple_phi_iterator gpi and
491 gimple_phi decls "phi" and "copy", and gimple decls "stmt" and
494 * tree-parloops.c (create_parallel_loop): Introduce
495 gimple_phi_iterator gpi, using it to strengthen "phi" to be a
498 * tree-ssa-loop-im.c (execute_sm_if_changed): Likewise.
500 * tree-ssa-loop-manip.c (create_iv): Split out new gimple_phi
501 local "phi" from "stmt", and convert the latter into being a
504 * tree-ssa-pre.c (insert_into_preds_of_block): Strengthen local
505 "phi" to be a gimple_phi.
507 * tree-ssa-tail-merge.c (vop_phi): Require a gimple_phi rather
509 (replace_block_by): Strengthen local "bb2_phi" to be a gimple_phi.
511 * tree-tailcall.c (add_successor_phi_arg): Use gsi.phi when
512 invoking add_phi_arg.
513 (eliminate_tail_call): Introduce gimple_phi_iterator gpi, using it
514 to strengthen "phi" to be a gimple_phi.
515 (create_tailcall_accumulator): Strengthen local "phi" to be a
517 (tree_optimize_tail_calls_1): Likewise.
519 * tree-vect-data-refs.c (vect_setup_realignment): Strengthen
520 local "phi_stmt" to be a gimple_phi.
522 * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg):
523 Strengthen "gsi", "gsi_orig", "gsi_new" to be
524 gimple_phi_iterators, and "phi" "orig_phi", "new_phi" to be
525 gimple_phi instances.
526 (slpeel_tree_peel_loop_to_edge): Strengthen local "new_phi" to be
529 * tree-vect-loop.c (get_initial_def_for_induction): Likewise for
531 (vect_create_epilog_for_reduction): Add checked casts to
532 gimple_phi; strengthen local "outer_phi" to gimple_phi and
533 "new_vec_stmt" to gimple_assign.
534 (vect_finalize_reduction): Strengthen local "vect_phi" to
536 (vectorizable_reduction): Likewise for "new_phi".
538 * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
539 (vectorizable_load): Likewise for "phi".
541 2014-10-24 David Malcolm <dmalcolm@redhat.com>
543 Make gimple_phi_arg_def_ptr and gimple_phi_arg_has_location require a gimple_phi
545 * gimple.h (gimple_phi_arg_def_ptr): Require a gimple_phi rather
547 (gimple_phi_arg_has_location): Likewise.
549 * gimple-streamer-in.c (input_phi): Return a gimple_phi rather
551 * gimple-streamer-out.c (output_phi): Require a gimple_phi rather
553 (output_bb): Convert iteration to a gimple_phi_iterator, and local
556 * omp-low.c (expand_omp_for_static_chunk): Convert iterator "psi"
557 to a gimple_phi_iterator; convert locals "phi" and "nphi" to be
560 * tree-cfg.c (gimple_duplicate_sese_tail): Likewise for "psi" and
562 (move_block_to_fn): Introduce new gimple_phi_iterator "psi", using
563 it in place of "gsi" where necessary. Convert "phi" to be a
566 * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
568 * tree-vect-loop-manip.c (vect_loop_versioning): Convert "gsi" to
569 a gimple_phi_iterator, and "orig_phi" and "new_phi" to be
572 * tree.c (find_decls_types_in_node): Introduce new
573 gimple_phi_iterator "psi", using it in place of "si" where
574 necessary. Convert "phi" to be a gimple_phi.
576 2014-10-24 David Malcolm <dmalcolm@redhat.com>
578 omp-low.c: Use more concrete types of gimple statement for various locals
580 * omp-low.c (finalize_task_copyfn): Strengthen local "bind" from
581 plain gimple to gimple_bind.
582 (lower_rec_input_clauses): Strengthen local "g" from
583 plain gimple to gimple_assign.
584 (lower_lastprivate_clauses): Likewise for "stmt" to gimple_cond
585 and "g" to gimple_call.
586 (expand_omp_for_init_vars): Likewise, for two decls of "stmt" to
588 (expand_omp_atomic_pipeline): Likewise for one decl of "stmt".
589 (expand_omp_atomic_mutex): Likewise.
590 (lower_omp_master): Likewise for "x" to gimple_call.
591 (lower_omp_ordered): Likewise.
593 2014-10-24 David Malcolm <dmalcolm@redhat.com>
595 tree-parloops.c: Use gimple_phi in various places
597 * tree-parloops.c (reduction_info::keep_res): Strengthen field
598 from plain gimple to gimple_phi.
599 (transform_to_exit_first_loop): Strengthen locals "phi", "nphi"
600 to gimple_phi. Eliminate early decl of gimple_stmt_iterator gsi
601 in favor of more tightly scoped gimple_phi_iterators, and a final
602 later decl as a gimple_stmt_iterator.
604 2014-10-24 David Malcolm <dmalcolm@redhat.com>
606 Introduce gimple_omp_sections
608 * coretypes.h (gimple_omp_sections): New typedef.
609 (const_gimple_omp_sections): New typedef.
611 * gimple-pretty-print.c (dump_gimple_omp_sections): Require a
612 gimple_omp_sections rather than a plain gimple.
613 (pp_gimple_stmt_1): Add checked cast to gimple_omp_sections within
614 GIMPLE_OMP_SECTIONS case of switch statement.
616 * gimple.c (gimple_build_omp_sections): Return a
617 gimple_omp_sections rather than a plain gimple.
619 * gimple.h (gimple_build_omp_sections): Return a
620 gimple_omp_sections rather than a plain gimple.
622 * omp-low.c (scan_omp_sections): Require a gimple_omp_sections
623 rather than a plain gimple.
624 (scan_omp_1_stmt): Add checked cast to gimple_omp_sections within
625 GIMPLE_OMP_SECTIONS case of switch statement.
626 (expand_omp_sections): Strengthen local "sections_stmt" from gimple
627 to gimple_omp_sections.
628 (lower_omp_sections): Likewise for "stmt".
630 2014-10-24 David Malcolm <dmalcolm@redhat.com>
632 Introduce gimple_omp_teams
634 * coretypes.h (gimple_omp_teams): New typedef.
635 (const_gimple_omp_teams): New typedef.
637 * gimple.h (gimple_build_omp_teams): Return a gimple_omp_teams
638 rather than a plain gimple.
639 (gimple_omp_teams_set_clauses): Require a gimple_omp_teams rather
642 * gimple-pretty-print.c (dump_gimple_omp_teams): Require a
643 gimple_omp_teams rather than a plain gimple.
644 (pp_gimple_stmt_1): Add checked cast to gimple_omp_teams within
645 GIMPLE_OMP_TEAMS case of switch statement.
647 * gimple.c (gimple_build_omp_teams): Return a gimple_omp_teams
648 rather than a plain gimple.
650 * omp-low.c (scan_omp_teams): Likewise.
651 (scan_omp_1_stmt): Add checked cast to gimple_omp_teams within
652 GIMPLE_OMP_TEAMS case of switch statement.
653 (lower_omp_teams): Strengthen local "teams_stmt" from gimple to
656 2014-10-24 David Malcolm <dmalcolm@redhat.com>
658 Introduce gimple_omp_target
660 * coretypes.h (gimple_omp_target): New typedef.
661 (const_gimple_omp_target): New typedef.
663 * gimple.h (gimple_build_omp_target): Return a gimple_omp_target
664 rather than a plain gimple.
665 (gimple_omp_target_set_clauses): Require a gimple_omp_target
666 rather than a plain gimple.
667 (gimple_omp_target_set_kind): Likewise.
668 (gimple_omp_target_child_fn_ptr): Likewise.
669 (gimple_omp_target_set_child_fn): Likewise.
670 (gimple_omp_target_data_arg_ptr): Likewise.
671 (gimple_omp_target_set_data_arg): Likewise.
672 (gimple_omp_target_child_fn): Require a const_gimple_omp_target
673 rather than a plain const_gimple.
674 (gimple_omp_target_data_arg): Likewise.
676 * gimple-pretty-print.c (dump_gimple_omp_target): Require a
677 gimple_omp_target rather than a plain gimple.
678 (pp_gimple_stmt_1): Add checked cast to gimple_omp_target within
679 GIMPLE_OMP_TARGET case of switch statement.
681 * gimple.c (gimple_build_omp_target): Return a gimple_omp_target
682 rather than a plain gimple.
684 * gimplify.c (gimplify_omp_target_update): Strengthen local "stmt"
685 from gimple to gimple_omp_target.
687 * omp-low.c (scan_omp_target): Require a gimple_omp_target rather
689 (scan_omp_1_stmt): Add checked cast to gimple_omp_target within
690 GIMPLE_OMP_TARGET case of switch statement.
691 (expand_omp_target): Strengthen local "entry_stmt" from gimple to
693 (lower_omp_target): Likewise for "stmt".
695 * tree-nested.c (convert_nonlocal_reference_stmt): Add checked
696 cast to gimple_omp_target.
697 (convert_local_reference_stmt): Likewise.
698 (convert_gimple_call): Likewise.
700 2014-10-24 David Malcolm <dmalcolm@redhat.com>
702 Introduce gimple_omp_single
704 * coretypes.h (gimple_omp_single): New typedef.
705 (const_gimple_omp_single): New typedef.
707 * gimple.h (gimple_build_omp_single): Return a gimple_omp_single
708 rather than a plain gimple.
709 (gimple_omp_single_set_clauses): Require a gimple_omp_single
710 rather than a plain gimple.
712 * gimple-pretty-print.c (dump_gimple_omp_single): Require a
713 gimple_omp_single rather than a plain gimple.
714 (pp_gimple_stmt_1): Add checked cast to gimple_omp_single within
715 GIMPLE_OMP_SINGLE case of switch statement.
717 * gimple.c (gimple_build_omp_single): Return a gimple_omp_single
718 rather than a plain gimple.
720 * omp-low.c (scan_omp_single): Require a gimple_omp_single rather
722 (scan_omp_1_stmt): Add checked cast to gimple_omp_single within
723 GIMPLE_OMP_SINGLE case of switch statement.
724 (lower_omp_single_simple): Require a gimple_omp_single rather
726 (lower_omp_single_copy): Likewise.
727 (lower_omp_single): Strengthen local "single_stmt" from gimple to
730 2014-10-24 David Malcolm <dmalcolm@redhat.com>
732 Introduce gimple_omp_task
734 * coretypes.h (gimple_omp_task): New typedef.
735 (const_gimple_omp_task): New typedef.
737 * gimple.h (gimple_build_omp_task): Return a gimple_omp_task
738 rather than a plain gimple.
740 * gimple-pretty-print.c (dump_gimple_omp_task): Require a
741 gimple_omp_task rather than a plain gimple.
742 (pp_gimple_stmt_1): Add checked cast to gimple_omp_task within
743 GIMPLE_OMP_TASK case of switch statement.
745 * gimple.c (gimple_build_omp_task): Return a gimple_omp_task
746 rather than a plain gimple.
748 * omp-low.c (finalize_task_copyfn): Require a gimple_omp_task
749 rather than a plain gimple.
750 (delete_omp_context): Add checked cast to gimple_omp_task.
751 (scan_omp_task): Strengthen local "stmt" from gimple to
753 (expand_task_call): Require a gimple_omp_task rather than a plain
755 (expand_omp_taskreg): Add checked cast to gimple_omp_task.
756 (create_task_copyfn): Require a gimple_omp_task rather than a
758 (lower_omp_taskreg): Add checked cast to gimple_omp_task.
760 2014-10-24 David Malcolm <dmalcolm@redhat.com>
762 tree-cfg.c: Make verify_gimple_call require a gimple_call
764 * tree-cfg.c (verify_gimple_call): Require a gimple_call rather
766 (verify_gimple_stmt): Add checked cast to gimple_call within
767 GIMPLE_CALL case of switch statement.
769 2014-10-24 David Malcolm <dmalcolm@redhat.com>
771 Introduce gimple_omp_parallel
773 * coretypes.h (gimple_omp_parallel): New typedef.
774 (const_gimple_omp_parallel): New typedef.
776 * cgraphbuild.c (build_cgraph_edges): Convert check of code
777 against GIMPLE_OMP_PARALLEL to a dyn_cast <gimple_omp_parallel>
780 * gimple-pretty-print.c (dump_gimple_omp_parallel): Require a
781 gimple_omp_parallel rather than a plain gimple.
782 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_parallel
783 within GIMPLE_OMP_PARALLEL case of switch statement.
785 * gimple-walk.c (walk_gimple_op): Likewise, introducing a local.
787 * gimple.c (gimple_build_omp_parallel): Return a
788 gimple_omp_parallel rather than a plain gimple.
789 (gimple_copy): Add checked casts to gimple_omp_parallel within
790 GIMPLE_OMP_PARALLEL case of switch statement, introducing locals.
792 * gimple.h (gimple_build_omp_parallel): Return a
793 gimple_omp_parallel rather than a plain gimple.
794 (gimple_omp_parallel_clauses_ptr): Require a gimple_omp_parallel
795 rather than a plain gimple.
796 (gimple_omp_parallel_set_clauses): Likewise.
797 (gimple_omp_parallel_data_arg_ptr): Likewise.
798 (gimple_omp_parallel_set_data_arg): Likewise.
799 (gimple_omp_parallel_child_fn_ptr): Likewise.
800 (gimple_omp_parallel_set_child_fn): Likewise.
801 (gimple_omp_parallel_child_fn): Require a
802 const_gimple_omp_parallel rather than a plain const_gimple.
803 (gimple_omp_parallel_data_arg): Likewise.
805 * omp-low.c (scan_omp_parallel): Strengthen local "stmt" from
806 gimple to gimple_omp_parallel.
807 (expand_parallel_call): Require a gimple_omp_parallel for
808 "entry_stmt" rather than a plain gimple.
809 (remove_exit_barrier): Strengthen local "parallel_stmt" from
810 gimple to gimple_omp_parallel.
811 (expand_omp_taskreg): Add checked casts to gimple_omp_parallel.
813 * tree-inline.c (remap_gimple_stmt): Add a checked cast to
814 gimple_omp_parallel within GIMPLE_OMP_PARALLEL case of switch
815 statement, introducing local.
817 2014-10-24 David Malcolm <dmalcolm@redhat.com>
819 Introduce gimple_omp_for
821 * coretypes.h (gimple_omp_for): New.
822 (const_gimple_omp_for): New.
824 * gimple.h (gimple_build_omp_for): Return a gimple_omp_for rather
826 (gimple_omp_for_set_kind): Require a gimple_omp_for rather than a
828 (gimple_omp_for_set_combined_p): Likewise.
829 (gimple_omp_for_set_combined_into_p): Likewise.
831 * gimple-pretty-print.c (dump_gimple_omp_for): Require a
832 gimple_omp_for rather than a plain gimple.
833 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_for in
834 GIMPLE_OMP_FOR case of switch statement.
836 * gimple.c (gimple_build_omp_for): Return a gimple_omp_for rather
838 (gimple_copy): Add a checked cast to gimple_omp_for and a new local.
840 * gimplify.c (gimplify_omp_for): Strengthen local "gfor" from
841 gimple to gimple_omp_for.
843 * omp-low.c (omp_for_data::for_stmt): Strengthen field from gimple
845 (extract_omp_for_data): Require a gimple_omp_for rather than a
847 (workshare_safe_to_combine_p): Add a checked cast to
849 (get_ws_args_for): Convert check of code against GIMPLE_OMP_FOR
850 with a dyn_cast<gimple_omp_for> and a new local.
851 (scan_omp_parallel): Add a checked cast to gimple_omp_for and a
853 (scan_omp_for): Require a gimple_omp_for rather than a plain
855 (scan_omp_1_stmt): Add a checked cast to gimple_omp_for in
856 GIMPLE_OMP_FOR case of switch statement.
857 (expand_omp_for): Add a checked cast to gimple_omp_for.
858 (lower_omp_for): Strengthen local "stmt" from gimple to
861 * tree-nested.c (walk_gimple_omp_for): Require a gimple_omp_for
862 rather than a plain gimple.
863 (convert_nonlocal_reference_stmt): Add a checked cast to
864 gimple_omp_for in GIMPLE_OMP_FOR case of switch statement.
865 (convert_local_reference_stmt): Likewise.
867 * tree-parloops.c (create_parallel_loop): Strengthen local
868 "for_stmt" from gimple to gimple_omp_for.
870 2014-10-24 David Malcolm <dmalcolm@redhat.com>
872 Introduce gimple_omp_critical
874 * coretypes.h (gimple_omp_critical): New typedef.
875 (const_gimple_omp_critical): New typedef.
877 * gimple-pretty-print.c (dump_gimple_omp_critical): Require a
878 gimple_omp_critical rather than a plain gimple.
879 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_critical
880 within GIMPLE_OMP_CRITICAL case of switch statement.
882 * gimple-walk.c (walk_gimple_op): Likewise.
884 * gimple.c (gimple_build_omp_critical): Return a gimple_omp_critical
885 rather than a plain gimple.
886 (gimple_copy): Add checked casts to gimple_omp_critical
887 within GIMPLE_OMP_CRITICAL case of switch statement.
889 * gimple.h (gimple_debug): Likewise.
890 (gimple_build_omp_critical): Return a gimple_omp_critical rather
892 (gimple_omp_critical_name): Require a const_gimple_omp_critical
893 rather than a plain const_gimple.
894 (gimple_omp_critical_name_ptr): Require a gimple_omp_critical
895 rather than a plain gimple.
896 (gimple_omp_critical_set_name): Likewise.
898 * omp-low.c (check_omp_nesting_restrictions): Add a checked cast
899 to gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
900 statement, introducing a new local "other_crit" for type-safety.
901 (lower_omp_critical): Strengthen local "stmt" to
904 * tree-inline.c (remap_gimple_stmt): Add a checked cast to
905 gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
908 2014-10-24 David Malcolm <dmalcolm@redhat.com>
910 Introduce gimple_omp_continue
912 * coretypes.h (gimple_omp_continue): New typedef.
913 (const_gimple_omp_continue): New typedef.
915 * gimple.h (gimple_build_omp_continue): Return a
916 gimple_omp_continue rather than a plain gimple.
917 (gimple_omp_continue_control_def): Require a
918 const_gimple_omp_continue rather than a plain const_gimple.
919 (gimple_omp_continue_control_use): Likewise.
920 (gimple_omp_continue_control_def_ptr): Require a gimple_omp_continue
921 rather than a plain gimple.
922 (gimple_omp_continue_set_control_def): Likewise.
923 (gimple_omp_continue_control_use_ptr): Likewise.
924 (gimple_omp_continue_set_control_use): Likewise.
926 * gimple-pretty-print.c (dump_gimple_omp_continue): Require a
927 gimple_omp_continue rather than a plain gimple.
928 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_continue
929 within GIMPLE_OMP_CONTINUE case of switch statement.
931 * gimple-walk.c (walk_gimple_op): Likewise, adding a new local.
933 * gimple.c (gimple_build_omp_continue): Return a
934 gimple_omp_continue rather than a plain gimple.
936 * omp-low.c (gimple_build_cond_empty): Return a gimple_cond
937 rather than a plain gimple.
938 (expand_omp_for_generic): Split local "stmt" into "assign_stmt",
939 "cont_stmt", "cond_stmt", "call_stmt" of types gimple_assign,
940 gimple_omp_continue, gimple_cond, gimple_call respectively.
941 (expand_omp_for_static_nochunk): Likewise, splitting into two
942 "cond_stmt" decls. "assign_stmt", "cont_stmt"
943 (expand_omp_for_static_chunk): Likewise, splitting into
944 "cond_stmt", "assign_stmt", "cont_stmt".
945 (expand_omp_sections): Strengthen local "cont" from gimple to
948 2014-10-24 David Malcolm <dmalcolm@redhat.com>
950 Introduce gimple_omp_atomic_store
952 * coretypes.h (gimple_omp_atomic_store): New typedef.
953 (const_gimple_omp_atomic_store): New typedef.
955 * gimple-pretty-print.c (dump_gimple_omp_atomic_store): Require
956 a gimple_omp_atomic_store rather than a plain gimple.
957 (pp_gimple_stmt_1): Add checked cast to gimple_omp_atomic_store
958 within GIMPLE_OMP_ATOMIC_STORE case of switch statement.
959 * gimple-walk.c (walk_gimple_op): Likewise.
961 * gimple.c (gimple_build_omp_atomic_store): Return a
962 gimple_omp_atomic_store rather than a plain gimple.
964 * gimple.h (gimple_build_omp_atomic_store): Return a
965 gimple_omp_atomic_store rather than a plain gimple.
966 (gimple_omp_atomic_store_set_val): Require a gimple_omp_atomic_store
967 rather than a plain gimple.
968 (gimple_omp_atomic_store_val_ptr): Likewise.
969 (gimple_omp_atomic_store_val): Require a
970 const_gimple_omp_atomic_store rather than a plain const_gimple.
972 * gimplify.c (gimplify_omp_atomic): Strengthen locals "loadstmt" and
973 "storestmt" from gimple to gimple_omp_atomic_load loadstmt and
974 gimple_omp_atomic_store storestmt respectively.
976 * omp-low.c (expand_omp_atomic): Strengthen local "store" from
977 gimple to gimple_omp_atomic_store.
979 2014-10-24 David Malcolm <dmalcolm@redhat.com>
981 Introduce gimple_omp_atomic_load
983 * coretypes.h (gimple_omp_atomic_load): New typedef.
984 (const_gimple_omp_atomic_load): New typedef.
986 * gimple-pretty-print.c (dump_gimple_omp_atomic_load): Require a
987 gimple_omp_atomic_load rather than a plain gimple.
988 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_atomic_load
989 within GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
991 * gimple-walk.c (walk_gimple_op): Likewise, introducing a new local.
993 * gimple.c (gimple_build_omp_atomic_load): Return a
994 gimple_omp_atomic_load rather than a plain gimple.
996 * gimple.h (gimple_build_omp_atomic_load): Return a
997 gimple_omp_atomic_load rather than a plain gimple.
998 (gimple_omp_atomic_load_set_lhs): Require a
999 gimple_omp_atomic_load rather than a plain gimple.
1000 (gimple_omp_atomic_load_lhs_ptr): Likewise.
1001 (gimple_omp_atomic_load_set_rhs): Likewise.
1002 (gimple_omp_atomic_load_rhs_ptr): Likewise.
1003 (gimple_omp_atomic_load_lhs): Require a
1004 const_gimple_omp_atomic_load rather than a plain const_gimple.
1005 (gimple_omp_atomic_load_rhs): Likewise.
1007 * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
1008 to gimple_omp_atomic_load within GIMPLE_OMP_ATOMIC_LOAD case of
1011 * omp-low.c (expand_omp_atomic): Strengthen type of local "load"
1012 from gimple to gimple_omp_atomic_load.
1013 (lower_omp_1): Add a checked cast to gimple_omp_atomic_load within
1014 GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
1016 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1018 Use more concrete types for various gimple statements
1020 * cgraphunit.c (thunk_adjust): Strengthen local "stmt" from gimple
1023 * gimple-ssa-isolate-paths.c
1024 (insert_trap_and_remove_trailing_statements): Strengthen local
1025 "new_stmt" from gimple to gimple_call.
1027 * gimple-ssa-strength-reduction.c (replace_mult_candidate):
1028 Strengthen local "copy_stmt" from gimple to gimple_assign.
1029 (create_add_on_incoming_edge): Likewise, for "new_stmt".
1030 (insert_initializers): Likewise, for "init_stmt".
1031 (introduce_cast_before_cand): Likewise, for "cast_stmt".
1032 (replace_one_candidate): Likewise, for "copy_stmt" and
1035 * gimplify.c (build_stack_save_restore): Require gimple_calls
1036 rather than plain gimples.
1037 (gimplify_bind_expr): Strengthen locals "stack_save" and
1038 "stack_restore" from gimple to gimple_call. Strengthen "gs"
1040 (gimplify_switch_expr): Strengthen local "gimple_switch" from
1041 gimple to gimple_switch, and "new_default" to gimple_label.
1042 (gimplify_cond_expr): Strengthen local "gimple_cond" from gimple
1044 (gimplify_init_constructor): Strengthen local "init" from gimple
1046 (gimplify_cleanup_point_expr): Strengthen local "gtry" from gimple
1048 (gimple_push_cleanup): Strengthen locals "ffalse" and "ftrue" from
1049 gimple to gimple_assign.
1051 * tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
1052 (emit_post_landing_pad): Strengthen local to gimple_label.
1054 * tree-outof-ssa.c (insert_backedge_copies): Strengthen local
1055 "stmt" from gimple to gimple_assign.
1057 * tree-parloops.c (take_address_of): Likewise.
1059 * tree-predcom.c (replace_ref_with): Likewise, for "new_stmt".
1060 (initialize_root_vars_lm): Likewise, for "init_stmt".
1061 (reassociate_to_the_same_stmt): Likewise, for "new_stmt" and "tmp_stmt".
1063 * tree-profile.c (gimple_gen_edge_profiler): Likewise, for "stmt1",
1065 (gimple_gen_ic_profiler): Likewise.
1066 (gimple_gen_ic_func_profiler): Strengthen local "stmt1" from
1067 gimple to gimple_call, and "stmt2" to gimple_assign.
1069 * tree-scalar-evolution.c (scev_const_prop): Strengthen local
1070 "ass" from gimple to gimple_assign.
1072 * tree-sra.c (build_ref_for_offset): Likewise for "stmt".
1073 (generate_subtree_copies): Likewise; also strengthen "ds" to
1075 (init_subtree_with_zero): Likewise.
1076 (sra_modify_expr): Likewise.
1077 (load_assign_lhs_subreplacements): Likewise.
1078 (sra_modify_assign): Strengthen "ds" to gimple_debug.
1079 (sra_ipa_reset_debug_stmts): Likewise for "def_temp".
1081 * tree-ssa-ccp.c (insert_clobber_before_stack_restore):
1082 Strengthen local "clobber_stmt" from gimple to gimple_assign.
1084 * tree-ssa-dce.c (remove_dead_stmt): Strengthen "note" to
1087 * tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
1088 local "new_stmt" from gimple to gimple_assign.
1089 (optimize_stmt): Likewise.
1091 * tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
1092 4 declarations of "newop".
1093 (simplify_rotate): Likewise for "g".
1095 * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
1096 (rewrite_bittest): Likewise for "stmt" and "stmt2".
1097 (move_computations_dom_walker::before_dom_children): Likewise for
1099 (execute_sm): Likewise for "load" and "store".
1101 * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
1102 Strengthen local "stmt" from gimple to gimple_call.
1103 (unloop_loops): Likewise.
1105 * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
1106 local "ass" from gimple to gimple_assign.
1107 (remove_unused_ivs): Strengthen "def_temp" to gimple_debug.
1109 * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local "stmt"
1110 from gimple to gimple_assign.
1112 * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
1113 "prefetch" from gimple to gimple_call.
1115 * tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
1116 "new_stmt" from gimple to gimple_assign.
1117 (powi_as_mults_1): Likewise for "mult_stmt".
1118 (powi_as_mults): Likewise for "div_stmt".
1119 (build_and_insert_binop): Likewise for "stmt".
1120 (build_and_insert_cast): Likewise.
1121 (pass_cse_sincos::execute): Likewise for "stmt" and various decls
1123 (convert_mult_to_fma): Likewise for "fma_stmt".
1125 * tree-ssa-phiopt.c (conditional_replacement): Likewise for "new_stmt".
1126 (abs_replacement): Likewise.
1128 * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for "tmp".
1130 * tree-ssa-pre.c (create_expression_by_pieces): Likewise for "newstmt".
1131 (eliminate_insert): Likewise for "tem".
1133 * tree-ssa-propagate.c (update_gimple_call): Strengthen locals
1134 "new_stmt" and "stmt" from gimple to gimple_call.
1135 (update_call_from_tree): Likewise for "new_stmt".
1137 * tree-ssa-reassoc.c (build_and_add_sum): Likewise for "sum".
1138 (update_ops): Likewise for "g".
1139 (maybe_optimize_range_tests): Likewise.
1140 (rewrite_expr_tree_parallel): Require a gimple_assign rather than
1142 (reassociate_bb): Add a checked cast to gimple_assign.
1144 * tree-ssa.c (insert_debug_temp_for_var_def): Strengthen local
1145 "def_temp" from gimple to gimple_debug.
1147 * tree-switch-conversion.c (emit_case_bit_tests): Strengthen local
1148 "shift_stmt" from gimple to gimple_assign.
1150 * tree-tailcall.c (adjust_return_value_with_ops): Likewise for
1152 (update_accumulator_with_ops): Likewise.
1154 * tree-vect-data-refs.c (bump_vector_ptr): Likewise for
1157 * tree-vect-stmts.c (vectorizable_condition): Likewise for
1160 * tree-vrp.c (build_assert_expr_for): Likewise for "assertion".
1161 (simplify_truth_ops_using_ranges): Likewise for "newop".
1162 (simplify_float_conversion_using_ranges): Likewise for "conv".
1164 * ubsan.c (instrument_mem_ref): Strengthen local "g" from gimple
1167 * value-prof.c (gimple_divmod_fixed_value): Require a
1168 gimple_assign rather than a plain gimple; strengthen types of locals.
1169 (gimple_mod_pow2): Likewise.
1170 (gimple_mod_subtract): Likewise.
1171 (gimple_divmod_fixed_value_transform): Strengthen local
1172 "stmt" from gimple to gimple_assign.
1173 (gimple_mod_pow2_value_transform): Likewise.
1174 (gimple_mod_subtract_transform): Likewise.
1175 (gimple_ic): Strengthen types of locals.
1177 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1179 Introduce gimple_try
1181 * coretypes.h (gimple_try): New typedef.
1182 (const_gimple_try): New typedef.
1184 * gimple-low.c (gimple_try_catch_may_fallthru): Require a
1185 gimple_try rather than a plain gimple.
1186 (gimple_stmt_may_fallthru): Add checked cast to gimple_try.
1188 * gimple-pretty-print.c (dump_gimple_try): Require a gimple_try
1189 rather than a plain gimple.
1190 (pp_gimple_stmt_1): Add checked cast to gimple_try within
1191 GIMPLE_TRY case of switch statement.
1193 * tree-eh.c (finally_tree_node::parent): Strengthen field from
1194 gimple to gimple_try.
1195 (record_in_finally_tree): Require a gimple_try rather than a plain
1197 (collect_finally_tree): Likewise.
1198 (collect_finally_tree_1): Likewise.
1199 (struct leh_tf_state::try_finally_expr): Strengthen field from
1200 gimple to gimple_try.
1201 (struct leh_tf_state::top_p): Likewise.
1202 (lower_eh_must_not_throw): Require a gimple_try rather than a
1204 (frob_into_branch_around): Likewise.
1205 (lower_try_finally_dup_block): Strengthen local from gimple to
1207 (honor_protect_cleanup_actions): Split out uses of "x" into new
1208 locals "eh_mnt" and "try_stmt" with stronger types.
1209 (lower_try_finally): Require a gimple_try rather than a plain
1211 (lower_catch): Likewise.
1212 (lower_eh_filter): Likewise.
1213 (lower_eh_must_not_throw): Likewise.
1214 (lower_cleanup): Likewise.
1215 (lower_eh_constructs_2): Add checked cast to gimple_try within
1216 GIMPLE_TRY case of switch statement, introducing new local
1217 "try_stmt", using it for type-safety.
1219 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1221 Use subclasses of gimple in various places
1223 * asan.c (insert_if_then_before_iter): Require a gimple cond
1224 rathern than a plain gimple.
1225 (asan_expand_check_ifn): Add a checked cast to gimple_cond.
1227 * cfgloopmanip.c (create_empty_if_region_on_edge): Likewise.
1229 * omp-low.c (simd_clone_adjust): Strengthen local from gimple
1232 * sese.c (set_ifsese_condition): Strengthen local from gimple to
1235 * tree-call-cdce.c (gen_one_condition): Strengthen locals from
1236 gimple to gimple_assign and gimple_cond.
1238 * tree-ssa-phiopt.c (minmax_replacement): Likewise.
1239 (cond_store_replacement): Strengthen locals from gimple to
1240 gimple_phi and gimple_assign.
1241 (cond_if_else_store_replacement_1): Likewise.
1243 * tree-ssa-pre.c (do_regular_insertion): Strengthen local from
1244 gimple to gimple_assign.
1246 * tree-switch-conversion.c (hoist_edge_and_branch_if_true):
1247 Strengthen local from gimple to gimple_cond.
1248 (gen_def_assigns): Return a gimple_assign rather than a plain
1250 (gen_inbound_check): Strengthen locals from gimple to gimple_cond
1253 * tree-vect-loop-manip.c (slpeel_add_loop_guard): Strengthen local
1254 from gimple to gimple_cond.
1255 (set_prologue_iterations): Strengthen locals from gimple to
1256 gimple_phi and gimple_cond.
1258 * value-prof.c (gimple_ic): Strengthen local from gimple to
1260 (gimple_stringop_fixed_value): Strengthen locals from gimple to
1261 gimple_assign, gimple_cond, gimple_call, and gimple_phi.
1263 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1265 Introduce gimple_eh_dispatch
1267 * coretypes.h (gimple_eh_dispatch): New typedef.
1268 (const_gimple_eh_dispatch): New typedef.
1270 * gimple-pretty-print.c (dump_gimple_eh_dispatch): Require a
1271 gimple_eh_dispatch rather than a plain gimple.
1272 (pp_gimple_stmt_1): Add a checked cast to gimple_eh_dispatch
1273 within GIMPLE_EH_DISPATCH case of switch statement.
1275 * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1277 * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1279 * gimple.c (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
1280 rather than a plain gimple.
1282 * gimple.h (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
1283 rather than a plain gimple.
1284 (gimple_eh_dispatch_region): Require a const_gimple_eh_dispatch
1285 rather than a plain const_gimple.
1286 (gimple_eh_dispatch_set_region): Require a gimple_eh_dispatch
1287 rather than a plain gimple.
1289 * tree-cfg.c (make_edges): Add a checked cast to gimple_eh_dispatch
1290 within GIMPLE_EH_DISPATCH case of switch statement.
1291 (gimple_verify_flow_info): Likewise.
1292 (gimple_redirect_edge_and_branch): Likewise.
1293 (move_stmt_r): Likewise, adding a local.
1295 * tree-eh.c (emit_eh_dispatch): Convert local from gimple to
1297 (make_eh_dispatch_edges): Require a gimple_eh_dispatch rather than
1299 (redirect_eh_dispatch_edge): Likewise.
1300 (lower_eh_dispatch): Likewise.
1301 (execute_lower_eh_dispatch): Add a checked cast to
1303 (mark_reachable_handlers): Likewise.
1304 (verify_eh_dispatch_edge): Require a gimple_eh_dispatch rather
1305 than a plain gimple.
1307 * tree-eh.h (make_eh_dispatch_edges): Likewise.
1308 (redirect_eh_dispatch_edge): Likewise.
1309 (verify_eh_dispatch_edge): Likewise.
1311 * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1312 gimple_eh_dispatch within GIMPLE_EH_DISPATCH case of switch
1313 statement, adding a local.
1314 (copy_edges_for_bb): Add a checked cast to gimple_eh_dispatch.
1316 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1318 Introduce gimple_resx
1320 * coretypes.h (gimple_resx): New typedef.
1321 (const_gimple_resx): New typedef.
1323 * gimple.h (gimple_build_resx): Return a gimple_resx rather than a
1325 (gimple_resx_region): Require a const_gimple_resx rather than a
1327 (gimple_resx_set_region): Require a gimple_resx rather than a
1330 * gimple-pretty-print.c (dump_gimple_resx): Require a gimple_resx
1331 rather than a plain gimple.
1332 (pp_gimple_stmt_1): Add a checked cast to gimple_resx within
1333 GIMPLE_RESX case of switch statement.
1335 * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1337 * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1339 * gimple.c (gimple_build_resx): Return a gimple_resx rather than
1342 * tree-cfg.c (move_stmt_r): Add a checked cast to gimple_resx
1343 within GIMPLE_RESX case of switch statement, adding a new local.
1345 * tree-eh.c (emit_resx): Convert local "x" from gimple to
1347 (lower_resx): Require a gimple_resx rather than a plain gimple.
1348 (pass_lower_resx::execute): Add a checked cast to gimple_resx.
1349 (mark_reachable_handlers): Likewise.
1351 * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1352 gimple_resx within GIMPLE_RESX case of switch statement, adding
1355 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1357 Introduce gimple_eh_else
1359 * coretypes.h (gimple_eh_else): New typedef.
1360 (const_gimple_eh_else): New typedef.
1362 * gimple.h (gimple_build_eh_else): Return a gimple_eh_else rather
1363 than a plain gimple.
1364 (gimple_eh_else_n_body_ptr): Require a gimple_eh_else rather than
1366 (gimple_eh_else_n_body): Likewise.
1367 (gimple_eh_else_e_body_ptr): Likewise.
1368 (gimple_eh_else_e_body): Likewise.
1369 (gimple_eh_else_set_n_body): Likewise.
1370 (gimple_eh_else_set_e_body): Likewise.
1372 * gimple-low.c (lower_stmt): Add checked cast to gimple_eh_else
1373 within GIMPLE_EH_ELSE case of switch statement, introducing a new
1375 (gimple_stmt_may_fallthru): Likewise.
1377 * gimple-pretty-print.c (dump_gimple_eh_else): Require a
1378 gimple_eh_else rather than a plain gimple.
1379 (pp_gimple_stmt_1): Add checked cast to gimple_eh_else within
1380 GIMPLE_EH_ELSE case of switch statement
1382 * gimple-walk.c (walk_gimple_stmt): Add checked cast to
1383 gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1384 introducing a new local.
1386 * gimple.c (gimple_build_eh_else): Return a gimple_eh_else
1387 rather than a plain gimple.
1388 (gimple_copy): Add checked casts to gimple_eh_else within
1389 GIMPLE_EH_ELSE case of switch statement, introducing new locals.
1391 * tree-cfg.c (verify_gimple_in_seq_2): Add checked cast to
1392 gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1393 introducing a new local.
1395 * tree-eh.c (collect_finally_tree): Likewise.
1396 (replace_goto_queue_1): Likewise.
1397 (get_eh_else): Return a gimple_eh_else rather than a plain gimple.
1398 (honor_protect_cleanup_actions): Convert local "eh_else" from
1399 gimple to gimple_eh_else.
1400 (lower_try_finally_nofallthru): Likewise.
1401 (lower_try_finally_onedest): Introduce locals "eh_else" and
1402 "label_stmt", using them in favor of "x" for the gimple_eh_else
1403 and the gimple_label.
1404 (lower_try_finally_copy): Convert local "eh_else" from gimple to
1406 (lower_try_finally_switch): Likewise.
1407 (decide_copy_try_finally): Likewise.
1408 (refactor_eh_r): Add checked cast to gimple_eh_else within
1409 GIMPLE_EH_ELSE case of switch statement, introducing a new local.
1411 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1413 Introduce gimple_eh_must_not_throw
1415 * coretypes.h (gimple_eh_must_not_throw): New typedef.
1416 (const_gimple_eh_must_not_throw): New typedef.
1418 * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
1419 a gimple_eh_must_not_throw rather than a plain gimple.
1420 (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
1421 within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
1423 * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1425 * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1427 * gimple.c (gimple_build_eh_must_not_throw): Return a
1428 gimple_eh_must_not_throw rather than a plain gimple.
1430 * gimple.h (gimple_build_eh_must_not_throw): Return a
1431 gimple_eh_must_not_throw rather than a plain gimple.
1432 (gimple_eh_must_not_throw_fndecl): Require a
1433 gimple_eh_must_not_throw rather than a plain gimple.
1434 (gimple_eh_must_not_throw_set_fndecl): Likewise.
1436 * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
1438 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1440 Introduce gimple_eh_filter
1442 * coretypes.h (gimple_eh_filter): New typedef.
1443 (const_gimple_eh_filter): New typedef.
1445 * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
1446 rather than a plain gimple.
1448 * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
1449 gimple_eh_filter rather than a plain gimple.
1450 (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
1451 GIMPLE_EH_FILTER case of switch statement.
1453 * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
1454 rather than a plain gimple.
1456 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1458 Introduce gimple_catch
1460 * coretypes.h (gimple_catch): New typedef.
1461 (const_gimple_catch): New typedef.
1463 * gimple-low.c (lower_try_catch): Add checked cast to gimple_catch.
1464 (gimple_try_catch_may_fallthru): Likewise.
1466 * gimple-pretty-print.c (dump_gimple_catch): Require a gimple_catch
1467 rather than a plain gimple.
1468 (pp_gimple_stmt_1): Add checked cast to gimple_catch within
1469 GIMPLE_CATCH case of switch statement.
1471 * gimple-walk.c (walk_gimple_op): Likewise.
1472 (walk_gimple_stmt): Likewise.
1474 * gimple.c (gimple_build_catch): Return a gimple_catch rather than
1476 (gimple_copy): Add checked casts to gimple_catch within
1477 GIMPLE_CATCH case of switch statement, introducing new locals.
1479 * gimple.h (gimple_build_catch): Return a gimple_catch rather than
1481 (gimple_catch_types_ptr): Require a gimple_catch rather than a
1483 (gimple_catch_handler_ptr): Likewise.
1484 (gimple_catch_handler): Likewise.
1485 (gimple_catch_set_types): Likewise.
1486 (gimple_catch_set_handler): Likewise.
1488 * omp-low.c (lower_omp_1): Add checked cast to gimple_catch within
1489 GIMPLE_CATCH case of switch statement.
1491 * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
1492 (do_warn_unused_result): Likewise.
1494 * tree-eh.c (collect_finally_tree): Likewise.
1495 (replace_goto_queue_1): Likewise.
1496 (lower_catch): Convert local from gimple to gimple_catch.
1497 (refactor_eh_r): Add checked cast to gimple_catch within
1498 GIMPLE_CATCH case of switch statement.
1500 * tree-inline.c (remap_gimple_stmt): Likewise.
1501 (estimate_num_insns): Add checked cast to gimple_catch within
1502 GIMPLE_CATCH case of switch statement, introducing new local.
1504 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1506 Introduce gimple_transaction
1508 * coretypes.h (gimple_transaction): New typedef.
1509 (const_gimple_transaction): New typedef.
1511 * gimple.h (gimple_build_transaction): Return a gimple_transaction
1512 rather than a plain gimple.
1513 (gimple_transaction_body_ptr): Require a gimple_transaction rather
1514 than a plain gimple.
1515 (gimple_transaction_body): Likewise.
1516 (gimple_transaction_label_ptr): Likewise.
1517 (gimple_transaction_set_body): Likewise.
1518 (gimple_transaction_set_label): Likewise.
1519 (gimple_transaction_set_subcode): Likewise.
1520 (gimple_transaction_label): Require a const_gimple_transaction
1521 rather than a plain const_gimple.
1522 (gimple_transaction_subcode): Likewise.
1524 * gimple-low.c (lower_stmt): Add checked cast to
1525 gimple_transaction within GIMPLE_TRANSACTION case of switch
1528 * gimple-pretty-print.c (dump_gimple_transaction): Require a
1529 gimple_transaction rather than a plain gimple.
1530 (pp_gimple_stmt_1): Add checked cast to gimple_transaction within
1531 GIMPLE_TRANSACTION case of switch statement.
1532 * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1533 * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1534 * gimple-walk.c (walk_gimple_op): Likewise.
1535 (walk_gimple_stmt): Likewise.
1537 * gimple.c (gimple_build_transaction): Return a gimple_transaction
1538 rather than a plain gimple.
1539 (gimple_copy): Add checked casts to gimple_transaction within
1540 GIMPLE_TRANSACTION case of switch statement.
1542 * gimplify.c (gimplify_transaction): Split local "g" into
1543 "body_stmt" and "trans_stmt", strengthening the type of the latter
1544 from gimple to gimple_transaction.
1546 * omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
1547 within GIMPLE_TRANSACTION case of switch statement.
1549 * trans-mem.c (diagnose_tm_1): Add checked cast within
1550 GIMPLE_TRANSACTION case of switch statement, introducing a new
1551 local "trans_stmt". Use it in place of "stmt".
1552 (examine_call_tm): Convert local from gimple to gimple_transaction.
1553 (tm_region::get_transaction_stmt): New method.
1554 (tm_region::transaction_stmt): Add clarification of type to the
1556 (tm_region_init_0): Require a gimple_transaction rather than a
1558 (tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
1559 dyn_cast<gimple_transaction> and new local.
1560 (transaction_subcode_ior): Add a new local, using the new
1561 get_transaction_stmt method to perform a checked cast.
1562 (propagate_tm_flags_out): Likewise.
1563 (expand_transaction): Add a checked cast using the new
1564 get_transaction_stmt method.
1565 (generate_tm_state): Likewise.
1566 (execute_tm_mark): Likewise.
1567 (ipa_tm_diagnose_transaction): Likewise.
1569 * tree-cfg.c (verify_gimple_transaction): Require a
1570 gimple_transaction rather than a plain gimple.
1571 (make_edges): Add checked cast within GIMPLE_TRANSACTION case of
1573 (cleanup_dead_labels): Likewise.
1574 (verify_gimple_stmt): Likewise.
1575 (verify_gimple_in_seq_2): Likewise.
1576 (verify_gimple_in_seq_2): Likewise.
1577 (gimple_redirect_edge_and_branch): Add checked cast.
1579 * tree-inline.c (remap_gimple_stmt): Add checked cast within
1580 GIMPLE_TRANSACTION case of switch statement, introducing a new
1581 local "old_trans_stmt". Use it in place of "stmt". Add new
1582 local "new_trans_stmt", using it to initialize "copy", and for
1583 type-safe operations as a transaction.
1584 (estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
1585 case of switch statement.
1587 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1589 Introduce gimple_asm
1591 * coretypes.h (gimple_asm): New typedef.
1592 (const_gimple_asm): New typedef.
1594 * gimple.h (gimple_build_asm_vec): Return a gimple_asm rather than
1596 (gimple_asm_clobbers_memory_p): Require a const_gimple_asm rather
1597 than just a const_gimple.
1598 (gimple_asm_ninputs): Likewise.
1599 (gimple_asm_noutputs): Likewise.
1600 (gimple_asm_nclobbers): Likewise.
1601 (gimple_asm_nlabels): Likewise.
1602 (gimple_asm_input_op): Likewise.
1603 (gimple_asm_input_op_ptr): Likewise.
1604 (gimple_asm_output_op): Likewise.
1605 (gimple_asm_output_op_ptr): Likewise.
1606 (gimple_asm_clobber_op): Likewise.
1607 (gimple_asm_label_op): Likewise.
1608 (gimple_asm_string): Likewise.
1609 (gimple_asm_volatile_p): Likewise.
1610 (gimple_asm_input_p): Likewise.
1611 (gimple_asm_set_input_op): Require a gimple_asm rather than a plain
1613 (gimple_asm_set_output_op): Likewise.
1614 (gimple_asm_set_clobber_op): Likewise.
1615 (gimple_asm_set_label_op): Likewise.
1616 (gimple_asm_set_volatile): Likewise.
1617 (gimple_asm_set_input): Likewise.
1619 * cfgexpand.c (expand_asm_stmt): Require a gimple_asm rather than
1621 (expand_gimple_stmt_1): Add checked cast to gimple_asm within
1622 GIMPLE_ASM case of switch statement.
1624 * gimple-fold.c (fold_stmt_1): Add new local from checked cast to
1625 gimple_asm within case GIMPLE_ASM.
1627 * gimple-pretty-print.c (dump_gimple_asm): Require a gimple_asm
1628 rather than a plain gimple.
1629 (pp_gimple_stmt_1): Add checked cast to gimple_asm within
1630 GIMPLE_ASM case of switch statement.
1632 * gimple-streamer-in.c (input_gimple_stmt): Rework existing
1633 checked cast to gimple_asm; add a new one.
1635 * gimple-streamer-out.c (output_gimple_stmt): Add new local from
1636 checked cast to gimple_asm within case GIMPLE_ASM.
1638 * gimple-walk.c (walk_gimple_asm): Require a gimple_asm rather
1639 than a plain gimple.
1640 (walk_gimple_op): Add checked cast to gimple_asm within GIMPLE_ASM
1641 case of switch statement.
1642 (walk_stmt_load_store_addr_ops): Use dyn_cast<gimple_asm> in place
1643 of a code check against GIMPLE_ASM to introduce a new gimple_asm
1646 * gimple.c (gimple_build_asm_1): Return a gimple_asm rather than
1648 (gimple_build_asm_vec): Likewise.
1649 (gimple_has_side_effects): Add a checked cast to gimple_asm.
1650 (gimple_could_trap_p_1): Likewise.
1651 (gimple_call_builtin_p): Require a const_gimple_asm rather then
1654 * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
1655 and a new local of type gimple_asm within GIMPLE_ASM case.
1657 * gimplify.c (gimplify_asm_expr): Convert a local from gimple to
1660 * ipa-pure-const.c (check_stmt): Add checked casts within
1663 * ssa-iterators.h (op_iter_init): Likewise.
1665 * tree-cfg.c (make_goto_expr_edges): Convert a local from gimple
1667 (cleanup_dead_labels): Add a checked cast and a new local of type
1668 gimple_asm within GIMPLE_ASM case.
1669 (gimple_redirect_edge_and_branch): Likewise.
1670 (is_ctrl_altering_stmt): Add a checked cast.
1671 (need_fake_edge_p): Replace a code check against GIMPLE_ASM with a
1672 dyn_cast<gimple_asm>.
1674 * tree-complex.c (expand_complex_comparison): Convert a local from
1675 gimple to gimple_asm.
1677 * tree-data-ref.c (get_references_in_stmt): Add a checked cast to
1680 * tree-eh.c (stmt_could_throw_p): Likewise.
1682 * tree-inline.c (estimate_num_insns): Likewise.
1684 * tree-sra.c (scan_function): Add a checked cast and a new local
1685 of type gimple_asm within GIMPLE_ASM case.
1686 (sra_modify_function_body): Likewise.
1687 (ipa_sra_modify_function_body): Likewise.
1689 * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
1691 * tree-ssa-dce.c (propagate_necessity): Replace a code check
1692 against GIMPLE_ASM with a dyn_cast<gimple_asm>.
1694 * tree-ssa-operands.c (maybe_add_call_vops): Require a gimple_asm
1695 rather than a plain gimple.
1696 (parse_ssa_operands): Add a checked cast to gimple_asm.
1698 * tree-ssa-structalias.c (find_func_aliases): Replace a check for
1699 GIMPLE_ASM with a dyn_cast<gimple_asm>, introducing a new local
1700 "asm_stmt", using it in place of "t" for typesafety.
1702 * tree-ssa-threadedge.c
1703 (record_temporary_equivalences_from_stmts_at_dest): Add a checked
1706 * tree-ssa.c (execute_update_addresses_taken): Add checked casts
1707 and new locals of type gimple_asm within clauses guarded by code
1710 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1712 Introduce gimple_goto
1714 * coretypes.h (gimple_goto): New typedef.
1715 (const_gimple_goto): New typedef.
1717 * gimple.h (gimple_statement_goto): New subclass of
1718 gimple_statement_with_ops, adding the invariant that
1719 stmt->code == GIMPLE_GOTO.
1720 (is_a_helper <gimple_statement_goto>::test): New.
1721 (gimple_build_goto): Return a gimple_goto rather than a
1724 * gimple-pretty-print.c (dump_gimple_goto): Require a gimple_goto
1725 rather than a plain gimple.
1726 (pp_gimple_stmt_1): Add a checked cast to gimple_goto within
1727 GIMPLE_GOTO case of switch statement.
1729 * gimple.c (gimple_build_goto): Return a gimple_goto rather than a
1732 * tree-cfg.c (verify_gimple_goto): Require a gimple_goto rather
1733 than a plain gimple.
1734 (verify_gimple_stmt): Add a checked cast to gimple_goto within
1735 GIMPLE_GOTO case of switch statement.
1737 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1739 Introduce gimple_return
1741 * coretypes.h (gimple_return): New typedef.
1742 (const_gimple_return): New typedef.
1744 * gimple.h (gimple_statement_return): New subclass of
1745 gimple_statement_with_memory_ops, adding the invariant that
1746 stmt->code == GIMPLE_RETURN.
1747 (is_a_helper <gimple_statement_return>::test): New.
1748 (gimple_build_return): Return a gimple_return rather
1749 than a plain gimple.
1751 * gimple.c (gimple_build_return): Return a gimple_return rather
1752 than a plain gimple.
1754 * cgraphunit.c (expand_thunk): Convert local from a gimple to
1757 * gimple-low.c (struct return_statements_t): Convert field "stmt"
1758 from a gimple to a gimple_return.
1759 (lower_gimple_return): Convert local from a gimple to a
1762 * gimple-pretty-print.c (dump_gimple_return): Require a
1763 gimple_return rather than a plain gimple.
1764 (pp_gimple_stmt_1): Add a checked cast to gimple_return within
1765 case GIMPLE_RETURN of switch statement.
1767 * gimplify.c (gimplify_return_expr): Convert locals from
1768 gimple to gimple_return.
1770 * ipa-split.c (split_function): Likewise.
1772 * tree-cfg.c (verify_gimple_assign): Require a gimple_return
1773 rather than a plain gimple.
1774 (verify_gimple_stmt): Add checked cast to gimple_return within
1775 case GIMPLE_RETURN of switch statement.
1777 * tree-tailcall.c (adjust_return_value): Convert local from
1778 gimple to gimple_return.
1780 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1782 Introduce gimple_call
1784 * coretypes.h (gimple_call): New typedef.
1785 (const_gimple_call): New typedef.
1787 * asan.c (get_mem_refs_of_builtin_call): Require a
1788 const_gimple_call rather than a const gimple.
1789 (has_stmt_been_instrumented_p): Add a checked cast to
1791 (instrument_strlen_call): Likewise.
1792 (instrument_builtin_call): Likewise.
1793 * builtins.c (validate_gimple_arglist): Require a
1794 const_gimple_call rather than a const gimple.
1795 (fold_call_stmt): Require a gimple_call rather than a gimple.
1796 * builtins.h (validate_gimple_arglist): Require a
1797 const_gimple_call rather than a const gimple.
1798 (fold_call_stmt): Require a gimple_call rather than a gimple.
1799 * cfgexpand.c (expand_call_stmt): Likewise.
1800 (expand_gimple_stmt_1): Add a checked cast to gimple_call within
1802 * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Strengthen
1803 local "new_stmt" from gimple to gimple_call, adding a checked
1805 * cgraphunit.c (cgraph_node::expand_thunk): Likewise for local
1807 * gimple-fold.c (gimple_fold_builtin_snprintf_chk): Likewise for
1809 (gimple_fold_builtin_snprintf): Likewise.
1810 (gimple_fold_builtin): Likewise.
1811 (gimple_fold_call): Likewise.
1812 (gimple_fold_stmt_to_constant_1): Introduce local "call_stmt" via
1813 checked cast of "stmt" to gimple_call, using it in various places
1815 * gimple-pretty-print.c (dump_gimple_call_args): Strengthen param
1816 2 from gimple to gimple_call.
1817 (dump_gimple_call): Likewise.
1818 (pp_gimple_stmt_1): Add a checked cast to gimple_call within
1820 * gimple-streamer-in.c (input_gimple_stmt): Replace is_gimple_call
1821 with a dyn_cast<gimple_call>, introducing local "call_stmt", and
1822 using it in place of "stmt" for typesafety. Add a checked cast
1823 in statement guarded by check for GIMPLE_CALL.
1824 * gimple-walk.c (walk_gimple_op): Add a checked cast to
1826 * gimple.c (gimple_call_reset_alias_info): Strengthen param from
1827 gimple to gimple_call.
1828 (gimple_build_call_1): Strengthen return type and local from
1829 gimple to gimple_call.
1830 (gimple_build_call_vec): Likewise.
1831 (gimple_build_call): Likewise.
1832 (gimple_build_call_valist): Likewise.
1833 (gimple_build_call_internal_1): Likewise.
1834 (gimple_build_call_internal): Likewise.
1835 (gimple_build_call_internal_vec): Likewise.
1836 (gimple_build_call_from_tree): Likewise.
1837 (gimple_call_return_flags): Strengthen param from
1838 const_gimple to const_gimple_call.
1839 (gimple_call_copy_skip_args): Strengthen return type and local from
1840 gimple to gimple_call.
1841 * gimple.h (gimple_call_reset_alias_info): Strengthen param from
1842 gimple to gimple_call.
1843 (gimple_build_call_vec): Strengthen return type from gimple to
1845 (gimple_build_call): Likewise.
1846 (gimple_build_call_valist): Likewise.
1847 (gimple_build_call_internal): Likewise.
1848 (gimple_build_call_internal_vec): Likewise.
1849 (gimple_build_call_from_tree): Likewise.
1850 (gimple_call_return_flags): Strengthen param from const_gimple to
1852 (gimple_call_copy_skip_args): Strengthen return type from gimple
1854 (gimple_call_set_internal_fn): Strengthen param "call_stmt" from
1855 gimple to gimple_call.
1856 (gimple_call_return_type): Strengthen param from const_gimple to
1858 (gimple_call_chain_ptr): Likewise.
1859 (gimple_call_set_chain): Strengthen param from gimple to
1861 (gimple_call_set_return_slot_opt): Likewise.
1862 (gimple_call_set_from_thunk): Likewise.
1863 (gimple_call_from_thunk_p): Likewise.
1864 (gimple_call_set_va_arg_pack): Likewise.
1865 (gimple_call_va_arg_pack_p): Likewise.
1866 (gimple_call_set_alloca_for_var): Likewise.
1867 (gimple_call_alloca_for_var_p): Likewise.
1868 (gimple_expr_type): Introduce local "call_stmt" via a checked cast
1869 and use it for typesafety.
1870 * gimplify.c (gimplify_call_expr): Strengthen local "call" from
1871 gimple to gimple_call.
1872 (gimplify_modify_expr_to_memcpy): Likewise for local "gs".
1873 (gimplify_modify_expr_to_memset): Likewise.
1874 (gimplify_modify_expr): Add a checked cast to gimple_call.
1875 (gimplify_expr): Strengthen local "call" from gimple to
1877 (gimplify_function_tree): Likewise.
1878 * internal-fn.c (expand_LOAD_LANES): Strengthen param from gimple
1880 (expand_STORE_LANES): Likewise.
1881 (expand_ANNOTATE): Likewise.
1882 (expand_GOMP_SIMD_LANE): Likewise.
1883 (expand_GOMP_SIMD_VF): Likewise.
1884 (expand_GOMP_SIMD_LAST_LANE): Likewise.
1885 (expand_UBSAN_NULL): Likewise.
1886 (expand_UBSAN_BOUNDS): Likewise.
1887 (expand_UBSAN_OBJECT_SIZE): Likewise.
1888 (expand_ASAN_CHECK): Likewise.
1889 (ubsan_expand_si_overflow_addsub_check): Likewise.
1890 (ubsan_expand_si_overflow_neg_check): Likewise.
1891 (ubsan_expand_si_overflow_mul_check): Likewise.
1892 (expand_UBSAN_CHECK_ADD): Likewise.
1893 (expand_UBSAN_CHECK_SUB): Likewise.
1894 (expand_UBSAN_CHECK_MUL): Likewise.
1895 (expand_LOOP_VECTORIZED): Likewise.
1896 (expand_MASK_LOAD): Likewise.
1897 (expand_MASK_STORE): Likewise.
1898 (expand_ABNORMAL_DISPATCHER): Likewise.
1899 (expand_BUILTIN_EXPECT): Likewise.
1900 (internal_fn_expanders): Likewise for entries in this table.
1901 (expand_internal_call): Likewise.
1902 * internal-fn.def: Update comment to reflect strengthening of
1904 * internal-fn.h (expand_internal_call): Strengthen param from
1905 gimple to gimple_call.
1906 * ipa-prop.c (ipa_modify_call_arguments): Likewise for local
1908 * ipa-pure-const.c (check_call): Likewise for param "call".
1909 (check_stmt): Add a checked cast to gimple_call within GIMPLE_CALL
1911 * ipa-split.c (split_function): Strengthen local "call" from
1912 gimple to gimple_call.
1913 * omp-low.c (build_omp_barrier): Likewise for local "g".
1914 (lower_rec_input_clauses): Likewise for local "stmt".
1915 * trans-mem.c (build_tm_load): Likewise for return type and local
1917 (build_tm_store): Likewise.
1918 (expand_transaction): Likewise for local "call".
1919 * tree-call-cdce.c (check_pow): Likewise for param.
1920 (check_builtin_call): Likewise.
1921 (is_call_dce_candidate): Likewise.
1922 (gen_conditions_for_pow): Likewise.
1923 (gen_shrink_wrap_conditions): Likewise.
1924 (shrink_wrap_one_built_in_call): Likewise.
1925 (shrink_wrap_conditional_dead_built_in_calls): Strengthen param
1926 from vec<gimple> to vec<gimple_call>, and local "bi_call" from
1927 gimple to gimple_call.
1928 (pass_call_cdce::execute): Strengthen local
1929 "cond_dead_built_in_calls" from auto_vec<gimple> to
1930 auto_vec<gimple_call> and local "stmt" from gimple to gimple_call,
1931 * tree-cfg.c (notice_special_calls): Strengthen param from gimple
1933 * tree-cfg.h (notice_special_calls): Likewise.
1934 * tree-complex.c (expand_complex_libcall): Likewise for local
1936 * tree-inline.c (remap_gimple_stmt): Add checked cast to
1938 (copy_bb): Likewise. Strengthen local "new_call" from gimple to
1940 (inline_forbidden_p_stmt): Add checked cast to gimple_call.
1941 * tree-nested.c (init_tmp_var_with_call): Strengthen param "call"
1942 from gimple to gimple_call.
1943 (convert_nl_goto_reference): Likewise for local "call".
1944 (convert_tramp_reference_op): Likewise.
1945 (convert_gimple_call): Add checked cast to gimple_call.
1946 * tree-nrv.c (dest_safe_for_nrv_p): Strengthen param "call" from
1947 gimple to gimple_call.
1948 (pass_return_slot::execute): Likewise for local "stmt", using a
1949 dyn_cast<gimple_call> rather than an is_gimple_call call.
1950 * tree-object-size.c (alloc_object_size): Strengthen param "call"
1951 from const_gimple to const_gimple_call.
1952 (pass_through_call): Likewise.
1953 (call_object_size): Strengthen param "call" from gimple to
1955 (collect_object_sizes_for): Introduce local "call_stmt" via a
1956 checked cast, using it for typesafety.
1957 (check_for_plus_in_loops_1): Likewise.
1958 (pass_object_sizes::execute): Add a checked cast to gimple_call.
1959 * tree-profile.c (gimple_gen_interval_profiler): Strengthen local
1960 "call" from gimple to gimple_call.
1961 (gimple_gen_pow2_profiler): Likewise.
1962 (gimple_gen_one_value_profiler): Likewise.
1963 (gimple_gen_time_profiler): Likewise.
1964 (gimple_gen_average_profiler): Likewise.
1965 (gimple_gen_ior_profiler): Likewise.
1966 * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise for
1968 (ref_maybe_used_by_call_p): Likewise.
1969 (ref_maybe_used_by_stmt_p): Add a checked cast to gimple_call.
1970 (call_may_clobber_ref_p_1): Strengthen param "call" from gimple to
1972 (call_may_clobber_ref_p): Likewise.
1973 (stmt_may_clobber_ref_p_1): Add a checked cast to gimple_call.
1974 * tree-ssa-alias.h (call_may_clobber_ref_p): Strengthen param 1
1975 from gimple to gimple_call.
1976 (call_may_clobber_ref_p_1): Likewise.
1977 * tree-ssa-dce.c (eliminate_unnecessary_stmts): Add a checked cast
1979 * tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Strengthen
1980 local "call" from gimple to gimple_call.
1981 * tree-ssa-math-opts.c (build_and_insert_call): Likewise for local
1983 * tree-ssa-operands.c (maybe_add_call_vops): Likewise for param
1985 (parse_ssa_operands): Add a checked cast to gimple_call within
1987 * tree-ssa-pre.c (compute_avail): Add a checked cast to
1989 * tree-ssa-sccvn.c (copy_reference_ops_from_call): Strengthen
1990 param "call" from gimple to gimple_call.
1991 (valueize_shared_reference_ops_from_call): Likewise.
1992 (vn_reference_lookup_3): Add a checked cast to gimple_call.
1993 (vn_reference_lookup_call): Strengthen param "call" from gimple to
1995 (visit_reference_op_call): Likewise for param "stmt".
1996 (visit_use): Replace is_gimple_call with a dyn_cast, introducing
1997 local "call_stmt", using it in place of "stmt" for type-safety.
1998 * tree-ssa-sccvn.h (vn_reference_lookup_call): Strengthen param 1
1999 from gimple to gimple_call.
2000 * tree-ssa-structalias.c (get_call_vi): Likewise.
2001 (lookup_call_use_vi): Likewise.
2002 (lookup_call_clobber_vi): Likewise.
2003 (get_call_use_vi): Likewise.
2004 (get_call_clobber_vi): Likewise.
2005 (handle_rhs_call): Likewise.
2006 (handle_lhs_call): Likewise.
2007 (handle_const_call): Likewise.
2008 (handle_pure_call): Likewise.
2009 (get_fi_for_callee): Likewise.
2010 (find_func_aliases_for_builtin_call): Likewise for param 2.
2011 (find_func_aliases_for_call): Likewise.
2012 (find_func_aliases): Add a checked cast to gimple_call.
2013 (find_func_clobbers): Replace is_gimple_call with a dyn_cast,
2014 introducing local "call_stmt", using it in place of "stmt" for
2016 (compute_points_to_sets): Strengthen local "stmt" from gimple to
2017 gimple_call, replacing is_gimple_call with a
2018 dyn_cast <gimple_call>.
2019 (ipa_pta_execute): Likewise.
2020 * tree-ssa-threadedge.c
2021 (record_temporary_equivalences_from_stmts_at_dest): Add checked
2022 cast to gimple_call.
2023 * tree-tailcall.c (find_tail_calls): Strengthen local "call" from
2024 gimple to gimple_call, adding a checked cast.
2025 * tree-vect-data-refs.c (vect_setup_realignment): Eliminate
2026 top-level local "new_stmt" in favor of more tightly-scoped locals
2027 "new_stmt" of type gimple_assign and gimple_call.
2028 * tree-vect-patterns.c (vect_recog_pow_pattern): Strenghthen local
2029 "stmt" from gimple to gimple_call.
2030 * tree-vect-stmts.c (vectorizable_function): Likewise for param
2032 (vectorizable_call): Rename param 1 from "stmt" to "gs",
2033 reintroducing "stmt" as a gimple_call once we've established that
2034 we're working with a GIMPLE_CALL.
2035 * tree-vectorizer.h (vectorizable_function): Strengthen param 1
2036 from gimple to gimple_call.
2037 * value-prof.c (check_ic_target): Likewise.
2038 (gimple_ic_transform): Likewise for local "stmt", replacing a
2039 check for GIMPLE_CALL with a dyn_cast.
2040 (interesting_stringop_to_profile_p): Strengthen param "call"
2041 from gimple to gimple_call.
2042 (gimple_stringop_fixed_value): Likewise for param "vcall_stmt".
2043 (gimple_stringops_transform): Likewise for local "stmt",
2044 replacing a check for GIMPLE_CALL with a dyn_cast.
2045 (gimple_stringops_values_to_profile): Rename param 1 from "stmt"
2046 to "gs", reintroducing "stmt" as a gimple_call once we've
2047 established that we're working with a GIMPLE_CALL.
2048 * vtable-verify.c (verify_bb_vtables): Strengthen local
2049 "call_stmt" from gimple to gimple_call.
2051 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2053 Concretize get_loop_exit_condition et al to working on gimple_cond
2055 * tree-scalar-evolution.h (get_loop_exit_condition): Return a
2057 * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
2058 concretizing local "res" from gimple to gimple_cond.
2059 * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
2060 locals from gimple to gimple_cond.
2061 (slpeel_can_duplicate_loop_p): Likewise.
2062 * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
2063 (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
2065 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2067 Update various expressions within tree-scalar-evolution.c to be gimple_phi
2069 * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
2070 rather than a gimple.
2071 (follow_ssa_edge_binary): Likewise.
2072 (follow_ssa_edge_expr): Likewise.
2073 (follow_ssa_edge_in_rhs): Likewise.
2074 (backedge_phi_arg_p): Likewise.
2075 (follow_ssa_edge_in_condition_phi_branch): Likewise.
2076 (follow_ssa_edge_in_condition_phi): Likewise.
2077 (follow_ssa_edge_inner_loop_phi): Likewise.
2078 (analyze_evolution_in_loop): Likewise.
2079 (analyze_initial_condition): Likewise.
2080 (interpret_loop_phi): Likewise.
2081 (interpret_condition_phi): Likewise.
2082 (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
2084 (analyze_scalar_evolution_1): Add checked casts to gimple_phi
2085 within "case GIMPLE_PHI".
2087 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2089 tree-ssa-loop-ivopts.c: use gimple_phi in a few places
2091 * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
2092 (find_bivs): Convert local "phi" into a gimple_phi.
2093 (mark_bivs): Likewise.
2095 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2097 tree-ssa-loop-manip.c: use gimple_phi in three places
2099 * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
2101 (split_loop_exit_edge): Likewise for "phi" and "new_phi".
2103 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2105 tree-ssa-loop-niter.c: use gimple_phi in a few places
2107 * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
2108 rather than a gimple.
2109 (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
2110 (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
2112 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2114 tree-ssa-phiprop.c: use gimple_phi
2116 * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
2117 parameter "phi" and local "new_phi" from gimple to gimple_phi.
2119 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2121 tree-predcom.c: use gimple_phi in various places
2123 * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
2125 (insert_looparound_copy): Require a gimple_phi rather than just a
2127 (add_looparound_copies): Convert local "phi" to be a gimple_phi.
2128 (initialize_root_vars): Likewise.
2129 (initialize_root_vars_lm): Likewise.
2131 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2133 tree-parloops.c: use gimple_phi in various places
2135 * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
2136 from gimple to gimple_phi.
2137 (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
2138 (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
2139 (gather_scalar_reductions): Convert to a gimple_phi_iterator and
2141 (try_create_reduction_list): Likewise.
2143 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2145 Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
2147 * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
2148 type of parameter from gimple to gimple_phi.
2150 * tree-complex.c (complex_visit_phi): Update signature of callback
2151 implementation accordingly.
2152 * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
2153 * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
2154 * tree-vrp.c (vrp_visit_phi_node): Likewise.
2156 * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
2157 gimple_phi when invoking the ssa_prop_visit_phi callback.
2159 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2161 Introduce gimple_phi_iterator
2163 * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
2164 gimple_stmt_iterator with identical layout, but adding...
2165 (gimple_phi_iterator::phi): ...new method, equivalent to
2166 gsi_stmt (), but casting the underlying gimple to gimple_phi,
2167 checking that code == GIMPLE_PHI in a checked build.
2168 (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
2169 gimple_stmt_iterator.
2171 * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
2173 (if_convertible_phi_p): Likewise.
2174 * tree-phinodes.h (add_phi_node_to_bb): Likewise.
2175 * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
2177 * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
2178 and a vec<gimple_phi> *, rather than just a gimple and
2179 vec<gimple> *, and a hash_set<gimple_phi> * rather than a
2181 (find_uninit_use): Likewise; add checked cast to gimple_phi when
2183 (pass_late_warn_uninitialized::execute): Strengthen types of
2184 various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
2185 "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
2186 gimple_phi, "added_to_worklist" from hash_set<gimple> to
2187 hash_set<gimple_phi>.
2189 * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
2190 gimple_phi_iterator * rather than a gimple_stmt_iterator *;
2191 use it to strengthen local from a gimple to a gimple_phi.
2193 * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
2194 gimple_stmt_iterator to a gimple_phi_iterator. Use the iterator's
2195 "phi" method rather than gsi_stmt. Use this checked cast to convert
2196 the type of related local from a plain gimple to a gimple_phi.
2197 * gimple-pretty-print.c (dump_phi_nodes): Likewise.
2198 * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
2200 * sese.c (sese_add_exit_phis_edge): Likewise.
2201 * tree-cfg.c (reinstall_phi_args): Likewise.
2202 (gimple_make_forwarder_block): Likewise.
2203 (add_phi_args_after_copy_edge): Likewise.
2204 (gimple_lv_adjust_loop_header_phi): Likewise.
2205 * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
2206 (remove_forwarder_block_with_phi): Likewise.
2207 (merge_phi_nodes): Likewise.
2208 * tree-complex.c (update_phi_components): Likewise.
2209 * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
2210 * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
2211 (copy_phis_for_bb): Likewise.
2212 * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
2213 * tree-outof-ssa.c (eliminate_build): Likewise.
2214 (eliminate_useless_phis): Likewise.
2215 (rewrite_trees): Likewise.
2216 (insert_backedge_copies): Likewise.
2217 * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
2218 (remove_phi_args): Likewise.
2219 (remove_phi_nodes): Likewise.
2220 * tree-predcom.c (find_looparound_phi): Likewise.
2221 (eliminate_temp_copies): Likewise.
2222 * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
2223 (scev_const_prop): Likewise; also, add checked cast to phi.
2224 * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
2225 * tree-ssa-dce.c (remove_dead_phis): Likewise.
2226 (forward_edge_to_pdom): Likewise.
2227 * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
2228 (cprop_into_successor_phis): Likewise.
2229 (propagate_rhs_into_lhs): Likewise.
2230 (eliminate_degenerate_phis_1): Likewise.
2231 * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
2232 * tree-ssa-live.c (calculate_live_on_exit): Likewise.
2233 (verify_live_on_entry): Likewise.
2234 * tree-ssa-loop-im.c
2235 (move_computations_dom_walker::before_dom_children): Likewise.
2236 * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
2237 (mark_bivs): Likewise.
2238 (find_interesting_uses_outside): Likewise.
2239 (determine_set_costs): Likewise.
2240 * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
2241 (tree_transform_and_unroll_loop): Likewise.
2242 (rewrite_all_phi_nodes_with_iv): Likewise.
2243 (canonicalize_loop_ivs): Likewise.
2244 * tree-ssa-loop-niter.c (determine_value_range): Likewise.
2245 * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
2246 * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
2247 * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
2248 * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
2249 (vop_phi): Likewise.
2250 * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
2252 * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
2253 (copy_phi_args): Likewise.
2254 (phi_args_equal_on_edges): Likewise.
2255 * tree-ssa.c (ssa_redirect_edge): Likewise.
2256 (flush_pending_stmts): Likewise.
2257 * tree-switch-conversion.c (check_final_bb): Likewise.
2258 (gather_default_values): Likewise.
2259 (build_constructors): Likewise.
2260 (fix_phi_nodes): Likewise.
2261 * tree-tailcall.c (propagate_through_phis): Likewise.
2262 (add_successor_phi_arg): Likewise.
2263 * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
2265 (slpeel_update_phi_nodes_for_guard2): Likewise.
2266 (slpeel_tree_peel_loop_to_edge): Likewise.
2267 (vect_can_advance_ivs_p): Likewise.
2268 (vect_update_ivs_after_vectorizer): Likewise.
2269 * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
2270 * tree-vrp.c (find_assert_locations): Likewise.
2271 * value-prof.c (gimple_ic): Likewise.
2273 * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
2275 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2277 Introduce gimple_phi and use it in various places
2279 * coretypes.h (gimple_phi): New typedef.
2280 (const_gimple_phi): New typedef.
2282 * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
2283 variants, using the gimple printer.
2285 * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
2286 vecs of more concrete gimple subclasses as appropriate; also the
2287 comment is about to become misleading.
2289 * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
2290 rather than spelling out the full type.
2291 (gimple_phi_num_args): Likewise.
2292 (gimple_phi_result): Likewise.
2293 (gimple_phi_result_ptr): Use gimple_phi typedef.
2294 (gimple_phi_set_result): Likewise.
2295 (gimple_phi_arg): Likewise.
2296 (gimple_phi_set_arg): Likewise.
2297 * tree-phinodes.c (allocate_phi_node): Likewise.
2298 (resize_phi_node): Likewise.
2299 (reserve_phi_args_for_new_edge): Likewise.
2300 (remove_phi_arg_num): Likewise.
2302 * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
2303 rather than just a gimple.
2304 * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
2306 * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
2308 (create_phi_node): Likewise.
2309 * tree-phinodes.h (create_phi_node): Likewise.
2311 * trans-mem.c (struct struct tm_log_entry): Replace use of
2312 now-removed gimple_vec with a plain vec<gimple>.
2314 * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
2315 vec<gimple_vec> to a vec< vec<gimple_phi> >.
2317 * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
2319 * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
2320 "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
2322 * tree-into-ssa.c (delete_update_ssa): Strengthen local
2323 "phis" from a gimple_vec to a vec<gimple_phi>.
2325 * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2326 gimple_phi in regions where a stmt is known to have code
2328 * tree-into-ssa.c (mark_use_interesting): Likewise.
2330 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2332 Introduce gimple_debug and use it in a few places
2334 * coretypes.h (gimple_debug): New typedef.
2335 (const_gimple_debug): New typedef.
2337 * gimple.h (struct gimple_statement_debug): New subclass of
2338 gimple_statement_with_ops, adding the invariant that
2339 stmt->code == GIMPLE_DEBUG.
2340 (is_a_helper <gimple_statement_debug>::test): New.
2342 * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
2343 variants, using the gimple printer.
2345 * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
2346 rather than just a gimple.
2347 * tree-inline.c (copy_debug_stmt): Likewise.
2349 * tree-inline.h (struct copy_body_data): Strengthen field
2350 "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
2352 * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
2353 rather than just a gimple.
2354 (gimple_build_debug_source_bind_stat): Likewise.
2355 * gimple.h (gimple_build_debug_bind_stat): Likewise.
2356 (gimple_build_debug_source_bind_stat): Likewise.
2358 * tree-inline.c (remap_gimple_stmt): Update locals to be a
2360 (maybe_move_debug_stmts_to_successors): Likewise.
2361 (copy_debug_stmts): Likewise.
2363 * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2364 gimple_debug in regions where a stmt is known to have code
2367 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2369 Introduce gimple_label and use it in a few places
2371 * coretypes.h (gimple_label): New typedef.
2372 (const_gimple_label): New typedef.
2374 * gimple.h (struct gimple_statement_label): New subclass of
2375 gimple_statement_with_ops, adding the invariant that
2376 stmt->code == GIMPLE_LABEL.
2377 (is_a_helper <gimple_statement_label>::test): New.
2379 * gdbhooks.py (build_pretty_printer): Add gimple_label and its
2380 variants, reusing the gimple printer.
2382 * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
2383 rather than just a gimple.
2384 * tree-cfg.c (verify_gimple_label): Likewise.
2386 * gimple.c (gimple_build_label): Return a gimple_label rather than
2388 * gimple.h (gimple_build_label): Likewise.
2390 * gimplify.c (gimplify_case_label_expr): Update local to be a
2392 * tree-switch-conversion.c (gen_inbound_check): Likewise.
2394 * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2395 gimple_label in regions where a stmt is known to have code
2397 * tree-cfg.c (verify_gimple_stmt): Likewise.
2399 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2401 Introduce gimple_assign and use it in various places
2403 * coretypes.h (gimple_assign): New typedef.
2404 (const_gimple_assign): New typedef.
2406 * gimple.h (struct gimple_statement_assign): New subclass of
2407 gimple_statement_with_memory_ops, adding the invariant that
2408 stmt->code == GIMPLE_ASSIGN.
2409 (is_a_helper <gimple_statement_assign>::test): New.
2411 * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
2412 variants, using the gimple printer.
2414 * gimple-builder.c (build_assign): Return a gimple_assign rather
2415 than just a gimple from each of the overloaded variants.
2416 (build_type_cast): Likewise.
2417 * gimple-builder.h (build_assign): Likewise.
2418 (build_type_cast): Likewise.
2419 * gimple.c (gimple_build_assign_stat): Likewise.
2420 (gimple_build_assign_with_ops): Likewise.
2421 * gimple.h (gimple_build_assign_stat): Likewise.
2422 (gimple_build_assign_with_ops): Likewise.
2424 * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
2425 rather than just a "const gimple" (the latter is not a
2427 * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
2428 rather than just a gimple.
2429 (dump_binary_rhs): Likewise.
2430 (dump_ternary_rhs): Likewise.
2431 * tree-cfg.c (verify_gimple_assign_unary): Likewise.
2432 (verify_gimple_assign_binary): Likewise.
2433 (verify_gimple_assign_ternary): Likewise.
2434 (verify_gimple_assign_single): Likewise.
2435 (verify_gimple_assign): Likewise.
2436 * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
2437 (try_to_simplify): Likewise.
2438 * tree-tailcall.c (process_assignment): Likewise.
2439 * tree-vect-generic.c (expand_vector_operation): Likewise.
2440 * tree-vrp.c (extract_range_from_cond_expr): Likewise.
2441 (extract_range_from_assignment): Likewise.
2443 * asan.c (has_stmt_been_instrumented_p): Add checked cast to
2444 gimple_assign in regions where a stmt is known to have code
2446 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2447 * tree-cfg.c (verify_gimple_stmt): Likewise.
2448 * tree-ssa-sccvn.c (visit_use): Likewise.
2449 * tree-tailcall.c (find_tail_calls): Likewise.
2450 * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
2452 * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
2453 against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
2454 a gimple_assign local.
2456 * tree-vect-generic.c (expand_vector_condition): Convert local to a
2457 gimple_assign, adding a checked cast when extracting from gsi, since
2458 this is only called when underlying stmt has code GIMPLE_ASSIGN.
2459 (optimize_vector_constructor): Likewise.
2460 (lower_vec_perm): Likewise.
2461 (expand_vector_operations_1): Convert local to a gimple_assign,
2462 introducing a dyn_cast.
2464 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2466 Introduce gimple_cond and use it in various places
2468 * coretypes.h (gimple_cond): New typedef.
2469 (const_gimple_cond): Likewise.
2471 * gimple.h (struct gimple_statement_cond): New subclass of
2472 gimple_statement_with_ops, adding the invariant that
2473 stmt->code == GIMPLE_COND.
2474 (is_a_helper <gimple_statement_cond>::test): New.
2475 (gimple_build_cond): Return a gimple_cond, rather than just
2477 (gimple_build_cond_from_tree): Likewise.
2479 * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
2480 variants, using the gimple printer.
2482 * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
2484 * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
2485 (gimple_cond_true_p): Likewise.
2486 (gimple_cond_false_p): Likewise.
2487 (gimple_cond_set_condition): Likewise.
2488 * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
2489 * gimple-fold.c (fold_gimple_cond): Likewise.
2490 * gimple-pretty-print.c (dump_gimple_cond): Likewise.
2491 * tree-ssa-dom.c (canonicalize_comparison): Likewise.
2492 * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
2493 * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
2494 (recognize_bits_test): Likewise.
2495 * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
2496 (thread_around_empty_blocks): Likewise.
2497 (thread_through_normal_block): Likewise.
2498 (thread_across_edge): Likewise.
2499 * tree-ssa-threadedge.h (thread_across_edge): Likewise.
2500 * tree-vrp.c (range_fits_type_p): Likewise.
2502 * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
2503 gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
2504 * gimple-fold.c (fold_stmt_1): Likewise.
2505 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2506 * tree-ssa-dom.c (optimize_stmt): Likewise.
2507 * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2508 * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
2509 * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
2511 * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
2513 * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
2515 * tree-vrp.c (identify_jump_threads): Likewise.
2517 * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
2519 (gimple_build_cond_from_tree): Likewise.
2521 * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
2522 field "m_dummy_cond" from a plain gimple to a gimple_cond.
2524 * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
2525 inner_stmt and outer_stmt so that inner_cond and outer_cond can be
2526 of type gimple_cond once we know that we have code == GIMPLE_COND.
2527 * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
2528 "last" so that stmt can be of type gimple_cond.
2530 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2532 Introduce gimple_bind and use it for accessors.
2534 * coretypes.h (gimple_bind): New typedef.
2535 (const_gimple_bind): New typedef.
2537 * gdbhooks.py (build_pretty_printer): Add gimple_bind
2538 and its variants, using the gimple printer.
2540 * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
2541 require a gimple_bind rather than just a gimple.
2543 * gimple.c (gimple_build_bind): Return a gimple_bind rather than
2545 * gimple.h (gimple_build_bind): Likewise.
2547 * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
2549 * gimple.h (gimple_bind_vars): Update type-signature to
2550 require a gimple_bind rather than just a gimple, removing
2551 as_a and hence run-time check.
2552 (gimple_bind_set_vars): Likewise.
2553 (gimple_bind_append_vars): Likewise.
2554 (gimple_bind_body_ptr): Likewise.
2555 (gimple_bind_body): Likewise.
2556 (gimple_bind_set_body): Likewise.
2557 (gimple_bind_add_stmt): Likewise.
2558 (gimple_bind_add_seq): Likewise.
2559 (gimple_bind_block): Likewise.
2560 (gimple_bind_set_block): Likewise.
2561 * gimplify.c (gimple_push_bind_expr): Likewise.
2562 (gimple_current_bind_expr): Likewise.
2563 * tree-inline.c (copy_gimple_bind): Likewise.
2565 * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
2566 rather than a plain gimple.
2567 (gimplify_body): Likewise.
2568 (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
2571 * gimplify.c (struct gimplify_ctx): Strengthen field
2572 "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
2573 (gimple_bind_expr_stack): Likewise for type of returned value.
2575 * gimplify.c (gimplify_body): Strengthen various types from gimple
2576 to gimple_bind, including the return type.
2578 * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
2579 so that local "scope" can be of type gimple_bind once we've reached
2580 the region where it must be of code GIMPLE_BIND.
2582 * gimple-low.c (lower_gimple_bind): Add checked cast to
2583 gimple_bind, since both callers (lower_function_body and
2584 lower_stmt) have checked the code for us.
2586 * gimple.c (gimple_copy): Add checked cast to gimple_bind in
2587 region guarded by check for code GIMPLE_BIND.
2588 * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
2589 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2590 * gimple-walk.c (walk_gimple_stmt): Likewise.
2591 * omp-low.c (scan_omp_1_stmt): Likewise.
2592 (lower_omp_1): Likewise.
2593 (lower_omp_for): Likewise.
2594 * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
2595 (do_warn_unused_result): Likewise.
2596 * tree-inline.c (remap_gimple_stmt): Likewise.
2597 (estimate_num_insns): Likewise.
2598 * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
2600 * gimplify.c (gimplify_bind_expr): Update local(s) to be a
2601 gimple_bind rather than just a gimple.
2602 (gimplify_function_tree): Likewise.
2603 * omp-low.c (lower_omp_sections): Likewise.
2604 (lower_omp_single): Likewise.
2605 (lower_omp_master): Likewise.
2606 (lower_omp_taskgroup): Likewise.
2607 (lower_omp_ordered): Likewise.
2608 (lower_omp_critical): Likewise.
2609 (lower_omp_taskreg): Likewise.
2610 (lower_omp_teams): Likewise.
2611 * omp-low.c (lower_omp_for): Likewise; use
2612 gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
2613 (lower_omp_target): Likewise.
2614 * tree-nested.c (finalize_nesting_tree_1): Likewise.
2616 * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
2617 * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
2619 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2621 Introduce gimple_switch and use it in various places
2623 * gimple.h (gimple_statement_switch): New subclass of
2624 gimple_statement_with_ops, adding the invariant that
2625 stmt->code == GIMPLE_SWITCH.
2626 (is_a_helper <gimple_statement_switch>::test (gimple)): New.
2628 * coretypes.h (gimple_switch): New typedef
2629 (const_gimple_switch): Likewise.
2631 * gdbhooks.py (build_pretty_printer): Add gimple_switch
2632 and its variants, using the gimple printer.
2634 * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
2635 rather than just a gimple.
2636 (gimple_build_switch): Likewise.
2637 * gimple.h (gimple_build_switch_nlabels): Likewise.
2638 (gimple_build_switch): Likewise.
2640 * gimple.h (gimple_switch_num_labels): Update type-signature to
2641 require a gimple_switch rather than just a gimple.
2642 (gimple_switch_set_num_labels): Likewise.
2643 (gimple_switch_set_index): Likewise.
2644 (gimple_switch_label): Likewise.
2645 (gimple_switch_set_label): Likewise.
2646 (gimple_switch_default_label): Likewise.
2647 (gimple_switch_set_default_label): Likewise.
2648 * expr.h (expand_case): Likewise.
2649 * gimple-pretty-print.c (dump_gimple_call): Likewise.
2650 * stmt.c (compute_cases_per_edge): Likewise.
2651 (expand_case): Likewise.
2652 * tree-cfg.h (group_case_labels_stmt): Likewise.
2653 * tree-cfg.c (make_gimple_switch_edges): Likewise.
2654 (find_taken_edge_switch_expr) Likewise.
2655 (find_case_label_for_value) Likewise.
2656 (get_cases_for_edge): Likewise.
2657 (group_case_labels_stmt): Likewise.
2658 (verify_gimple_switch): Likewise.
2659 * tree-eh.c (verify_norecord_switch_expr): Likewise.
2660 * tree-eh.c (lower_eh_constructs_2): Likewise.
2661 * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
2662 * tree-ssa-dom.c (record_edge_info): Likewise.
2663 * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
2664 (simplify_gimple_switch): Likewise.
2665 * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
2666 (collect_switch_conv_info): Likewise.
2667 (build_constructors): Likewise.
2668 (array_value_type): Likewise.
2669 (build_one_array): Likewise.
2670 (build_arrays): Likewise.
2671 (gen_inbound_check): Likewise.
2672 * tree-vrp.c (find_switch_asserts): Likewise.
2673 (find_case_label_range): Likewise.
2674 (find_case_label_ranges): Likewise.
2675 (vrp_visit_switch_stmt): Likewise.
2676 (simplify_switch_using_ranges): Likewise.
2678 * tree-vrp.c (switch_update): Strengthen field "stmt" from being
2679 merely a gimple to being a gimple_switch.
2681 * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
2682 gimple_switch in regions where the stmt code has been tested as
2684 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2685 * tree-cfg.c (make_edges): Likewise.
2686 (end_recording_case_labels): Likewise.
2687 (cleanup_dead_labels): Likewise.
2688 (cleanup_dead_labels): Likewise.
2689 (group_case_labels): Likewise.
2690 (find_taken_edge): Likewise.
2691 (find_case_label_for_value): Likewise.
2692 (verify_gimple_stmt): Likewise.
2693 (gimple_verify_flow_info): Likewise.
2694 (gimple_redirect_edge_and_branch): Likewise.
2695 * tree-inline.c (estimate_num_insns): Likewise.
2696 * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2697 * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
2698 * tree-switch-conversion.c (do_switchconv): Likewise.
2699 * tree-vrp.c (find_assert_locations_1): Likewise.
2700 (vrp_visit_stmt): Likewise.
2701 (simplify_stmt_using_ranges): Likewise.
2703 * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
2704 Introduce local "lastg" as a generic gimple, so that local "last"
2705 can be of type gimple_switch once lastg's code has been verified.
2707 * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
2708 the GIMPLE_SWITCH case.
2710 * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
2711 argument, since the caller (find_taken_edge) has checked that
2712 last_stmt is a switch.
2714 Copyright (C) 2014 Free Software Foundation, Inc.
2716 Copying and distribution of this file, with or without modification,
2717 are permitted in any medium without royalty provided the copyright
2718 notice and this notice are preserved.