1 2014-10-24 David Malcolm <dmalcolm@redhat.com>
3 Concretize gimple_switch_index and gimple_switch_index_ptr
5 * gimple.h (gimple_switch_index): Require a const_gimple_switch rather
6 than a plain const_gimple.
7 (gimple_switch_index_ptr): Likewise.
9 * gimplify-me.c (gimple_regimplify_operands): Add checked cast to
10 gimple_switch within "case GIMPLE_SWITCH".
11 * tree-cfgcleanup.c (cleanup_control_expr_graph): Likewise.
12 * tree-ssa-ccp.c (ccp_fold): Likewise.
13 * tree-ssa-dom.c (optimize_stmt): Likewise.
15 * tree-ssa-ccp.c (evaluate_stmt): Add checked cast to
16 gimple_switch within region guarded by check for GIMPLE_SWITCH.
17 * tree-ssa-dom.c (record_edge_info): Likewise.
18 (eliminate_redundant_computations): Likewise.
19 * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Likewise.
20 * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
22 * tree-ssa-dom.c (initialize_hash_element): Replace check for
23 code GIMPLE_SWITCH with a dyn_cast<gimple_switch>.
24 (propagate_rhs_into_lhs): Likewise.
25 * tree-ssa-propagate.c (may_propagate_copy_into_stmt): Likewise.
26 (propagate_tree_value_into_stmt): Likewise.
28 2014-10-24 David Malcolm <dmalcolm@redhat.com>
30 Concretize gimple_cond_make_{false|true}
32 * gimple.h (gimple_cond_make_false): Require a gimple_cond.
33 (gimple_cond_make_true): Likewise.
35 * tree-cfg.c (fold_cond_expr_cond): Add a checked cast to
36 gimple_cond within region guarded by check for GIMPLE_COND.
37 * tree-ssa-ccp.c (ccp_fold_stmt): Likewise.
39 * tree-loop-distribution.c (generate_loops_for_partition): Replace
40 a check for GIMPLE_COND with a dyn_cast<gimple_cond>.
41 * tree-ssa-ccp.c (optimize_unreachable): Likewise.
42 * tree-ssa-loop-niter.c (number_of_iterations_exit): Likewise.
43 * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
46 * tree-vrp.c (fold_predicate_in): Add a checked cast to
47 gimple_cond. We must be dealing with a GIMPLE_COND since logic
48 at top of the function ensures we only act on GIMPLE_ASSIGN and
49 GIMPLE_COND statements, and we're now within a "not a GIMPLE_ASSIGN"
52 * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts): Add
53 checked cast of elt->stmt to gimple_cond. The existing code requires
54 this to be a GIMPLE_COND, though it's not clear to me how this
55 requirement is enforced.
56 (remove_redundant_iv_tests): Likewise.
57 (try_unroll_loop_completely): Likewise, for the last_stmt of the
58 preceding bb along edge_to_cancel.
59 * tree-ssa-reassoc.c (maybe_optimize_range_tests): Likewise, for the
62 2014-10-24 David Malcolm <dmalcolm@redhat.com>
64 Concretize locals within expand_omp_for_init_counts
66 * omp-low.c (expand_omp_for_init_counts): Eliminate local "stmt"
67 in favor of new locals "cond_stmt" and "assign_stmt" with more
70 2014-10-24 David Malcolm <dmalcolm@redhat.com>
72 Make gimple_cond_set_{true|false}_label require gimple_cond.
74 * gimple.h (gimple_cond_set_true_label): Require a gimple_cond.
75 (gimple_cond_set_false_label): Likewise.
77 * tree-cfg.c (make_cond_expr_edges): Convert "entry" from gimple to
79 (cleanup_dead_labels): Introduce a checked cast to a gimple_cond within
82 2014-10-24 David Malcolm <dmalcolm@redhat.com>
84 Concretize three gimple_return_ accessors
86 * gimple.h (gimple_return_retval_ptr): Require a const_gimple_return
87 rather than a const_gimple.
88 (gimple_return_retval): Likewise.
89 (gimple_return_set_retval): Require a gimple_return.
91 * cfgexpand.c (expand_gimple_stmt_1): Add a checked cast to
93 (expand_gimple_basic_block): Likewise.
94 * tree-complex.c (expand_complex_move): Likewise.
95 (expand_complex_comparison): Likewise.
96 * tree-inline.c (remap_gimple_stmt): Likewise.
97 * tree-sra.c (scan_function): Likewise.
98 (sra_modify_function_body): Likewise.
99 (ipa_sra_modify_function_body): Likewise.
100 * tree-ssa-structalias.c (find_func_aliases): Likewise.
102 * gimple-ssa-isolate-paths.c (isolate_path): Strengthen local
103 "ret" from gimple to gimple_return.
104 (find_implicit_erroneous_behaviour): Replace a check for code
105 GIMPLE_RETURN with a dyn_cast and a new local.
106 (find_explicit_erroneous_behaviour): Likewise.
107 * gimple-walk.c (walk_stmt_load_store_addr_ops): Likewise.
108 * gimple.c (infer_nonnull_range): Likewise.
109 * ipa-split.c (find_return_bb): Likewise.
110 (find_retval): Likewise.
111 (split_function): Likewise.
112 * omp-low.c (ipa_simd_modify_function_body): Likewise.
113 * tree-cfg.c (pass_warn_function_return::execute): Likewise.
114 * tree-nrv.c (tree_nrv): Likewise.
115 * tree-ssa-alias.c (ref_maybe_used_by_stmt_p): Likewise.
116 * tree-ssa-dce.c (propagate_necessity): Likewise.
117 * tree-ssa-structalias.c (find_func_clobbers): Likewise.
118 * tree-tailcall.c (find_tail_calls): Likewise.
120 * predict.c (apply_return_prediction): Rework the search for
121 return_stmt so that the latter can have type gimple_return.
123 2014-10-24 David Malcolm <dmalcolm@redhat.com>
125 Make gimple_phi_arg_location require a gimple_phi.
127 * gimple.h (gimple_phi_arg_location): Require a gimple_phi.
129 * tree-into-ssa.c (rewrite_update_phi_arguments): Replace a check
130 for code GIMPLE_PHI with a dyn_cast and a new local.
131 * tree-ssa-ter.c (ter_is_replaceable_p): Likewise.
133 * tree-ssa-live.c (remove_unused_locals): Replace a
134 gimple_stmt_iterator with a gimple_phi_iterator, using it to make
135 local "phi" be a gimple_phi.
136 * tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Likewise.
138 * tree-ssa-phiopt.c (conditional_replacement): Require a gimple_phi.
139 (single_non_singleton_phi_for_edges): Return a gimple_phi; update
140 local to be a gimple_phi, adding checked casts since we're working
141 on a sequence of gimple_phi.
142 (conditional_replacement): Require a gimple_phi.
144 * tree-ssa-threadupdate.c (get_value_locus_in_path): Strengthen
145 type of local "def_phi" to gimple_phi by replacing a check of the
146 code for GIMPLE_PHI with a dyn_cast<gimple_phi>.
148 2014-10-24 David Malcolm <dmalcolm@redhat.com>
150 Make gimple_phi_arg_location_from_edge require a gimple_phi
152 * gimple.h (gimple_phi_arg_location_from_edge): Require a
155 * tree-parloops.c (create_parallel_loop): Split up local variable
156 "stmt", introducing other locals for the various statements created
157 by this function. Reuse "stmt" within the phi-handling code, and
158 change to type gimple_phi, since this is the only remaining
159 "non-phi" user of gimple_phi_arg_location_from_edge.
161 2014-10-24 David Malcolm <dmalcolm@redhat.com>
163 Concretize three gimple_try_set_ accessors
165 * gimple.c (gimple_copy): Add checked casts to gimple_try.
167 * gimple.h (gimple_try_set_kind): Require a gimple_try.
168 (gimple_try_set_eval): Likewise.
169 (gimple_try_set_cleanup): Likewise.
171 * tree-eh.c (optimize_double_finally): Require a pair of gimple_try
173 (refactor_eh_r): Convert code comparisons to dynamic casts.
175 2014-10-24 David Malcolm <dmalcolm@redhat.com>
177 Concretize gimple_try_set_catch_is_cleanup
179 * gimple.h (gimple_try_set_catch_is_cleanup): Require a gimple_try.
181 * gimplify.c (gimplify_expr): Convert local "try_" from a gimple
184 2014-10-24 David Malcolm <dmalcolm@redhat.com>
186 Concretize gimple_eh_filter_set_types and gimple_eh_filter_set_failure
188 * gimple.h (gimple_eh_filter_set_types): Require a gimple_eh_filter.
189 (gimple_eh_filter_set_failure): Likewise.
190 * gimple.c (gimple_copy): Add checked casts to gimple_eh_filter
191 within GIMPLE_EH_FILTER case.
193 2014-10-24 David Malcolm <dmalcolm@redhat.com>
195 Concretize gimple_label_label
197 * gimple.h (gimple_label_label): Require a const_gimple_label
198 rather than just a const_gimple.
200 * cfgexpand.c (label_rtx_for_bb): Convert local from gimple to
201 gimple_label, replacing a check against GIMPLE_LABEL with a
202 dyn_cast<gimple_label>.
203 * predict.c (tree_estimate_probability_bb): Likewise.
204 * tree-cfg.c (make_edges): Likewise.
205 (cleanup_dead_labels): Likewise (twice).
206 (gimple_can_merge_blocks_p): Likewise.
207 (gimple_block_label): Likewise.
208 * tree-eh.c (unsplit_eh): Likewise.
209 (cleanup_empty_eh_unsplit): Likewise.
210 * tree-inline.c (mark_local_labels_stmt): Likewise.
211 * tree-nested.c (convert_nl_goto_receiver): Likewise.
213 * cfgexpand.c (expand_gimple_stmt_1): Add a checked cast to
214 gimple_label when invoking gimple_label_label in a region where
215 we've checked the code is GIMPLE_LABEL.
216 * gimple-pretty-print.c (pp_cfg_jump): Likewise.
217 * gimple.c (gimple_set_bb): Likewise.
218 * ipa-pure-const.c (check_stmt): Likewise.
219 * omp-low.c (diagnose_sb_1): Likewise.
220 * tree-cfg.c (gimple_verify_flow_info): Likewise.
221 * tree-cfgcleanup.c (tree_forwarder_block_p): Likewise.
222 (remove_forwarder_block): Likewise.
223 * tree-eh.c (collect_finally_tree): Likewise.
225 * ipa-split.c (verify_non_ssa_vars): Replace a check against
226 GIMPLE_LABEL with a dyn_cast<gimple_label>, introducing a
228 * tree-cfg.c (gimple_can_merge_blocks_p): Likewise.
229 (gimple_merge_blocks): Likewise.
230 (remove_bb): Likewise.
231 (stmt_starts_bb_p): Likewise.
232 (gimple_verify_flow_info): Likewise.
233 (move_block_to_fn): Likewise.
234 * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
235 (remove_forwarder_block_with_phi): Likewise.
236 * tree-ssa-ccp.c (optimize_unreachable): Likewise.
238 2014-10-24 David Malcolm <dmalcolm@redhat.com>
240 Concretize gimple_call_use_set and gimple_call_clobber_set
242 * gimple.h (gimple_call_use_set): Require a gimple_call.
243 (gimple_call_clobber_set): Likewise.
245 2014-10-24 David Malcolm <dmalcolm@redhat.com>
247 Concretize gimple_catch_types
249 * gimple.h (gimple_catch_types): Require a const_gimple_catch
250 rather than a const_gimple.
252 2014-10-24 David Malcolm <dmalcolm@redhat.com>
254 Make gimple_goto_set_dest require a gimple_goto
256 * gimple.h (gimple_goto_set_dest): Require a gimple_goto.
258 * tree-cfg.c (factor_computed_gotos): Add checked cast to
260 (cleanup_dead_labels): Likewise.
262 2014-10-24 David Malcolm <dmalcolm@redhat.com>
264 Make gimple_label_set_label require a gimple_label
266 * gimple.h (gimple_label_set_label): Require a gimple_label.
268 2014-10-24 David Malcolm <dmalcolm@redhat.com>
270 Concretize parameter to gimple_call_copy_skip_args
272 * gimple.c (gimple_call_copy_skip_args): Require a gimple_call.
273 * gimple.h (gimple_call_copy_skip_args): Likewise.
275 2014-10-24 David Malcolm <dmalcolm@redhat.com>
277 Various gimple to gimple_call conversions in IPA
279 * ipa-prop.c (detect_type_change_from_memory_writes): Require a
280 gimple_call rather than a plain gimple.
281 (detect_type_change): Likewise.
282 (detect_type_change_ssa): Likewise.
283 (compute_complex_assign_jump_func): Likewise.
284 (compute_complex_ancestor_jump_func): Likewise.
285 (compute_known_type_jump_func): Likewise.
286 (determine_locally_known_aggregate_parts): Likewise.
287 (ipa_compute_jump_functions_for_edge): Strengthen local "call" to
288 a gimple_call; add checked cast to gimple_phi.
289 (ipa_note_param_call): Require a gimple_call rather than a plain
291 (ipa_analyze_indirect_call_uses): Likewise.
292 (ipa_analyze_virtual_call_uses): Likewise.
293 (ipa_analyze_call_uses): Likewise.
294 (ipa_analyze_stmt_uses):Add checked cast to gimple_call.
296 * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
297 Replace use of is_gimple_call with dyn_cast<gimple_call> and a
298 new local "call_stmt".
300 2014-10-24 David Malcolm <dmalcolm@redhat.com>
302 Use gimple_call for callgraph edges
304 * cgraph.h (cgraph_edge::call_stmt): Strengthen field from plain
305 gimple to a gimple_call.
306 (cgraph_node::set_call_stmt_including_clones): Likewise for param
308 (cgraph_node::create_edge): Likewise for param "call_stmt".
309 (cgraph_node::create_indirect_edge): Likewise.
310 (cgraph_node::create_edge_including_clones): Likewise for param
312 (cgraph_edge::set_call_stmt): Likewise for param "new_stmt".
313 (cgraph_edge::clone): Likewise for param "call_stmt".
314 (symbol_table::create_edge): Likewise.
316 * cgraph.c (cgraph_edge::set_call_stmt): Require a gimple_call
317 rather than a plain gimple.
318 (symbol_table::create_edge): Likewise.
319 (cgraph_node::create_edge): Likewise.
320 (cgraph_node::create_indirect_edge): Likewise.
321 (cgraph_edge::redirect_call_stmt_to_callee): Strengthen local
322 "new_stmt" from gimple to gimple_call.
323 (cgraph_update_edges_for_call_stmt_node): Add checked casts to
326 * cgraphbuild.c (pass_build_cgraph_edges::execute): Replace
327 is_gimple_call with dyn_cast<gimple_call> and new local
329 (cgraph_edge::rebuild_edges): Likewise.
331 * cgraphclones.c (cgraph_edge::clone): Require a gimple_call
332 rather than a plain gimple.
333 (cgraph_node::set_call_stmt_including_clones): Likewise.
334 (cgraph_node::create_edge_including_clones): Likewise.
336 * lto-streamer-in.c (fixup_call_stmt_edges_1): Add checked casts
339 * omp-low.c (simd_clone_adjust): Strengthen local "call" from
340 gimple to gimple_call.
342 * trans-mem.c (ipa_tm_insert_irr_call): Likewise for "g".
343 (ipa_tm_insert_gettmclone_call): Likewise; also strengthen "g2"
346 * tree-emutls.c (gen_emutls_addr): Strengthen local "x" from
347 gimple to gimple_call.
349 * tree-inline.c (copy_bb): Replace is_gimple_call with
350 dyn_cast<gimple_call> and new local "call_stmt".
352 * value-prof.c (gimple_ic): Require and return a gimple_call,
353 rather than a plain gimple.
354 * value-prof.h (gimple_ic): Likewise.
356 2014-10-24 David Malcolm <dmalcolm@redhat.com>
358 Make gimple_call_return_slot_opt_p require a gimple_call.
360 * gimple.h (gimple_call_return_slot_opt_p): Require a gimple_call
361 rather than a plain gimple.
363 * gimple-walk.c (walk_stmt_load_store_addr_ops): Convert usage of
364 is_gimple_call to dyn_cast<gimple_call>, introducing a new local
367 * trans-mem.c (expand_call_tm): Split local "stmt", strengthening
368 from plain gimple to a gimple_call, and introducing new local
369 gimple_assign "assign_stmt".
371 * tree-inline.c (expand_call_inline): Convert check of code against
372 GIMPLE_CALL to dyn_cast<gimple_call>, introducing a new local
375 2014-10-24 David Malcolm <dmalcolm@redhat.com>
379 * gimple.h (gimple_phi_set_result): Require a gimple_phi rather
381 (gimple_phi_set_arg): Likewise.
383 * tree-outof-ssa.c (remove_gimple_phi_args): Likewise; add a checked
386 * tree-sra.c (replace_removed_params_ssa_names): Add a checked
389 2014-10-24 David Malcolm <dmalcolm@redhat.com>
391 Make gimple_phi_arg_edge require a gimple_phi
393 * gimple.h (gimple_phi_arg_edge): Require a gimple_phi rather
396 * gimple-ssa-strength-reduction.c (ncd_with_phi): Strengthen
397 param "phi" from gimple to gimple_phi. Add a checked cast.
398 (ncd_of_cand_and_phis): Add a checked cast.
400 * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Require a
401 gimple_phi_iterator; strengthen local "phi" from gimple to a
403 (rewrite_cross_bb_scalar_deps): Strengthen local "psi" from
404 a gimple_stmt_iterator to a gimple_phi_iterator.
405 (edge_initial_value_for_loop_phi): Require a gimple phi.
406 (initial_value_for_loop_phi): Likewise.
408 * ipa-split.c (consider_split): Convert "bsi" to a
409 gimple_phi_iterator and "stmt" to a gimple_phi.
411 * predict.c (predict_extra_loop_exits): Convert "phi_stmt" to be
412 a gimple_phi; introduce "lhs_def_stmt" as plain gimple.
413 (apply_return_prediction): Convert "phi" to be a gimple_phi.
415 * tree-cfg.c (replace_uses_by): Add checked cast to gimple_phi.
416 (verify_gimple_in_cfg): Introduce gimple_phi_iterator "gpi" and use
417 it to convert "phi" to a gimple_phi.
419 * tree-eh.c (cleanup_empty_eh_merge_phis): Convert "ngsi", "ogsi"
420 to be gimple_phi_iterators. Convert "ophi", "nphi" to be
423 * tree-into-ssa.c (prepare_use_sites_for): Add checked cast to
426 * tree-ssa-coalesce.c (create_outofssa_var_map): Introduce
427 gimple_phi_iterator "gpi" and use it to convert "phi" to a
430 * tree-ssa-dce.c (propagate_necessity): Introduce local "phi",
431 from checked cast to gimple_phi.
433 * tree-ssa-live.c (set_var_live_on_entry): Add checked cast to
436 * tree-ssa-propagate.c (replace_phi_args_in): Require a gimple_phi
437 rather than a plain gimple.
438 (substitute_and_fold_dom_walker::before_dom_children): Introduce
439 gimple_phi_iterator "gpi".
441 * tree-ssa-sink.c (find_bb_for_arg): Require a gimple_phi rather
443 (nearest_common_dominator_of_uses): Replace check of code against
444 GIMPLE_PHI with a dyn_cast<gimple_phi>, introducing a new local.
445 (statement_sink_location): Add checked cast to gimple_phi.
447 * tree-ssa-uninit.c (compute_uninit_opnds_pos): Require a
448 gimple_phi rather than a plain gimple.
449 (collect_phi_def_edges): Likewise. Add a checked cast.
450 (find_def_preds): Strengthen param "phi" from gimple to
452 (prune_uninit_phi_opnds_in_unrealizable_paths): Likewise for
453 params "phi" and "flag_def". Strenghen param "visited_phis" from
454 hash_set<gimple> * to hash_set<gimple_phi> *. Convert
455 "flag_arg_def", "phi_arg_def" to gimple_phi using
456 dyn_cast<gimple_phi>. Similarly, introduce new local
458 (use_pred_not_overlap_with_undef_path_pred): Strengthen param
459 "phi" from gimple to gimple_phi, and param "visited_phis" from
460 hash_set<gimple> * to hash_set<gimple_phi> *. Add a checked cast.
461 (is_use_properly_guarded): Likewise for params.
462 (find_uninit_use): Replace check of code against GIMPLE_PHI with
463 a dyn_cast<gimple_phi>, introducing a new local "use_phi".
464 Strengthen local "visited_phis" from hash_set<gimple> to
465 hash_set<gimple_phi>.
467 2014-10-24 David Malcolm <dmalcolm@redhat.com>
469 Update GRAPHITE to use more concrete gimple statement classes
471 * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
472 Strengthen local "psi" to be a gimple_phi_iterator and "phi" to
475 * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Require
476 a gimple_phi rathen than a plain gimple.
477 (remove_simple_copy_phi): Require a gimple_phi_iterator;
478 strengthen local "phi" to be a gimple_phi and "stmt" to be a
480 (remove_invariant_phi): Likewise.
481 (simple_copy_phi_p): Require a gimple_phi.
482 (reduction_phi_p): Require a gimple_phi_iterator; strengthen
483 local "phi" to be a gimple_phi.
484 (add_condition_to_pbb): Require a gimple_cond rather than a
486 (add_conditions_to_domain): Add checked cast to gimple_cond
487 within GIMPLE_COND case of switch statement.
488 (single_pred_cond_non_loop_exit): Return a gimple_cond rather
489 than a plain gimple, via a checked cast.
490 (sese_dom_walker::before_dom_children): Strengthen local "stmt"
491 from gimple to gimple_cond.
492 (gsi_for_phi_node): Require a gimple_phi, and return a
494 (insert_out_of_ssa_copy): Strengthen local "stmt" from gimple to
496 (rewrite_reductions_out_of_ssa): Strengthen "psi" to be a
497 gimple_phi_iterator, and "phi" to be a gimple_phi.
498 (phi_contains_arg): Require a gimple_phi.
499 (follow_ssa_with_commutative_ops): Strengthen return type from
500 gimple to gimple_phi, by converting a check for code GIMPLE_PHI to
501 a dyn_cast<gimple_phi>, and strengthening local "res" from gimple
503 (detect_commutative_reduction_arg): Strengthen return type from
504 gimple to gimple_phi, and strengthen local "phi" to be a
506 (detect_commutative_reduction_assign): Strengthen return type from
507 gimple to gimple_phi, and strengthen local "res" to be a
509 (follow_inital_value_to_phi): Strengthen return type from
510 gimple to gimple_phi. Replace check for code GIMPLE_PHI with
511 a dyn_cast<gimple_phi>.
512 (detect_commutative_reduction): Strengthen return type and locals
513 "loop_phi", "phi", "close_phi" from gimple to gimple_phi,
514 introducing a checked cast of "stmt" in region guarded by
515 scalar_close_phi_node_p (stmt).
516 (translate_scalar_reduction_to_array_for_stmt): Require param
517 "loop_phi" to be a gimple_phi. Strengthen local "assign" from
518 gimple to gimple_assign.
519 (remove_phi): Require a gimple_phi.
520 (close_phi_written_to_memory): Likewise.
521 (translate_scalar_reduction_to_array): We expect the first element
522 in each vector to be an arbitrary statement, but all of the
523 subsequent elements to be phi nodes. Hence the decls of gimple
524 locals "loop_phi" and "close_phi" are replaced with decls of gimple
525 "loop_stmt" and "close_stmt", with decls of the more-strongly typed
526 gimple_phi "loop_phi" and "close_phi" occurring lower down, within
527 the region where we're dealing with i > 0 and hence where we can
528 safely assign them using the checked cast as_a <gimple_phi>.
529 This allows many of the strengthenings from gimple to gimple_phi
530 above. We eliminate the local "stmt", since we can simply use
532 (rewrite_commutative_reductions_out_of_ssa_close_phi): Strengthen
533 param "close_phi" from gimple to gimple_phi, and local "gsi" from
534 gimple_stmt_iterator to gimple_phi_iterator, converting uses of
535 gsi_stmt to gsi.phi for type-safety.
536 (scop_ivs_can_be_represented): Strengthen local "gsi" from
537 gimple_stmt_iterator to gimple_phi_iterator, and "phi" from gimple
540 2014-10-24 David Malcolm <dmalcolm@redhat.com>
542 Make gimple_phi_arg_set_location require a gimple_phi
544 * gimple.h (gimple_phi_arg_set_location): Require a gimple_phi
545 rather than a plain gimple.
547 2014-10-24 David Malcolm <dmalcolm@redhat.com>
549 Make add_phi_arg require a gimple_phi
551 * tree-phinodes.h (add_phi_arg): Require a gimple_phi rather than
553 * tree-phinodes.c (add_phi_arg): Likewise.
555 * gimple-ssa-strength-reduction.c (create_phi_basis): Strengthen
556 local "phi" from plain gimple to gimple_phi.
558 * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
559 Likewise for "close_phi".
561 * ipa-split.c (split_function): Convert "psi" to
564 * omp-low.c (expand_omp_for_static_nochunk): Introduce
565 gimple_phi_iterator gpi, using it to strengthen "phi" to be a
567 (expand_omp_for_static_chunk): Likewise.
569 * tree-cfg.c (gimple_duplicate_bb): Make topmost "gsi" decl more
570 tightly-scoped, and eliminate decls "phis", "phi", "stmt", "copy"
571 in favor of more tightly-scoped gimple_phi_iterator gpi and
572 gimple_phi decls "phi" and "copy", and gimple decls "stmt" and
575 * tree-parloops.c (create_parallel_loop): Introduce
576 gimple_phi_iterator gpi, using it to strengthen "phi" to be a
579 * tree-ssa-loop-im.c (execute_sm_if_changed): Likewise.
581 * tree-ssa-loop-manip.c (create_iv): Split out new gimple_phi
582 local "phi" from "stmt", and convert the latter into being a
585 * tree-ssa-pre.c (insert_into_preds_of_block): Strengthen local
586 "phi" to be a gimple_phi.
588 * tree-ssa-tail-merge.c (vop_phi): Require a gimple_phi rather
590 (replace_block_by): Strengthen local "bb2_phi" to be a gimple_phi.
592 * tree-tailcall.c (add_successor_phi_arg): Use gsi.phi when
593 invoking add_phi_arg.
594 (eliminate_tail_call): Introduce gimple_phi_iterator gpi, using it
595 to strengthen "phi" to be a gimple_phi.
596 (create_tailcall_accumulator): Strengthen local "phi" to be a
598 (tree_optimize_tail_calls_1): Likewise.
600 * tree-vect-data-refs.c (vect_setup_realignment): Strengthen
601 local "phi_stmt" to be a gimple_phi.
603 * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg):
604 Strengthen "gsi", "gsi_orig", "gsi_new" to be
605 gimple_phi_iterators, and "phi" "orig_phi", "new_phi" to be
606 gimple_phi instances.
607 (slpeel_tree_peel_loop_to_edge): Strengthen local "new_phi" to be
610 * tree-vect-loop.c (get_initial_def_for_induction): Likewise for
612 (vect_create_epilog_for_reduction): Add checked casts to
613 gimple_phi; strengthen local "outer_phi" to gimple_phi and
614 "new_vec_stmt" to gimple_assign.
615 (vect_finalize_reduction): Strengthen local "vect_phi" to
617 (vectorizable_reduction): Likewise for "new_phi".
619 * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
620 (vectorizable_load): Likewise for "phi".
622 2014-10-24 David Malcolm <dmalcolm@redhat.com>
624 Make gimple_phi_arg_def_ptr and gimple_phi_arg_has_location require a gimple_phi
626 * gimple.h (gimple_phi_arg_def_ptr): Require a gimple_phi rather
628 (gimple_phi_arg_has_location): Likewise.
630 * gimple-streamer-in.c (input_phi): Return a gimple_phi rather
632 * gimple-streamer-out.c (output_phi): Require a gimple_phi rather
634 (output_bb): Convert iteration to a gimple_phi_iterator, and local
637 * omp-low.c (expand_omp_for_static_chunk): Convert iterator "psi"
638 to a gimple_phi_iterator; convert locals "phi" and "nphi" to be
641 * tree-cfg.c (gimple_duplicate_sese_tail): Likewise for "psi" and
643 (move_block_to_fn): Introduce new gimple_phi_iterator "psi", using
644 it in place of "gsi" where necessary. Convert "phi" to be a
647 * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
649 * tree-vect-loop-manip.c (vect_loop_versioning): Convert "gsi" to
650 a gimple_phi_iterator, and "orig_phi" and "new_phi" to be
653 * tree.c (find_decls_types_in_node): Introduce new
654 gimple_phi_iterator "psi", using it in place of "si" where
655 necessary. Convert "phi" to be a gimple_phi.
657 2014-10-24 David Malcolm <dmalcolm@redhat.com>
659 omp-low.c: Use more concrete types of gimple statement for various locals
661 * omp-low.c (finalize_task_copyfn): Strengthen local "bind" from
662 plain gimple to gimple_bind.
663 (lower_rec_input_clauses): Strengthen local "g" from
664 plain gimple to gimple_assign.
665 (lower_lastprivate_clauses): Likewise for "stmt" to gimple_cond
666 and "g" to gimple_call.
667 (expand_omp_for_init_vars): Likewise, for two decls of "stmt" to
669 (expand_omp_atomic_pipeline): Likewise for one decl of "stmt".
670 (expand_omp_atomic_mutex): Likewise.
671 (lower_omp_master): Likewise for "x" to gimple_call.
672 (lower_omp_ordered): Likewise.
674 2014-10-24 David Malcolm <dmalcolm@redhat.com>
676 tree-parloops.c: Use gimple_phi in various places
678 * tree-parloops.c (reduction_info::keep_res): Strengthen field
679 from plain gimple to gimple_phi.
680 (transform_to_exit_first_loop): Strengthen locals "phi", "nphi"
681 to gimple_phi. Eliminate early decl of gimple_stmt_iterator gsi
682 in favor of more tightly scoped gimple_phi_iterators, and a final
683 later decl as a gimple_stmt_iterator.
685 2014-10-24 David Malcolm <dmalcolm@redhat.com>
687 Introduce gimple_omp_sections
689 * coretypes.h (gimple_omp_sections): New typedef.
690 (const_gimple_omp_sections): New typedef.
692 * gimple-pretty-print.c (dump_gimple_omp_sections): Require a
693 gimple_omp_sections rather than a plain gimple.
694 (pp_gimple_stmt_1): Add checked cast to gimple_omp_sections within
695 GIMPLE_OMP_SECTIONS case of switch statement.
697 * gimple.c (gimple_build_omp_sections): Return a
698 gimple_omp_sections rather than a plain gimple.
700 * gimple.h (gimple_build_omp_sections): Return a
701 gimple_omp_sections rather than a plain gimple.
703 * omp-low.c (scan_omp_sections): Require a gimple_omp_sections
704 rather than a plain gimple.
705 (scan_omp_1_stmt): Add checked cast to gimple_omp_sections within
706 GIMPLE_OMP_SECTIONS case of switch statement.
707 (expand_omp_sections): Strengthen local "sections_stmt" from gimple
708 to gimple_omp_sections.
709 (lower_omp_sections): Likewise for "stmt".
711 2014-10-24 David Malcolm <dmalcolm@redhat.com>
713 Introduce gimple_omp_teams
715 * coretypes.h (gimple_omp_teams): New typedef.
716 (const_gimple_omp_teams): New typedef.
718 * gimple.h (gimple_build_omp_teams): Return a gimple_omp_teams
719 rather than a plain gimple.
720 (gimple_omp_teams_set_clauses): Require a gimple_omp_teams rather
723 * gimple-pretty-print.c (dump_gimple_omp_teams): Require a
724 gimple_omp_teams rather than a plain gimple.
725 (pp_gimple_stmt_1): Add checked cast to gimple_omp_teams within
726 GIMPLE_OMP_TEAMS case of switch statement.
728 * gimple.c (gimple_build_omp_teams): Return a gimple_omp_teams
729 rather than a plain gimple.
731 * omp-low.c (scan_omp_teams): Likewise.
732 (scan_omp_1_stmt): Add checked cast to gimple_omp_teams within
733 GIMPLE_OMP_TEAMS case of switch statement.
734 (lower_omp_teams): Strengthen local "teams_stmt" from gimple to
737 2014-10-24 David Malcolm <dmalcolm@redhat.com>
739 Introduce gimple_omp_target
741 * coretypes.h (gimple_omp_target): New typedef.
742 (const_gimple_omp_target): New typedef.
744 * gimple.h (gimple_build_omp_target): Return a gimple_omp_target
745 rather than a plain gimple.
746 (gimple_omp_target_set_clauses): Require a gimple_omp_target
747 rather than a plain gimple.
748 (gimple_omp_target_set_kind): Likewise.
749 (gimple_omp_target_child_fn_ptr): Likewise.
750 (gimple_omp_target_set_child_fn): Likewise.
751 (gimple_omp_target_data_arg_ptr): Likewise.
752 (gimple_omp_target_set_data_arg): Likewise.
753 (gimple_omp_target_child_fn): Require a const_gimple_omp_target
754 rather than a plain const_gimple.
755 (gimple_omp_target_data_arg): Likewise.
757 * gimple-pretty-print.c (dump_gimple_omp_target): Require a
758 gimple_omp_target rather than a plain gimple.
759 (pp_gimple_stmt_1): Add checked cast to gimple_omp_target within
760 GIMPLE_OMP_TARGET case of switch statement.
762 * gimple.c (gimple_build_omp_target): Return a gimple_omp_target
763 rather than a plain gimple.
765 * gimplify.c (gimplify_omp_target_update): Strengthen local "stmt"
766 from gimple to gimple_omp_target.
768 * omp-low.c (scan_omp_target): Require a gimple_omp_target rather
770 (scan_omp_1_stmt): Add checked cast to gimple_omp_target within
771 GIMPLE_OMP_TARGET case of switch statement.
772 (expand_omp_target): Strengthen local "entry_stmt" from gimple to
774 (lower_omp_target): Likewise for "stmt".
776 * tree-nested.c (convert_nonlocal_reference_stmt): Add checked
777 cast to gimple_omp_target.
778 (convert_local_reference_stmt): Likewise.
779 (convert_gimple_call): Likewise.
781 2014-10-24 David Malcolm <dmalcolm@redhat.com>
783 Introduce gimple_omp_single
785 * coretypes.h (gimple_omp_single): New typedef.
786 (const_gimple_omp_single): New typedef.
788 * gimple.h (gimple_build_omp_single): Return a gimple_omp_single
789 rather than a plain gimple.
790 (gimple_omp_single_set_clauses): Require a gimple_omp_single
791 rather than a plain gimple.
793 * gimple-pretty-print.c (dump_gimple_omp_single): Require a
794 gimple_omp_single rather than a plain gimple.
795 (pp_gimple_stmt_1): Add checked cast to gimple_omp_single within
796 GIMPLE_OMP_SINGLE case of switch statement.
798 * gimple.c (gimple_build_omp_single): Return a gimple_omp_single
799 rather than a plain gimple.
801 * omp-low.c (scan_omp_single): Require a gimple_omp_single rather
803 (scan_omp_1_stmt): Add checked cast to gimple_omp_single within
804 GIMPLE_OMP_SINGLE case of switch statement.
805 (lower_omp_single_simple): Require a gimple_omp_single rather
807 (lower_omp_single_copy): Likewise.
808 (lower_omp_single): Strengthen local "single_stmt" from gimple to
811 2014-10-24 David Malcolm <dmalcolm@redhat.com>
813 Introduce gimple_omp_task
815 * coretypes.h (gimple_omp_task): New typedef.
816 (const_gimple_omp_task): New typedef.
818 * gimple.h (gimple_build_omp_task): Return a gimple_omp_task
819 rather than a plain gimple.
821 * gimple-pretty-print.c (dump_gimple_omp_task): Require a
822 gimple_omp_task rather than a plain gimple.
823 (pp_gimple_stmt_1): Add checked cast to gimple_omp_task within
824 GIMPLE_OMP_TASK case of switch statement.
826 * gimple.c (gimple_build_omp_task): Return a gimple_omp_task
827 rather than a plain gimple.
829 * omp-low.c (finalize_task_copyfn): Require a gimple_omp_task
830 rather than a plain gimple.
831 (delete_omp_context): Add checked cast to gimple_omp_task.
832 (scan_omp_task): Strengthen local "stmt" from gimple to
834 (expand_task_call): Require a gimple_omp_task rather than a plain
836 (expand_omp_taskreg): Add checked cast to gimple_omp_task.
837 (create_task_copyfn): Require a gimple_omp_task rather than a
839 (lower_omp_taskreg): Add checked cast to gimple_omp_task.
841 2014-10-24 David Malcolm <dmalcolm@redhat.com>
843 tree-cfg.c: Make verify_gimple_call require a gimple_call
845 * tree-cfg.c (verify_gimple_call): Require a gimple_call rather
847 (verify_gimple_stmt): Add checked cast to gimple_call within
848 GIMPLE_CALL case of switch statement.
850 2014-10-24 David Malcolm <dmalcolm@redhat.com>
852 Introduce gimple_omp_parallel
854 * coretypes.h (gimple_omp_parallel): New typedef.
855 (const_gimple_omp_parallel): New typedef.
857 * cgraphbuild.c (build_cgraph_edges): Convert check of code
858 against GIMPLE_OMP_PARALLEL to a dyn_cast <gimple_omp_parallel>
861 * gimple-pretty-print.c (dump_gimple_omp_parallel): Require a
862 gimple_omp_parallel rather than a plain gimple.
863 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_parallel
864 within GIMPLE_OMP_PARALLEL case of switch statement.
866 * gimple-walk.c (walk_gimple_op): Likewise, introducing a local.
868 * gimple.c (gimple_build_omp_parallel): Return a
869 gimple_omp_parallel rather than a plain gimple.
870 (gimple_copy): Add checked casts to gimple_omp_parallel within
871 GIMPLE_OMP_PARALLEL case of switch statement, introducing locals.
873 * gimple.h (gimple_build_omp_parallel): Return a
874 gimple_omp_parallel rather than a plain gimple.
875 (gimple_omp_parallel_clauses_ptr): Require a gimple_omp_parallel
876 rather than a plain gimple.
877 (gimple_omp_parallel_set_clauses): Likewise.
878 (gimple_omp_parallel_data_arg_ptr): Likewise.
879 (gimple_omp_parallel_set_data_arg): Likewise.
880 (gimple_omp_parallel_child_fn_ptr): Likewise.
881 (gimple_omp_parallel_set_child_fn): Likewise.
882 (gimple_omp_parallel_child_fn): Require a
883 const_gimple_omp_parallel rather than a plain const_gimple.
884 (gimple_omp_parallel_data_arg): Likewise.
886 * omp-low.c (scan_omp_parallel): Strengthen local "stmt" from
887 gimple to gimple_omp_parallel.
888 (expand_parallel_call): Require a gimple_omp_parallel for
889 "entry_stmt" rather than a plain gimple.
890 (remove_exit_barrier): Strengthen local "parallel_stmt" from
891 gimple to gimple_omp_parallel.
892 (expand_omp_taskreg): Add checked casts to gimple_omp_parallel.
894 * tree-inline.c (remap_gimple_stmt): Add a checked cast to
895 gimple_omp_parallel within GIMPLE_OMP_PARALLEL case of switch
896 statement, introducing local.
898 2014-10-24 David Malcolm <dmalcolm@redhat.com>
900 Introduce gimple_omp_for
902 * coretypes.h (gimple_omp_for): New.
903 (const_gimple_omp_for): New.
905 * gimple.h (gimple_build_omp_for): Return a gimple_omp_for rather
907 (gimple_omp_for_set_kind): Require a gimple_omp_for rather than a
909 (gimple_omp_for_set_combined_p): Likewise.
910 (gimple_omp_for_set_combined_into_p): Likewise.
912 * gimple-pretty-print.c (dump_gimple_omp_for): Require a
913 gimple_omp_for rather than a plain gimple.
914 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_for in
915 GIMPLE_OMP_FOR case of switch statement.
917 * gimple.c (gimple_build_omp_for): Return a gimple_omp_for rather
919 (gimple_copy): Add a checked cast to gimple_omp_for and a new local.
921 * gimplify.c (gimplify_omp_for): Strengthen local "gfor" from
922 gimple to gimple_omp_for.
924 * omp-low.c (omp_for_data::for_stmt): Strengthen field from gimple
926 (extract_omp_for_data): Require a gimple_omp_for rather than a
928 (workshare_safe_to_combine_p): Add a checked cast to
930 (get_ws_args_for): Convert check of code against GIMPLE_OMP_FOR
931 with a dyn_cast<gimple_omp_for> and a new local.
932 (scan_omp_parallel): Add a checked cast to gimple_omp_for and a
934 (scan_omp_for): Require a gimple_omp_for rather than a plain
936 (scan_omp_1_stmt): Add a checked cast to gimple_omp_for in
937 GIMPLE_OMP_FOR case of switch statement.
938 (expand_omp_for): Add a checked cast to gimple_omp_for.
939 (lower_omp_for): Strengthen local "stmt" from gimple to
942 * tree-nested.c (walk_gimple_omp_for): Require a gimple_omp_for
943 rather than a plain gimple.
944 (convert_nonlocal_reference_stmt): Add a checked cast to
945 gimple_omp_for in GIMPLE_OMP_FOR case of switch statement.
946 (convert_local_reference_stmt): Likewise.
948 * tree-parloops.c (create_parallel_loop): Strengthen local
949 "for_stmt" from gimple to gimple_omp_for.
951 2014-10-24 David Malcolm <dmalcolm@redhat.com>
953 Introduce gimple_omp_critical
955 * coretypes.h (gimple_omp_critical): New typedef.
956 (const_gimple_omp_critical): New typedef.
958 * gimple-pretty-print.c (dump_gimple_omp_critical): Require a
959 gimple_omp_critical rather than a plain gimple.
960 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_critical
961 within GIMPLE_OMP_CRITICAL case of switch statement.
963 * gimple-walk.c (walk_gimple_op): Likewise.
965 * gimple.c (gimple_build_omp_critical): Return a gimple_omp_critical
966 rather than a plain gimple.
967 (gimple_copy): Add checked casts to gimple_omp_critical
968 within GIMPLE_OMP_CRITICAL case of switch statement.
970 * gimple.h (gimple_debug): Likewise.
971 (gimple_build_omp_critical): Return a gimple_omp_critical rather
973 (gimple_omp_critical_name): Require a const_gimple_omp_critical
974 rather than a plain const_gimple.
975 (gimple_omp_critical_name_ptr): Require a gimple_omp_critical
976 rather than a plain gimple.
977 (gimple_omp_critical_set_name): Likewise.
979 * omp-low.c (check_omp_nesting_restrictions): Add a checked cast
980 to gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
981 statement, introducing a new local "other_crit" for type-safety.
982 (lower_omp_critical): Strengthen local "stmt" to
985 * tree-inline.c (remap_gimple_stmt): Add a checked cast to
986 gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
989 2014-10-24 David Malcolm <dmalcolm@redhat.com>
991 Introduce gimple_omp_continue
993 * coretypes.h (gimple_omp_continue): New typedef.
994 (const_gimple_omp_continue): New typedef.
996 * gimple.h (gimple_build_omp_continue): Return a
997 gimple_omp_continue rather than a plain gimple.
998 (gimple_omp_continue_control_def): Require a
999 const_gimple_omp_continue rather than a plain const_gimple.
1000 (gimple_omp_continue_control_use): Likewise.
1001 (gimple_omp_continue_control_def_ptr): Require a gimple_omp_continue
1002 rather than a plain gimple.
1003 (gimple_omp_continue_set_control_def): Likewise.
1004 (gimple_omp_continue_control_use_ptr): Likewise.
1005 (gimple_omp_continue_set_control_use): Likewise.
1007 * gimple-pretty-print.c (dump_gimple_omp_continue): Require a
1008 gimple_omp_continue rather than a plain gimple.
1009 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_continue
1010 within GIMPLE_OMP_CONTINUE case of switch statement.
1012 * gimple-walk.c (walk_gimple_op): Likewise, adding a new local.
1014 * gimple.c (gimple_build_omp_continue): Return a
1015 gimple_omp_continue rather than a plain gimple.
1017 * omp-low.c (gimple_build_cond_empty): Return a gimple_cond
1018 rather than a plain gimple.
1019 (expand_omp_for_generic): Split local "stmt" into "assign_stmt",
1020 "cont_stmt", "cond_stmt", "call_stmt" of types gimple_assign,
1021 gimple_omp_continue, gimple_cond, gimple_call respectively.
1022 (expand_omp_for_static_nochunk): Likewise, splitting into two
1023 "cond_stmt" decls. "assign_stmt", "cont_stmt"
1024 (expand_omp_for_static_chunk): Likewise, splitting into
1025 "cond_stmt", "assign_stmt", "cont_stmt".
1026 (expand_omp_sections): Strengthen local "cont" from gimple to
1027 gimple_omp_continue.
1029 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1031 Introduce gimple_omp_atomic_store
1033 * coretypes.h (gimple_omp_atomic_store): New typedef.
1034 (const_gimple_omp_atomic_store): New typedef.
1036 * gimple-pretty-print.c (dump_gimple_omp_atomic_store): Require
1037 a gimple_omp_atomic_store rather than a plain gimple.
1038 (pp_gimple_stmt_1): Add checked cast to gimple_omp_atomic_store
1039 within GIMPLE_OMP_ATOMIC_STORE case of switch statement.
1040 * gimple-walk.c (walk_gimple_op): Likewise.
1042 * gimple.c (gimple_build_omp_atomic_store): Return a
1043 gimple_omp_atomic_store rather than a plain gimple.
1045 * gimple.h (gimple_build_omp_atomic_store): Return a
1046 gimple_omp_atomic_store rather than a plain gimple.
1047 (gimple_omp_atomic_store_set_val): Require a gimple_omp_atomic_store
1048 rather than a plain gimple.
1049 (gimple_omp_atomic_store_val_ptr): Likewise.
1050 (gimple_omp_atomic_store_val): Require a
1051 const_gimple_omp_atomic_store rather than a plain const_gimple.
1053 * gimplify.c (gimplify_omp_atomic): Strengthen locals "loadstmt" and
1054 "storestmt" from gimple to gimple_omp_atomic_load loadstmt and
1055 gimple_omp_atomic_store storestmt respectively.
1057 * omp-low.c (expand_omp_atomic): Strengthen local "store" from
1058 gimple to gimple_omp_atomic_store.
1060 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1062 Introduce gimple_omp_atomic_load
1064 * coretypes.h (gimple_omp_atomic_load): New typedef.
1065 (const_gimple_omp_atomic_load): New typedef.
1067 * gimple-pretty-print.c (dump_gimple_omp_atomic_load): Require a
1068 gimple_omp_atomic_load rather than a plain gimple.
1069 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_atomic_load
1070 within GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
1072 * gimple-walk.c (walk_gimple_op): Likewise, introducing a new local.
1074 * gimple.c (gimple_build_omp_atomic_load): Return a
1075 gimple_omp_atomic_load rather than a plain gimple.
1077 * gimple.h (gimple_build_omp_atomic_load): Return a
1078 gimple_omp_atomic_load rather than a plain gimple.
1079 (gimple_omp_atomic_load_set_lhs): Require a
1080 gimple_omp_atomic_load rather than a plain gimple.
1081 (gimple_omp_atomic_load_lhs_ptr): Likewise.
1082 (gimple_omp_atomic_load_set_rhs): Likewise.
1083 (gimple_omp_atomic_load_rhs_ptr): Likewise.
1084 (gimple_omp_atomic_load_lhs): Require a
1085 const_gimple_omp_atomic_load rather than a plain const_gimple.
1086 (gimple_omp_atomic_load_rhs): Likewise.
1088 * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
1089 to gimple_omp_atomic_load within GIMPLE_OMP_ATOMIC_LOAD case of
1092 * omp-low.c (expand_omp_atomic): Strengthen type of local "load"
1093 from gimple to gimple_omp_atomic_load.
1094 (lower_omp_1): Add a checked cast to gimple_omp_atomic_load within
1095 GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
1097 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1099 Use more concrete types for various gimple statements
1101 * cgraphunit.c (thunk_adjust): Strengthen local "stmt" from gimple
1104 * gimple-ssa-isolate-paths.c
1105 (insert_trap_and_remove_trailing_statements): Strengthen local
1106 "new_stmt" from gimple to gimple_call.
1108 * gimple-ssa-strength-reduction.c (replace_mult_candidate):
1109 Strengthen local "copy_stmt" from gimple to gimple_assign.
1110 (create_add_on_incoming_edge): Likewise, for "new_stmt".
1111 (insert_initializers): Likewise, for "init_stmt".
1112 (introduce_cast_before_cand): Likewise, for "cast_stmt".
1113 (replace_one_candidate): Likewise, for "copy_stmt" and
1116 * gimplify.c (build_stack_save_restore): Require gimple_calls
1117 rather than plain gimples.
1118 (gimplify_bind_expr): Strengthen locals "stack_save" and
1119 "stack_restore" from gimple to gimple_call. Strengthen "gs"
1121 (gimplify_switch_expr): Strengthen local "gimple_switch" from
1122 gimple to gimple_switch, and "new_default" to gimple_label.
1123 (gimplify_cond_expr): Strengthen local "gimple_cond" from gimple
1125 (gimplify_init_constructor): Strengthen local "init" from gimple
1127 (gimplify_cleanup_point_expr): Strengthen local "gtry" from gimple
1129 (gimple_push_cleanup): Strengthen locals "ffalse" and "ftrue" from
1130 gimple to gimple_assign.
1132 * tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
1133 (emit_post_landing_pad): Strengthen local to gimple_label.
1135 * tree-outof-ssa.c (insert_backedge_copies): Strengthen local
1136 "stmt" from gimple to gimple_assign.
1138 * tree-parloops.c (take_address_of): Likewise.
1140 * tree-predcom.c (replace_ref_with): Likewise, for "new_stmt".
1141 (initialize_root_vars_lm): Likewise, for "init_stmt".
1142 (reassociate_to_the_same_stmt): Likewise, for "new_stmt" and "tmp_stmt".
1144 * tree-profile.c (gimple_gen_edge_profiler): Likewise, for "stmt1",
1146 (gimple_gen_ic_profiler): Likewise.
1147 (gimple_gen_ic_func_profiler): Strengthen local "stmt1" from
1148 gimple to gimple_call, and "stmt2" to gimple_assign.
1150 * tree-scalar-evolution.c (scev_const_prop): Strengthen local
1151 "ass" from gimple to gimple_assign.
1153 * tree-sra.c (build_ref_for_offset): Likewise for "stmt".
1154 (generate_subtree_copies): Likewise; also strengthen "ds" to
1156 (init_subtree_with_zero): Likewise.
1157 (sra_modify_expr): Likewise.
1158 (load_assign_lhs_subreplacements): Likewise.
1159 (sra_modify_assign): Strengthen "ds" to gimple_debug.
1160 (sra_ipa_reset_debug_stmts): Likewise for "def_temp".
1162 * tree-ssa-ccp.c (insert_clobber_before_stack_restore):
1163 Strengthen local "clobber_stmt" from gimple to gimple_assign.
1165 * tree-ssa-dce.c (remove_dead_stmt): Strengthen "note" to
1168 * tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
1169 local "new_stmt" from gimple to gimple_assign.
1170 (optimize_stmt): Likewise.
1172 * tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
1173 4 declarations of "newop".
1174 (simplify_rotate): Likewise for "g".
1176 * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
1177 (rewrite_bittest): Likewise for "stmt" and "stmt2".
1178 (move_computations_dom_walker::before_dom_children): Likewise for
1180 (execute_sm): Likewise for "load" and "store".
1182 * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
1183 Strengthen local "stmt" from gimple to gimple_call.
1184 (unloop_loops): Likewise.
1186 * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
1187 local "ass" from gimple to gimple_assign.
1188 (remove_unused_ivs): Strengthen "def_temp" to gimple_debug.
1190 * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local "stmt"
1191 from gimple to gimple_assign.
1193 * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
1194 "prefetch" from gimple to gimple_call.
1196 * tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
1197 "new_stmt" from gimple to gimple_assign.
1198 (powi_as_mults_1): Likewise for "mult_stmt".
1199 (powi_as_mults): Likewise for "div_stmt".
1200 (build_and_insert_binop): Likewise for "stmt".
1201 (build_and_insert_cast): Likewise.
1202 (pass_cse_sincos::execute): Likewise for "stmt" and various decls
1204 (convert_mult_to_fma): Likewise for "fma_stmt".
1206 * tree-ssa-phiopt.c (conditional_replacement): Likewise for "new_stmt".
1207 (abs_replacement): Likewise.
1209 * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for "tmp".
1211 * tree-ssa-pre.c (create_expression_by_pieces): Likewise for "newstmt".
1212 (eliminate_insert): Likewise for "tem".
1214 * tree-ssa-propagate.c (update_gimple_call): Strengthen locals
1215 "new_stmt" and "stmt" from gimple to gimple_call.
1216 (update_call_from_tree): Likewise for "new_stmt".
1218 * tree-ssa-reassoc.c (build_and_add_sum): Likewise for "sum".
1219 (update_ops): Likewise for "g".
1220 (maybe_optimize_range_tests): Likewise.
1221 (rewrite_expr_tree_parallel): Require a gimple_assign rather than
1223 (reassociate_bb): Add a checked cast to gimple_assign.
1225 * tree-ssa.c (insert_debug_temp_for_var_def): Strengthen local
1226 "def_temp" from gimple to gimple_debug.
1228 * tree-switch-conversion.c (emit_case_bit_tests): Strengthen local
1229 "shift_stmt" from gimple to gimple_assign.
1231 * tree-tailcall.c (adjust_return_value_with_ops): Likewise for
1233 (update_accumulator_with_ops): Likewise.
1235 * tree-vect-data-refs.c (bump_vector_ptr): Likewise for
1238 * tree-vect-stmts.c (vectorizable_condition): Likewise for
1241 * tree-vrp.c (build_assert_expr_for): Likewise for "assertion".
1242 (simplify_truth_ops_using_ranges): Likewise for "newop".
1243 (simplify_float_conversion_using_ranges): Likewise for "conv".
1245 * ubsan.c (instrument_mem_ref): Strengthen local "g" from gimple
1248 * value-prof.c (gimple_divmod_fixed_value): Require a
1249 gimple_assign rather than a plain gimple; strengthen types of locals.
1250 (gimple_mod_pow2): Likewise.
1251 (gimple_mod_subtract): Likewise.
1252 (gimple_divmod_fixed_value_transform): Strengthen local
1253 "stmt" from gimple to gimple_assign.
1254 (gimple_mod_pow2_value_transform): Likewise.
1255 (gimple_mod_subtract_transform): Likewise.
1256 (gimple_ic): Strengthen types of locals.
1258 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1260 Introduce gimple_try
1262 * coretypes.h (gimple_try): New typedef.
1263 (const_gimple_try): New typedef.
1265 * gimple-low.c (gimple_try_catch_may_fallthru): Require a
1266 gimple_try rather than a plain gimple.
1267 (gimple_stmt_may_fallthru): Add checked cast to gimple_try.
1269 * gimple-pretty-print.c (dump_gimple_try): Require a gimple_try
1270 rather than a plain gimple.
1271 (pp_gimple_stmt_1): Add checked cast to gimple_try within
1272 GIMPLE_TRY case of switch statement.
1274 * tree-eh.c (finally_tree_node::parent): Strengthen field from
1275 gimple to gimple_try.
1276 (record_in_finally_tree): Require a gimple_try rather than a plain
1278 (collect_finally_tree): Likewise.
1279 (collect_finally_tree_1): Likewise.
1280 (struct leh_tf_state::try_finally_expr): Strengthen field from
1281 gimple to gimple_try.
1282 (struct leh_tf_state::top_p): Likewise.
1283 (lower_eh_must_not_throw): Require a gimple_try rather than a
1285 (frob_into_branch_around): Likewise.
1286 (lower_try_finally_dup_block): Strengthen local from gimple to
1288 (honor_protect_cleanup_actions): Split out uses of "x" into new
1289 locals "eh_mnt" and "try_stmt" with stronger types.
1290 (lower_try_finally): Require a gimple_try rather than a plain
1292 (lower_catch): Likewise.
1293 (lower_eh_filter): Likewise.
1294 (lower_eh_must_not_throw): Likewise.
1295 (lower_cleanup): Likewise.
1296 (lower_eh_constructs_2): Add checked cast to gimple_try within
1297 GIMPLE_TRY case of switch statement, introducing new local
1298 "try_stmt", using it for type-safety.
1300 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1302 Use subclasses of gimple in various places
1304 * asan.c (insert_if_then_before_iter): Require a gimple cond
1305 rathern than a plain gimple.
1306 (asan_expand_check_ifn): Add a checked cast to gimple_cond.
1308 * cfgloopmanip.c (create_empty_if_region_on_edge): Likewise.
1310 * omp-low.c (simd_clone_adjust): Strengthen local from gimple
1313 * sese.c (set_ifsese_condition): Strengthen local from gimple to
1316 * tree-call-cdce.c (gen_one_condition): Strengthen locals from
1317 gimple to gimple_assign and gimple_cond.
1319 * tree-ssa-phiopt.c (minmax_replacement): Likewise.
1320 (cond_store_replacement): Strengthen locals from gimple to
1321 gimple_phi and gimple_assign.
1322 (cond_if_else_store_replacement_1): Likewise.
1324 * tree-ssa-pre.c (do_regular_insertion): Strengthen local from
1325 gimple to gimple_assign.
1327 * tree-switch-conversion.c (hoist_edge_and_branch_if_true):
1328 Strengthen local from gimple to gimple_cond.
1329 (gen_def_assigns): Return a gimple_assign rather than a plain
1331 (gen_inbound_check): Strengthen locals from gimple to gimple_cond
1334 * tree-vect-loop-manip.c (slpeel_add_loop_guard): Strengthen local
1335 from gimple to gimple_cond.
1336 (set_prologue_iterations): Strengthen locals from gimple to
1337 gimple_phi and gimple_cond.
1339 * value-prof.c (gimple_ic): Strengthen local from gimple to
1341 (gimple_stringop_fixed_value): Strengthen locals from gimple to
1342 gimple_assign, gimple_cond, gimple_call, and gimple_phi.
1344 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1346 Introduce gimple_eh_dispatch
1348 * coretypes.h (gimple_eh_dispatch): New typedef.
1349 (const_gimple_eh_dispatch): New typedef.
1351 * gimple-pretty-print.c (dump_gimple_eh_dispatch): Require a
1352 gimple_eh_dispatch rather than a plain gimple.
1353 (pp_gimple_stmt_1): Add a checked cast to gimple_eh_dispatch
1354 within GIMPLE_EH_DISPATCH case of switch statement.
1356 * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1358 * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1360 * gimple.c (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
1361 rather than a plain gimple.
1363 * gimple.h (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
1364 rather than a plain gimple.
1365 (gimple_eh_dispatch_region): Require a const_gimple_eh_dispatch
1366 rather than a plain const_gimple.
1367 (gimple_eh_dispatch_set_region): Require a gimple_eh_dispatch
1368 rather than a plain gimple.
1370 * tree-cfg.c (make_edges): Add a checked cast to gimple_eh_dispatch
1371 within GIMPLE_EH_DISPATCH case of switch statement.
1372 (gimple_verify_flow_info): Likewise.
1373 (gimple_redirect_edge_and_branch): Likewise.
1374 (move_stmt_r): Likewise, adding a local.
1376 * tree-eh.c (emit_eh_dispatch): Convert local from gimple to
1378 (make_eh_dispatch_edges): Require a gimple_eh_dispatch rather than
1380 (redirect_eh_dispatch_edge): Likewise.
1381 (lower_eh_dispatch): Likewise.
1382 (execute_lower_eh_dispatch): Add a checked cast to
1384 (mark_reachable_handlers): Likewise.
1385 (verify_eh_dispatch_edge): Require a gimple_eh_dispatch rather
1386 than a plain gimple.
1388 * tree-eh.h (make_eh_dispatch_edges): Likewise.
1389 (redirect_eh_dispatch_edge): Likewise.
1390 (verify_eh_dispatch_edge): Likewise.
1392 * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1393 gimple_eh_dispatch within GIMPLE_EH_DISPATCH case of switch
1394 statement, adding a local.
1395 (copy_edges_for_bb): Add a checked cast to gimple_eh_dispatch.
1397 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1399 Introduce gimple_resx
1401 * coretypes.h (gimple_resx): New typedef.
1402 (const_gimple_resx): New typedef.
1404 * gimple.h (gimple_build_resx): Return a gimple_resx rather than a
1406 (gimple_resx_region): Require a const_gimple_resx rather than a
1408 (gimple_resx_set_region): Require a gimple_resx rather than a
1411 * gimple-pretty-print.c (dump_gimple_resx): Require a gimple_resx
1412 rather than a plain gimple.
1413 (pp_gimple_stmt_1): Add a checked cast to gimple_resx within
1414 GIMPLE_RESX case of switch statement.
1416 * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1418 * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1420 * gimple.c (gimple_build_resx): Return a gimple_resx rather than
1423 * tree-cfg.c (move_stmt_r): Add a checked cast to gimple_resx
1424 within GIMPLE_RESX case of switch statement, adding a new local.
1426 * tree-eh.c (emit_resx): Convert local "x" from gimple to
1428 (lower_resx): Require a gimple_resx rather than a plain gimple.
1429 (pass_lower_resx::execute): Add a checked cast to gimple_resx.
1430 (mark_reachable_handlers): Likewise.
1432 * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1433 gimple_resx within GIMPLE_RESX case of switch statement, adding
1436 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1438 Introduce gimple_eh_else
1440 * coretypes.h (gimple_eh_else): New typedef.
1441 (const_gimple_eh_else): New typedef.
1443 * gimple.h (gimple_build_eh_else): Return a gimple_eh_else rather
1444 than a plain gimple.
1445 (gimple_eh_else_n_body_ptr): Require a gimple_eh_else rather than
1447 (gimple_eh_else_n_body): Likewise.
1448 (gimple_eh_else_e_body_ptr): Likewise.
1449 (gimple_eh_else_e_body): Likewise.
1450 (gimple_eh_else_set_n_body): Likewise.
1451 (gimple_eh_else_set_e_body): Likewise.
1453 * gimple-low.c (lower_stmt): Add checked cast to gimple_eh_else
1454 within GIMPLE_EH_ELSE case of switch statement, introducing a new
1456 (gimple_stmt_may_fallthru): Likewise.
1458 * gimple-pretty-print.c (dump_gimple_eh_else): Require a
1459 gimple_eh_else rather than a plain gimple.
1460 (pp_gimple_stmt_1): Add checked cast to gimple_eh_else within
1461 GIMPLE_EH_ELSE case of switch statement
1463 * gimple-walk.c (walk_gimple_stmt): Add checked cast to
1464 gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1465 introducing a new local.
1467 * gimple.c (gimple_build_eh_else): Return a gimple_eh_else
1468 rather than a plain gimple.
1469 (gimple_copy): Add checked casts to gimple_eh_else within
1470 GIMPLE_EH_ELSE case of switch statement, introducing new locals.
1472 * tree-cfg.c (verify_gimple_in_seq_2): Add checked cast to
1473 gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1474 introducing a new local.
1476 * tree-eh.c (collect_finally_tree): Likewise.
1477 (replace_goto_queue_1): Likewise.
1478 (get_eh_else): Return a gimple_eh_else rather than a plain gimple.
1479 (honor_protect_cleanup_actions): Convert local "eh_else" from
1480 gimple to gimple_eh_else.
1481 (lower_try_finally_nofallthru): Likewise.
1482 (lower_try_finally_onedest): Introduce locals "eh_else" and
1483 "label_stmt", using them in favor of "x" for the gimple_eh_else
1484 and the gimple_label.
1485 (lower_try_finally_copy): Convert local "eh_else" from gimple to
1487 (lower_try_finally_switch): Likewise.
1488 (decide_copy_try_finally): Likewise.
1489 (refactor_eh_r): Add checked cast to gimple_eh_else within
1490 GIMPLE_EH_ELSE case of switch statement, introducing a new local.
1492 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1494 Introduce gimple_eh_must_not_throw
1496 * coretypes.h (gimple_eh_must_not_throw): New typedef.
1497 (const_gimple_eh_must_not_throw): New typedef.
1499 * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
1500 a gimple_eh_must_not_throw rather than a plain gimple.
1501 (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
1502 within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
1504 * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1506 * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1508 * gimple.c (gimple_build_eh_must_not_throw): Return a
1509 gimple_eh_must_not_throw rather than a plain gimple.
1511 * gimple.h (gimple_build_eh_must_not_throw): Return a
1512 gimple_eh_must_not_throw rather than a plain gimple.
1513 (gimple_eh_must_not_throw_fndecl): Require a
1514 gimple_eh_must_not_throw rather than a plain gimple.
1515 (gimple_eh_must_not_throw_set_fndecl): Likewise.
1517 * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
1519 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1521 Introduce gimple_eh_filter
1523 * coretypes.h (gimple_eh_filter): New typedef.
1524 (const_gimple_eh_filter): New typedef.
1526 * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
1527 rather than a plain gimple.
1529 * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
1530 gimple_eh_filter rather than a plain gimple.
1531 (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
1532 GIMPLE_EH_FILTER case of switch statement.
1534 * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
1535 rather than a plain gimple.
1537 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1539 Introduce gimple_catch
1541 * coretypes.h (gimple_catch): New typedef.
1542 (const_gimple_catch): New typedef.
1544 * gimple-low.c (lower_try_catch): Add checked cast to gimple_catch.
1545 (gimple_try_catch_may_fallthru): Likewise.
1547 * gimple-pretty-print.c (dump_gimple_catch): Require a gimple_catch
1548 rather than a plain gimple.
1549 (pp_gimple_stmt_1): Add checked cast to gimple_catch within
1550 GIMPLE_CATCH case of switch statement.
1552 * gimple-walk.c (walk_gimple_op): Likewise.
1553 (walk_gimple_stmt): Likewise.
1555 * gimple.c (gimple_build_catch): Return a gimple_catch rather than
1557 (gimple_copy): Add checked casts to gimple_catch within
1558 GIMPLE_CATCH case of switch statement, introducing new locals.
1560 * gimple.h (gimple_build_catch): Return a gimple_catch rather than
1562 (gimple_catch_types_ptr): Require a gimple_catch rather than a
1564 (gimple_catch_handler_ptr): Likewise.
1565 (gimple_catch_handler): Likewise.
1566 (gimple_catch_set_types): Likewise.
1567 (gimple_catch_set_handler): Likewise.
1569 * omp-low.c (lower_omp_1): Add checked cast to gimple_catch within
1570 GIMPLE_CATCH case of switch statement.
1572 * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
1573 (do_warn_unused_result): Likewise.
1575 * tree-eh.c (collect_finally_tree): Likewise.
1576 (replace_goto_queue_1): Likewise.
1577 (lower_catch): Convert local from gimple to gimple_catch.
1578 (refactor_eh_r): Add checked cast to gimple_catch within
1579 GIMPLE_CATCH case of switch statement.
1581 * tree-inline.c (remap_gimple_stmt): Likewise.
1582 (estimate_num_insns): Add checked cast to gimple_catch within
1583 GIMPLE_CATCH case of switch statement, introducing new local.
1585 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1587 Introduce gimple_transaction
1589 * coretypes.h (gimple_transaction): New typedef.
1590 (const_gimple_transaction): New typedef.
1592 * gimple.h (gimple_build_transaction): Return a gimple_transaction
1593 rather than a plain gimple.
1594 (gimple_transaction_body_ptr): Require a gimple_transaction rather
1595 than a plain gimple.
1596 (gimple_transaction_body): Likewise.
1597 (gimple_transaction_label_ptr): Likewise.
1598 (gimple_transaction_set_body): Likewise.
1599 (gimple_transaction_set_label): Likewise.
1600 (gimple_transaction_set_subcode): Likewise.
1601 (gimple_transaction_label): Require a const_gimple_transaction
1602 rather than a plain const_gimple.
1603 (gimple_transaction_subcode): Likewise.
1605 * gimple-low.c (lower_stmt): Add checked cast to
1606 gimple_transaction within GIMPLE_TRANSACTION case of switch
1609 * gimple-pretty-print.c (dump_gimple_transaction): Require a
1610 gimple_transaction rather than a plain gimple.
1611 (pp_gimple_stmt_1): Add checked cast to gimple_transaction within
1612 GIMPLE_TRANSACTION case of switch statement.
1613 * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1614 * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1615 * gimple-walk.c (walk_gimple_op): Likewise.
1616 (walk_gimple_stmt): Likewise.
1618 * gimple.c (gimple_build_transaction): Return a gimple_transaction
1619 rather than a plain gimple.
1620 (gimple_copy): Add checked casts to gimple_transaction within
1621 GIMPLE_TRANSACTION case of switch statement.
1623 * gimplify.c (gimplify_transaction): Split local "g" into
1624 "body_stmt" and "trans_stmt", strengthening the type of the latter
1625 from gimple to gimple_transaction.
1627 * omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
1628 within GIMPLE_TRANSACTION case of switch statement.
1630 * trans-mem.c (diagnose_tm_1): Add checked cast within
1631 GIMPLE_TRANSACTION case of switch statement, introducing a new
1632 local "trans_stmt". Use it in place of "stmt".
1633 (examine_call_tm): Convert local from gimple to gimple_transaction.
1634 (tm_region::get_transaction_stmt): New method.
1635 (tm_region::transaction_stmt): Add clarification of type to the
1637 (tm_region_init_0): Require a gimple_transaction rather than a
1639 (tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
1640 dyn_cast<gimple_transaction> and new local.
1641 (transaction_subcode_ior): Add a new local, using the new
1642 get_transaction_stmt method to perform a checked cast.
1643 (propagate_tm_flags_out): Likewise.
1644 (expand_transaction): Add a checked cast using the new
1645 get_transaction_stmt method.
1646 (generate_tm_state): Likewise.
1647 (execute_tm_mark): Likewise.
1648 (ipa_tm_diagnose_transaction): Likewise.
1650 * tree-cfg.c (verify_gimple_transaction): Require a
1651 gimple_transaction rather than a plain gimple.
1652 (make_edges): Add checked cast within GIMPLE_TRANSACTION case of
1654 (cleanup_dead_labels): Likewise.
1655 (verify_gimple_stmt): Likewise.
1656 (verify_gimple_in_seq_2): Likewise.
1657 (verify_gimple_in_seq_2): Likewise.
1658 (gimple_redirect_edge_and_branch): Add checked cast.
1660 * tree-inline.c (remap_gimple_stmt): Add checked cast within
1661 GIMPLE_TRANSACTION case of switch statement, introducing a new
1662 local "old_trans_stmt". Use it in place of "stmt". Add new
1663 local "new_trans_stmt", using it to initialize "copy", and for
1664 type-safe operations as a transaction.
1665 (estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
1666 case of switch statement.
1668 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1670 Introduce gimple_asm
1672 * coretypes.h (gimple_asm): New typedef.
1673 (const_gimple_asm): New typedef.
1675 * gimple.h (gimple_build_asm_vec): Return a gimple_asm rather than
1677 (gimple_asm_clobbers_memory_p): Require a const_gimple_asm rather
1678 than just a const_gimple.
1679 (gimple_asm_ninputs): Likewise.
1680 (gimple_asm_noutputs): Likewise.
1681 (gimple_asm_nclobbers): Likewise.
1682 (gimple_asm_nlabels): Likewise.
1683 (gimple_asm_input_op): Likewise.
1684 (gimple_asm_input_op_ptr): Likewise.
1685 (gimple_asm_output_op): Likewise.
1686 (gimple_asm_output_op_ptr): Likewise.
1687 (gimple_asm_clobber_op): Likewise.
1688 (gimple_asm_label_op): Likewise.
1689 (gimple_asm_string): Likewise.
1690 (gimple_asm_volatile_p): Likewise.
1691 (gimple_asm_input_p): Likewise.
1692 (gimple_asm_set_input_op): Require a gimple_asm rather than a plain
1694 (gimple_asm_set_output_op): Likewise.
1695 (gimple_asm_set_clobber_op): Likewise.
1696 (gimple_asm_set_label_op): Likewise.
1697 (gimple_asm_set_volatile): Likewise.
1698 (gimple_asm_set_input): Likewise.
1700 * cfgexpand.c (expand_asm_stmt): Require a gimple_asm rather than
1702 (expand_gimple_stmt_1): Add checked cast to gimple_asm within
1703 GIMPLE_ASM case of switch statement.
1705 * gimple-fold.c (fold_stmt_1): Add new local from checked cast to
1706 gimple_asm within case GIMPLE_ASM.
1708 * gimple-pretty-print.c (dump_gimple_asm): Require a gimple_asm
1709 rather than a plain gimple.
1710 (pp_gimple_stmt_1): Add checked cast to gimple_asm within
1711 GIMPLE_ASM case of switch statement.
1713 * gimple-streamer-in.c (input_gimple_stmt): Rework existing
1714 checked cast to gimple_asm; add a new one.
1716 * gimple-streamer-out.c (output_gimple_stmt): Add new local from
1717 checked cast to gimple_asm within case GIMPLE_ASM.
1719 * gimple-walk.c (walk_gimple_asm): Require a gimple_asm rather
1720 than a plain gimple.
1721 (walk_gimple_op): Add checked cast to gimple_asm within GIMPLE_ASM
1722 case of switch statement.
1723 (walk_stmt_load_store_addr_ops): Use dyn_cast<gimple_asm> in place
1724 of a code check against GIMPLE_ASM to introduce a new gimple_asm
1727 * gimple.c (gimple_build_asm_1): Return a gimple_asm rather than
1729 (gimple_build_asm_vec): Likewise.
1730 (gimple_has_side_effects): Add a checked cast to gimple_asm.
1731 (gimple_could_trap_p_1): Likewise.
1732 (gimple_call_builtin_p): Require a const_gimple_asm rather then
1735 * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
1736 and a new local of type gimple_asm within GIMPLE_ASM case.
1738 * gimplify.c (gimplify_asm_expr): Convert a local from gimple to
1741 * ipa-pure-const.c (check_stmt): Add checked casts within
1744 * ssa-iterators.h (op_iter_init): Likewise.
1746 * tree-cfg.c (make_goto_expr_edges): Convert a local from gimple
1748 (cleanup_dead_labels): Add a checked cast and a new local of type
1749 gimple_asm within GIMPLE_ASM case.
1750 (gimple_redirect_edge_and_branch): Likewise.
1751 (is_ctrl_altering_stmt): Add a checked cast.
1752 (need_fake_edge_p): Replace a code check against GIMPLE_ASM with a
1753 dyn_cast<gimple_asm>.
1755 * tree-complex.c (expand_complex_comparison): Convert a local from
1756 gimple to gimple_asm.
1758 * tree-data-ref.c (get_references_in_stmt): Add a checked cast to
1761 * tree-eh.c (stmt_could_throw_p): Likewise.
1763 * tree-inline.c (estimate_num_insns): Likewise.
1765 * tree-sra.c (scan_function): Add a checked cast and a new local
1766 of type gimple_asm within GIMPLE_ASM case.
1767 (sra_modify_function_body): Likewise.
1768 (ipa_sra_modify_function_body): Likewise.
1770 * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
1772 * tree-ssa-dce.c (propagate_necessity): Replace a code check
1773 against GIMPLE_ASM with a dyn_cast<gimple_asm>.
1775 * tree-ssa-operands.c (maybe_add_call_vops): Require a gimple_asm
1776 rather than a plain gimple.
1777 (parse_ssa_operands): Add a checked cast to gimple_asm.
1779 * tree-ssa-structalias.c (find_func_aliases): Replace a check for
1780 GIMPLE_ASM with a dyn_cast<gimple_asm>, introducing a new local
1781 "asm_stmt", using it in place of "t" for typesafety.
1783 * tree-ssa-threadedge.c
1784 (record_temporary_equivalences_from_stmts_at_dest): Add a checked
1787 * tree-ssa.c (execute_update_addresses_taken): Add checked casts
1788 and new locals of type gimple_asm within clauses guarded by code
1791 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1793 Introduce gimple_goto
1795 * coretypes.h (gimple_goto): New typedef.
1796 (const_gimple_goto): New typedef.
1798 * gimple.h (gimple_statement_goto): New subclass of
1799 gimple_statement_with_ops, adding the invariant that
1800 stmt->code == GIMPLE_GOTO.
1801 (is_a_helper <gimple_statement_goto>::test): New.
1802 (gimple_build_goto): Return a gimple_goto rather than a
1805 * gimple-pretty-print.c (dump_gimple_goto): Require a gimple_goto
1806 rather than a plain gimple.
1807 (pp_gimple_stmt_1): Add a checked cast to gimple_goto within
1808 GIMPLE_GOTO case of switch statement.
1810 * gimple.c (gimple_build_goto): Return a gimple_goto rather than a
1813 * tree-cfg.c (verify_gimple_goto): Require a gimple_goto rather
1814 than a plain gimple.
1815 (verify_gimple_stmt): Add a checked cast to gimple_goto within
1816 GIMPLE_GOTO case of switch statement.
1818 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1820 Introduce gimple_return
1822 * coretypes.h (gimple_return): New typedef.
1823 (const_gimple_return): New typedef.
1825 * gimple.h (gimple_statement_return): New subclass of
1826 gimple_statement_with_memory_ops, adding the invariant that
1827 stmt->code == GIMPLE_RETURN.
1828 (is_a_helper <gimple_statement_return>::test): New.
1829 (gimple_build_return): Return a gimple_return rather
1830 than a plain gimple.
1832 * gimple.c (gimple_build_return): Return a gimple_return rather
1833 than a plain gimple.
1835 * cgraphunit.c (expand_thunk): Convert local from a gimple to
1838 * gimple-low.c (struct return_statements_t): Convert field "stmt"
1839 from a gimple to a gimple_return.
1840 (lower_gimple_return): Convert local from a gimple to a
1843 * gimple-pretty-print.c (dump_gimple_return): Require a
1844 gimple_return rather than a plain gimple.
1845 (pp_gimple_stmt_1): Add a checked cast to gimple_return within
1846 case GIMPLE_RETURN of switch statement.
1848 * gimplify.c (gimplify_return_expr): Convert locals from
1849 gimple to gimple_return.
1851 * ipa-split.c (split_function): Likewise.
1853 * tree-cfg.c (verify_gimple_assign): Require a gimple_return
1854 rather than a plain gimple.
1855 (verify_gimple_stmt): Add checked cast to gimple_return within
1856 case GIMPLE_RETURN of switch statement.
1858 * tree-tailcall.c (adjust_return_value): Convert local from
1859 gimple to gimple_return.
1861 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1863 Introduce gimple_call
1865 * coretypes.h (gimple_call): New typedef.
1866 (const_gimple_call): New typedef.
1868 * asan.c (get_mem_refs_of_builtin_call): Require a
1869 const_gimple_call rather than a const gimple.
1870 (has_stmt_been_instrumented_p): Add a checked cast to
1872 (instrument_strlen_call): Likewise.
1873 (instrument_builtin_call): Likewise.
1874 * builtins.c (validate_gimple_arglist): Require a
1875 const_gimple_call rather than a const gimple.
1876 (fold_call_stmt): Require a gimple_call rather than a gimple.
1877 * builtins.h (validate_gimple_arglist): Require a
1878 const_gimple_call rather than a const gimple.
1879 (fold_call_stmt): Require a gimple_call rather than a gimple.
1880 * cfgexpand.c (expand_call_stmt): Likewise.
1881 (expand_gimple_stmt_1): Add a checked cast to gimple_call within
1883 * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Strengthen
1884 local "new_stmt" from gimple to gimple_call, adding a checked
1886 * cgraphunit.c (cgraph_node::expand_thunk): Likewise for local
1888 * gimple-fold.c (gimple_fold_builtin_snprintf_chk): Likewise for
1890 (gimple_fold_builtin_snprintf): Likewise.
1891 (gimple_fold_builtin): Likewise.
1892 (gimple_fold_call): Likewise.
1893 (gimple_fold_stmt_to_constant_1): Introduce local "call_stmt" via
1894 checked cast of "stmt" to gimple_call, using it in various places
1896 * gimple-pretty-print.c (dump_gimple_call_args): Strengthen param
1897 2 from gimple to gimple_call.
1898 (dump_gimple_call): Likewise.
1899 (pp_gimple_stmt_1): Add a checked cast to gimple_call within
1901 * gimple-streamer-in.c (input_gimple_stmt): Replace is_gimple_call
1902 with a dyn_cast<gimple_call>, introducing local "call_stmt", and
1903 using it in place of "stmt" for typesafety. Add a checked cast
1904 in statement guarded by check for GIMPLE_CALL.
1905 * gimple-walk.c (walk_gimple_op): Add a checked cast to
1907 * gimple.c (gimple_call_reset_alias_info): Strengthen param from
1908 gimple to gimple_call.
1909 (gimple_build_call_1): Strengthen return type and local from
1910 gimple to gimple_call.
1911 (gimple_build_call_vec): Likewise.
1912 (gimple_build_call): Likewise.
1913 (gimple_build_call_valist): Likewise.
1914 (gimple_build_call_internal_1): Likewise.
1915 (gimple_build_call_internal): Likewise.
1916 (gimple_build_call_internal_vec): Likewise.
1917 (gimple_build_call_from_tree): Likewise.
1918 (gimple_call_return_flags): Strengthen param from
1919 const_gimple to const_gimple_call.
1920 (gimple_call_copy_skip_args): Strengthen return type and local from
1921 gimple to gimple_call.
1922 * gimple.h (gimple_call_reset_alias_info): Strengthen param from
1923 gimple to gimple_call.
1924 (gimple_build_call_vec): Strengthen return type from gimple to
1926 (gimple_build_call): Likewise.
1927 (gimple_build_call_valist): Likewise.
1928 (gimple_build_call_internal): Likewise.
1929 (gimple_build_call_internal_vec): Likewise.
1930 (gimple_build_call_from_tree): Likewise.
1931 (gimple_call_return_flags): Strengthen param from const_gimple to
1933 (gimple_call_copy_skip_args): Strengthen return type from gimple
1935 (gimple_call_set_internal_fn): Strengthen param "call_stmt" from
1936 gimple to gimple_call.
1937 (gimple_call_return_type): Strengthen param from const_gimple to
1939 (gimple_call_chain_ptr): Likewise.
1940 (gimple_call_set_chain): Strengthen param from gimple to
1942 (gimple_call_set_return_slot_opt): Likewise.
1943 (gimple_call_set_from_thunk): Likewise.
1944 (gimple_call_from_thunk_p): Likewise.
1945 (gimple_call_set_va_arg_pack): Likewise.
1946 (gimple_call_va_arg_pack_p): Likewise.
1947 (gimple_call_set_alloca_for_var): Likewise.
1948 (gimple_call_alloca_for_var_p): Likewise.
1949 (gimple_expr_type): Introduce local "call_stmt" via a checked cast
1950 and use it for typesafety.
1951 * gimplify.c (gimplify_call_expr): Strengthen local "call" from
1952 gimple to gimple_call.
1953 (gimplify_modify_expr_to_memcpy): Likewise for local "gs".
1954 (gimplify_modify_expr_to_memset): Likewise.
1955 (gimplify_modify_expr): Add a checked cast to gimple_call.
1956 (gimplify_expr): Strengthen local "call" from gimple to
1958 (gimplify_function_tree): Likewise.
1959 * internal-fn.c (expand_LOAD_LANES): Strengthen param from gimple
1961 (expand_STORE_LANES): Likewise.
1962 (expand_ANNOTATE): Likewise.
1963 (expand_GOMP_SIMD_LANE): Likewise.
1964 (expand_GOMP_SIMD_VF): Likewise.
1965 (expand_GOMP_SIMD_LAST_LANE): Likewise.
1966 (expand_UBSAN_NULL): Likewise.
1967 (expand_UBSAN_BOUNDS): Likewise.
1968 (expand_UBSAN_OBJECT_SIZE): Likewise.
1969 (expand_ASAN_CHECK): Likewise.
1970 (ubsan_expand_si_overflow_addsub_check): Likewise.
1971 (ubsan_expand_si_overflow_neg_check): Likewise.
1972 (ubsan_expand_si_overflow_mul_check): Likewise.
1973 (expand_UBSAN_CHECK_ADD): Likewise.
1974 (expand_UBSAN_CHECK_SUB): Likewise.
1975 (expand_UBSAN_CHECK_MUL): Likewise.
1976 (expand_LOOP_VECTORIZED): Likewise.
1977 (expand_MASK_LOAD): Likewise.
1978 (expand_MASK_STORE): Likewise.
1979 (expand_ABNORMAL_DISPATCHER): Likewise.
1980 (expand_BUILTIN_EXPECT): Likewise.
1981 (internal_fn_expanders): Likewise for entries in this table.
1982 (expand_internal_call): Likewise.
1983 * internal-fn.def: Update comment to reflect strengthening of
1985 * internal-fn.h (expand_internal_call): Strengthen param from
1986 gimple to gimple_call.
1987 * ipa-prop.c (ipa_modify_call_arguments): Likewise for local
1989 * ipa-pure-const.c (check_call): Likewise for param "call".
1990 (check_stmt): Add a checked cast to gimple_call within GIMPLE_CALL
1992 * ipa-split.c (split_function): Strengthen local "call" from
1993 gimple to gimple_call.
1994 * omp-low.c (build_omp_barrier): Likewise for local "g".
1995 (lower_rec_input_clauses): Likewise for local "stmt".
1996 * trans-mem.c (build_tm_load): Likewise for return type and local
1998 (build_tm_store): Likewise.
1999 (expand_transaction): Likewise for local "call".
2000 * tree-call-cdce.c (check_pow): Likewise for param.
2001 (check_builtin_call): Likewise.
2002 (is_call_dce_candidate): Likewise.
2003 (gen_conditions_for_pow): Likewise.
2004 (gen_shrink_wrap_conditions): Likewise.
2005 (shrink_wrap_one_built_in_call): Likewise.
2006 (shrink_wrap_conditional_dead_built_in_calls): Strengthen param
2007 from vec<gimple> to vec<gimple_call>, and local "bi_call" from
2008 gimple to gimple_call.
2009 (pass_call_cdce::execute): Strengthen local
2010 "cond_dead_built_in_calls" from auto_vec<gimple> to
2011 auto_vec<gimple_call> and local "stmt" from gimple to gimple_call,
2012 * tree-cfg.c (notice_special_calls): Strengthen param from gimple
2014 * tree-cfg.h (notice_special_calls): Likewise.
2015 * tree-complex.c (expand_complex_libcall): Likewise for local
2017 * tree-inline.c (remap_gimple_stmt): Add checked cast to
2019 (copy_bb): Likewise. Strengthen local "new_call" from gimple to
2021 (inline_forbidden_p_stmt): Add checked cast to gimple_call.
2022 * tree-nested.c (init_tmp_var_with_call): Strengthen param "call"
2023 from gimple to gimple_call.
2024 (convert_nl_goto_reference): Likewise for local "call".
2025 (convert_tramp_reference_op): Likewise.
2026 (convert_gimple_call): Add checked cast to gimple_call.
2027 * tree-nrv.c (dest_safe_for_nrv_p): Strengthen param "call" from
2028 gimple to gimple_call.
2029 (pass_return_slot::execute): Likewise for local "stmt", using a
2030 dyn_cast<gimple_call> rather than an is_gimple_call call.
2031 * tree-object-size.c (alloc_object_size): Strengthen param "call"
2032 from const_gimple to const_gimple_call.
2033 (pass_through_call): Likewise.
2034 (call_object_size): Strengthen param "call" from gimple to
2036 (collect_object_sizes_for): Introduce local "call_stmt" via a
2037 checked cast, using it for typesafety.
2038 (check_for_plus_in_loops_1): Likewise.
2039 (pass_object_sizes::execute): Add a checked cast to gimple_call.
2040 * tree-profile.c (gimple_gen_interval_profiler): Strengthen local
2041 "call" from gimple to gimple_call.
2042 (gimple_gen_pow2_profiler): Likewise.
2043 (gimple_gen_one_value_profiler): Likewise.
2044 (gimple_gen_time_profiler): Likewise.
2045 (gimple_gen_average_profiler): Likewise.
2046 (gimple_gen_ior_profiler): Likewise.
2047 * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise for
2049 (ref_maybe_used_by_call_p): Likewise.
2050 (ref_maybe_used_by_stmt_p): Add a checked cast to gimple_call.
2051 (call_may_clobber_ref_p_1): Strengthen param "call" from gimple to
2053 (call_may_clobber_ref_p): Likewise.
2054 (stmt_may_clobber_ref_p_1): Add a checked cast to gimple_call.
2055 * tree-ssa-alias.h (call_may_clobber_ref_p): Strengthen param 1
2056 from gimple to gimple_call.
2057 (call_may_clobber_ref_p_1): Likewise.
2058 * tree-ssa-dce.c (eliminate_unnecessary_stmts): Add a checked cast
2060 * tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Strengthen
2061 local "call" from gimple to gimple_call.
2062 * tree-ssa-math-opts.c (build_and_insert_call): Likewise for local
2064 * tree-ssa-operands.c (maybe_add_call_vops): Likewise for param
2066 (parse_ssa_operands): Add a checked cast to gimple_call within
2068 * tree-ssa-pre.c (compute_avail): Add a checked cast to
2070 * tree-ssa-sccvn.c (copy_reference_ops_from_call): Strengthen
2071 param "call" from gimple to gimple_call.
2072 (valueize_shared_reference_ops_from_call): Likewise.
2073 (vn_reference_lookup_3): Add a checked cast to gimple_call.
2074 (vn_reference_lookup_call): Strengthen param "call" from gimple to
2076 (visit_reference_op_call): Likewise for param "stmt".
2077 (visit_use): Replace is_gimple_call with a dyn_cast, introducing
2078 local "call_stmt", using it in place of "stmt" for type-safety.
2079 * tree-ssa-sccvn.h (vn_reference_lookup_call): Strengthen param 1
2080 from gimple to gimple_call.
2081 * tree-ssa-structalias.c (get_call_vi): Likewise.
2082 (lookup_call_use_vi): Likewise.
2083 (lookup_call_clobber_vi): Likewise.
2084 (get_call_use_vi): Likewise.
2085 (get_call_clobber_vi): Likewise.
2086 (handle_rhs_call): Likewise.
2087 (handle_lhs_call): Likewise.
2088 (handle_const_call): Likewise.
2089 (handle_pure_call): Likewise.
2090 (get_fi_for_callee): Likewise.
2091 (find_func_aliases_for_builtin_call): Likewise for param 2.
2092 (find_func_aliases_for_call): Likewise.
2093 (find_func_aliases): Add a checked cast to gimple_call.
2094 (find_func_clobbers): Replace is_gimple_call with a dyn_cast,
2095 introducing local "call_stmt", using it in place of "stmt" for
2097 (compute_points_to_sets): Strengthen local "stmt" from gimple to
2098 gimple_call, replacing is_gimple_call with a
2099 dyn_cast <gimple_call>.
2100 (ipa_pta_execute): Likewise.
2101 * tree-ssa-threadedge.c
2102 (record_temporary_equivalences_from_stmts_at_dest): Add checked
2103 cast to gimple_call.
2104 * tree-tailcall.c (find_tail_calls): Strengthen local "call" from
2105 gimple to gimple_call, adding a checked cast.
2106 * tree-vect-data-refs.c (vect_setup_realignment): Eliminate
2107 top-level local "new_stmt" in favor of more tightly-scoped locals
2108 "new_stmt" of type gimple_assign and gimple_call.
2109 * tree-vect-patterns.c (vect_recog_pow_pattern): Strenghthen local
2110 "stmt" from gimple to gimple_call.
2111 * tree-vect-stmts.c (vectorizable_function): Likewise for param
2113 (vectorizable_call): Rename param 1 from "stmt" to "gs",
2114 reintroducing "stmt" as a gimple_call once we've established that
2115 we're working with a GIMPLE_CALL.
2116 * tree-vectorizer.h (vectorizable_function): Strengthen param 1
2117 from gimple to gimple_call.
2118 * value-prof.c (check_ic_target): Likewise.
2119 (gimple_ic_transform): Likewise for local "stmt", replacing a
2120 check for GIMPLE_CALL with a dyn_cast.
2121 (interesting_stringop_to_profile_p): Strengthen param "call"
2122 from gimple to gimple_call.
2123 (gimple_stringop_fixed_value): Likewise for param "vcall_stmt".
2124 (gimple_stringops_transform): Likewise for local "stmt",
2125 replacing a check for GIMPLE_CALL with a dyn_cast.
2126 (gimple_stringops_values_to_profile): Rename param 1 from "stmt"
2127 to "gs", reintroducing "stmt" as a gimple_call once we've
2128 established that we're working with a GIMPLE_CALL.
2129 * vtable-verify.c (verify_bb_vtables): Strengthen local
2130 "call_stmt" from gimple to gimple_call.
2132 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2134 Concretize get_loop_exit_condition et al to working on gimple_cond
2136 * tree-scalar-evolution.h (get_loop_exit_condition): Return a
2138 * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
2139 concretizing local "res" from gimple to gimple_cond.
2140 * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
2141 locals from gimple to gimple_cond.
2142 (slpeel_can_duplicate_loop_p): Likewise.
2143 * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
2144 (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
2146 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2148 Update various expressions within tree-scalar-evolution.c to be gimple_phi
2150 * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
2151 rather than a gimple.
2152 (follow_ssa_edge_binary): Likewise.
2153 (follow_ssa_edge_expr): Likewise.
2154 (follow_ssa_edge_in_rhs): Likewise.
2155 (backedge_phi_arg_p): Likewise.
2156 (follow_ssa_edge_in_condition_phi_branch): Likewise.
2157 (follow_ssa_edge_in_condition_phi): Likewise.
2158 (follow_ssa_edge_inner_loop_phi): Likewise.
2159 (analyze_evolution_in_loop): Likewise.
2160 (analyze_initial_condition): Likewise.
2161 (interpret_loop_phi): Likewise.
2162 (interpret_condition_phi): Likewise.
2163 (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
2165 (analyze_scalar_evolution_1): Add checked casts to gimple_phi
2166 within "case GIMPLE_PHI".
2168 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2170 tree-ssa-loop-ivopts.c: use gimple_phi in a few places
2172 * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
2173 (find_bivs): Convert local "phi" into a gimple_phi.
2174 (mark_bivs): Likewise.
2176 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2178 tree-ssa-loop-manip.c: use gimple_phi in three places
2180 * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
2182 (split_loop_exit_edge): Likewise for "phi" and "new_phi".
2184 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2186 tree-ssa-loop-niter.c: use gimple_phi in a few places
2188 * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
2189 rather than a gimple.
2190 (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
2191 (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
2193 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2195 tree-ssa-phiprop.c: use gimple_phi
2197 * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
2198 parameter "phi" and local "new_phi" from gimple to gimple_phi.
2200 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2202 tree-predcom.c: use gimple_phi in various places
2204 * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
2206 (insert_looparound_copy): Require a gimple_phi rather than just a
2208 (add_looparound_copies): Convert local "phi" to be a gimple_phi.
2209 (initialize_root_vars): Likewise.
2210 (initialize_root_vars_lm): Likewise.
2212 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2214 tree-parloops.c: use gimple_phi in various places
2216 * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
2217 from gimple to gimple_phi.
2218 (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
2219 (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
2220 (gather_scalar_reductions): Convert to a gimple_phi_iterator and
2222 (try_create_reduction_list): Likewise.
2224 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2226 Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
2228 * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
2229 type of parameter from gimple to gimple_phi.
2231 * tree-complex.c (complex_visit_phi): Update signature of callback
2232 implementation accordingly.
2233 * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
2234 * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
2235 * tree-vrp.c (vrp_visit_phi_node): Likewise.
2237 * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
2238 gimple_phi when invoking the ssa_prop_visit_phi callback.
2240 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2242 Introduce gimple_phi_iterator
2244 * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
2245 gimple_stmt_iterator with identical layout, but adding...
2246 (gimple_phi_iterator::phi): ...new method, equivalent to
2247 gsi_stmt (), but casting the underlying gimple to gimple_phi,
2248 checking that code == GIMPLE_PHI in a checked build.
2249 (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
2250 gimple_stmt_iterator.
2252 * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
2254 (if_convertible_phi_p): Likewise.
2255 * tree-phinodes.h (add_phi_node_to_bb): Likewise.
2256 * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
2258 * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
2259 and a vec<gimple_phi> *, rather than just a gimple and
2260 vec<gimple> *, and a hash_set<gimple_phi> * rather than a
2262 (find_uninit_use): Likewise; add checked cast to gimple_phi when
2264 (pass_late_warn_uninitialized::execute): Strengthen types of
2265 various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
2266 "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
2267 gimple_phi, "added_to_worklist" from hash_set<gimple> to
2268 hash_set<gimple_phi>.
2270 * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
2271 gimple_phi_iterator * rather than a gimple_stmt_iterator *;
2272 use it to strengthen local from a gimple to a gimple_phi.
2274 * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
2275 gimple_stmt_iterator to a gimple_phi_iterator. Use the iterator's
2276 "phi" method rather than gsi_stmt. Use this checked cast to convert
2277 the type of related local from a plain gimple to a gimple_phi.
2278 * gimple-pretty-print.c (dump_phi_nodes): Likewise.
2279 * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
2281 * sese.c (sese_add_exit_phis_edge): Likewise.
2282 * tree-cfg.c (reinstall_phi_args): Likewise.
2283 (gimple_make_forwarder_block): Likewise.
2284 (add_phi_args_after_copy_edge): Likewise.
2285 (gimple_lv_adjust_loop_header_phi): Likewise.
2286 * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
2287 (remove_forwarder_block_with_phi): Likewise.
2288 (merge_phi_nodes): Likewise.
2289 * tree-complex.c (update_phi_components): Likewise.
2290 * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
2291 * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
2292 (copy_phis_for_bb): Likewise.
2293 * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
2294 * tree-outof-ssa.c (eliminate_build): Likewise.
2295 (eliminate_useless_phis): Likewise.
2296 (rewrite_trees): Likewise.
2297 (insert_backedge_copies): Likewise.
2298 * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
2299 (remove_phi_args): Likewise.
2300 (remove_phi_nodes): Likewise.
2301 * tree-predcom.c (find_looparound_phi): Likewise.
2302 (eliminate_temp_copies): Likewise.
2303 * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
2304 (scev_const_prop): Likewise; also, add checked cast to phi.
2305 * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
2306 * tree-ssa-dce.c (remove_dead_phis): Likewise.
2307 (forward_edge_to_pdom): Likewise.
2308 * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
2309 (cprop_into_successor_phis): Likewise.
2310 (propagate_rhs_into_lhs): Likewise.
2311 (eliminate_degenerate_phis_1): Likewise.
2312 * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
2313 * tree-ssa-live.c (calculate_live_on_exit): Likewise.
2314 (verify_live_on_entry): Likewise.
2315 * tree-ssa-loop-im.c
2316 (move_computations_dom_walker::before_dom_children): Likewise.
2317 * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
2318 (mark_bivs): Likewise.
2319 (find_interesting_uses_outside): Likewise.
2320 (determine_set_costs): Likewise.
2321 * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
2322 (tree_transform_and_unroll_loop): Likewise.
2323 (rewrite_all_phi_nodes_with_iv): Likewise.
2324 (canonicalize_loop_ivs): Likewise.
2325 * tree-ssa-loop-niter.c (determine_value_range): Likewise.
2326 * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
2327 * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
2328 * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
2329 * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
2330 (vop_phi): Likewise.
2331 * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
2333 * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
2334 (copy_phi_args): Likewise.
2335 (phi_args_equal_on_edges): Likewise.
2336 * tree-ssa.c (ssa_redirect_edge): Likewise.
2337 (flush_pending_stmts): Likewise.
2338 * tree-switch-conversion.c (check_final_bb): Likewise.
2339 (gather_default_values): Likewise.
2340 (build_constructors): Likewise.
2341 (fix_phi_nodes): Likewise.
2342 * tree-tailcall.c (propagate_through_phis): Likewise.
2343 (add_successor_phi_arg): Likewise.
2344 * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
2346 (slpeel_update_phi_nodes_for_guard2): Likewise.
2347 (slpeel_tree_peel_loop_to_edge): Likewise.
2348 (vect_can_advance_ivs_p): Likewise.
2349 (vect_update_ivs_after_vectorizer): Likewise.
2350 * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
2351 * tree-vrp.c (find_assert_locations): Likewise.
2352 * value-prof.c (gimple_ic): Likewise.
2354 * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
2356 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2358 Introduce gimple_phi and use it in various places
2360 * coretypes.h (gimple_phi): New typedef.
2361 (const_gimple_phi): New typedef.
2363 * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
2364 variants, using the gimple printer.
2366 * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
2367 vecs of more concrete gimple subclasses as appropriate; also the
2368 comment is about to become misleading.
2370 * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
2371 rather than spelling out the full type.
2372 (gimple_phi_num_args): Likewise.
2373 (gimple_phi_result): Likewise.
2374 (gimple_phi_result_ptr): Use gimple_phi typedef.
2375 (gimple_phi_set_result): Likewise.
2376 (gimple_phi_arg): Likewise.
2377 (gimple_phi_set_arg): Likewise.
2378 * tree-phinodes.c (allocate_phi_node): Likewise.
2379 (resize_phi_node): Likewise.
2380 (reserve_phi_args_for_new_edge): Likewise.
2381 (remove_phi_arg_num): Likewise.
2383 * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
2384 rather than just a gimple.
2385 * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
2387 * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
2389 (create_phi_node): Likewise.
2390 * tree-phinodes.h (create_phi_node): Likewise.
2392 * trans-mem.c (struct struct tm_log_entry): Replace use of
2393 now-removed gimple_vec with a plain vec<gimple>.
2395 * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
2396 vec<gimple_vec> to a vec< vec<gimple_phi> >.
2398 * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
2400 * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
2401 "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
2403 * tree-into-ssa.c (delete_update_ssa): Strengthen local
2404 "phis" from a gimple_vec to a vec<gimple_phi>.
2406 * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2407 gimple_phi in regions where a stmt is known to have code
2409 * tree-into-ssa.c (mark_use_interesting): Likewise.
2411 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2413 Introduce gimple_debug and use it in a few places
2415 * coretypes.h (gimple_debug): New typedef.
2416 (const_gimple_debug): New typedef.
2418 * gimple.h (struct gimple_statement_debug): New subclass of
2419 gimple_statement_with_ops, adding the invariant that
2420 stmt->code == GIMPLE_DEBUG.
2421 (is_a_helper <gimple_statement_debug>::test): New.
2423 * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
2424 variants, using the gimple printer.
2426 * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
2427 rather than just a gimple.
2428 * tree-inline.c (copy_debug_stmt): Likewise.
2430 * tree-inline.h (struct copy_body_data): Strengthen field
2431 "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
2433 * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
2434 rather than just a gimple.
2435 (gimple_build_debug_source_bind_stat): Likewise.
2436 * gimple.h (gimple_build_debug_bind_stat): Likewise.
2437 (gimple_build_debug_source_bind_stat): Likewise.
2439 * tree-inline.c (remap_gimple_stmt): Update locals to be a
2441 (maybe_move_debug_stmts_to_successors): Likewise.
2442 (copy_debug_stmts): Likewise.
2444 * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2445 gimple_debug in regions where a stmt is known to have code
2448 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2450 Introduce gimple_label and use it in a few places
2452 * coretypes.h (gimple_label): New typedef.
2453 (const_gimple_label): New typedef.
2455 * gimple.h (struct gimple_statement_label): New subclass of
2456 gimple_statement_with_ops, adding the invariant that
2457 stmt->code == GIMPLE_LABEL.
2458 (is_a_helper <gimple_statement_label>::test): New.
2460 * gdbhooks.py (build_pretty_printer): Add gimple_label and its
2461 variants, reusing the gimple printer.
2463 * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
2464 rather than just a gimple.
2465 * tree-cfg.c (verify_gimple_label): Likewise.
2467 * gimple.c (gimple_build_label): Return a gimple_label rather than
2469 * gimple.h (gimple_build_label): Likewise.
2471 * gimplify.c (gimplify_case_label_expr): Update local to be a
2473 * tree-switch-conversion.c (gen_inbound_check): Likewise.
2475 * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2476 gimple_label in regions where a stmt is known to have code
2478 * tree-cfg.c (verify_gimple_stmt): Likewise.
2480 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2482 Introduce gimple_assign and use it in various places
2484 * coretypes.h (gimple_assign): New typedef.
2485 (const_gimple_assign): New typedef.
2487 * gimple.h (struct gimple_statement_assign): New subclass of
2488 gimple_statement_with_memory_ops, adding the invariant that
2489 stmt->code == GIMPLE_ASSIGN.
2490 (is_a_helper <gimple_statement_assign>::test): New.
2492 * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
2493 variants, using the gimple printer.
2495 * gimple-builder.c (build_assign): Return a gimple_assign rather
2496 than just a gimple from each of the overloaded variants.
2497 (build_type_cast): Likewise.
2498 * gimple-builder.h (build_assign): Likewise.
2499 (build_type_cast): Likewise.
2500 * gimple.c (gimple_build_assign_stat): Likewise.
2501 (gimple_build_assign_with_ops): Likewise.
2502 * gimple.h (gimple_build_assign_stat): Likewise.
2503 (gimple_build_assign_with_ops): Likewise.
2505 * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
2506 rather than just a "const gimple" (the latter is not a
2508 * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
2509 rather than just a gimple.
2510 (dump_binary_rhs): Likewise.
2511 (dump_ternary_rhs): Likewise.
2512 * tree-cfg.c (verify_gimple_assign_unary): Likewise.
2513 (verify_gimple_assign_binary): Likewise.
2514 (verify_gimple_assign_ternary): Likewise.
2515 (verify_gimple_assign_single): Likewise.
2516 (verify_gimple_assign): Likewise.
2517 * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
2518 (try_to_simplify): Likewise.
2519 * tree-tailcall.c (process_assignment): Likewise.
2520 * tree-vect-generic.c (expand_vector_operation): Likewise.
2521 * tree-vrp.c (extract_range_from_cond_expr): Likewise.
2522 (extract_range_from_assignment): Likewise.
2524 * asan.c (has_stmt_been_instrumented_p): Add checked cast to
2525 gimple_assign in regions where a stmt is known to have code
2527 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2528 * tree-cfg.c (verify_gimple_stmt): Likewise.
2529 * tree-ssa-sccvn.c (visit_use): Likewise.
2530 * tree-tailcall.c (find_tail_calls): Likewise.
2531 * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
2533 * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
2534 against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
2535 a gimple_assign local.
2537 * tree-vect-generic.c (expand_vector_condition): Convert local to a
2538 gimple_assign, adding a checked cast when extracting from gsi, since
2539 this is only called when underlying stmt has code GIMPLE_ASSIGN.
2540 (optimize_vector_constructor): Likewise.
2541 (lower_vec_perm): Likewise.
2542 (expand_vector_operations_1): Convert local to a gimple_assign,
2543 introducing a dyn_cast.
2545 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2547 Introduce gimple_cond and use it in various places
2549 * coretypes.h (gimple_cond): New typedef.
2550 (const_gimple_cond): Likewise.
2552 * gimple.h (struct gimple_statement_cond): New subclass of
2553 gimple_statement_with_ops, adding the invariant that
2554 stmt->code == GIMPLE_COND.
2555 (is_a_helper <gimple_statement_cond>::test): New.
2556 (gimple_build_cond): Return a gimple_cond, rather than just
2558 (gimple_build_cond_from_tree): Likewise.
2560 * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
2561 variants, using the gimple printer.
2563 * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
2565 * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
2566 (gimple_cond_true_p): Likewise.
2567 (gimple_cond_false_p): Likewise.
2568 (gimple_cond_set_condition): Likewise.
2569 * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
2570 * gimple-fold.c (fold_gimple_cond): Likewise.
2571 * gimple-pretty-print.c (dump_gimple_cond): Likewise.
2572 * tree-ssa-dom.c (canonicalize_comparison): Likewise.
2573 * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
2574 * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
2575 (recognize_bits_test): Likewise.
2576 * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
2577 (thread_around_empty_blocks): Likewise.
2578 (thread_through_normal_block): Likewise.
2579 (thread_across_edge): Likewise.
2580 * tree-ssa-threadedge.h (thread_across_edge): Likewise.
2581 * tree-vrp.c (range_fits_type_p): Likewise.
2583 * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
2584 gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
2585 * gimple-fold.c (fold_stmt_1): Likewise.
2586 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2587 * tree-ssa-dom.c (optimize_stmt): Likewise.
2588 * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2589 * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
2590 * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
2592 * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
2594 * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
2596 * tree-vrp.c (identify_jump_threads): Likewise.
2598 * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
2600 (gimple_build_cond_from_tree): Likewise.
2602 * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
2603 field "m_dummy_cond" from a plain gimple to a gimple_cond.
2605 * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
2606 inner_stmt and outer_stmt so that inner_cond and outer_cond can be
2607 of type gimple_cond once we know that we have code == GIMPLE_COND.
2608 * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
2609 "last" so that stmt can be of type gimple_cond.
2611 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2613 Introduce gimple_bind and use it for accessors.
2615 * coretypes.h (gimple_bind): New typedef.
2616 (const_gimple_bind): New typedef.
2618 * gdbhooks.py (build_pretty_printer): Add gimple_bind
2619 and its variants, using the gimple printer.
2621 * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
2622 require a gimple_bind rather than just a gimple.
2624 * gimple.c (gimple_build_bind): Return a gimple_bind rather than
2626 * gimple.h (gimple_build_bind): Likewise.
2628 * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
2630 * gimple.h (gimple_bind_vars): Update type-signature to
2631 require a gimple_bind rather than just a gimple, removing
2632 as_a and hence run-time check.
2633 (gimple_bind_set_vars): Likewise.
2634 (gimple_bind_append_vars): Likewise.
2635 (gimple_bind_body_ptr): Likewise.
2636 (gimple_bind_body): Likewise.
2637 (gimple_bind_set_body): Likewise.
2638 (gimple_bind_add_stmt): Likewise.
2639 (gimple_bind_add_seq): Likewise.
2640 (gimple_bind_block): Likewise.
2641 (gimple_bind_set_block): Likewise.
2642 * gimplify.c (gimple_push_bind_expr): Likewise.
2643 (gimple_current_bind_expr): Likewise.
2644 * tree-inline.c (copy_gimple_bind): Likewise.
2646 * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
2647 rather than a plain gimple.
2648 (gimplify_body): Likewise.
2649 (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
2652 * gimplify.c (struct gimplify_ctx): Strengthen field
2653 "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
2654 (gimple_bind_expr_stack): Likewise for type of returned value.
2656 * gimplify.c (gimplify_body): Strengthen various types from gimple
2657 to gimple_bind, including the return type.
2659 * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
2660 so that local "scope" can be of type gimple_bind once we've reached
2661 the region where it must be of code GIMPLE_BIND.
2663 * gimple-low.c (lower_gimple_bind): Add checked cast to
2664 gimple_bind, since both callers (lower_function_body and
2665 lower_stmt) have checked the code for us.
2667 * gimple.c (gimple_copy): Add checked cast to gimple_bind in
2668 region guarded by check for code GIMPLE_BIND.
2669 * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
2670 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2671 * gimple-walk.c (walk_gimple_stmt): Likewise.
2672 * omp-low.c (scan_omp_1_stmt): Likewise.
2673 (lower_omp_1): Likewise.
2674 (lower_omp_for): Likewise.
2675 * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
2676 (do_warn_unused_result): Likewise.
2677 * tree-inline.c (remap_gimple_stmt): Likewise.
2678 (estimate_num_insns): Likewise.
2679 * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
2681 * gimplify.c (gimplify_bind_expr): Update local(s) to be a
2682 gimple_bind rather than just a gimple.
2683 (gimplify_function_tree): Likewise.
2684 * omp-low.c (lower_omp_sections): Likewise.
2685 (lower_omp_single): Likewise.
2686 (lower_omp_master): Likewise.
2687 (lower_omp_taskgroup): Likewise.
2688 (lower_omp_ordered): Likewise.
2689 (lower_omp_critical): Likewise.
2690 (lower_omp_taskreg): Likewise.
2691 (lower_omp_teams): Likewise.
2692 * omp-low.c (lower_omp_for): Likewise; use
2693 gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
2694 (lower_omp_target): Likewise.
2695 * tree-nested.c (finalize_nesting_tree_1): Likewise.
2697 * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
2698 * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
2700 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2702 Introduce gimple_switch and use it in various places
2704 * gimple.h (gimple_statement_switch): New subclass of
2705 gimple_statement_with_ops, adding the invariant that
2706 stmt->code == GIMPLE_SWITCH.
2707 (is_a_helper <gimple_statement_switch>::test (gimple)): New.
2709 * coretypes.h (gimple_switch): New typedef
2710 (const_gimple_switch): Likewise.
2712 * gdbhooks.py (build_pretty_printer): Add gimple_switch
2713 and its variants, using the gimple printer.
2715 * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
2716 rather than just a gimple.
2717 (gimple_build_switch): Likewise.
2718 * gimple.h (gimple_build_switch_nlabels): Likewise.
2719 (gimple_build_switch): Likewise.
2721 * gimple.h (gimple_switch_num_labels): Update type-signature to
2722 require a gimple_switch rather than just a gimple.
2723 (gimple_switch_set_num_labels): Likewise.
2724 (gimple_switch_set_index): Likewise.
2725 (gimple_switch_label): Likewise.
2726 (gimple_switch_set_label): Likewise.
2727 (gimple_switch_default_label): Likewise.
2728 (gimple_switch_set_default_label): Likewise.
2729 * expr.h (expand_case): Likewise.
2730 * gimple-pretty-print.c (dump_gimple_call): Likewise.
2731 * stmt.c (compute_cases_per_edge): Likewise.
2732 (expand_case): Likewise.
2733 * tree-cfg.h (group_case_labels_stmt): Likewise.
2734 * tree-cfg.c (make_gimple_switch_edges): Likewise.
2735 (find_taken_edge_switch_expr) Likewise.
2736 (find_case_label_for_value) Likewise.
2737 (get_cases_for_edge): Likewise.
2738 (group_case_labels_stmt): Likewise.
2739 (verify_gimple_switch): Likewise.
2740 * tree-eh.c (verify_norecord_switch_expr): Likewise.
2741 * tree-eh.c (lower_eh_constructs_2): Likewise.
2742 * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
2743 * tree-ssa-dom.c (record_edge_info): Likewise.
2744 * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
2745 (simplify_gimple_switch): Likewise.
2746 * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
2747 (collect_switch_conv_info): Likewise.
2748 (build_constructors): Likewise.
2749 (array_value_type): Likewise.
2750 (build_one_array): Likewise.
2751 (build_arrays): Likewise.
2752 (gen_inbound_check): Likewise.
2753 * tree-vrp.c (find_switch_asserts): Likewise.
2754 (find_case_label_range): Likewise.
2755 (find_case_label_ranges): Likewise.
2756 (vrp_visit_switch_stmt): Likewise.
2757 (simplify_switch_using_ranges): Likewise.
2759 * tree-vrp.c (switch_update): Strengthen field "stmt" from being
2760 merely a gimple to being a gimple_switch.
2762 * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
2763 gimple_switch in regions where the stmt code has been tested as
2765 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2766 * tree-cfg.c (make_edges): Likewise.
2767 (end_recording_case_labels): Likewise.
2768 (cleanup_dead_labels): Likewise.
2769 (cleanup_dead_labels): Likewise.
2770 (group_case_labels): Likewise.
2771 (find_taken_edge): Likewise.
2772 (find_case_label_for_value): Likewise.
2773 (verify_gimple_stmt): Likewise.
2774 (gimple_verify_flow_info): Likewise.
2775 (gimple_redirect_edge_and_branch): Likewise.
2776 * tree-inline.c (estimate_num_insns): Likewise.
2777 * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2778 * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
2779 * tree-switch-conversion.c (do_switchconv): Likewise.
2780 * tree-vrp.c (find_assert_locations_1): Likewise.
2781 (vrp_visit_stmt): Likewise.
2782 (simplify_stmt_using_ranges): Likewise.
2784 * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
2785 Introduce local "lastg" as a generic gimple, so that local "last"
2786 can be of type gimple_switch once lastg's code has been verified.
2788 * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
2789 the GIMPLE_SWITCH case.
2791 * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
2792 argument, since the caller (find_taken_edge) has checked that
2793 last_stmt is a switch.
2795 Copyright (C) 2014 Free Software Foundation, Inc.
2797 Copying and distribution of this file, with or without modification,
2798 are permitted in any medium without royalty provided the copyright
2799 notice and this notice are preserved.