1 2014-10-24 David Malcolm <dmalcolm@redhat.com>
3 Concretize gimple_call_set_fn
5 * gimple.h (gimple_call_set_fn): Require a gimple_call.
7 * trans-mem.c (dump_tm_memopt_transform): Likewise.
8 (tm_memopt_transform_blocks): Add checked casts to gimple_call in
9 suites guarded by is_tm_simple_{load|store}, which enforce that
10 the statement must be a GIMPLE_CALL; use this when invoking
11 dump_tm_memopt_transform.
13 2014-10-24 David Malcolm <dmalcolm@redhat.com>
15 Tweak to gimplify_modify_expr
17 * gimplify.c (gimplify_modify_expr): Introduce local "call_stmt".
19 2014-10-24 David Malcolm <dmalcolm@redhat.com>
21 Concretize gimple_call_nothrow_p
23 * gimple.h (gimple_call_nothrow_p): Require a gimple_call.
25 * tree-eh.c (stmt_could_throw_p): Add checked cast to gimple_call.
27 * tree-vect-slp.c (vect_build_slp_tree_1): Replace call to
28 is_gimple_call with dyn_cast<gimple_call>, introducing a local.
30 2014-10-24 David Malcolm <dmalcolm@redhat.com>
32 Concretize gimple_call_set_nothrow
34 * gimple.h (gimple_call_set_nothrow): Require a gimple_call.
36 * trans-mem.c (ipa_tm_insert_gettmclone_call): Likewise.
37 (ipa_tm_transform_calls_redirect): Add checked cast to gimple call; this
38 is only called for gsi on a GIMPLE_CALL statement.
40 2014-10-24 David Malcolm <dmalcolm@redhat.com>
42 Concretize various expressions from gimple to gimple_cond
44 * ipa-split.c (check_forbidden_calls): Replace check against
45 GIMPLE_COND with a dyn_cast<gimple_cond>, introducing a
47 * predict.c (predict_extra_loop_exits): Likewise.
48 * tree-vrp.c (fold_predicate_in): Likewise.
49 (simplify_stmt_for_jump_threading): Likewise.
51 * predict.c (is_comparison_with_loop_invariant_p): Require a
53 (predict_iv_comparison): Add checked cast to gimple_cond once we
54 know the code is GIMPLE_COND.
55 (predict_loops): Change type of "stmt" to gimple_cond,
56 adding checked casts to its assignments (which are both guarded by
57 checks against GIMPLE_COND).
59 * tree-vrp.c (find_conditional_asserts): Require a gimple_cond.
60 (vrp_evaluate_conditional): Likewise.
61 (find_assert_locations_1): Add checked cast to gimple_cond.
62 (vrp_visit_stmt): Likewise.
64 2014-10-24 David Malcolm <dmalcolm@redhat.com>
66 Concretize gimple_cond_{lhs|rhs}_ptr
68 * gimple.h (gimple_cond_lhs_ptr): Require a const_gimple_cond
69 rather than just a const_gimple_cond.
70 (gimple_cond_rhs_ptr): Likewise.
72 * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
73 to gimple_cond within "case GIMPLE_COND".
74 * omp-low.c (lower_omp_1): Likewise.
76 * omp-low.c (expand_omp_simd): Introduce a new local cond_stmt
77 to express that the conditional is indeed a gimple_cond.
79 * tree-ssa-loop-ivopts.c (extract_cond_operands): Add a checked
80 cast to gimple_cond within a region where the code is known to
83 2014-10-24 David Malcolm <dmalcolm@redhat.com>
85 Concretize gimple_cond_set_{lhs|rhs}
87 * gimple.h (gimple_cond_set_lhs): Require a gimple_cond.
88 (gimple_cond_set_rhs): Likewise.
90 * tree-parloops.c (transform_to_exit_first_loop): Convert locals
91 "cond_stmt" and "cond_nit" to gimple_cond, adding checked casts,
92 since the existing code assumes that code is GIMPLE_COND. Convert
93 "stmt" to a gimple_assign.
94 (create_parallel_loop): Likewise for "cond_stmt".
96 * tree-ssa-loop-im.c (rewrite_bittest): Replace check for code
97 GIMPLE_COND with a dyn_cast, adding new local "cond_stmt".
99 2014-10-24 David Malcolm <dmalcolm@redhat.com>
101 Concretize gimple_cond_set_code
103 * gimple.h (gimple_cond_set_code): Require a gimple_cond.
105 * tree-complex.c (expand_complex_comparison): Add a checked cast to
106 gimple_cond within "case GIMPLE_COND".
108 * tree-ssa-loop-ivcanon.c (create_canonical_iv): Convert local "cond"
109 to a gimple_cond, adding a checked cast. The existing code requires
110 that the last statement before the exit edge have code GIMPLE_COND,
111 though it's not clear to me where this is verified.
113 * tree-ssa-loop-ivopts.c (rewrite_use_compare): Add a checked cast
114 to gimple_cond on "use->stmt".
116 * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Convert
117 local "exit_if" to gimple_cond, adding a checked cast. It's not
118 clear to me exactly where the GIMPLE_COND-ness of this is
119 established, but the existing code requires it.
120 (canonicalize_loop_ivs): Similarly for "stmt".
122 * tree-ssa-propagate.c (propagate_tree_value_into_stmt): Replace
123 a check against GIMPLE_COND with a dyn_cast<gimple_cond>.
125 2014-10-24 David Malcolm <dmalcolm@redhat.com>
127 Concretize gimple_cond_{true|false}_label
129 * gimple.h (gimple_cond_true_label): Require a const_gimple_cond
130 rather than just a const_gimple.
131 (gimple_cond_false_label): Likewise.
133 * omp-low.c (diagnose_sb_2): Add checked cast to gimple_cond within
135 * tree-eh.c (maybe_record_in_goto_queue): Likewise.
137 * tree-cfg.c (verify_gimple_stmt): Add a checked cast to gimple_cond
138 within "case GIMPLE_COND", splitting it out into...
139 (verify_gimple_label): New.
141 2014-10-24 David Malcolm <dmalcolm@redhat.com>
143 Concretize gimple_switch_index and gimple_switch_index_ptr
145 * gimple.h (gimple_switch_index): Require a const_gimple_switch rather
146 than a plain const_gimple.
147 (gimple_switch_index_ptr): Likewise.
149 * gimplify-me.c (gimple_regimplify_operands): Add checked cast to
150 gimple_switch within "case GIMPLE_SWITCH".
151 * tree-cfgcleanup.c (cleanup_control_expr_graph): Likewise.
152 * tree-ssa-ccp.c (ccp_fold): Likewise.
153 * tree-ssa-dom.c (optimize_stmt): Likewise.
155 * tree-ssa-ccp.c (evaluate_stmt): Add checked cast to
156 gimple_switch within region guarded by check for GIMPLE_SWITCH.
157 * tree-ssa-dom.c (record_edge_info): Likewise.
158 (eliminate_redundant_computations): Likewise.
159 * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Likewise.
160 * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
162 * tree-ssa-dom.c (initialize_hash_element): Replace check for
163 code GIMPLE_SWITCH with a dyn_cast<gimple_switch>.
164 (propagate_rhs_into_lhs): Likewise.
165 * tree-ssa-propagate.c (may_propagate_copy_into_stmt): Likewise.
166 (propagate_tree_value_into_stmt): Likewise.
168 2014-10-24 David Malcolm <dmalcolm@redhat.com>
170 Concretize gimple_cond_make_{false|true}
172 * gimple.h (gimple_cond_make_false): Require a gimple_cond.
173 (gimple_cond_make_true): Likewise.
175 * tree-cfg.c (fold_cond_expr_cond): Add a checked cast to
176 gimple_cond within region guarded by check for GIMPLE_COND.
177 * tree-ssa-ccp.c (ccp_fold_stmt): Likewise.
179 * tree-loop-distribution.c (generate_loops_for_partition): Replace
180 a check for GIMPLE_COND with a dyn_cast<gimple_cond>.
181 * tree-ssa-ccp.c (optimize_unreachable): Likewise.
182 * tree-ssa-loop-niter.c (number_of_iterations_exit): Likewise.
183 * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
186 * tree-vrp.c (fold_predicate_in): Add a checked cast to
187 gimple_cond. We must be dealing with a GIMPLE_COND since logic
188 at top of the function ensures we only act on GIMPLE_ASSIGN and
189 GIMPLE_COND statements, and we're now within a "not a GIMPLE_ASSIGN"
192 * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts): Add
193 checked cast of elt->stmt to gimple_cond. The existing code requires
194 this to be a GIMPLE_COND, though it's not clear to me how this
195 requirement is enforced.
196 (remove_redundant_iv_tests): Likewise.
197 (try_unroll_loop_completely): Likewise, for the last_stmt of the
198 preceding bb along edge_to_cancel.
199 * tree-ssa-reassoc.c (maybe_optimize_range_tests): Likewise, for the
202 2014-10-24 David Malcolm <dmalcolm@redhat.com>
204 Concretize locals within expand_omp_for_init_counts
206 * omp-low.c (expand_omp_for_init_counts): Eliminate local "stmt"
207 in favor of new locals "cond_stmt" and "assign_stmt" with more
210 2014-10-24 David Malcolm <dmalcolm@redhat.com>
212 Make gimple_cond_set_{true|false}_label require gimple_cond.
214 * gimple.h (gimple_cond_set_true_label): Require a gimple_cond.
215 (gimple_cond_set_false_label): Likewise.
217 * tree-cfg.c (make_cond_expr_edges): Convert "entry" from gimple to
219 (cleanup_dead_labels): Introduce a checked cast to a gimple_cond within
220 the GIMPLE_COND case.
222 2014-10-24 David Malcolm <dmalcolm@redhat.com>
224 Concretize three gimple_return_ accessors
226 * gimple.h (gimple_return_retval_ptr): Require a const_gimple_return
227 rather than a const_gimple.
228 (gimple_return_retval): Likewise.
229 (gimple_return_set_retval): Require a gimple_return.
231 * cfgexpand.c (expand_gimple_stmt_1): Add a checked cast to
233 (expand_gimple_basic_block): Likewise.
234 * tree-complex.c (expand_complex_move): Likewise.
235 (expand_complex_comparison): Likewise.
236 * tree-inline.c (remap_gimple_stmt): Likewise.
237 * tree-sra.c (scan_function): Likewise.
238 (sra_modify_function_body): Likewise.
239 (ipa_sra_modify_function_body): Likewise.
240 * tree-ssa-structalias.c (find_func_aliases): Likewise.
242 * gimple-ssa-isolate-paths.c (isolate_path): Strengthen local
243 "ret" from gimple to gimple_return.
244 (find_implicit_erroneous_behaviour): Replace a check for code
245 GIMPLE_RETURN with a dyn_cast and a new local.
246 (find_explicit_erroneous_behaviour): Likewise.
247 * gimple-walk.c (walk_stmt_load_store_addr_ops): Likewise.
248 * gimple.c (infer_nonnull_range): Likewise.
249 * ipa-split.c (find_return_bb): Likewise.
250 (find_retval): Likewise.
251 (split_function): Likewise.
252 * omp-low.c (ipa_simd_modify_function_body): Likewise.
253 * tree-cfg.c (pass_warn_function_return::execute): Likewise.
254 * tree-nrv.c (tree_nrv): Likewise.
255 * tree-ssa-alias.c (ref_maybe_used_by_stmt_p): Likewise.
256 * tree-ssa-dce.c (propagate_necessity): Likewise.
257 * tree-ssa-structalias.c (find_func_clobbers): Likewise.
258 * tree-tailcall.c (find_tail_calls): Likewise.
260 * predict.c (apply_return_prediction): Rework the search for
261 return_stmt so that the latter can have type gimple_return.
263 2014-10-24 David Malcolm <dmalcolm@redhat.com>
265 Make gimple_phi_arg_location require a gimple_phi.
267 * gimple.h (gimple_phi_arg_location): Require a gimple_phi.
269 * tree-into-ssa.c (rewrite_update_phi_arguments): Replace a check
270 for code GIMPLE_PHI with a dyn_cast and a new local.
271 * tree-ssa-ter.c (ter_is_replaceable_p): Likewise.
273 * tree-ssa-live.c (remove_unused_locals): Replace a
274 gimple_stmt_iterator with a gimple_phi_iterator, using it to make
275 local "phi" be a gimple_phi.
276 * tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Likewise.
278 * tree-ssa-phiopt.c (conditional_replacement): Require a gimple_phi.
279 (single_non_singleton_phi_for_edges): Return a gimple_phi; update
280 local to be a gimple_phi, adding checked casts since we're working
281 on a sequence of gimple_phi.
282 (conditional_replacement): Require a gimple_phi.
284 * tree-ssa-threadupdate.c (get_value_locus_in_path): Strengthen
285 type of local "def_phi" to gimple_phi by replacing a check of the
286 code for GIMPLE_PHI with a dyn_cast<gimple_phi>.
288 2014-10-24 David Malcolm <dmalcolm@redhat.com>
290 Make gimple_phi_arg_location_from_edge require a gimple_phi
292 * gimple.h (gimple_phi_arg_location_from_edge): Require a
295 * tree-parloops.c (create_parallel_loop): Split up local variable
296 "stmt", introducing other locals for the various statements created
297 by this function. Reuse "stmt" within the phi-handling code, and
298 change to type gimple_phi, since this is the only remaining
299 "non-phi" user of gimple_phi_arg_location_from_edge.
301 2014-10-24 David Malcolm <dmalcolm@redhat.com>
303 Concretize three gimple_try_set_ accessors
305 * gimple.c (gimple_copy): Add checked casts to gimple_try.
307 * gimple.h (gimple_try_set_kind): Require a gimple_try.
308 (gimple_try_set_eval): Likewise.
309 (gimple_try_set_cleanup): Likewise.
311 * tree-eh.c (optimize_double_finally): Require a pair of gimple_try
313 (refactor_eh_r): Convert code comparisons to dynamic casts.
315 2014-10-24 David Malcolm <dmalcolm@redhat.com>
317 Concretize gimple_try_set_catch_is_cleanup
319 * gimple.h (gimple_try_set_catch_is_cleanup): Require a gimple_try.
321 * gimplify.c (gimplify_expr): Convert local "try_" from a gimple
324 2014-10-24 David Malcolm <dmalcolm@redhat.com>
326 Concretize gimple_eh_filter_set_types and gimple_eh_filter_set_failure
328 * gimple.h (gimple_eh_filter_set_types): Require a gimple_eh_filter.
329 (gimple_eh_filter_set_failure): Likewise.
330 * gimple.c (gimple_copy): Add checked casts to gimple_eh_filter
331 within GIMPLE_EH_FILTER case.
333 2014-10-24 David Malcolm <dmalcolm@redhat.com>
335 Concretize gimple_label_label
337 * gimple.h (gimple_label_label): Require a const_gimple_label
338 rather than just a const_gimple.
340 * cfgexpand.c (label_rtx_for_bb): Convert local from gimple to
341 gimple_label, replacing a check against GIMPLE_LABEL with a
342 dyn_cast<gimple_label>.
343 * predict.c (tree_estimate_probability_bb): Likewise.
344 * tree-cfg.c (make_edges): Likewise.
345 (cleanup_dead_labels): Likewise (twice).
346 (gimple_can_merge_blocks_p): Likewise.
347 (gimple_block_label): Likewise.
348 * tree-eh.c (unsplit_eh): Likewise.
349 (cleanup_empty_eh_unsplit): Likewise.
350 * tree-inline.c (mark_local_labels_stmt): Likewise.
351 * tree-nested.c (convert_nl_goto_receiver): Likewise.
353 * cfgexpand.c (expand_gimple_stmt_1): Add a checked cast to
354 gimple_label when invoking gimple_label_label in a region where
355 we've checked the code is GIMPLE_LABEL.
356 * gimple-pretty-print.c (pp_cfg_jump): Likewise.
357 * gimple.c (gimple_set_bb): Likewise.
358 * ipa-pure-const.c (check_stmt): Likewise.
359 * omp-low.c (diagnose_sb_1): Likewise.
360 * tree-cfg.c (gimple_verify_flow_info): Likewise.
361 * tree-cfgcleanup.c (tree_forwarder_block_p): Likewise.
362 (remove_forwarder_block): Likewise.
363 * tree-eh.c (collect_finally_tree): Likewise.
365 * ipa-split.c (verify_non_ssa_vars): Replace a check against
366 GIMPLE_LABEL with a dyn_cast<gimple_label>, introducing a
368 * tree-cfg.c (gimple_can_merge_blocks_p): Likewise.
369 (gimple_merge_blocks): Likewise.
370 (remove_bb): Likewise.
371 (stmt_starts_bb_p): Likewise.
372 (gimple_verify_flow_info): Likewise.
373 (move_block_to_fn): Likewise.
374 * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
375 (remove_forwarder_block_with_phi): Likewise.
376 * tree-ssa-ccp.c (optimize_unreachable): Likewise.
378 2014-10-24 David Malcolm <dmalcolm@redhat.com>
380 Concretize gimple_call_use_set and gimple_call_clobber_set
382 * gimple.h (gimple_call_use_set): Require a gimple_call.
383 (gimple_call_clobber_set): Likewise.
385 2014-10-24 David Malcolm <dmalcolm@redhat.com>
387 Concretize gimple_catch_types
389 * gimple.h (gimple_catch_types): Require a const_gimple_catch
390 rather than a const_gimple.
392 2014-10-24 David Malcolm <dmalcolm@redhat.com>
394 Make gimple_goto_set_dest require a gimple_goto
396 * gimple.h (gimple_goto_set_dest): Require a gimple_goto.
398 * tree-cfg.c (factor_computed_gotos): Add checked cast to
400 (cleanup_dead_labels): Likewise.
402 2014-10-24 David Malcolm <dmalcolm@redhat.com>
404 Make gimple_label_set_label require a gimple_label
406 * gimple.h (gimple_label_set_label): Require a gimple_label.
408 2014-10-24 David Malcolm <dmalcolm@redhat.com>
410 Concretize parameter to gimple_call_copy_skip_args
412 * gimple.c (gimple_call_copy_skip_args): Require a gimple_call.
413 * gimple.h (gimple_call_copy_skip_args): Likewise.
415 2014-10-24 David Malcolm <dmalcolm@redhat.com>
417 Various gimple to gimple_call conversions in IPA
419 * ipa-prop.c (detect_type_change_from_memory_writes): Require a
420 gimple_call rather than a plain gimple.
421 (detect_type_change): Likewise.
422 (detect_type_change_ssa): Likewise.
423 (compute_complex_assign_jump_func): Likewise.
424 (compute_complex_ancestor_jump_func): Likewise.
425 (compute_known_type_jump_func): Likewise.
426 (determine_locally_known_aggregate_parts): Likewise.
427 (ipa_compute_jump_functions_for_edge): Strengthen local "call" to
428 a gimple_call; add checked cast to gimple_phi.
429 (ipa_note_param_call): Require a gimple_call rather than a plain
431 (ipa_analyze_indirect_call_uses): Likewise.
432 (ipa_analyze_virtual_call_uses): Likewise.
433 (ipa_analyze_call_uses): Likewise.
434 (ipa_analyze_stmt_uses):Add checked cast to gimple_call.
436 * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
437 Replace use of is_gimple_call with dyn_cast<gimple_call> and a
438 new local "call_stmt".
440 2014-10-24 David Malcolm <dmalcolm@redhat.com>
442 Use gimple_call for callgraph edges
444 * cgraph.h (cgraph_edge::call_stmt): Strengthen field from plain
445 gimple to a gimple_call.
446 (cgraph_node::set_call_stmt_including_clones): Likewise for param
448 (cgraph_node::create_edge): Likewise for param "call_stmt".
449 (cgraph_node::create_indirect_edge): Likewise.
450 (cgraph_node::create_edge_including_clones): Likewise for param
452 (cgraph_edge::set_call_stmt): Likewise for param "new_stmt".
453 (cgraph_edge::clone): Likewise for param "call_stmt".
454 (symbol_table::create_edge): Likewise.
456 * cgraph.c (cgraph_edge::set_call_stmt): Require a gimple_call
457 rather than a plain gimple.
458 (symbol_table::create_edge): Likewise.
459 (cgraph_node::create_edge): Likewise.
460 (cgraph_node::create_indirect_edge): Likewise.
461 (cgraph_edge::redirect_call_stmt_to_callee): Strengthen local
462 "new_stmt" from gimple to gimple_call.
463 (cgraph_update_edges_for_call_stmt_node): Add checked casts to
466 * cgraphbuild.c (pass_build_cgraph_edges::execute): Replace
467 is_gimple_call with dyn_cast<gimple_call> and new local
469 (cgraph_edge::rebuild_edges): Likewise.
471 * cgraphclones.c (cgraph_edge::clone): Require a gimple_call
472 rather than a plain gimple.
473 (cgraph_node::set_call_stmt_including_clones): Likewise.
474 (cgraph_node::create_edge_including_clones): Likewise.
476 * lto-streamer-in.c (fixup_call_stmt_edges_1): Add checked casts
479 * omp-low.c (simd_clone_adjust): Strengthen local "call" from
480 gimple to gimple_call.
482 * trans-mem.c (ipa_tm_insert_irr_call): Likewise for "g".
483 (ipa_tm_insert_gettmclone_call): Likewise; also strengthen "g2"
486 * tree-emutls.c (gen_emutls_addr): Strengthen local "x" from
487 gimple to gimple_call.
489 * tree-inline.c (copy_bb): Replace is_gimple_call with
490 dyn_cast<gimple_call> and new local "call_stmt".
492 * value-prof.c (gimple_ic): Require and return a gimple_call,
493 rather than a plain gimple.
494 * value-prof.h (gimple_ic): Likewise.
496 2014-10-24 David Malcolm <dmalcolm@redhat.com>
498 Make gimple_call_return_slot_opt_p require a gimple_call.
500 * gimple.h (gimple_call_return_slot_opt_p): Require a gimple_call
501 rather than a plain gimple.
503 * gimple-walk.c (walk_stmt_load_store_addr_ops): Convert usage of
504 is_gimple_call to dyn_cast<gimple_call>, introducing a new local
507 * trans-mem.c (expand_call_tm): Split local "stmt", strengthening
508 from plain gimple to a gimple_call, and introducing new local
509 gimple_assign "assign_stmt".
511 * tree-inline.c (expand_call_inline): Convert check of code against
512 GIMPLE_CALL to dyn_cast<gimple_call>, introducing a new local
515 2014-10-24 David Malcolm <dmalcolm@redhat.com>
519 * gimple.h (gimple_phi_set_result): Require a gimple_phi rather
521 (gimple_phi_set_arg): Likewise.
523 * tree-outof-ssa.c (remove_gimple_phi_args): Likewise; add a checked
526 * tree-sra.c (replace_removed_params_ssa_names): Add a checked
529 2014-10-24 David Malcolm <dmalcolm@redhat.com>
531 Make gimple_phi_arg_edge require a gimple_phi
533 * gimple.h (gimple_phi_arg_edge): Require a gimple_phi rather
536 * gimple-ssa-strength-reduction.c (ncd_with_phi): Strengthen
537 param "phi" from gimple to gimple_phi. Add a checked cast.
538 (ncd_of_cand_and_phis): Add a checked cast.
540 * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Require a
541 gimple_phi_iterator; strengthen local "phi" from gimple to a
543 (rewrite_cross_bb_scalar_deps): Strengthen local "psi" from
544 a gimple_stmt_iterator to a gimple_phi_iterator.
545 (edge_initial_value_for_loop_phi): Require a gimple phi.
546 (initial_value_for_loop_phi): Likewise.
548 * ipa-split.c (consider_split): Convert "bsi" to a
549 gimple_phi_iterator and "stmt" to a gimple_phi.
551 * predict.c (predict_extra_loop_exits): Convert "phi_stmt" to be
552 a gimple_phi; introduce "lhs_def_stmt" as plain gimple.
553 (apply_return_prediction): Convert "phi" to be a gimple_phi.
555 * tree-cfg.c (replace_uses_by): Add checked cast to gimple_phi.
556 (verify_gimple_in_cfg): Introduce gimple_phi_iterator "gpi" and use
557 it to convert "phi" to a gimple_phi.
559 * tree-eh.c (cleanup_empty_eh_merge_phis): Convert "ngsi", "ogsi"
560 to be gimple_phi_iterators. Convert "ophi", "nphi" to be
563 * tree-into-ssa.c (prepare_use_sites_for): Add checked cast to
566 * tree-ssa-coalesce.c (create_outofssa_var_map): Introduce
567 gimple_phi_iterator "gpi" and use it to convert "phi" to a
570 * tree-ssa-dce.c (propagate_necessity): Introduce local "phi",
571 from checked cast to gimple_phi.
573 * tree-ssa-live.c (set_var_live_on_entry): Add checked cast to
576 * tree-ssa-propagate.c (replace_phi_args_in): Require a gimple_phi
577 rather than a plain gimple.
578 (substitute_and_fold_dom_walker::before_dom_children): Introduce
579 gimple_phi_iterator "gpi".
581 * tree-ssa-sink.c (find_bb_for_arg): Require a gimple_phi rather
583 (nearest_common_dominator_of_uses): Replace check of code against
584 GIMPLE_PHI with a dyn_cast<gimple_phi>, introducing a new local.
585 (statement_sink_location): Add checked cast to gimple_phi.
587 * tree-ssa-uninit.c (compute_uninit_opnds_pos): Require a
588 gimple_phi rather than a plain gimple.
589 (collect_phi_def_edges): Likewise. Add a checked cast.
590 (find_def_preds): Strengthen param "phi" from gimple to
592 (prune_uninit_phi_opnds_in_unrealizable_paths): Likewise for
593 params "phi" and "flag_def". Strenghen param "visited_phis" from
594 hash_set<gimple> * to hash_set<gimple_phi> *. Convert
595 "flag_arg_def", "phi_arg_def" to gimple_phi using
596 dyn_cast<gimple_phi>. Similarly, introduce new local
598 (use_pred_not_overlap_with_undef_path_pred): Strengthen param
599 "phi" from gimple to gimple_phi, and param "visited_phis" from
600 hash_set<gimple> * to hash_set<gimple_phi> *. Add a checked cast.
601 (is_use_properly_guarded): Likewise for params.
602 (find_uninit_use): Replace check of code against GIMPLE_PHI with
603 a dyn_cast<gimple_phi>, introducing a new local "use_phi".
604 Strengthen local "visited_phis" from hash_set<gimple> to
605 hash_set<gimple_phi>.
607 2014-10-24 David Malcolm <dmalcolm@redhat.com>
609 Update GRAPHITE to use more concrete gimple statement classes
611 * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
612 Strengthen local "psi" to be a gimple_phi_iterator and "phi" to
615 * graphite-sese-to-poly.c (phi_arg_in_outermost_loop): Require
616 a gimple_phi rathen than a plain gimple.
617 (remove_simple_copy_phi): Require a gimple_phi_iterator;
618 strengthen local "phi" to be a gimple_phi and "stmt" to be a
620 (remove_invariant_phi): Likewise.
621 (simple_copy_phi_p): Require a gimple_phi.
622 (reduction_phi_p): Require a gimple_phi_iterator; strengthen
623 local "phi" to be a gimple_phi.
624 (add_condition_to_pbb): Require a gimple_cond rather than a
626 (add_conditions_to_domain): Add checked cast to gimple_cond
627 within GIMPLE_COND case of switch statement.
628 (single_pred_cond_non_loop_exit): Return a gimple_cond rather
629 than a plain gimple, via a checked cast.
630 (sese_dom_walker::before_dom_children): Strengthen local "stmt"
631 from gimple to gimple_cond.
632 (gsi_for_phi_node): Require a gimple_phi, and return a
634 (insert_out_of_ssa_copy): Strengthen local "stmt" from gimple to
636 (rewrite_reductions_out_of_ssa): Strengthen "psi" to be a
637 gimple_phi_iterator, and "phi" to be a gimple_phi.
638 (phi_contains_arg): Require a gimple_phi.
639 (follow_ssa_with_commutative_ops): Strengthen return type from
640 gimple to gimple_phi, by converting a check for code GIMPLE_PHI to
641 a dyn_cast<gimple_phi>, and strengthening local "res" from gimple
643 (detect_commutative_reduction_arg): Strengthen return type from
644 gimple to gimple_phi, and strengthen local "phi" to be a
646 (detect_commutative_reduction_assign): Strengthen return type from
647 gimple to gimple_phi, and strengthen local "res" to be a
649 (follow_inital_value_to_phi): Strengthen return type from
650 gimple to gimple_phi. Replace check for code GIMPLE_PHI with
651 a dyn_cast<gimple_phi>.
652 (detect_commutative_reduction): Strengthen return type and locals
653 "loop_phi", "phi", "close_phi" from gimple to gimple_phi,
654 introducing a checked cast of "stmt" in region guarded by
655 scalar_close_phi_node_p (stmt).
656 (translate_scalar_reduction_to_array_for_stmt): Require param
657 "loop_phi" to be a gimple_phi. Strengthen local "assign" from
658 gimple to gimple_assign.
659 (remove_phi): Require a gimple_phi.
660 (close_phi_written_to_memory): Likewise.
661 (translate_scalar_reduction_to_array): We expect the first element
662 in each vector to be an arbitrary statement, but all of the
663 subsequent elements to be phi nodes. Hence the decls of gimple
664 locals "loop_phi" and "close_phi" are replaced with decls of gimple
665 "loop_stmt" and "close_stmt", with decls of the more-strongly typed
666 gimple_phi "loop_phi" and "close_phi" occurring lower down, within
667 the region where we're dealing with i > 0 and hence where we can
668 safely assign them using the checked cast as_a <gimple_phi>.
669 This allows many of the strengthenings from gimple to gimple_phi
670 above. We eliminate the local "stmt", since we can simply use
672 (rewrite_commutative_reductions_out_of_ssa_close_phi): Strengthen
673 param "close_phi" from gimple to gimple_phi, and local "gsi" from
674 gimple_stmt_iterator to gimple_phi_iterator, converting uses of
675 gsi_stmt to gsi.phi for type-safety.
676 (scop_ivs_can_be_represented): Strengthen local "gsi" from
677 gimple_stmt_iterator to gimple_phi_iterator, and "phi" from gimple
680 2014-10-24 David Malcolm <dmalcolm@redhat.com>
682 Make gimple_phi_arg_set_location require a gimple_phi
684 * gimple.h (gimple_phi_arg_set_location): Require a gimple_phi
685 rather than a plain gimple.
687 2014-10-24 David Malcolm <dmalcolm@redhat.com>
689 Make add_phi_arg require a gimple_phi
691 * tree-phinodes.h (add_phi_arg): Require a gimple_phi rather than
693 * tree-phinodes.c (add_phi_arg): Likewise.
695 * gimple-ssa-strength-reduction.c (create_phi_basis): Strengthen
696 local "phi" from plain gimple to gimple_phi.
698 * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
699 Likewise for "close_phi".
701 * ipa-split.c (split_function): Convert "psi" to
704 * omp-low.c (expand_omp_for_static_nochunk): Introduce
705 gimple_phi_iterator gpi, using it to strengthen "phi" to be a
707 (expand_omp_for_static_chunk): Likewise.
709 * tree-cfg.c (gimple_duplicate_bb): Make topmost "gsi" decl more
710 tightly-scoped, and eliminate decls "phis", "phi", "stmt", "copy"
711 in favor of more tightly-scoped gimple_phi_iterator gpi and
712 gimple_phi decls "phi" and "copy", and gimple decls "stmt" and
715 * tree-parloops.c (create_parallel_loop): Introduce
716 gimple_phi_iterator gpi, using it to strengthen "phi" to be a
719 * tree-ssa-loop-im.c (execute_sm_if_changed): Likewise.
721 * tree-ssa-loop-manip.c (create_iv): Split out new gimple_phi
722 local "phi" from "stmt", and convert the latter into being a
725 * tree-ssa-pre.c (insert_into_preds_of_block): Strengthen local
726 "phi" to be a gimple_phi.
728 * tree-ssa-tail-merge.c (vop_phi): Require a gimple_phi rather
730 (replace_block_by): Strengthen local "bb2_phi" to be a gimple_phi.
732 * tree-tailcall.c (add_successor_phi_arg): Use gsi.phi when
733 invoking add_phi_arg.
734 (eliminate_tail_call): Introduce gimple_phi_iterator gpi, using it
735 to strengthen "phi" to be a gimple_phi.
736 (create_tailcall_accumulator): Strengthen local "phi" to be a
738 (tree_optimize_tail_calls_1): Likewise.
740 * tree-vect-data-refs.c (vect_setup_realignment): Strengthen
741 local "phi_stmt" to be a gimple_phi.
743 * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg):
744 Strengthen "gsi", "gsi_orig", "gsi_new" to be
745 gimple_phi_iterators, and "phi" "orig_phi", "new_phi" to be
746 gimple_phi instances.
747 (slpeel_tree_peel_loop_to_edge): Strengthen local "new_phi" to be
750 * tree-vect-loop.c (get_initial_def_for_induction): Likewise for
752 (vect_create_epilog_for_reduction): Add checked casts to
753 gimple_phi; strengthen local "outer_phi" to gimple_phi and
754 "new_vec_stmt" to gimple_assign.
755 (vect_finalize_reduction): Strengthen local "vect_phi" to
757 (vectorizable_reduction): Likewise for "new_phi".
759 * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
760 (vectorizable_load): Likewise for "phi".
762 2014-10-24 David Malcolm <dmalcolm@redhat.com>
764 Make gimple_phi_arg_def_ptr and gimple_phi_arg_has_location require a gimple_phi
766 * gimple.h (gimple_phi_arg_def_ptr): Require a gimple_phi rather
768 (gimple_phi_arg_has_location): Likewise.
770 * gimple-streamer-in.c (input_phi): Return a gimple_phi rather
772 * gimple-streamer-out.c (output_phi): Require a gimple_phi rather
774 (output_bb): Convert iteration to a gimple_phi_iterator, and local
777 * omp-low.c (expand_omp_for_static_chunk): Convert iterator "psi"
778 to a gimple_phi_iterator; convert locals "phi" and "nphi" to be
781 * tree-cfg.c (gimple_duplicate_sese_tail): Likewise for "psi" and
783 (move_block_to_fn): Introduce new gimple_phi_iterator "psi", using
784 it in place of "gsi" where necessary. Convert "phi" to be a
787 * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
789 * tree-vect-loop-manip.c (vect_loop_versioning): Convert "gsi" to
790 a gimple_phi_iterator, and "orig_phi" and "new_phi" to be
793 * tree.c (find_decls_types_in_node): Introduce new
794 gimple_phi_iterator "psi", using it in place of "si" where
795 necessary. Convert "phi" to be a gimple_phi.
797 2014-10-24 David Malcolm <dmalcolm@redhat.com>
799 omp-low.c: Use more concrete types of gimple statement for various locals
801 * omp-low.c (finalize_task_copyfn): Strengthen local "bind" from
802 plain gimple to gimple_bind.
803 (lower_rec_input_clauses): Strengthen local "g" from
804 plain gimple to gimple_assign.
805 (lower_lastprivate_clauses): Likewise for "stmt" to gimple_cond
806 and "g" to gimple_call.
807 (expand_omp_for_init_vars): Likewise, for two decls of "stmt" to
809 (expand_omp_atomic_pipeline): Likewise for one decl of "stmt".
810 (expand_omp_atomic_mutex): Likewise.
811 (lower_omp_master): Likewise for "x" to gimple_call.
812 (lower_omp_ordered): Likewise.
814 2014-10-24 David Malcolm <dmalcolm@redhat.com>
816 tree-parloops.c: Use gimple_phi in various places
818 * tree-parloops.c (reduction_info::keep_res): Strengthen field
819 from plain gimple to gimple_phi.
820 (transform_to_exit_first_loop): Strengthen locals "phi", "nphi"
821 to gimple_phi. Eliminate early decl of gimple_stmt_iterator gsi
822 in favor of more tightly scoped gimple_phi_iterators, and a final
823 later decl as a gimple_stmt_iterator.
825 2014-10-24 David Malcolm <dmalcolm@redhat.com>
827 Introduce gimple_omp_sections
829 * coretypes.h (gimple_omp_sections): New typedef.
830 (const_gimple_omp_sections): New typedef.
832 * gimple-pretty-print.c (dump_gimple_omp_sections): Require a
833 gimple_omp_sections rather than a plain gimple.
834 (pp_gimple_stmt_1): Add checked cast to gimple_omp_sections within
835 GIMPLE_OMP_SECTIONS case of switch statement.
837 * gimple.c (gimple_build_omp_sections): Return a
838 gimple_omp_sections rather than a plain gimple.
840 * gimple.h (gimple_build_omp_sections): Return a
841 gimple_omp_sections rather than a plain gimple.
843 * omp-low.c (scan_omp_sections): Require a gimple_omp_sections
844 rather than a plain gimple.
845 (scan_omp_1_stmt): Add checked cast to gimple_omp_sections within
846 GIMPLE_OMP_SECTIONS case of switch statement.
847 (expand_omp_sections): Strengthen local "sections_stmt" from gimple
848 to gimple_omp_sections.
849 (lower_omp_sections): Likewise for "stmt".
851 2014-10-24 David Malcolm <dmalcolm@redhat.com>
853 Introduce gimple_omp_teams
855 * coretypes.h (gimple_omp_teams): New typedef.
856 (const_gimple_omp_teams): New typedef.
858 * gimple.h (gimple_build_omp_teams): Return a gimple_omp_teams
859 rather than a plain gimple.
860 (gimple_omp_teams_set_clauses): Require a gimple_omp_teams rather
863 * gimple-pretty-print.c (dump_gimple_omp_teams): Require a
864 gimple_omp_teams rather than a plain gimple.
865 (pp_gimple_stmt_1): Add checked cast to gimple_omp_teams within
866 GIMPLE_OMP_TEAMS case of switch statement.
868 * gimple.c (gimple_build_omp_teams): Return a gimple_omp_teams
869 rather than a plain gimple.
871 * omp-low.c (scan_omp_teams): Likewise.
872 (scan_omp_1_stmt): Add checked cast to gimple_omp_teams within
873 GIMPLE_OMP_TEAMS case of switch statement.
874 (lower_omp_teams): Strengthen local "teams_stmt" from gimple to
877 2014-10-24 David Malcolm <dmalcolm@redhat.com>
879 Introduce gimple_omp_target
881 * coretypes.h (gimple_omp_target): New typedef.
882 (const_gimple_omp_target): New typedef.
884 * gimple.h (gimple_build_omp_target): Return a gimple_omp_target
885 rather than a plain gimple.
886 (gimple_omp_target_set_clauses): Require a gimple_omp_target
887 rather than a plain gimple.
888 (gimple_omp_target_set_kind): Likewise.
889 (gimple_omp_target_child_fn_ptr): Likewise.
890 (gimple_omp_target_set_child_fn): Likewise.
891 (gimple_omp_target_data_arg_ptr): Likewise.
892 (gimple_omp_target_set_data_arg): Likewise.
893 (gimple_omp_target_child_fn): Require a const_gimple_omp_target
894 rather than a plain const_gimple.
895 (gimple_omp_target_data_arg): Likewise.
897 * gimple-pretty-print.c (dump_gimple_omp_target): Require a
898 gimple_omp_target rather than a plain gimple.
899 (pp_gimple_stmt_1): Add checked cast to gimple_omp_target within
900 GIMPLE_OMP_TARGET case of switch statement.
902 * gimple.c (gimple_build_omp_target): Return a gimple_omp_target
903 rather than a plain gimple.
905 * gimplify.c (gimplify_omp_target_update): Strengthen local "stmt"
906 from gimple to gimple_omp_target.
908 * omp-low.c (scan_omp_target): Require a gimple_omp_target rather
910 (scan_omp_1_stmt): Add checked cast to gimple_omp_target within
911 GIMPLE_OMP_TARGET case of switch statement.
912 (expand_omp_target): Strengthen local "entry_stmt" from gimple to
914 (lower_omp_target): Likewise for "stmt".
916 * tree-nested.c (convert_nonlocal_reference_stmt): Add checked
917 cast to gimple_omp_target.
918 (convert_local_reference_stmt): Likewise.
919 (convert_gimple_call): Likewise.
921 2014-10-24 David Malcolm <dmalcolm@redhat.com>
923 Introduce gimple_omp_single
925 * coretypes.h (gimple_omp_single): New typedef.
926 (const_gimple_omp_single): New typedef.
928 * gimple.h (gimple_build_omp_single): Return a gimple_omp_single
929 rather than a plain gimple.
930 (gimple_omp_single_set_clauses): Require a gimple_omp_single
931 rather than a plain gimple.
933 * gimple-pretty-print.c (dump_gimple_omp_single): Require a
934 gimple_omp_single rather than a plain gimple.
935 (pp_gimple_stmt_1): Add checked cast to gimple_omp_single within
936 GIMPLE_OMP_SINGLE case of switch statement.
938 * gimple.c (gimple_build_omp_single): Return a gimple_omp_single
939 rather than a plain gimple.
941 * omp-low.c (scan_omp_single): Require a gimple_omp_single rather
943 (scan_omp_1_stmt): Add checked cast to gimple_omp_single within
944 GIMPLE_OMP_SINGLE case of switch statement.
945 (lower_omp_single_simple): Require a gimple_omp_single rather
947 (lower_omp_single_copy): Likewise.
948 (lower_omp_single): Strengthen local "single_stmt" from gimple to
951 2014-10-24 David Malcolm <dmalcolm@redhat.com>
953 Introduce gimple_omp_task
955 * coretypes.h (gimple_omp_task): New typedef.
956 (const_gimple_omp_task): New typedef.
958 * gimple.h (gimple_build_omp_task): Return a gimple_omp_task
959 rather than a plain gimple.
961 * gimple-pretty-print.c (dump_gimple_omp_task): Require a
962 gimple_omp_task rather than a plain gimple.
963 (pp_gimple_stmt_1): Add checked cast to gimple_omp_task within
964 GIMPLE_OMP_TASK case of switch statement.
966 * gimple.c (gimple_build_omp_task): Return a gimple_omp_task
967 rather than a plain gimple.
969 * omp-low.c (finalize_task_copyfn): Require a gimple_omp_task
970 rather than a plain gimple.
971 (delete_omp_context): Add checked cast to gimple_omp_task.
972 (scan_omp_task): Strengthen local "stmt" from gimple to
974 (expand_task_call): Require a gimple_omp_task rather than a plain
976 (expand_omp_taskreg): Add checked cast to gimple_omp_task.
977 (create_task_copyfn): Require a gimple_omp_task rather than a
979 (lower_omp_taskreg): Add checked cast to gimple_omp_task.
981 2014-10-24 David Malcolm <dmalcolm@redhat.com>
983 tree-cfg.c: Make verify_gimple_call require a gimple_call
985 * tree-cfg.c (verify_gimple_call): Require a gimple_call rather
987 (verify_gimple_stmt): Add checked cast to gimple_call within
988 GIMPLE_CALL case of switch statement.
990 2014-10-24 David Malcolm <dmalcolm@redhat.com>
992 Introduce gimple_omp_parallel
994 * coretypes.h (gimple_omp_parallel): New typedef.
995 (const_gimple_omp_parallel): New typedef.
997 * cgraphbuild.c (build_cgraph_edges): Convert check of code
998 against GIMPLE_OMP_PARALLEL to a dyn_cast <gimple_omp_parallel>
1001 * gimple-pretty-print.c (dump_gimple_omp_parallel): Require a
1002 gimple_omp_parallel rather than a plain gimple.
1003 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_parallel
1004 within GIMPLE_OMP_PARALLEL case of switch statement.
1006 * gimple-walk.c (walk_gimple_op): Likewise, introducing a local.
1008 * gimple.c (gimple_build_omp_parallel): Return a
1009 gimple_omp_parallel rather than a plain gimple.
1010 (gimple_copy): Add checked casts to gimple_omp_parallel within
1011 GIMPLE_OMP_PARALLEL case of switch statement, introducing locals.
1013 * gimple.h (gimple_build_omp_parallel): Return a
1014 gimple_omp_parallel rather than a plain gimple.
1015 (gimple_omp_parallel_clauses_ptr): Require a gimple_omp_parallel
1016 rather than a plain gimple.
1017 (gimple_omp_parallel_set_clauses): Likewise.
1018 (gimple_omp_parallel_data_arg_ptr): Likewise.
1019 (gimple_omp_parallel_set_data_arg): Likewise.
1020 (gimple_omp_parallel_child_fn_ptr): Likewise.
1021 (gimple_omp_parallel_set_child_fn): Likewise.
1022 (gimple_omp_parallel_child_fn): Require a
1023 const_gimple_omp_parallel rather than a plain const_gimple.
1024 (gimple_omp_parallel_data_arg): Likewise.
1026 * omp-low.c (scan_omp_parallel): Strengthen local "stmt" from
1027 gimple to gimple_omp_parallel.
1028 (expand_parallel_call): Require a gimple_omp_parallel for
1029 "entry_stmt" rather than a plain gimple.
1030 (remove_exit_barrier): Strengthen local "parallel_stmt" from
1031 gimple to gimple_omp_parallel.
1032 (expand_omp_taskreg): Add checked casts to gimple_omp_parallel.
1034 * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1035 gimple_omp_parallel within GIMPLE_OMP_PARALLEL case of switch
1036 statement, introducing local.
1038 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1040 Introduce gimple_omp_for
1042 * coretypes.h (gimple_omp_for): New.
1043 (const_gimple_omp_for): New.
1045 * gimple.h (gimple_build_omp_for): Return a gimple_omp_for rather
1046 than a plain gimple.
1047 (gimple_omp_for_set_kind): Require a gimple_omp_for rather than a
1049 (gimple_omp_for_set_combined_p): Likewise.
1050 (gimple_omp_for_set_combined_into_p): Likewise.
1052 * gimple-pretty-print.c (dump_gimple_omp_for): Require a
1053 gimple_omp_for rather than a plain gimple.
1054 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_for in
1055 GIMPLE_OMP_FOR case of switch statement.
1057 * gimple.c (gimple_build_omp_for): Return a gimple_omp_for rather
1058 than a plain gimple.
1059 (gimple_copy): Add a checked cast to gimple_omp_for and a new local.
1061 * gimplify.c (gimplify_omp_for): Strengthen local "gfor" from
1062 gimple to gimple_omp_for.
1064 * omp-low.c (omp_for_data::for_stmt): Strengthen field from gimple
1066 (extract_omp_for_data): Require a gimple_omp_for rather than a
1068 (workshare_safe_to_combine_p): Add a checked cast to
1070 (get_ws_args_for): Convert check of code against GIMPLE_OMP_FOR
1071 with a dyn_cast<gimple_omp_for> and a new local.
1072 (scan_omp_parallel): Add a checked cast to gimple_omp_for and a
1074 (scan_omp_for): Require a gimple_omp_for rather than a plain
1076 (scan_omp_1_stmt): Add a checked cast to gimple_omp_for in
1077 GIMPLE_OMP_FOR case of switch statement.
1078 (expand_omp_for): Add a checked cast to gimple_omp_for.
1079 (lower_omp_for): Strengthen local "stmt" from gimple to
1082 * tree-nested.c (walk_gimple_omp_for): Require a gimple_omp_for
1083 rather than a plain gimple.
1084 (convert_nonlocal_reference_stmt): Add a checked cast to
1085 gimple_omp_for in GIMPLE_OMP_FOR case of switch statement.
1086 (convert_local_reference_stmt): Likewise.
1088 * tree-parloops.c (create_parallel_loop): Strengthen local
1089 "for_stmt" from gimple to gimple_omp_for.
1091 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1093 Introduce gimple_omp_critical
1095 * coretypes.h (gimple_omp_critical): New typedef.
1096 (const_gimple_omp_critical): New typedef.
1098 * gimple-pretty-print.c (dump_gimple_omp_critical): Require a
1099 gimple_omp_critical rather than a plain gimple.
1100 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_critical
1101 within GIMPLE_OMP_CRITICAL case of switch statement.
1103 * gimple-walk.c (walk_gimple_op): Likewise.
1105 * gimple.c (gimple_build_omp_critical): Return a gimple_omp_critical
1106 rather than a plain gimple.
1107 (gimple_copy): Add checked casts to gimple_omp_critical
1108 within GIMPLE_OMP_CRITICAL case of switch statement.
1110 * gimple.h (gimple_debug): Likewise.
1111 (gimple_build_omp_critical): Return a gimple_omp_critical rather
1112 than a plain gimple.
1113 (gimple_omp_critical_name): Require a const_gimple_omp_critical
1114 rather than a plain const_gimple.
1115 (gimple_omp_critical_name_ptr): Require a gimple_omp_critical
1116 rather than a plain gimple.
1117 (gimple_omp_critical_set_name): Likewise.
1119 * omp-low.c (check_omp_nesting_restrictions): Add a checked cast
1120 to gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
1121 statement, introducing a new local "other_crit" for type-safety.
1122 (lower_omp_critical): Strengthen local "stmt" to
1123 gimple_omp_critical.
1125 * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1126 gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
1129 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1131 Introduce gimple_omp_continue
1133 * coretypes.h (gimple_omp_continue): New typedef.
1134 (const_gimple_omp_continue): New typedef.
1136 * gimple.h (gimple_build_omp_continue): Return a
1137 gimple_omp_continue rather than a plain gimple.
1138 (gimple_omp_continue_control_def): Require a
1139 const_gimple_omp_continue rather than a plain const_gimple.
1140 (gimple_omp_continue_control_use): Likewise.
1141 (gimple_omp_continue_control_def_ptr): Require a gimple_omp_continue
1142 rather than a plain gimple.
1143 (gimple_omp_continue_set_control_def): Likewise.
1144 (gimple_omp_continue_control_use_ptr): Likewise.
1145 (gimple_omp_continue_set_control_use): Likewise.
1147 * gimple-pretty-print.c (dump_gimple_omp_continue): Require a
1148 gimple_omp_continue rather than a plain gimple.
1149 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_continue
1150 within GIMPLE_OMP_CONTINUE case of switch statement.
1152 * gimple-walk.c (walk_gimple_op): Likewise, adding a new local.
1154 * gimple.c (gimple_build_omp_continue): Return a
1155 gimple_omp_continue rather than a plain gimple.
1157 * omp-low.c (gimple_build_cond_empty): Return a gimple_cond
1158 rather than a plain gimple.
1159 (expand_omp_for_generic): Split local "stmt" into "assign_stmt",
1160 "cont_stmt", "cond_stmt", "call_stmt" of types gimple_assign,
1161 gimple_omp_continue, gimple_cond, gimple_call respectively.
1162 (expand_omp_for_static_nochunk): Likewise, splitting into two
1163 "cond_stmt" decls. "assign_stmt", "cont_stmt"
1164 (expand_omp_for_static_chunk): Likewise, splitting into
1165 "cond_stmt", "assign_stmt", "cont_stmt".
1166 (expand_omp_sections): Strengthen local "cont" from gimple to
1167 gimple_omp_continue.
1169 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1171 Introduce gimple_omp_atomic_store
1173 * coretypes.h (gimple_omp_atomic_store): New typedef.
1174 (const_gimple_omp_atomic_store): New typedef.
1176 * gimple-pretty-print.c (dump_gimple_omp_atomic_store): Require
1177 a gimple_omp_atomic_store rather than a plain gimple.
1178 (pp_gimple_stmt_1): Add checked cast to gimple_omp_atomic_store
1179 within GIMPLE_OMP_ATOMIC_STORE case of switch statement.
1180 * gimple-walk.c (walk_gimple_op): Likewise.
1182 * gimple.c (gimple_build_omp_atomic_store): Return a
1183 gimple_omp_atomic_store rather than a plain gimple.
1185 * gimple.h (gimple_build_omp_atomic_store): Return a
1186 gimple_omp_atomic_store rather than a plain gimple.
1187 (gimple_omp_atomic_store_set_val): Require a gimple_omp_atomic_store
1188 rather than a plain gimple.
1189 (gimple_omp_atomic_store_val_ptr): Likewise.
1190 (gimple_omp_atomic_store_val): Require a
1191 const_gimple_omp_atomic_store rather than a plain const_gimple.
1193 * gimplify.c (gimplify_omp_atomic): Strengthen locals "loadstmt" and
1194 "storestmt" from gimple to gimple_omp_atomic_load loadstmt and
1195 gimple_omp_atomic_store storestmt respectively.
1197 * omp-low.c (expand_omp_atomic): Strengthen local "store" from
1198 gimple to gimple_omp_atomic_store.
1200 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1202 Introduce gimple_omp_atomic_load
1204 * coretypes.h (gimple_omp_atomic_load): New typedef.
1205 (const_gimple_omp_atomic_load): New typedef.
1207 * gimple-pretty-print.c (dump_gimple_omp_atomic_load): Require a
1208 gimple_omp_atomic_load rather than a plain gimple.
1209 (pp_gimple_stmt_1): Add a checked cast to gimple_omp_atomic_load
1210 within GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
1212 * gimple-walk.c (walk_gimple_op): Likewise, introducing a new local.
1214 * gimple.c (gimple_build_omp_atomic_load): Return a
1215 gimple_omp_atomic_load rather than a plain gimple.
1217 * gimple.h (gimple_build_omp_atomic_load): Return a
1218 gimple_omp_atomic_load rather than a plain gimple.
1219 (gimple_omp_atomic_load_set_lhs): Require a
1220 gimple_omp_atomic_load rather than a plain gimple.
1221 (gimple_omp_atomic_load_lhs_ptr): Likewise.
1222 (gimple_omp_atomic_load_set_rhs): Likewise.
1223 (gimple_omp_atomic_load_rhs_ptr): Likewise.
1224 (gimple_omp_atomic_load_lhs): Require a
1225 const_gimple_omp_atomic_load rather than a plain const_gimple.
1226 (gimple_omp_atomic_load_rhs): Likewise.
1228 * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
1229 to gimple_omp_atomic_load within GIMPLE_OMP_ATOMIC_LOAD case of
1232 * omp-low.c (expand_omp_atomic): Strengthen type of local "load"
1233 from gimple to gimple_omp_atomic_load.
1234 (lower_omp_1): Add a checked cast to gimple_omp_atomic_load within
1235 GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
1237 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1239 Use more concrete types for various gimple statements
1241 * cgraphunit.c (thunk_adjust): Strengthen local "stmt" from gimple
1244 * gimple-ssa-isolate-paths.c
1245 (insert_trap_and_remove_trailing_statements): Strengthen local
1246 "new_stmt" from gimple to gimple_call.
1248 * gimple-ssa-strength-reduction.c (replace_mult_candidate):
1249 Strengthen local "copy_stmt" from gimple to gimple_assign.
1250 (create_add_on_incoming_edge): Likewise, for "new_stmt".
1251 (insert_initializers): Likewise, for "init_stmt".
1252 (introduce_cast_before_cand): Likewise, for "cast_stmt".
1253 (replace_one_candidate): Likewise, for "copy_stmt" and
1256 * gimplify.c (build_stack_save_restore): Require gimple_calls
1257 rather than plain gimples.
1258 (gimplify_bind_expr): Strengthen locals "stack_save" and
1259 "stack_restore" from gimple to gimple_call. Strengthen "gs"
1261 (gimplify_switch_expr): Strengthen local "gimple_switch" from
1262 gimple to gimple_switch, and "new_default" to gimple_label.
1263 (gimplify_cond_expr): Strengthen local "gimple_cond" from gimple
1265 (gimplify_init_constructor): Strengthen local "init" from gimple
1267 (gimplify_cleanup_point_expr): Strengthen local "gtry" from gimple
1269 (gimple_push_cleanup): Strengthen locals "ffalse" and "ftrue" from
1270 gimple to gimple_assign.
1272 * tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
1273 (emit_post_landing_pad): Strengthen local to gimple_label.
1275 * tree-outof-ssa.c (insert_backedge_copies): Strengthen local
1276 "stmt" from gimple to gimple_assign.
1278 * tree-parloops.c (take_address_of): Likewise.
1280 * tree-predcom.c (replace_ref_with): Likewise, for "new_stmt".
1281 (initialize_root_vars_lm): Likewise, for "init_stmt".
1282 (reassociate_to_the_same_stmt): Likewise, for "new_stmt" and "tmp_stmt".
1284 * tree-profile.c (gimple_gen_edge_profiler): Likewise, for "stmt1",
1286 (gimple_gen_ic_profiler): Likewise.
1287 (gimple_gen_ic_func_profiler): Strengthen local "stmt1" from
1288 gimple to gimple_call, and "stmt2" to gimple_assign.
1290 * tree-scalar-evolution.c (scev_const_prop): Strengthen local
1291 "ass" from gimple to gimple_assign.
1293 * tree-sra.c (build_ref_for_offset): Likewise for "stmt".
1294 (generate_subtree_copies): Likewise; also strengthen "ds" to
1296 (init_subtree_with_zero): Likewise.
1297 (sra_modify_expr): Likewise.
1298 (load_assign_lhs_subreplacements): Likewise.
1299 (sra_modify_assign): Strengthen "ds" to gimple_debug.
1300 (sra_ipa_reset_debug_stmts): Likewise for "def_temp".
1302 * tree-ssa-ccp.c (insert_clobber_before_stack_restore):
1303 Strengthen local "clobber_stmt" from gimple to gimple_assign.
1305 * tree-ssa-dce.c (remove_dead_stmt): Strengthen "note" to
1308 * tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
1309 local "new_stmt" from gimple to gimple_assign.
1310 (optimize_stmt): Likewise.
1312 * tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
1313 4 declarations of "newop".
1314 (simplify_rotate): Likewise for "g".
1316 * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
1317 (rewrite_bittest): Likewise for "stmt" and "stmt2".
1318 (move_computations_dom_walker::before_dom_children): Likewise for
1320 (execute_sm): Likewise for "load" and "store".
1322 * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
1323 Strengthen local "stmt" from gimple to gimple_call.
1324 (unloop_loops): Likewise.
1326 * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
1327 local "ass" from gimple to gimple_assign.
1328 (remove_unused_ivs): Strengthen "def_temp" to gimple_debug.
1330 * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local "stmt"
1331 from gimple to gimple_assign.
1333 * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
1334 "prefetch" from gimple to gimple_call.
1336 * tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
1337 "new_stmt" from gimple to gimple_assign.
1338 (powi_as_mults_1): Likewise for "mult_stmt".
1339 (powi_as_mults): Likewise for "div_stmt".
1340 (build_and_insert_binop): Likewise for "stmt".
1341 (build_and_insert_cast): Likewise.
1342 (pass_cse_sincos::execute): Likewise for "stmt" and various decls
1344 (convert_mult_to_fma): Likewise for "fma_stmt".
1346 * tree-ssa-phiopt.c (conditional_replacement): Likewise for "new_stmt".
1347 (abs_replacement): Likewise.
1349 * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for "tmp".
1351 * tree-ssa-pre.c (create_expression_by_pieces): Likewise for "newstmt".
1352 (eliminate_insert): Likewise for "tem".
1354 * tree-ssa-propagate.c (update_gimple_call): Strengthen locals
1355 "new_stmt" and "stmt" from gimple to gimple_call.
1356 (update_call_from_tree): Likewise for "new_stmt".
1358 * tree-ssa-reassoc.c (build_and_add_sum): Likewise for "sum".
1359 (update_ops): Likewise for "g".
1360 (maybe_optimize_range_tests): Likewise.
1361 (rewrite_expr_tree_parallel): Require a gimple_assign rather than
1363 (reassociate_bb): Add a checked cast to gimple_assign.
1365 * tree-ssa.c (insert_debug_temp_for_var_def): Strengthen local
1366 "def_temp" from gimple to gimple_debug.
1368 * tree-switch-conversion.c (emit_case_bit_tests): Strengthen local
1369 "shift_stmt" from gimple to gimple_assign.
1371 * tree-tailcall.c (adjust_return_value_with_ops): Likewise for
1373 (update_accumulator_with_ops): Likewise.
1375 * tree-vect-data-refs.c (bump_vector_ptr): Likewise for
1378 * tree-vect-stmts.c (vectorizable_condition): Likewise for
1381 * tree-vrp.c (build_assert_expr_for): Likewise for "assertion".
1382 (simplify_truth_ops_using_ranges): Likewise for "newop".
1383 (simplify_float_conversion_using_ranges): Likewise for "conv".
1385 * ubsan.c (instrument_mem_ref): Strengthen local "g" from gimple
1388 * value-prof.c (gimple_divmod_fixed_value): Require a
1389 gimple_assign rather than a plain gimple; strengthen types of locals.
1390 (gimple_mod_pow2): Likewise.
1391 (gimple_mod_subtract): Likewise.
1392 (gimple_divmod_fixed_value_transform): Strengthen local
1393 "stmt" from gimple to gimple_assign.
1394 (gimple_mod_pow2_value_transform): Likewise.
1395 (gimple_mod_subtract_transform): Likewise.
1396 (gimple_ic): Strengthen types of locals.
1398 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1400 Introduce gimple_try
1402 * coretypes.h (gimple_try): New typedef.
1403 (const_gimple_try): New typedef.
1405 * gimple-low.c (gimple_try_catch_may_fallthru): Require a
1406 gimple_try rather than a plain gimple.
1407 (gimple_stmt_may_fallthru): Add checked cast to gimple_try.
1409 * gimple-pretty-print.c (dump_gimple_try): Require a gimple_try
1410 rather than a plain gimple.
1411 (pp_gimple_stmt_1): Add checked cast to gimple_try within
1412 GIMPLE_TRY case of switch statement.
1414 * tree-eh.c (finally_tree_node::parent): Strengthen field from
1415 gimple to gimple_try.
1416 (record_in_finally_tree): Require a gimple_try rather than a plain
1418 (collect_finally_tree): Likewise.
1419 (collect_finally_tree_1): Likewise.
1420 (struct leh_tf_state::try_finally_expr): Strengthen field from
1421 gimple to gimple_try.
1422 (struct leh_tf_state::top_p): Likewise.
1423 (lower_eh_must_not_throw): Require a gimple_try rather than a
1425 (frob_into_branch_around): Likewise.
1426 (lower_try_finally_dup_block): Strengthen local from gimple to
1428 (honor_protect_cleanup_actions): Split out uses of "x" into new
1429 locals "eh_mnt" and "try_stmt" with stronger types.
1430 (lower_try_finally): Require a gimple_try rather than a plain
1432 (lower_catch): Likewise.
1433 (lower_eh_filter): Likewise.
1434 (lower_eh_must_not_throw): Likewise.
1435 (lower_cleanup): Likewise.
1436 (lower_eh_constructs_2): Add checked cast to gimple_try within
1437 GIMPLE_TRY case of switch statement, introducing new local
1438 "try_stmt", using it for type-safety.
1440 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1442 Use subclasses of gimple in various places
1444 * asan.c (insert_if_then_before_iter): Require a gimple cond
1445 rathern than a plain gimple.
1446 (asan_expand_check_ifn): Add a checked cast to gimple_cond.
1448 * cfgloopmanip.c (create_empty_if_region_on_edge): Likewise.
1450 * omp-low.c (simd_clone_adjust): Strengthen local from gimple
1453 * sese.c (set_ifsese_condition): Strengthen local from gimple to
1456 * tree-call-cdce.c (gen_one_condition): Strengthen locals from
1457 gimple to gimple_assign and gimple_cond.
1459 * tree-ssa-phiopt.c (minmax_replacement): Likewise.
1460 (cond_store_replacement): Strengthen locals from gimple to
1461 gimple_phi and gimple_assign.
1462 (cond_if_else_store_replacement_1): Likewise.
1464 * tree-ssa-pre.c (do_regular_insertion): Strengthen local from
1465 gimple to gimple_assign.
1467 * tree-switch-conversion.c (hoist_edge_and_branch_if_true):
1468 Strengthen local from gimple to gimple_cond.
1469 (gen_def_assigns): Return a gimple_assign rather than a plain
1471 (gen_inbound_check): Strengthen locals from gimple to gimple_cond
1474 * tree-vect-loop-manip.c (slpeel_add_loop_guard): Strengthen local
1475 from gimple to gimple_cond.
1476 (set_prologue_iterations): Strengthen locals from gimple to
1477 gimple_phi and gimple_cond.
1479 * value-prof.c (gimple_ic): Strengthen local from gimple to
1481 (gimple_stringop_fixed_value): Strengthen locals from gimple to
1482 gimple_assign, gimple_cond, gimple_call, and gimple_phi.
1484 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1486 Introduce gimple_eh_dispatch
1488 * coretypes.h (gimple_eh_dispatch): New typedef.
1489 (const_gimple_eh_dispatch): New typedef.
1491 * gimple-pretty-print.c (dump_gimple_eh_dispatch): Require a
1492 gimple_eh_dispatch rather than a plain gimple.
1493 (pp_gimple_stmt_1): Add a checked cast to gimple_eh_dispatch
1494 within GIMPLE_EH_DISPATCH case of switch statement.
1496 * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1498 * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1500 * gimple.c (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
1501 rather than a plain gimple.
1503 * gimple.h (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
1504 rather than a plain gimple.
1505 (gimple_eh_dispatch_region): Require a const_gimple_eh_dispatch
1506 rather than a plain const_gimple.
1507 (gimple_eh_dispatch_set_region): Require a gimple_eh_dispatch
1508 rather than a plain gimple.
1510 * tree-cfg.c (make_edges): Add a checked cast to gimple_eh_dispatch
1511 within GIMPLE_EH_DISPATCH case of switch statement.
1512 (gimple_verify_flow_info): Likewise.
1513 (gimple_redirect_edge_and_branch): Likewise.
1514 (move_stmt_r): Likewise, adding a local.
1516 * tree-eh.c (emit_eh_dispatch): Convert local from gimple to
1518 (make_eh_dispatch_edges): Require a gimple_eh_dispatch rather than
1520 (redirect_eh_dispatch_edge): Likewise.
1521 (lower_eh_dispatch): Likewise.
1522 (execute_lower_eh_dispatch): Add a checked cast to
1524 (mark_reachable_handlers): Likewise.
1525 (verify_eh_dispatch_edge): Require a gimple_eh_dispatch rather
1526 than a plain gimple.
1528 * tree-eh.h (make_eh_dispatch_edges): Likewise.
1529 (redirect_eh_dispatch_edge): Likewise.
1530 (verify_eh_dispatch_edge): Likewise.
1532 * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1533 gimple_eh_dispatch within GIMPLE_EH_DISPATCH case of switch
1534 statement, adding a local.
1535 (copy_edges_for_bb): Add a checked cast to gimple_eh_dispatch.
1537 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1539 Introduce gimple_resx
1541 * coretypes.h (gimple_resx): New typedef.
1542 (const_gimple_resx): New typedef.
1544 * gimple.h (gimple_build_resx): Return a gimple_resx rather than a
1546 (gimple_resx_region): Require a const_gimple_resx rather than a
1548 (gimple_resx_set_region): Require a gimple_resx rather than a
1551 * gimple-pretty-print.c (dump_gimple_resx): Require a gimple_resx
1552 rather than a plain gimple.
1553 (pp_gimple_stmt_1): Add a checked cast to gimple_resx within
1554 GIMPLE_RESX case of switch statement.
1556 * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1558 * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1560 * gimple.c (gimple_build_resx): Return a gimple_resx rather than
1563 * tree-cfg.c (move_stmt_r): Add a checked cast to gimple_resx
1564 within GIMPLE_RESX case of switch statement, adding a new local.
1566 * tree-eh.c (emit_resx): Convert local "x" from gimple to
1568 (lower_resx): Require a gimple_resx rather than a plain gimple.
1569 (pass_lower_resx::execute): Add a checked cast to gimple_resx.
1570 (mark_reachable_handlers): Likewise.
1572 * tree-inline.c (remap_gimple_stmt): Add a checked cast to
1573 gimple_resx within GIMPLE_RESX case of switch statement, adding
1576 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1578 Introduce gimple_eh_else
1580 * coretypes.h (gimple_eh_else): New typedef.
1581 (const_gimple_eh_else): New typedef.
1583 * gimple.h (gimple_build_eh_else): Return a gimple_eh_else rather
1584 than a plain gimple.
1585 (gimple_eh_else_n_body_ptr): Require a gimple_eh_else rather than
1587 (gimple_eh_else_n_body): Likewise.
1588 (gimple_eh_else_e_body_ptr): Likewise.
1589 (gimple_eh_else_e_body): Likewise.
1590 (gimple_eh_else_set_n_body): Likewise.
1591 (gimple_eh_else_set_e_body): Likewise.
1593 * gimple-low.c (lower_stmt): Add checked cast to gimple_eh_else
1594 within GIMPLE_EH_ELSE case of switch statement, introducing a new
1596 (gimple_stmt_may_fallthru): Likewise.
1598 * gimple-pretty-print.c (dump_gimple_eh_else): Require a
1599 gimple_eh_else rather than a plain gimple.
1600 (pp_gimple_stmt_1): Add checked cast to gimple_eh_else within
1601 GIMPLE_EH_ELSE case of switch statement
1603 * gimple-walk.c (walk_gimple_stmt): Add checked cast to
1604 gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1605 introducing a new local.
1607 * gimple.c (gimple_build_eh_else): Return a gimple_eh_else
1608 rather than a plain gimple.
1609 (gimple_copy): Add checked casts to gimple_eh_else within
1610 GIMPLE_EH_ELSE case of switch statement, introducing new locals.
1612 * tree-cfg.c (verify_gimple_in_seq_2): Add checked cast to
1613 gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
1614 introducing a new local.
1616 * tree-eh.c (collect_finally_tree): Likewise.
1617 (replace_goto_queue_1): Likewise.
1618 (get_eh_else): Return a gimple_eh_else rather than a plain gimple.
1619 (honor_protect_cleanup_actions): Convert local "eh_else" from
1620 gimple to gimple_eh_else.
1621 (lower_try_finally_nofallthru): Likewise.
1622 (lower_try_finally_onedest): Introduce locals "eh_else" and
1623 "label_stmt", using them in favor of "x" for the gimple_eh_else
1624 and the gimple_label.
1625 (lower_try_finally_copy): Convert local "eh_else" from gimple to
1627 (lower_try_finally_switch): Likewise.
1628 (decide_copy_try_finally): Likewise.
1629 (refactor_eh_r): Add checked cast to gimple_eh_else within
1630 GIMPLE_EH_ELSE case of switch statement, introducing a new local.
1632 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1634 Introduce gimple_eh_must_not_throw
1636 * coretypes.h (gimple_eh_must_not_throw): New typedef.
1637 (const_gimple_eh_must_not_throw): New typedef.
1639 * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
1640 a gimple_eh_must_not_throw rather than a plain gimple.
1641 (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
1642 within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
1644 * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1646 * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1648 * gimple.c (gimple_build_eh_must_not_throw): Return a
1649 gimple_eh_must_not_throw rather than a plain gimple.
1651 * gimple.h (gimple_build_eh_must_not_throw): Return a
1652 gimple_eh_must_not_throw rather than a plain gimple.
1653 (gimple_eh_must_not_throw_fndecl): Require a
1654 gimple_eh_must_not_throw rather than a plain gimple.
1655 (gimple_eh_must_not_throw_set_fndecl): Likewise.
1657 * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
1659 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1661 Introduce gimple_eh_filter
1663 * coretypes.h (gimple_eh_filter): New typedef.
1664 (const_gimple_eh_filter): New typedef.
1666 * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
1667 rather than a plain gimple.
1669 * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
1670 gimple_eh_filter rather than a plain gimple.
1671 (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
1672 GIMPLE_EH_FILTER case of switch statement.
1674 * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
1675 rather than a plain gimple.
1677 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1679 Introduce gimple_catch
1681 * coretypes.h (gimple_catch): New typedef.
1682 (const_gimple_catch): New typedef.
1684 * gimple-low.c (lower_try_catch): Add checked cast to gimple_catch.
1685 (gimple_try_catch_may_fallthru): Likewise.
1687 * gimple-pretty-print.c (dump_gimple_catch): Require a gimple_catch
1688 rather than a plain gimple.
1689 (pp_gimple_stmt_1): Add checked cast to gimple_catch within
1690 GIMPLE_CATCH case of switch statement.
1692 * gimple-walk.c (walk_gimple_op): Likewise.
1693 (walk_gimple_stmt): Likewise.
1695 * gimple.c (gimple_build_catch): Return a gimple_catch rather than
1697 (gimple_copy): Add checked casts to gimple_catch within
1698 GIMPLE_CATCH case of switch statement, introducing new locals.
1700 * gimple.h (gimple_build_catch): Return a gimple_catch rather than
1702 (gimple_catch_types_ptr): Require a gimple_catch rather than a
1704 (gimple_catch_handler_ptr): Likewise.
1705 (gimple_catch_handler): Likewise.
1706 (gimple_catch_set_types): Likewise.
1707 (gimple_catch_set_handler): Likewise.
1709 * omp-low.c (lower_omp_1): Add checked cast to gimple_catch within
1710 GIMPLE_CATCH case of switch statement.
1712 * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
1713 (do_warn_unused_result): Likewise.
1715 * tree-eh.c (collect_finally_tree): Likewise.
1716 (replace_goto_queue_1): Likewise.
1717 (lower_catch): Convert local from gimple to gimple_catch.
1718 (refactor_eh_r): Add checked cast to gimple_catch within
1719 GIMPLE_CATCH case of switch statement.
1721 * tree-inline.c (remap_gimple_stmt): Likewise.
1722 (estimate_num_insns): Add checked cast to gimple_catch within
1723 GIMPLE_CATCH case of switch statement, introducing new local.
1725 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1727 Introduce gimple_transaction
1729 * coretypes.h (gimple_transaction): New typedef.
1730 (const_gimple_transaction): New typedef.
1732 * gimple.h (gimple_build_transaction): Return a gimple_transaction
1733 rather than a plain gimple.
1734 (gimple_transaction_body_ptr): Require a gimple_transaction rather
1735 than a plain gimple.
1736 (gimple_transaction_body): Likewise.
1737 (gimple_transaction_label_ptr): Likewise.
1738 (gimple_transaction_set_body): Likewise.
1739 (gimple_transaction_set_label): Likewise.
1740 (gimple_transaction_set_subcode): Likewise.
1741 (gimple_transaction_label): Require a const_gimple_transaction
1742 rather than a plain const_gimple.
1743 (gimple_transaction_subcode): Likewise.
1745 * gimple-low.c (lower_stmt): Add checked cast to
1746 gimple_transaction within GIMPLE_TRANSACTION case of switch
1749 * gimple-pretty-print.c (dump_gimple_transaction): Require a
1750 gimple_transaction rather than a plain gimple.
1751 (pp_gimple_stmt_1): Add checked cast to gimple_transaction within
1752 GIMPLE_TRANSACTION case of switch statement.
1753 * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1754 * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1755 * gimple-walk.c (walk_gimple_op): Likewise.
1756 (walk_gimple_stmt): Likewise.
1758 * gimple.c (gimple_build_transaction): Return a gimple_transaction
1759 rather than a plain gimple.
1760 (gimple_copy): Add checked casts to gimple_transaction within
1761 GIMPLE_TRANSACTION case of switch statement.
1763 * gimplify.c (gimplify_transaction): Split local "g" into
1764 "body_stmt" and "trans_stmt", strengthening the type of the latter
1765 from gimple to gimple_transaction.
1767 * omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
1768 within GIMPLE_TRANSACTION case of switch statement.
1770 * trans-mem.c (diagnose_tm_1): Add checked cast within
1771 GIMPLE_TRANSACTION case of switch statement, introducing a new
1772 local "trans_stmt". Use it in place of "stmt".
1773 (examine_call_tm): Convert local from gimple to gimple_transaction.
1774 (tm_region::get_transaction_stmt): New method.
1775 (tm_region::transaction_stmt): Add clarification of type to the
1777 (tm_region_init_0): Require a gimple_transaction rather than a
1779 (tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
1780 dyn_cast<gimple_transaction> and new local.
1781 (transaction_subcode_ior): Add a new local, using the new
1782 get_transaction_stmt method to perform a checked cast.
1783 (propagate_tm_flags_out): Likewise.
1784 (expand_transaction): Add a checked cast using the new
1785 get_transaction_stmt method.
1786 (generate_tm_state): Likewise.
1787 (execute_tm_mark): Likewise.
1788 (ipa_tm_diagnose_transaction): Likewise.
1790 * tree-cfg.c (verify_gimple_transaction): Require a
1791 gimple_transaction rather than a plain gimple.
1792 (make_edges): Add checked cast within GIMPLE_TRANSACTION case of
1794 (cleanup_dead_labels): Likewise.
1795 (verify_gimple_stmt): Likewise.
1796 (verify_gimple_in_seq_2): Likewise.
1797 (verify_gimple_in_seq_2): Likewise.
1798 (gimple_redirect_edge_and_branch): Add checked cast.
1800 * tree-inline.c (remap_gimple_stmt): Add checked cast within
1801 GIMPLE_TRANSACTION case of switch statement, introducing a new
1802 local "old_trans_stmt". Use it in place of "stmt". Add new
1803 local "new_trans_stmt", using it to initialize "copy", and for
1804 type-safe operations as a transaction.
1805 (estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
1806 case of switch statement.
1808 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1810 Introduce gimple_asm
1812 * coretypes.h (gimple_asm): New typedef.
1813 (const_gimple_asm): New typedef.
1815 * gimple.h (gimple_build_asm_vec): Return a gimple_asm rather than
1817 (gimple_asm_clobbers_memory_p): Require a const_gimple_asm rather
1818 than just a const_gimple.
1819 (gimple_asm_ninputs): Likewise.
1820 (gimple_asm_noutputs): Likewise.
1821 (gimple_asm_nclobbers): Likewise.
1822 (gimple_asm_nlabels): Likewise.
1823 (gimple_asm_input_op): Likewise.
1824 (gimple_asm_input_op_ptr): Likewise.
1825 (gimple_asm_output_op): Likewise.
1826 (gimple_asm_output_op_ptr): Likewise.
1827 (gimple_asm_clobber_op): Likewise.
1828 (gimple_asm_label_op): Likewise.
1829 (gimple_asm_string): Likewise.
1830 (gimple_asm_volatile_p): Likewise.
1831 (gimple_asm_input_p): Likewise.
1832 (gimple_asm_set_input_op): Require a gimple_asm rather than a plain
1834 (gimple_asm_set_output_op): Likewise.
1835 (gimple_asm_set_clobber_op): Likewise.
1836 (gimple_asm_set_label_op): Likewise.
1837 (gimple_asm_set_volatile): Likewise.
1838 (gimple_asm_set_input): Likewise.
1840 * cfgexpand.c (expand_asm_stmt): Require a gimple_asm rather than
1842 (expand_gimple_stmt_1): Add checked cast to gimple_asm within
1843 GIMPLE_ASM case of switch statement.
1845 * gimple-fold.c (fold_stmt_1): Add new local from checked cast to
1846 gimple_asm within case GIMPLE_ASM.
1848 * gimple-pretty-print.c (dump_gimple_asm): Require a gimple_asm
1849 rather than a plain gimple.
1850 (pp_gimple_stmt_1): Add checked cast to gimple_asm within
1851 GIMPLE_ASM case of switch statement.
1853 * gimple-streamer-in.c (input_gimple_stmt): Rework existing
1854 checked cast to gimple_asm; add a new one.
1856 * gimple-streamer-out.c (output_gimple_stmt): Add new local from
1857 checked cast to gimple_asm within case GIMPLE_ASM.
1859 * gimple-walk.c (walk_gimple_asm): Require a gimple_asm rather
1860 than a plain gimple.
1861 (walk_gimple_op): Add checked cast to gimple_asm within GIMPLE_ASM
1862 case of switch statement.
1863 (walk_stmt_load_store_addr_ops): Use dyn_cast<gimple_asm> in place
1864 of a code check against GIMPLE_ASM to introduce a new gimple_asm
1867 * gimple.c (gimple_build_asm_1): Return a gimple_asm rather than
1869 (gimple_build_asm_vec): Likewise.
1870 (gimple_has_side_effects): Add a checked cast to gimple_asm.
1871 (gimple_could_trap_p_1): Likewise.
1872 (gimple_call_builtin_p): Require a const_gimple_asm rather then
1875 * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
1876 and a new local of type gimple_asm within GIMPLE_ASM case.
1878 * gimplify.c (gimplify_asm_expr): Convert a local from gimple to
1881 * ipa-pure-const.c (check_stmt): Add checked casts within
1884 * ssa-iterators.h (op_iter_init): Likewise.
1886 * tree-cfg.c (make_goto_expr_edges): Convert a local from gimple
1888 (cleanup_dead_labels): Add a checked cast and a new local of type
1889 gimple_asm within GIMPLE_ASM case.
1890 (gimple_redirect_edge_and_branch): Likewise.
1891 (is_ctrl_altering_stmt): Add a checked cast.
1892 (need_fake_edge_p): Replace a code check against GIMPLE_ASM with a
1893 dyn_cast<gimple_asm>.
1895 * tree-complex.c (expand_complex_comparison): Convert a local from
1896 gimple to gimple_asm.
1898 * tree-data-ref.c (get_references_in_stmt): Add a checked cast to
1901 * tree-eh.c (stmt_could_throw_p): Likewise.
1903 * tree-inline.c (estimate_num_insns): Likewise.
1905 * tree-sra.c (scan_function): Add a checked cast and a new local
1906 of type gimple_asm within GIMPLE_ASM case.
1907 (sra_modify_function_body): Likewise.
1908 (ipa_sra_modify_function_body): Likewise.
1910 * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
1912 * tree-ssa-dce.c (propagate_necessity): Replace a code check
1913 against GIMPLE_ASM with a dyn_cast<gimple_asm>.
1915 * tree-ssa-operands.c (maybe_add_call_vops): Require a gimple_asm
1916 rather than a plain gimple.
1917 (parse_ssa_operands): Add a checked cast to gimple_asm.
1919 * tree-ssa-structalias.c (find_func_aliases): Replace a check for
1920 GIMPLE_ASM with a dyn_cast<gimple_asm>, introducing a new local
1921 "asm_stmt", using it in place of "t" for typesafety.
1923 * tree-ssa-threadedge.c
1924 (record_temporary_equivalences_from_stmts_at_dest): Add a checked
1927 * tree-ssa.c (execute_update_addresses_taken): Add checked casts
1928 and new locals of type gimple_asm within clauses guarded by code
1931 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1933 Introduce gimple_goto
1935 * coretypes.h (gimple_goto): New typedef.
1936 (const_gimple_goto): New typedef.
1938 * gimple.h (gimple_statement_goto): New subclass of
1939 gimple_statement_with_ops, adding the invariant that
1940 stmt->code == GIMPLE_GOTO.
1941 (is_a_helper <gimple_statement_goto>::test): New.
1942 (gimple_build_goto): Return a gimple_goto rather than a
1945 * gimple-pretty-print.c (dump_gimple_goto): Require a gimple_goto
1946 rather than a plain gimple.
1947 (pp_gimple_stmt_1): Add a checked cast to gimple_goto within
1948 GIMPLE_GOTO case of switch statement.
1950 * gimple.c (gimple_build_goto): Return a gimple_goto rather than a
1953 * tree-cfg.c (verify_gimple_goto): Require a gimple_goto rather
1954 than a plain gimple.
1955 (verify_gimple_stmt): Add a checked cast to gimple_goto within
1956 GIMPLE_GOTO case of switch statement.
1958 2014-10-24 David Malcolm <dmalcolm@redhat.com>
1960 Introduce gimple_return
1962 * coretypes.h (gimple_return): New typedef.
1963 (const_gimple_return): New typedef.
1965 * gimple.h (gimple_statement_return): New subclass of
1966 gimple_statement_with_memory_ops, adding the invariant that
1967 stmt->code == GIMPLE_RETURN.
1968 (is_a_helper <gimple_statement_return>::test): New.
1969 (gimple_build_return): Return a gimple_return rather
1970 than a plain gimple.
1972 * gimple.c (gimple_build_return): Return a gimple_return rather
1973 than a plain gimple.
1975 * cgraphunit.c (expand_thunk): Convert local from a gimple to
1978 * gimple-low.c (struct return_statements_t): Convert field "stmt"
1979 from a gimple to a gimple_return.
1980 (lower_gimple_return): Convert local from a gimple to a
1983 * gimple-pretty-print.c (dump_gimple_return): Require a
1984 gimple_return rather than a plain gimple.
1985 (pp_gimple_stmt_1): Add a checked cast to gimple_return within
1986 case GIMPLE_RETURN of switch statement.
1988 * gimplify.c (gimplify_return_expr): Convert locals from
1989 gimple to gimple_return.
1991 * ipa-split.c (split_function): Likewise.
1993 * tree-cfg.c (verify_gimple_assign): Require a gimple_return
1994 rather than a plain gimple.
1995 (verify_gimple_stmt): Add checked cast to gimple_return within
1996 case GIMPLE_RETURN of switch statement.
1998 * tree-tailcall.c (adjust_return_value): Convert local from
1999 gimple to gimple_return.
2001 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2003 Introduce gimple_call
2005 * coretypes.h (gimple_call): New typedef.
2006 (const_gimple_call): New typedef.
2008 * asan.c (get_mem_refs_of_builtin_call): Require a
2009 const_gimple_call rather than a const gimple.
2010 (has_stmt_been_instrumented_p): Add a checked cast to
2012 (instrument_strlen_call): Likewise.
2013 (instrument_builtin_call): Likewise.
2014 * builtins.c (validate_gimple_arglist): Require a
2015 const_gimple_call rather than a const gimple.
2016 (fold_call_stmt): Require a gimple_call rather than a gimple.
2017 * builtins.h (validate_gimple_arglist): Require a
2018 const_gimple_call rather than a const gimple.
2019 (fold_call_stmt): Require a gimple_call rather than a gimple.
2020 * cfgexpand.c (expand_call_stmt): Likewise.
2021 (expand_gimple_stmt_1): Add a checked cast to gimple_call within
2023 * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Strengthen
2024 local "new_stmt" from gimple to gimple_call, adding a checked
2026 * cgraphunit.c (cgraph_node::expand_thunk): Likewise for local
2028 * gimple-fold.c (gimple_fold_builtin_snprintf_chk): Likewise for
2030 (gimple_fold_builtin_snprintf): Likewise.
2031 (gimple_fold_builtin): Likewise.
2032 (gimple_fold_call): Likewise.
2033 (gimple_fold_stmt_to_constant_1): Introduce local "call_stmt" via
2034 checked cast of "stmt" to gimple_call, using it in various places
2036 * gimple-pretty-print.c (dump_gimple_call_args): Strengthen param
2037 2 from gimple to gimple_call.
2038 (dump_gimple_call): Likewise.
2039 (pp_gimple_stmt_1): Add a checked cast to gimple_call within
2041 * gimple-streamer-in.c (input_gimple_stmt): Replace is_gimple_call
2042 with a dyn_cast<gimple_call>, introducing local "call_stmt", and
2043 using it in place of "stmt" for typesafety. Add a checked cast
2044 in statement guarded by check for GIMPLE_CALL.
2045 * gimple-walk.c (walk_gimple_op): Add a checked cast to
2047 * gimple.c (gimple_call_reset_alias_info): Strengthen param from
2048 gimple to gimple_call.
2049 (gimple_build_call_1): Strengthen return type and local from
2050 gimple to gimple_call.
2051 (gimple_build_call_vec): Likewise.
2052 (gimple_build_call): Likewise.
2053 (gimple_build_call_valist): Likewise.
2054 (gimple_build_call_internal_1): Likewise.
2055 (gimple_build_call_internal): Likewise.
2056 (gimple_build_call_internal_vec): Likewise.
2057 (gimple_build_call_from_tree): Likewise.
2058 (gimple_call_return_flags): Strengthen param from
2059 const_gimple to const_gimple_call.
2060 (gimple_call_copy_skip_args): Strengthen return type and local from
2061 gimple to gimple_call.
2062 * gimple.h (gimple_call_reset_alias_info): Strengthen param from
2063 gimple to gimple_call.
2064 (gimple_build_call_vec): Strengthen return type from gimple to
2066 (gimple_build_call): Likewise.
2067 (gimple_build_call_valist): Likewise.
2068 (gimple_build_call_internal): Likewise.
2069 (gimple_build_call_internal_vec): Likewise.
2070 (gimple_build_call_from_tree): Likewise.
2071 (gimple_call_return_flags): Strengthen param from const_gimple to
2073 (gimple_call_copy_skip_args): Strengthen return type from gimple
2075 (gimple_call_set_internal_fn): Strengthen param "call_stmt" from
2076 gimple to gimple_call.
2077 (gimple_call_return_type): Strengthen param from const_gimple to
2079 (gimple_call_chain_ptr): Likewise.
2080 (gimple_call_set_chain): Strengthen param from gimple to
2082 (gimple_call_set_return_slot_opt): Likewise.
2083 (gimple_call_set_from_thunk): Likewise.
2084 (gimple_call_from_thunk_p): Likewise.
2085 (gimple_call_set_va_arg_pack): Likewise.
2086 (gimple_call_va_arg_pack_p): Likewise.
2087 (gimple_call_set_alloca_for_var): Likewise.
2088 (gimple_call_alloca_for_var_p): Likewise.
2089 (gimple_expr_type): Introduce local "call_stmt" via a checked cast
2090 and use it for typesafety.
2091 * gimplify.c (gimplify_call_expr): Strengthen local "call" from
2092 gimple to gimple_call.
2093 (gimplify_modify_expr_to_memcpy): Likewise for local "gs".
2094 (gimplify_modify_expr_to_memset): Likewise.
2095 (gimplify_modify_expr): Add a checked cast to gimple_call.
2096 (gimplify_expr): Strengthen local "call" from gimple to
2098 (gimplify_function_tree): Likewise.
2099 * internal-fn.c (expand_LOAD_LANES): Strengthen param from gimple
2101 (expand_STORE_LANES): Likewise.
2102 (expand_ANNOTATE): Likewise.
2103 (expand_GOMP_SIMD_LANE): Likewise.
2104 (expand_GOMP_SIMD_VF): Likewise.
2105 (expand_GOMP_SIMD_LAST_LANE): Likewise.
2106 (expand_UBSAN_NULL): Likewise.
2107 (expand_UBSAN_BOUNDS): Likewise.
2108 (expand_UBSAN_OBJECT_SIZE): Likewise.
2109 (expand_ASAN_CHECK): Likewise.
2110 (ubsan_expand_si_overflow_addsub_check): Likewise.
2111 (ubsan_expand_si_overflow_neg_check): Likewise.
2112 (ubsan_expand_si_overflow_mul_check): Likewise.
2113 (expand_UBSAN_CHECK_ADD): Likewise.
2114 (expand_UBSAN_CHECK_SUB): Likewise.
2115 (expand_UBSAN_CHECK_MUL): Likewise.
2116 (expand_LOOP_VECTORIZED): Likewise.
2117 (expand_MASK_LOAD): Likewise.
2118 (expand_MASK_STORE): Likewise.
2119 (expand_ABNORMAL_DISPATCHER): Likewise.
2120 (expand_BUILTIN_EXPECT): Likewise.
2121 (internal_fn_expanders): Likewise for entries in this table.
2122 (expand_internal_call): Likewise.
2123 * internal-fn.def: Update comment to reflect strengthening of
2125 * internal-fn.h (expand_internal_call): Strengthen param from
2126 gimple to gimple_call.
2127 * ipa-prop.c (ipa_modify_call_arguments): Likewise for local
2129 * ipa-pure-const.c (check_call): Likewise for param "call".
2130 (check_stmt): Add a checked cast to gimple_call within GIMPLE_CALL
2132 * ipa-split.c (split_function): Strengthen local "call" from
2133 gimple to gimple_call.
2134 * omp-low.c (build_omp_barrier): Likewise for local "g".
2135 (lower_rec_input_clauses): Likewise for local "stmt".
2136 * trans-mem.c (build_tm_load): Likewise for return type and local
2138 (build_tm_store): Likewise.
2139 (expand_transaction): Likewise for local "call".
2140 * tree-call-cdce.c (check_pow): Likewise for param.
2141 (check_builtin_call): Likewise.
2142 (is_call_dce_candidate): Likewise.
2143 (gen_conditions_for_pow): Likewise.
2144 (gen_shrink_wrap_conditions): Likewise.
2145 (shrink_wrap_one_built_in_call): Likewise.
2146 (shrink_wrap_conditional_dead_built_in_calls): Strengthen param
2147 from vec<gimple> to vec<gimple_call>, and local "bi_call" from
2148 gimple to gimple_call.
2149 (pass_call_cdce::execute): Strengthen local
2150 "cond_dead_built_in_calls" from auto_vec<gimple> to
2151 auto_vec<gimple_call> and local "stmt" from gimple to gimple_call,
2152 * tree-cfg.c (notice_special_calls): Strengthen param from gimple
2154 * tree-cfg.h (notice_special_calls): Likewise.
2155 * tree-complex.c (expand_complex_libcall): Likewise for local
2157 * tree-inline.c (remap_gimple_stmt): Add checked cast to
2159 (copy_bb): Likewise. Strengthen local "new_call" from gimple to
2161 (inline_forbidden_p_stmt): Add checked cast to gimple_call.
2162 * tree-nested.c (init_tmp_var_with_call): Strengthen param "call"
2163 from gimple to gimple_call.
2164 (convert_nl_goto_reference): Likewise for local "call".
2165 (convert_tramp_reference_op): Likewise.
2166 (convert_gimple_call): Add checked cast to gimple_call.
2167 * tree-nrv.c (dest_safe_for_nrv_p): Strengthen param "call" from
2168 gimple to gimple_call.
2169 (pass_return_slot::execute): Likewise for local "stmt", using a
2170 dyn_cast<gimple_call> rather than an is_gimple_call call.
2171 * tree-object-size.c (alloc_object_size): Strengthen param "call"
2172 from const_gimple to const_gimple_call.
2173 (pass_through_call): Likewise.
2174 (call_object_size): Strengthen param "call" from gimple to
2176 (collect_object_sizes_for): Introduce local "call_stmt" via a
2177 checked cast, using it for typesafety.
2178 (check_for_plus_in_loops_1): Likewise.
2179 (pass_object_sizes::execute): Add a checked cast to gimple_call.
2180 * tree-profile.c (gimple_gen_interval_profiler): Strengthen local
2181 "call" from gimple to gimple_call.
2182 (gimple_gen_pow2_profiler): Likewise.
2183 (gimple_gen_one_value_profiler): Likewise.
2184 (gimple_gen_time_profiler): Likewise.
2185 (gimple_gen_average_profiler): Likewise.
2186 (gimple_gen_ior_profiler): Likewise.
2187 * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise for
2189 (ref_maybe_used_by_call_p): Likewise.
2190 (ref_maybe_used_by_stmt_p): Add a checked cast to gimple_call.
2191 (call_may_clobber_ref_p_1): Strengthen param "call" from gimple to
2193 (call_may_clobber_ref_p): Likewise.
2194 (stmt_may_clobber_ref_p_1): Add a checked cast to gimple_call.
2195 * tree-ssa-alias.h (call_may_clobber_ref_p): Strengthen param 1
2196 from gimple to gimple_call.
2197 (call_may_clobber_ref_p_1): Likewise.
2198 * tree-ssa-dce.c (eliminate_unnecessary_stmts): Add a checked cast
2200 * tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Strengthen
2201 local "call" from gimple to gimple_call.
2202 * tree-ssa-math-opts.c (build_and_insert_call): Likewise for local
2204 * tree-ssa-operands.c (maybe_add_call_vops): Likewise for param
2206 (parse_ssa_operands): Add a checked cast to gimple_call within
2208 * tree-ssa-pre.c (compute_avail): Add a checked cast to
2210 * tree-ssa-sccvn.c (copy_reference_ops_from_call): Strengthen
2211 param "call" from gimple to gimple_call.
2212 (valueize_shared_reference_ops_from_call): Likewise.
2213 (vn_reference_lookup_3): Add a checked cast to gimple_call.
2214 (vn_reference_lookup_call): Strengthen param "call" from gimple to
2216 (visit_reference_op_call): Likewise for param "stmt".
2217 (visit_use): Replace is_gimple_call with a dyn_cast, introducing
2218 local "call_stmt", using it in place of "stmt" for type-safety.
2219 * tree-ssa-sccvn.h (vn_reference_lookup_call): Strengthen param 1
2220 from gimple to gimple_call.
2221 * tree-ssa-structalias.c (get_call_vi): Likewise.
2222 (lookup_call_use_vi): Likewise.
2223 (lookup_call_clobber_vi): Likewise.
2224 (get_call_use_vi): Likewise.
2225 (get_call_clobber_vi): Likewise.
2226 (handle_rhs_call): Likewise.
2227 (handle_lhs_call): Likewise.
2228 (handle_const_call): Likewise.
2229 (handle_pure_call): Likewise.
2230 (get_fi_for_callee): Likewise.
2231 (find_func_aliases_for_builtin_call): Likewise for param 2.
2232 (find_func_aliases_for_call): Likewise.
2233 (find_func_aliases): Add a checked cast to gimple_call.
2234 (find_func_clobbers): Replace is_gimple_call with a dyn_cast,
2235 introducing local "call_stmt", using it in place of "stmt" for
2237 (compute_points_to_sets): Strengthen local "stmt" from gimple to
2238 gimple_call, replacing is_gimple_call with a
2239 dyn_cast <gimple_call>.
2240 (ipa_pta_execute): Likewise.
2241 * tree-ssa-threadedge.c
2242 (record_temporary_equivalences_from_stmts_at_dest): Add checked
2243 cast to gimple_call.
2244 * tree-tailcall.c (find_tail_calls): Strengthen local "call" from
2245 gimple to gimple_call, adding a checked cast.
2246 * tree-vect-data-refs.c (vect_setup_realignment): Eliminate
2247 top-level local "new_stmt" in favor of more tightly-scoped locals
2248 "new_stmt" of type gimple_assign and gimple_call.
2249 * tree-vect-patterns.c (vect_recog_pow_pattern): Strenghthen local
2250 "stmt" from gimple to gimple_call.
2251 * tree-vect-stmts.c (vectorizable_function): Likewise for param
2253 (vectorizable_call): Rename param 1 from "stmt" to "gs",
2254 reintroducing "stmt" as a gimple_call once we've established that
2255 we're working with a GIMPLE_CALL.
2256 * tree-vectorizer.h (vectorizable_function): Strengthen param 1
2257 from gimple to gimple_call.
2258 * value-prof.c (check_ic_target): Likewise.
2259 (gimple_ic_transform): Likewise for local "stmt", replacing a
2260 check for GIMPLE_CALL with a dyn_cast.
2261 (interesting_stringop_to_profile_p): Strengthen param "call"
2262 from gimple to gimple_call.
2263 (gimple_stringop_fixed_value): Likewise for param "vcall_stmt".
2264 (gimple_stringops_transform): Likewise for local "stmt",
2265 replacing a check for GIMPLE_CALL with a dyn_cast.
2266 (gimple_stringops_values_to_profile): Rename param 1 from "stmt"
2267 to "gs", reintroducing "stmt" as a gimple_call once we've
2268 established that we're working with a GIMPLE_CALL.
2269 * vtable-verify.c (verify_bb_vtables): Strengthen local
2270 "call_stmt" from gimple to gimple_call.
2272 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2274 Concretize get_loop_exit_condition et al to working on gimple_cond
2276 * tree-scalar-evolution.h (get_loop_exit_condition): Return a
2278 * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
2279 concretizing local "res" from gimple to gimple_cond.
2280 * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
2281 locals from gimple to gimple_cond.
2282 (slpeel_can_duplicate_loop_p): Likewise.
2283 * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
2284 (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
2286 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2288 Update various expressions within tree-scalar-evolution.c to be gimple_phi
2290 * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
2291 rather than a gimple.
2292 (follow_ssa_edge_binary): Likewise.
2293 (follow_ssa_edge_expr): Likewise.
2294 (follow_ssa_edge_in_rhs): Likewise.
2295 (backedge_phi_arg_p): Likewise.
2296 (follow_ssa_edge_in_condition_phi_branch): Likewise.
2297 (follow_ssa_edge_in_condition_phi): Likewise.
2298 (follow_ssa_edge_inner_loop_phi): Likewise.
2299 (analyze_evolution_in_loop): Likewise.
2300 (analyze_initial_condition): Likewise.
2301 (interpret_loop_phi): Likewise.
2302 (interpret_condition_phi): Likewise.
2303 (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
2305 (analyze_scalar_evolution_1): Add checked casts to gimple_phi
2306 within "case GIMPLE_PHI".
2308 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2310 tree-ssa-loop-ivopts.c: use gimple_phi in a few places
2312 * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
2313 (find_bivs): Convert local "phi" into a gimple_phi.
2314 (mark_bivs): Likewise.
2316 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2318 tree-ssa-loop-manip.c: use gimple_phi in three places
2320 * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
2322 (split_loop_exit_edge): Likewise for "phi" and "new_phi".
2324 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2326 tree-ssa-loop-niter.c: use gimple_phi in a few places
2328 * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
2329 rather than a gimple.
2330 (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
2331 (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
2333 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2335 tree-ssa-phiprop.c: use gimple_phi
2337 * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
2338 parameter "phi" and local "new_phi" from gimple to gimple_phi.
2340 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2342 tree-predcom.c: use gimple_phi in various places
2344 * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
2346 (insert_looparound_copy): Require a gimple_phi rather than just a
2348 (add_looparound_copies): Convert local "phi" to be a gimple_phi.
2349 (initialize_root_vars): Likewise.
2350 (initialize_root_vars_lm): Likewise.
2352 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2354 tree-parloops.c: use gimple_phi in various places
2356 * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
2357 from gimple to gimple_phi.
2358 (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
2359 (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
2360 (gather_scalar_reductions): Convert to a gimple_phi_iterator and
2362 (try_create_reduction_list): Likewise.
2364 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2366 Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
2368 * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
2369 type of parameter from gimple to gimple_phi.
2371 * tree-complex.c (complex_visit_phi): Update signature of callback
2372 implementation accordingly.
2373 * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
2374 * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
2375 * tree-vrp.c (vrp_visit_phi_node): Likewise.
2377 * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
2378 gimple_phi when invoking the ssa_prop_visit_phi callback.
2380 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2382 Introduce gimple_phi_iterator
2384 * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
2385 gimple_stmt_iterator with identical layout, but adding...
2386 (gimple_phi_iterator::phi): ...new method, equivalent to
2387 gsi_stmt (), but casting the underlying gimple to gimple_phi,
2388 checking that code == GIMPLE_PHI in a checked build.
2389 (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
2390 gimple_stmt_iterator.
2392 * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
2394 (if_convertible_phi_p): Likewise.
2395 * tree-phinodes.h (add_phi_node_to_bb): Likewise.
2396 * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
2398 * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
2399 and a vec<gimple_phi> *, rather than just a gimple and
2400 vec<gimple> *, and a hash_set<gimple_phi> * rather than a
2402 (find_uninit_use): Likewise; add checked cast to gimple_phi when
2404 (pass_late_warn_uninitialized::execute): Strengthen types of
2405 various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
2406 "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
2407 gimple_phi, "added_to_worklist" from hash_set<gimple> to
2408 hash_set<gimple_phi>.
2410 * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
2411 gimple_phi_iterator * rather than a gimple_stmt_iterator *;
2412 use it to strengthen local from a gimple to a gimple_phi.
2414 * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
2415 gimple_stmt_iterator to a gimple_phi_iterator. Use the iterator's
2416 "phi" method rather than gsi_stmt. Use this checked cast to convert
2417 the type of related local from a plain gimple to a gimple_phi.
2418 * gimple-pretty-print.c (dump_phi_nodes): Likewise.
2419 * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
2421 * sese.c (sese_add_exit_phis_edge): Likewise.
2422 * tree-cfg.c (reinstall_phi_args): Likewise.
2423 (gimple_make_forwarder_block): Likewise.
2424 (add_phi_args_after_copy_edge): Likewise.
2425 (gimple_lv_adjust_loop_header_phi): Likewise.
2426 * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
2427 (remove_forwarder_block_with_phi): Likewise.
2428 (merge_phi_nodes): Likewise.
2429 * tree-complex.c (update_phi_components): Likewise.
2430 * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
2431 * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
2432 (copy_phis_for_bb): Likewise.
2433 * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
2434 * tree-outof-ssa.c (eliminate_build): Likewise.
2435 (eliminate_useless_phis): Likewise.
2436 (rewrite_trees): Likewise.
2437 (insert_backedge_copies): Likewise.
2438 * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
2439 (remove_phi_args): Likewise.
2440 (remove_phi_nodes): Likewise.
2441 * tree-predcom.c (find_looparound_phi): Likewise.
2442 (eliminate_temp_copies): Likewise.
2443 * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
2444 (scev_const_prop): Likewise; also, add checked cast to phi.
2445 * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
2446 * tree-ssa-dce.c (remove_dead_phis): Likewise.
2447 (forward_edge_to_pdom): Likewise.
2448 * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
2449 (cprop_into_successor_phis): Likewise.
2450 (propagate_rhs_into_lhs): Likewise.
2451 (eliminate_degenerate_phis_1): Likewise.
2452 * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
2453 * tree-ssa-live.c (calculate_live_on_exit): Likewise.
2454 (verify_live_on_entry): Likewise.
2455 * tree-ssa-loop-im.c
2456 (move_computations_dom_walker::before_dom_children): Likewise.
2457 * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
2458 (mark_bivs): Likewise.
2459 (find_interesting_uses_outside): Likewise.
2460 (determine_set_costs): Likewise.
2461 * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
2462 (tree_transform_and_unroll_loop): Likewise.
2463 (rewrite_all_phi_nodes_with_iv): Likewise.
2464 (canonicalize_loop_ivs): Likewise.
2465 * tree-ssa-loop-niter.c (determine_value_range): Likewise.
2466 * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
2467 * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
2468 * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
2469 * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
2470 (vop_phi): Likewise.
2471 * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
2473 * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
2474 (copy_phi_args): Likewise.
2475 (phi_args_equal_on_edges): Likewise.
2476 * tree-ssa.c (ssa_redirect_edge): Likewise.
2477 (flush_pending_stmts): Likewise.
2478 * tree-switch-conversion.c (check_final_bb): Likewise.
2479 (gather_default_values): Likewise.
2480 (build_constructors): Likewise.
2481 (fix_phi_nodes): Likewise.
2482 * tree-tailcall.c (propagate_through_phis): Likewise.
2483 (add_successor_phi_arg): Likewise.
2484 * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
2486 (slpeel_update_phi_nodes_for_guard2): Likewise.
2487 (slpeel_tree_peel_loop_to_edge): Likewise.
2488 (vect_can_advance_ivs_p): Likewise.
2489 (vect_update_ivs_after_vectorizer): Likewise.
2490 * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
2491 * tree-vrp.c (find_assert_locations): Likewise.
2492 * value-prof.c (gimple_ic): Likewise.
2494 * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
2496 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2498 Introduce gimple_phi and use it in various places
2500 * coretypes.h (gimple_phi): New typedef.
2501 (const_gimple_phi): New typedef.
2503 * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
2504 variants, using the gimple printer.
2506 * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
2507 vecs of more concrete gimple subclasses as appropriate; also the
2508 comment is about to become misleading.
2510 * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
2511 rather than spelling out the full type.
2512 (gimple_phi_num_args): Likewise.
2513 (gimple_phi_result): Likewise.
2514 (gimple_phi_result_ptr): Use gimple_phi typedef.
2515 (gimple_phi_set_result): Likewise.
2516 (gimple_phi_arg): Likewise.
2517 (gimple_phi_set_arg): Likewise.
2518 * tree-phinodes.c (allocate_phi_node): Likewise.
2519 (resize_phi_node): Likewise.
2520 (reserve_phi_args_for_new_edge): Likewise.
2521 (remove_phi_arg_num): Likewise.
2523 * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
2524 rather than just a gimple.
2525 * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
2527 * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
2529 (create_phi_node): Likewise.
2530 * tree-phinodes.h (create_phi_node): Likewise.
2532 * trans-mem.c (struct struct tm_log_entry): Replace use of
2533 now-removed gimple_vec with a plain vec<gimple>.
2535 * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
2536 vec<gimple_vec> to a vec< vec<gimple_phi> >.
2538 * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
2540 * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
2541 "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
2543 * tree-into-ssa.c (delete_update_ssa): Strengthen local
2544 "phis" from a gimple_vec to a vec<gimple_phi>.
2546 * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2547 gimple_phi in regions where a stmt is known to have code
2549 * tree-into-ssa.c (mark_use_interesting): Likewise.
2551 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2553 Introduce gimple_debug and use it in a few places
2555 * coretypes.h (gimple_debug): New typedef.
2556 (const_gimple_debug): New typedef.
2558 * gimple.h (struct gimple_statement_debug): New subclass of
2559 gimple_statement_with_ops, adding the invariant that
2560 stmt->code == GIMPLE_DEBUG.
2561 (is_a_helper <gimple_statement_debug>::test): New.
2563 * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
2564 variants, using the gimple printer.
2566 * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
2567 rather than just a gimple.
2568 * tree-inline.c (copy_debug_stmt): Likewise.
2570 * tree-inline.h (struct copy_body_data): Strengthen field
2571 "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
2573 * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
2574 rather than just a gimple.
2575 (gimple_build_debug_source_bind_stat): Likewise.
2576 * gimple.h (gimple_build_debug_bind_stat): Likewise.
2577 (gimple_build_debug_source_bind_stat): Likewise.
2579 * tree-inline.c (remap_gimple_stmt): Update locals to be a
2581 (maybe_move_debug_stmts_to_successors): Likewise.
2582 (copy_debug_stmts): Likewise.
2584 * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2585 gimple_debug in regions where a stmt is known to have code
2588 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2590 Introduce gimple_label and use it in a few places
2592 * coretypes.h (gimple_label): New typedef.
2593 (const_gimple_label): New typedef.
2595 * gimple.h (struct gimple_statement_label): New subclass of
2596 gimple_statement_with_ops, adding the invariant that
2597 stmt->code == GIMPLE_LABEL.
2598 (is_a_helper <gimple_statement_label>::test): New.
2600 * gdbhooks.py (build_pretty_printer): Add gimple_label and its
2601 variants, reusing the gimple printer.
2603 * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
2604 rather than just a gimple.
2605 * tree-cfg.c (verify_gimple_label): Likewise.
2607 * gimple.c (gimple_build_label): Return a gimple_label rather than
2609 * gimple.h (gimple_build_label): Likewise.
2611 * gimplify.c (gimplify_case_label_expr): Update local to be a
2613 * tree-switch-conversion.c (gen_inbound_check): Likewise.
2615 * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
2616 gimple_label in regions where a stmt is known to have code
2618 * tree-cfg.c (verify_gimple_stmt): Likewise.
2620 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2622 Introduce gimple_assign and use it in various places
2624 * coretypes.h (gimple_assign): New typedef.
2625 (const_gimple_assign): New typedef.
2627 * gimple.h (struct gimple_statement_assign): New subclass of
2628 gimple_statement_with_memory_ops, adding the invariant that
2629 stmt->code == GIMPLE_ASSIGN.
2630 (is_a_helper <gimple_statement_assign>::test): New.
2632 * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
2633 variants, using the gimple printer.
2635 * gimple-builder.c (build_assign): Return a gimple_assign rather
2636 than just a gimple from each of the overloaded variants.
2637 (build_type_cast): Likewise.
2638 * gimple-builder.h (build_assign): Likewise.
2639 (build_type_cast): Likewise.
2640 * gimple.c (gimple_build_assign_stat): Likewise.
2641 (gimple_build_assign_with_ops): Likewise.
2642 * gimple.h (gimple_build_assign_stat): Likewise.
2643 (gimple_build_assign_with_ops): Likewise.
2645 * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
2646 rather than just a "const gimple" (the latter is not a
2648 * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
2649 rather than just a gimple.
2650 (dump_binary_rhs): Likewise.
2651 (dump_ternary_rhs): Likewise.
2652 * tree-cfg.c (verify_gimple_assign_unary): Likewise.
2653 (verify_gimple_assign_binary): Likewise.
2654 (verify_gimple_assign_ternary): Likewise.
2655 (verify_gimple_assign_single): Likewise.
2656 (verify_gimple_assign): Likewise.
2657 * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
2658 (try_to_simplify): Likewise.
2659 * tree-tailcall.c (process_assignment): Likewise.
2660 * tree-vect-generic.c (expand_vector_operation): Likewise.
2661 * tree-vrp.c (extract_range_from_cond_expr): Likewise.
2662 (extract_range_from_assignment): Likewise.
2664 * asan.c (has_stmt_been_instrumented_p): Add checked cast to
2665 gimple_assign in regions where a stmt is known to have code
2667 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2668 * tree-cfg.c (verify_gimple_stmt): Likewise.
2669 * tree-ssa-sccvn.c (visit_use): Likewise.
2670 * tree-tailcall.c (find_tail_calls): Likewise.
2671 * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
2673 * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
2674 against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
2675 a gimple_assign local.
2677 * tree-vect-generic.c (expand_vector_condition): Convert local to a
2678 gimple_assign, adding a checked cast when extracting from gsi, since
2679 this is only called when underlying stmt has code GIMPLE_ASSIGN.
2680 (optimize_vector_constructor): Likewise.
2681 (lower_vec_perm): Likewise.
2682 (expand_vector_operations_1): Convert local to a gimple_assign,
2683 introducing a dyn_cast.
2685 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2687 Introduce gimple_cond and use it in various places
2689 * coretypes.h (gimple_cond): New typedef.
2690 (const_gimple_cond): Likewise.
2692 * gimple.h (struct gimple_statement_cond): New subclass of
2693 gimple_statement_with_ops, adding the invariant that
2694 stmt->code == GIMPLE_COND.
2695 (is_a_helper <gimple_statement_cond>::test): New.
2696 (gimple_build_cond): Return a gimple_cond, rather than just
2698 (gimple_build_cond_from_tree): Likewise.
2700 * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
2701 variants, using the gimple printer.
2703 * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
2705 * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
2706 (gimple_cond_true_p): Likewise.
2707 (gimple_cond_false_p): Likewise.
2708 (gimple_cond_set_condition): Likewise.
2709 * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
2710 * gimple-fold.c (fold_gimple_cond): Likewise.
2711 * gimple-pretty-print.c (dump_gimple_cond): Likewise.
2712 * tree-ssa-dom.c (canonicalize_comparison): Likewise.
2713 * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
2714 * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
2715 (recognize_bits_test): Likewise.
2716 * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
2717 (thread_around_empty_blocks): Likewise.
2718 (thread_through_normal_block): Likewise.
2719 (thread_across_edge): Likewise.
2720 * tree-ssa-threadedge.h (thread_across_edge): Likewise.
2721 * tree-vrp.c (range_fits_type_p): Likewise.
2723 * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
2724 gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
2725 * gimple-fold.c (fold_stmt_1): Likewise.
2726 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2727 * tree-ssa-dom.c (optimize_stmt): Likewise.
2728 * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2729 * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
2730 * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
2732 * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
2734 * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
2736 * tree-vrp.c (identify_jump_threads): Likewise.
2738 * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
2740 (gimple_build_cond_from_tree): Likewise.
2742 * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
2743 field "m_dummy_cond" from a plain gimple to a gimple_cond.
2745 * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
2746 inner_stmt and outer_stmt so that inner_cond and outer_cond can be
2747 of type gimple_cond once we know that we have code == GIMPLE_COND.
2748 * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
2749 "last" so that stmt can be of type gimple_cond.
2751 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2753 Introduce gimple_bind and use it for accessors.
2755 * coretypes.h (gimple_bind): New typedef.
2756 (const_gimple_bind): New typedef.
2758 * gdbhooks.py (build_pretty_printer): Add gimple_bind
2759 and its variants, using the gimple printer.
2761 * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
2762 require a gimple_bind rather than just a gimple.
2764 * gimple.c (gimple_build_bind): Return a gimple_bind rather than
2766 * gimple.h (gimple_build_bind): Likewise.
2768 * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
2770 * gimple.h (gimple_bind_vars): Update type-signature to
2771 require a gimple_bind rather than just a gimple, removing
2772 as_a and hence run-time check.
2773 (gimple_bind_set_vars): Likewise.
2774 (gimple_bind_append_vars): Likewise.
2775 (gimple_bind_body_ptr): Likewise.
2776 (gimple_bind_body): Likewise.
2777 (gimple_bind_set_body): Likewise.
2778 (gimple_bind_add_stmt): Likewise.
2779 (gimple_bind_add_seq): Likewise.
2780 (gimple_bind_block): Likewise.
2781 (gimple_bind_set_block): Likewise.
2782 * gimplify.c (gimple_push_bind_expr): Likewise.
2783 (gimple_current_bind_expr): Likewise.
2784 * tree-inline.c (copy_gimple_bind): Likewise.
2786 * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
2787 rather than a plain gimple.
2788 (gimplify_body): Likewise.
2789 (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
2792 * gimplify.c (struct gimplify_ctx): Strengthen field
2793 "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
2794 (gimple_bind_expr_stack): Likewise for type of returned value.
2796 * gimplify.c (gimplify_body): Strengthen various types from gimple
2797 to gimple_bind, including the return type.
2799 * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
2800 so that local "scope" can be of type gimple_bind once we've reached
2801 the region where it must be of code GIMPLE_BIND.
2803 * gimple-low.c (lower_gimple_bind): Add checked cast to
2804 gimple_bind, since both callers (lower_function_body and
2805 lower_stmt) have checked the code for us.
2807 * gimple.c (gimple_copy): Add checked cast to gimple_bind in
2808 region guarded by check for code GIMPLE_BIND.
2809 * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
2810 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2811 * gimple-walk.c (walk_gimple_stmt): Likewise.
2812 * omp-low.c (scan_omp_1_stmt): Likewise.
2813 (lower_omp_1): Likewise.
2814 (lower_omp_for): Likewise.
2815 * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
2816 (do_warn_unused_result): Likewise.
2817 * tree-inline.c (remap_gimple_stmt): Likewise.
2818 (estimate_num_insns): Likewise.
2819 * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
2821 * gimplify.c (gimplify_bind_expr): Update local(s) to be a
2822 gimple_bind rather than just a gimple.
2823 (gimplify_function_tree): Likewise.
2824 * omp-low.c (lower_omp_sections): Likewise.
2825 (lower_omp_single): Likewise.
2826 (lower_omp_master): Likewise.
2827 (lower_omp_taskgroup): Likewise.
2828 (lower_omp_ordered): Likewise.
2829 (lower_omp_critical): Likewise.
2830 (lower_omp_taskreg): Likewise.
2831 (lower_omp_teams): Likewise.
2832 * omp-low.c (lower_omp_for): Likewise; use
2833 gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
2834 (lower_omp_target): Likewise.
2835 * tree-nested.c (finalize_nesting_tree_1): Likewise.
2837 * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
2838 * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
2840 2014-10-24 David Malcolm <dmalcolm@redhat.com>
2842 Introduce gimple_switch and use it in various places
2844 * gimple.h (gimple_statement_switch): New subclass of
2845 gimple_statement_with_ops, adding the invariant that
2846 stmt->code == GIMPLE_SWITCH.
2847 (is_a_helper <gimple_statement_switch>::test (gimple)): New.
2849 * coretypes.h (gimple_switch): New typedef
2850 (const_gimple_switch): Likewise.
2852 * gdbhooks.py (build_pretty_printer): Add gimple_switch
2853 and its variants, using the gimple printer.
2855 * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
2856 rather than just a gimple.
2857 (gimple_build_switch): Likewise.
2858 * gimple.h (gimple_build_switch_nlabels): Likewise.
2859 (gimple_build_switch): Likewise.
2861 * gimple.h (gimple_switch_num_labels): Update type-signature to
2862 require a gimple_switch rather than just a gimple.
2863 (gimple_switch_set_num_labels): Likewise.
2864 (gimple_switch_set_index): Likewise.
2865 (gimple_switch_label): Likewise.
2866 (gimple_switch_set_label): Likewise.
2867 (gimple_switch_default_label): Likewise.
2868 (gimple_switch_set_default_label): Likewise.
2869 * expr.h (expand_case): Likewise.
2870 * gimple-pretty-print.c (dump_gimple_call): Likewise.
2871 * stmt.c (compute_cases_per_edge): Likewise.
2872 (expand_case): Likewise.
2873 * tree-cfg.h (group_case_labels_stmt): Likewise.
2874 * tree-cfg.c (make_gimple_switch_edges): Likewise.
2875 (find_taken_edge_switch_expr) Likewise.
2876 (find_case_label_for_value) Likewise.
2877 (get_cases_for_edge): Likewise.
2878 (group_case_labels_stmt): Likewise.
2879 (verify_gimple_switch): Likewise.
2880 * tree-eh.c (verify_norecord_switch_expr): Likewise.
2881 * tree-eh.c (lower_eh_constructs_2): Likewise.
2882 * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
2883 * tree-ssa-dom.c (record_edge_info): Likewise.
2884 * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
2885 (simplify_gimple_switch): Likewise.
2886 * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
2887 (collect_switch_conv_info): Likewise.
2888 (build_constructors): Likewise.
2889 (array_value_type): Likewise.
2890 (build_one_array): Likewise.
2891 (build_arrays): Likewise.
2892 (gen_inbound_check): Likewise.
2893 * tree-vrp.c (find_switch_asserts): Likewise.
2894 (find_case_label_range): Likewise.
2895 (find_case_label_ranges): Likewise.
2896 (vrp_visit_switch_stmt): Likewise.
2897 (simplify_switch_using_ranges): Likewise.
2899 * tree-vrp.c (switch_update): Strengthen field "stmt" from being
2900 merely a gimple to being a gimple_switch.
2902 * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
2903 gimple_switch in regions where the stmt code has been tested as
2905 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2906 * tree-cfg.c (make_edges): Likewise.
2907 (end_recording_case_labels): Likewise.
2908 (cleanup_dead_labels): Likewise.
2909 (cleanup_dead_labels): Likewise.
2910 (group_case_labels): Likewise.
2911 (find_taken_edge): Likewise.
2912 (find_case_label_for_value): Likewise.
2913 (verify_gimple_stmt): Likewise.
2914 (gimple_verify_flow_info): Likewise.
2915 (gimple_redirect_edge_and_branch): Likewise.
2916 * tree-inline.c (estimate_num_insns): Likewise.
2917 * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2918 * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
2919 * tree-switch-conversion.c (do_switchconv): Likewise.
2920 * tree-vrp.c (find_assert_locations_1): Likewise.
2921 (vrp_visit_stmt): Likewise.
2922 (simplify_stmt_using_ranges): Likewise.
2924 * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
2925 Introduce local "lastg" as a generic gimple, so that local "last"
2926 can be of type gimple_switch once lastg's code has been verified.
2928 * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
2929 the GIMPLE_SWITCH case.
2931 * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
2932 argument, since the caller (find_taken_edge) has checked that
2933 last_stmt is a switch.
2935 Copyright (C) 2014 Free Software Foundation, Inc.
2937 Copying and distribution of this file, with or without modification,
2938 are permitted in any medium without royalty provided the copyright
2939 notice and this notice are preserved.