1 2014-10-24 David Malcolm <dmalcolm@redhat.com>
3 Concretize get_loop_exit_condition et al to working on gimple_cond
5 * tree-scalar-evolution.h (get_loop_exit_condition): Return a
7 * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
8 concretizing local "res" from gimple to gimple_cond.
9 * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
10 locals from gimple to gimple_cond.
11 (slpeel_can_duplicate_loop_p): Likewise.
12 * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
13 (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
15 2014-10-24 David Malcolm <dmalcolm@redhat.com>
17 Update various expressions within tree-scalar-evolution.c to be gimple_phi
19 * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
21 (follow_ssa_edge_binary): Likewise.
22 (follow_ssa_edge_expr): Likewise.
23 (follow_ssa_edge_in_rhs): Likewise.
24 (backedge_phi_arg_p): Likewise.
25 (follow_ssa_edge_in_condition_phi_branch): Likewise.
26 (follow_ssa_edge_in_condition_phi): Likewise.
27 (follow_ssa_edge_inner_loop_phi): Likewise.
28 (analyze_evolution_in_loop): Likewise.
29 (analyze_initial_condition): Likewise.
30 (interpret_loop_phi): Likewise.
31 (interpret_condition_phi): Likewise.
32 (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
34 (analyze_scalar_evolution_1): Add checked casts to gimple_phi
35 within "case GIMPLE_PHI".
37 2014-10-24 David Malcolm <dmalcolm@redhat.com>
39 tree-ssa-loop-ivopts.c: use gimple_phi in a few places
41 * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
42 (find_bivs): Convert local "phi" into a gimple_phi.
43 (mark_bivs): Likewise.
45 2014-10-24 David Malcolm <dmalcolm@redhat.com>
47 tree-ssa-loop-manip.c: use gimple_phi in three places
49 * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
51 (split_loop_exit_edge): Likewise for "phi" and "new_phi".
53 2014-10-24 David Malcolm <dmalcolm@redhat.com>
55 tree-ssa-loop-niter.c: use gimple_phi in a few places
57 * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
59 (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
60 (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
62 2014-10-24 David Malcolm <dmalcolm@redhat.com>
64 tree-ssa-phiprop.c: use gimple_phi
66 * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
67 parameter "phi" and local "new_phi" from gimple to gimple_phi.
69 2014-10-24 David Malcolm <dmalcolm@redhat.com>
71 tree-predcom.c: use gimple_phi in various places
73 * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
75 (insert_looparound_copy): Require a gimple_phi rather than just a
77 (add_looparound_copies): Convert local "phi" to be a gimple_phi.
78 (initialize_root_vars): Likewise.
79 (initialize_root_vars_lm): Likewise.
81 2014-10-24 David Malcolm <dmalcolm@redhat.com>
83 tree-parloops.c: use gimple_phi in various places
85 * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
86 from gimple to gimple_phi.
87 (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
88 (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
89 (gather_scalar_reductions): Convert to a gimple_phi_iterator and
91 (try_create_reduction_list): Likewise.
93 2014-10-24 David Malcolm <dmalcolm@redhat.com>
95 Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
97 * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
98 type of parameter from gimple to gimple_phi.
100 * tree-complex.c (complex_visit_phi): Update signature of callback
101 implementation accordingly.
102 * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
103 * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
104 * tree-vrp.c (vrp_visit_phi_node): Likewise.
106 * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
107 gimple_phi when invoking the ssa_prop_visit_phi callback.
109 2014-10-24 David Malcolm <dmalcolm@redhat.com>
111 Introduce gimple_phi_iterator
113 * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
114 gimple_stmt_iterator with identical layout, but adding...
115 (gimple_phi_iterator::phi): ...new method, equivalent to
116 gsi_stmt (), but casting the underlying gimple to gimple_phi,
117 checking that code == GIMPLE_PHI in a checked build.
118 (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
119 gimple_stmt_iterator.
121 * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
123 (if_convertible_phi_p): Likewise.
124 * tree-phinodes.h (add_phi_node_to_bb): Likewise.
125 * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
127 * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
128 and a vec<gimple_phi> *, rather than just a gimple and
129 vec<gimple> *, and a hash_set<gimple_phi> * rather than a
131 (find_uninit_use): Likewise; add checked cast to gimple_phi when
133 (pass_late_warn_uninitialized::execute): Strengthen types of
134 various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
135 "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
136 gimple_phi, "added_to_worklist" from hash_set<gimple> to
137 hash_set<gimple_phi>.
139 * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
140 gimple_phi_iterator * rather than a gimple_stmt_iterator *;
141 use it to strengthen local from a gimple to a gimple_phi.
143 * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
144 gimple_stmt_iterator to a gimple_phi_iterator. Use the iterator's
145 "phi" method rather than gsi_stmt. Use this checked cast to convert
146 the type of related local from a plain gimple to a gimple_phi.
147 * gimple-pretty-print.c (dump_phi_nodes): Likewise.
148 * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
150 * sese.c (sese_add_exit_phis_edge): Likewise.
151 * tree-cfg.c (reinstall_phi_args): Likewise.
152 (gimple_make_forwarder_block): Likewise.
153 (add_phi_args_after_copy_edge): Likewise.
154 (gimple_lv_adjust_loop_header_phi): Likewise.
155 * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
156 (remove_forwarder_block_with_phi): Likewise.
157 (merge_phi_nodes): Likewise.
158 * tree-complex.c (update_phi_components): Likewise.
159 * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
160 * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
161 (copy_phis_for_bb): Likewise.
162 * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
163 * tree-outof-ssa.c (eliminate_build): Likewise.
164 (eliminate_useless_phis): Likewise.
165 (rewrite_trees): Likewise.
166 (insert_backedge_copies): Likewise.
167 * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
168 (remove_phi_args): Likewise.
169 (remove_phi_nodes): Likewise.
170 * tree-predcom.c (find_looparound_phi): Likewise.
171 (eliminate_temp_copies): Likewise.
172 * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
173 (scev_const_prop): Likewise; also, add checked cast to phi.
174 * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
175 * tree-ssa-dce.c (remove_dead_phis): Likewise.
176 (forward_edge_to_pdom): Likewise.
177 * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
178 (cprop_into_successor_phis): Likewise.
179 (propagate_rhs_into_lhs): Likewise.
180 (eliminate_degenerate_phis_1): Likewise.
181 * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
182 * tree-ssa-live.c (calculate_live_on_exit): Likewise.
183 (verify_live_on_entry): Likewise.
185 (move_computations_dom_walker::before_dom_children): Likewise.
186 * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
187 (mark_bivs): Likewise.
188 (find_interesting_uses_outside): Likewise.
189 (determine_set_costs): Likewise.
190 * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
191 (tree_transform_and_unroll_loop): Likewise.
192 (rewrite_all_phi_nodes_with_iv): Likewise.
193 (canonicalize_loop_ivs): Likewise.
194 * tree-ssa-loop-niter.c (determine_value_range): Likewise.
195 * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
196 * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
197 * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
198 * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
200 * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
202 * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
203 (copy_phi_args): Likewise.
204 (phi_args_equal_on_edges): Likewise.
205 * tree-ssa.c (ssa_redirect_edge): Likewise.
206 (flush_pending_stmts): Likewise.
207 * tree-switch-conversion.c (check_final_bb): Likewise.
208 (gather_default_values): Likewise.
209 (build_constructors): Likewise.
210 (fix_phi_nodes): Likewise.
211 * tree-tailcall.c (propagate_through_phis): Likewise.
212 (add_successor_phi_arg): Likewise.
213 * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
215 (slpeel_update_phi_nodes_for_guard2): Likewise.
216 (slpeel_tree_peel_loop_to_edge): Likewise.
217 (vect_can_advance_ivs_p): Likewise.
218 (vect_update_ivs_after_vectorizer): Likewise.
219 * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
220 * tree-vrp.c (find_assert_locations): Likewise.
221 * value-prof.c (gimple_ic): Likewise.
223 * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
225 2014-10-24 David Malcolm <dmalcolm@redhat.com>
227 Introduce gimple_phi and use it in various places
229 * coretypes.h (gimple_phi): New typedef.
230 (const_gimple_phi): New typedef.
232 * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
233 variants, using the gimple printer.
235 * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
236 vecs of more concrete gimple subclasses as appropriate; also the
237 comment is about to become misleading.
239 * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
240 rather than spelling out the full type.
241 (gimple_phi_num_args): Likewise.
242 (gimple_phi_result): Likewise.
243 (gimple_phi_result_ptr): Use gimple_phi typedef.
244 (gimple_phi_set_result): Likewise.
245 (gimple_phi_arg): Likewise.
246 (gimple_phi_set_arg): Likewise.
247 * tree-phinodes.c (allocate_phi_node): Likewise.
248 (resize_phi_node): Likewise.
249 (reserve_phi_args_for_new_edge): Likewise.
250 (remove_phi_arg_num): Likewise.
252 * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
253 rather than just a gimple.
254 * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
256 * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
258 (create_phi_node): Likewise.
259 * tree-phinodes.h (create_phi_node): Likewise.
261 * trans-mem.c (struct struct tm_log_entry): Replace use of
262 now-removed gimple_vec with a plain vec<gimple>.
264 * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
265 vec<gimple_vec> to a vec< vec<gimple_phi> >.
267 * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
269 * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
270 "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
272 * tree-into-ssa.c (delete_update_ssa): Strengthen local
273 "phis" from a gimple_vec to a vec<gimple_phi>.
275 * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
276 gimple_phi in regions where a stmt is known to have code
278 * tree-into-ssa.c (mark_use_interesting): Likewise.
280 2014-10-24 David Malcolm <dmalcolm@redhat.com>
282 Introduce gimple_debug and use it in a few places
284 * coretypes.h (gimple_debug): New typedef.
285 (const_gimple_debug): New typedef.
287 * gimple.h (struct gimple_statement_debug): New subclass of
288 gimple_statement_with_ops, adding the invariant that
289 stmt->code == GIMPLE_DEBUG.
290 (is_a_helper <gimple_statement_debug>::test): New.
292 * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
293 variants, using the gimple printer.
295 * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
296 rather than just a gimple.
297 * tree-inline.c (copy_debug_stmt): Likewise.
299 * tree-inline.h (struct copy_body_data): Strengthen field
300 "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
302 * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
303 rather than just a gimple.
304 (gimple_build_debug_source_bind_stat): Likewise.
305 * gimple.h (gimple_build_debug_bind_stat): Likewise.
306 (gimple_build_debug_source_bind_stat): Likewise.
308 * tree-inline.c (remap_gimple_stmt): Update locals to be a
310 (maybe_move_debug_stmts_to_successors): Likewise.
311 (copy_debug_stmts): Likewise.
313 * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
314 gimple_debug in regions where a stmt is known to have code
317 2014-10-24 David Malcolm <dmalcolm@redhat.com>
319 Introduce gimple_label and use it in a few places
321 * coretypes.h (gimple_label): New typedef.
322 (const_gimple_label): New typedef.
324 * gimple.h (struct gimple_statement_label): New subclass of
325 gimple_statement_with_ops, adding the invariant that
326 stmt->code == GIMPLE_LABEL.
327 (is_a_helper <gimple_statement_label>::test): New.
329 * gdbhooks.py (build_pretty_printer): Add gimple_label and its
330 variants, reusing the gimple printer.
332 * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
333 rather than just a gimple.
334 * tree-cfg.c (verify_gimple_label): Likewise.
336 * gimple.c (gimple_build_label): Return a gimple_label rather than
338 * gimple.h (gimple_build_label): Likewise.
340 * gimplify.c (gimplify_case_label_expr): Update local to be a
342 * tree-switch-conversion.c (gen_inbound_check): Likewise.
344 * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
345 gimple_label in regions where a stmt is known to have code
347 * tree-cfg.c (verify_gimple_stmt): Likewise.
349 2014-10-24 David Malcolm <dmalcolm@redhat.com>
351 Introduce gimple_assign and use it in various places
353 * coretypes.h (gimple_assign): New typedef.
354 (const_gimple_assign): New typedef.
356 * gimple.h (struct gimple_statement_assign): New subclass of
357 gimple_statement_with_memory_ops, adding the invariant that
358 stmt->code == GIMPLE_ASSIGN.
359 (is_a_helper <gimple_statement_assign>::test): New.
361 * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
362 variants, using the gimple printer.
364 * gimple-builder.c (build_assign): Return a gimple_assign rather
365 than just a gimple from each of the overloaded variants.
366 (build_type_cast): Likewise.
367 * gimple-builder.h (build_assign): Likewise.
368 (build_type_cast): Likewise.
369 * gimple.c (gimple_build_assign_stat): Likewise.
370 (gimple_build_assign_with_ops): Likewise.
371 * gimple.h (gimple_build_assign_stat): Likewise.
372 (gimple_build_assign_with_ops): Likewise.
374 * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
375 rather than just a "const gimple" (the latter is not a
377 * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
378 rather than just a gimple.
379 (dump_binary_rhs): Likewise.
380 (dump_ternary_rhs): Likewise.
381 * tree-cfg.c (verify_gimple_assign_unary): Likewise.
382 (verify_gimple_assign_binary): Likewise.
383 (verify_gimple_assign_ternary): Likewise.
384 (verify_gimple_assign_single): Likewise.
385 (verify_gimple_assign): Likewise.
386 * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
387 (try_to_simplify): Likewise.
388 * tree-tailcall.c (process_assignment): Likewise.
389 * tree-vect-generic.c (expand_vector_operation): Likewise.
390 * tree-vrp.c (extract_range_from_cond_expr): Likewise.
391 (extract_range_from_assignment): Likewise.
393 * asan.c (has_stmt_been_instrumented_p): Add checked cast to
394 gimple_assign in regions where a stmt is known to have code
396 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
397 * tree-cfg.c (verify_gimple_stmt): Likewise.
398 * tree-ssa-sccvn.c (visit_use): Likewise.
399 * tree-tailcall.c (find_tail_calls): Likewise.
400 * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
402 * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
403 against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
404 a gimple_assign local.
406 * tree-vect-generic.c (expand_vector_condition): Convert local to a
407 gimple_assign, adding a checked cast when extracting from gsi, since
408 this is only called when underlying stmt has code GIMPLE_ASSIGN.
409 (optimize_vector_constructor): Likewise.
410 (lower_vec_perm): Likewise.
411 (expand_vector_operations_1): Convert local to a gimple_assign,
412 introducing a dyn_cast.
414 2014-10-24 David Malcolm <dmalcolm@redhat.com>
416 Introduce gimple_cond and use it in various places
418 * coretypes.h (gimple_cond): New typedef.
419 (const_gimple_cond): Likewise.
421 * gimple.h (struct gimple_statement_cond): New subclass of
422 gimple_statement_with_ops, adding the invariant that
423 stmt->code == GIMPLE_COND.
424 (is_a_helper <gimple_statement_cond>::test): New.
425 (gimple_build_cond): Return a gimple_cond, rather than just
427 (gimple_build_cond_from_tree): Likewise.
429 * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
430 variants, using the gimple printer.
432 * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
434 * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
435 (gimple_cond_true_p): Likewise.
436 (gimple_cond_false_p): Likewise.
437 (gimple_cond_set_condition): Likewise.
438 * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
439 * gimple-fold.c (fold_gimple_cond): Likewise.
440 * gimple-pretty-print.c (dump_gimple_cond): Likewise.
441 * tree-ssa-dom.c (canonicalize_comparison): Likewise.
442 * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
443 * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
444 (recognize_bits_test): Likewise.
445 * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
446 (thread_around_empty_blocks): Likewise.
447 (thread_through_normal_block): Likewise.
448 (thread_across_edge): Likewise.
449 * tree-ssa-threadedge.h (thread_across_edge): Likewise.
450 * tree-vrp.c (range_fits_type_p): Likewise.
452 * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
453 gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
454 * gimple-fold.c (fold_stmt_1): Likewise.
455 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
456 * tree-ssa-dom.c (optimize_stmt): Likewise.
457 * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
458 * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
459 * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
461 * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
463 * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
465 * tree-vrp.c (identify_jump_threads): Likewise.
467 * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
469 (gimple_build_cond_from_tree): Likewise.
471 * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
472 field "m_dummy_cond" from a plain gimple to a gimple_cond.
474 * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
475 inner_stmt and outer_stmt so that inner_cond and outer_cond can be
476 of type gimple_cond once we know that we have code == GIMPLE_COND.
477 * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
478 "last" so that stmt can be of type gimple_cond.
480 2014-10-24 David Malcolm <dmalcolm@redhat.com>
482 Introduce gimple_bind and use it for accessors.
484 * coretypes.h (gimple_bind): New typedef.
485 (const_gimple_bind): New typedef.
487 * gdbhooks.py (build_pretty_printer): Add gimple_bind
488 and its variants, using the gimple printer.
490 * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
491 require a gimple_bind rather than just a gimple.
493 * gimple.c (gimple_build_bind): Return a gimple_bind rather than
495 * gimple.h (gimple_build_bind): Likewise.
497 * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
499 * gimple.h (gimple_bind_vars): Update type-signature to
500 require a gimple_bind rather than just a gimple, removing
501 as_a and hence run-time check.
502 (gimple_bind_set_vars): Likewise.
503 (gimple_bind_append_vars): Likewise.
504 (gimple_bind_body_ptr): Likewise.
505 (gimple_bind_body): Likewise.
506 (gimple_bind_set_body): Likewise.
507 (gimple_bind_add_stmt): Likewise.
508 (gimple_bind_add_seq): Likewise.
509 (gimple_bind_block): Likewise.
510 (gimple_bind_set_block): Likewise.
511 * gimplify.c (gimple_push_bind_expr): Likewise.
512 (gimple_current_bind_expr): Likewise.
513 * tree-inline.c (copy_gimple_bind): Likewise.
515 * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
516 rather than a plain gimple.
517 (gimplify_body): Likewise.
518 (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
521 * gimplify.c (struct gimplify_ctx): Strengthen field
522 "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
523 (gimple_bind_expr_stack): Likewise for type of returned value.
525 * gimplify.c (gimplify_body): Strengthen various types from gimple
526 to gimple_bind, including the return type.
528 * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
529 so that local "scope" can be of type gimple_bind once we've reached
530 the region where it must be of code GIMPLE_BIND.
532 * gimple-low.c (lower_gimple_bind): Add checked cast to
533 gimple_bind, since both callers (lower_function_body and
534 lower_stmt) have checked the code for us.
536 * gimple.c (gimple_copy): Add checked cast to gimple_bind in
537 region guarded by check for code GIMPLE_BIND.
538 * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
539 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
540 * gimple-walk.c (walk_gimple_stmt): Likewise.
541 * omp-low.c (scan_omp_1_stmt): Likewise.
542 (lower_omp_1): Likewise.
543 (lower_omp_for): Likewise.
544 * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
545 (do_warn_unused_result): Likewise.
546 * tree-inline.c (remap_gimple_stmt): Likewise.
547 (estimate_num_insns): Likewise.
548 * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
550 * gimplify.c (gimplify_bind_expr): Update local(s) to be a
551 gimple_bind rather than just a gimple.
552 (gimplify_function_tree): Likewise.
553 * omp-low.c (lower_omp_sections): Likewise.
554 (lower_omp_single): Likewise.
555 (lower_omp_master): Likewise.
556 (lower_omp_taskgroup): Likewise.
557 (lower_omp_ordered): Likewise.
558 (lower_omp_critical): Likewise.
559 (lower_omp_taskreg): Likewise.
560 (lower_omp_teams): Likewise.
561 * omp-low.c (lower_omp_for): Likewise; use
562 gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
563 (lower_omp_target): Likewise.
564 * tree-nested.c (finalize_nesting_tree_1): Likewise.
566 * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
567 * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
569 2014-10-24 David Malcolm <dmalcolm@redhat.com>
571 Introduce gimple_switch and use it in various places
573 * gimple.h (gimple_statement_switch): New subclass of
574 gimple_statement_with_ops, adding the invariant that
575 stmt->code == GIMPLE_SWITCH.
576 (is_a_helper <gimple_statement_switch>::test (gimple)): New.
578 * coretypes.h (gimple_switch): New typedef
579 (const_gimple_switch): Likewise.
581 * gdbhooks.py (build_pretty_printer): Add gimple_switch
582 and its variants, using the gimple printer.
584 * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
585 rather than just a gimple.
586 (gimple_build_switch): Likewise.
587 * gimple.h (gimple_build_switch_nlabels): Likewise.
588 (gimple_build_switch): Likewise.
590 * gimple.h (gimple_switch_num_labels): Update type-signature to
591 require a gimple_switch rather than just a gimple.
592 (gimple_switch_set_num_labels): Likewise.
593 (gimple_switch_set_index): Likewise.
594 (gimple_switch_label): Likewise.
595 (gimple_switch_set_label): Likewise.
596 (gimple_switch_default_label): Likewise.
597 (gimple_switch_set_default_label): Likewise.
598 * expr.h (expand_case): Likewise.
599 * gimple-pretty-print.c (dump_gimple_call): Likewise.
600 * stmt.c (compute_cases_per_edge): Likewise.
601 (expand_case): Likewise.
602 * tree-cfg.h (group_case_labels_stmt): Likewise.
603 * tree-cfg.c (make_gimple_switch_edges): Likewise.
604 (find_taken_edge_switch_expr) Likewise.
605 (find_case_label_for_value) Likewise.
606 (get_cases_for_edge): Likewise.
607 (group_case_labels_stmt): Likewise.
608 (verify_gimple_switch): Likewise.
609 * tree-eh.c (verify_norecord_switch_expr): Likewise.
610 * tree-eh.c (lower_eh_constructs_2): Likewise.
611 * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
612 * tree-ssa-dom.c (record_edge_info): Likewise.
613 * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
614 (simplify_gimple_switch): Likewise.
615 * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
616 (collect_switch_conv_info): Likewise.
617 (build_constructors): Likewise.
618 (array_value_type): Likewise.
619 (build_one_array): Likewise.
620 (build_arrays): Likewise.
621 (gen_inbound_check): Likewise.
622 * tree-vrp.c (find_switch_asserts): Likewise.
623 (find_case_label_range): Likewise.
624 (find_case_label_ranges): Likewise.
625 (vrp_visit_switch_stmt): Likewise.
626 (simplify_switch_using_ranges): Likewise.
628 * tree-vrp.c (switch_update): Strengthen field "stmt" from being
629 merely a gimple to being a gimple_switch.
631 * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
632 gimple_switch in regions where the stmt code has been tested as
634 * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
635 * tree-cfg.c (make_edges): Likewise.
636 (end_recording_case_labels): Likewise.
637 (cleanup_dead_labels): Likewise.
638 (cleanup_dead_labels): Likewise.
639 (group_case_labels): Likewise.
640 (find_taken_edge): Likewise.
641 (find_case_label_for_value): Likewise.
642 (verify_gimple_stmt): Likewise.
643 (gimple_verify_flow_info): Likewise.
644 (gimple_redirect_edge_and_branch): Likewise.
645 * tree-inline.c (estimate_num_insns): Likewise.
646 * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
647 * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
648 * tree-switch-conversion.c (do_switchconv): Likewise.
649 * tree-vrp.c (find_assert_locations_1): Likewise.
650 (vrp_visit_stmt): Likewise.
651 (simplify_stmt_using_ranges): Likewise.
653 * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
654 Introduce local "lastg" as a generic gimple, so that local "last"
655 can be of type gimple_switch once lastg's code has been verified.
657 * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
658 the GIMPLE_SWITCH case.
660 * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
661 argument, since the caller (find_taken_edge) has checked that
662 last_stmt is a switch.
664 Copyright (C) 2014 Free Software Foundation, Inc.
666 Copying and distribution of this file, with or without modification,
667 are permitted in any medium without royalty provided the copyright
668 notice and this notice are preserved.