tree-ssa-loop-manip.c: use gimple_phi in three places
[official-gcc.git] / gcc / ChangeLog.gimple-classes
blob1e636be055921229203022327a795dbc9b843221
1 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
3         tree-ssa-loop-manip.c: use gimple_phi in three places
5         * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
6         gimple_phi.
7         (split_loop_exit_edge): Likewise for "phi" and "new_phi".
9 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
11         tree-ssa-loop-niter.c: use gimple_phi in a few places
13         * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
14         rather than a gimple.
15         (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
16         (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
18 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
20         tree-ssa-phiprop.c: use gimple_phi
22         * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
23         parameter "phi" and local "new_phi" from gimple to gimple_phi.
25 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
27         tree-predcom.c: use gimple_phi in various places
29         * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
30         than just a gimple.
31         (insert_looparound_copy): Require a gimple_phi rather than just a
32         gimple.
33         (add_looparound_copies): Convert local "phi" to be a gimple_phi.
34         (initialize_root_vars): Likewise.
35         (initialize_root_vars_lm): Likewise.
37 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
39         tree-parloops.c: use gimple_phi in various places
41         * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
42         from gimple to gimple_phi.
43         (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
44         (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
45         (gather_scalar_reductions): Convert to a gimple_phi_iterator and
46         gimple_phi.
47         (try_create_reduction_list): Likewise.
49 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
51         Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
53         * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
54         type of parameter from gimple to gimple_phi.
56         * tree-complex.c (complex_visit_phi): Update signature of callback
57         implementation accordingly.
58         * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
59         * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
60         * tree-vrp.c (vrp_visit_phi_node): Likewise.
62         * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
63         gimple_phi when invoking the ssa_prop_visit_phi callback.
65 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
67         Introduce gimple_phi_iterator
69         * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
70         gimple_stmt_iterator with identical layout, but adding...
71         (gimple_phi_iterator::phi): ...new method, equivalent to
72         gsi_stmt (), but casting the underlying gimple to gimple_phi,
73         checking that code == GIMPLE_PHI in a checked build.
74         (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
75         gimple_stmt_iterator.
77         * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
78         than just a gimple.
79         (if_convertible_phi_p): Likewise.
80         * tree-phinodes.h (add_phi_node_to_bb): Likewise.
81         * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
83         * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
84         and a vec<gimple_phi> *, rather than just a gimple and
85         vec<gimple> *, and a hash_set<gimple_phi> * rather than a
86         hash_set<gimple> *.
87         (find_uninit_use): Likewise; add checked cast to gimple_phi when
88         adding to worklist.
89         (pass_late_warn_uninitialized::execute): Strengthen types of
90         various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
91         "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
92         gimple_phi, "added_to_worklist" from hash_set<gimple> to
93         hash_set<gimple_phi>.
95         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
96         gimple_phi_iterator * rather than a gimple_stmt_iterator *;
97         use it to strengthen local from a gimple to a gimple_phi.
99         * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
100         gimple_stmt_iterator to a gimple_phi_iterator.  Use the iterator's
101         "phi" method rather than gsi_stmt.  Use this checked cast to convert
102         the type of related local from a plain gimple to a gimple_phi.
103         * gimple-pretty-print.c (dump_phi_nodes): Likewise.
104         * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
105         Likewise.
106         * sese.c (sese_add_exit_phis_edge): Likewise.
107         * tree-cfg.c (reinstall_phi_args): Likewise.
108         (gimple_make_forwarder_block): Likewise.
109         (add_phi_args_after_copy_edge): Likewise.
110         (gimple_lv_adjust_loop_header_phi): Likewise.
111         * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
112         (remove_forwarder_block_with_phi): Likewise.
113         (merge_phi_nodes): Likewise.
114         * tree-complex.c (update_phi_components): Likewise.
115         * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
116         * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
117         (copy_phis_for_bb): Likewise.
118         * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
119         * tree-outof-ssa.c (eliminate_build): Likewise.
120         (eliminate_useless_phis): Likewise.
121         (rewrite_trees): Likewise.
122         (insert_backedge_copies): Likewise.
123         * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
124         (remove_phi_args): Likewise.
125         (remove_phi_nodes): Likewise.
126         * tree-predcom.c (find_looparound_phi): Likewise.
127         (eliminate_temp_copies): Likewise.
128         * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
129         (scev_const_prop): Likewise; also, add checked cast to phi.
130         * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
131         * tree-ssa-dce.c (remove_dead_phis): Likewise.
132         (forward_edge_to_pdom): Likewise.
133         * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
134         (cprop_into_successor_phis): Likewise.
135         (propagate_rhs_into_lhs): Likewise.
136         (eliminate_degenerate_phis_1): Likewise.
137         * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
138         * tree-ssa-live.c (calculate_live_on_exit): Likewise.
139         (verify_live_on_entry): Likewise.
140         * tree-ssa-loop-im.c
141         (move_computations_dom_walker::before_dom_children): Likewise.
142         * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
143         (mark_bivs): Likewise.
144         (find_interesting_uses_outside): Likewise.
145         (determine_set_costs): Likewise.
146         * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
147         (tree_transform_and_unroll_loop): Likewise.
148         (rewrite_all_phi_nodes_with_iv): Likewise.
149         (canonicalize_loop_ivs): Likewise.
150         * tree-ssa-loop-niter.c (determine_value_range): Likewise.
151         * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
152         * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
153         * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
154         * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
155         (vop_phi): Likewise.
156         * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
157         Likewise.
158         * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
159         (copy_phi_args): Likewise.
160         (phi_args_equal_on_edges): Likewise.
161         * tree-ssa.c (ssa_redirect_edge): Likewise.
162         (flush_pending_stmts): Likewise.
163         * tree-switch-conversion.c (check_final_bb): Likewise.
164         (gather_default_values): Likewise.
165         (build_constructors): Likewise.
166         (fix_phi_nodes): Likewise.
167         * tree-tailcall.c (propagate_through_phis): Likewise.
168         (add_successor_phi_arg): Likewise.
169         * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
170         Likewise.
171         (slpeel_update_phi_nodes_for_guard2): Likewise.
172         (slpeel_tree_peel_loop_to_edge): Likewise.
173         (vect_can_advance_ivs_p): Likewise.
174         (vect_update_ivs_after_vectorizer): Likewise.
175         * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
176         * tree-vrp.c (find_assert_locations): Likewise.
177         * value-prof.c (gimple_ic): Likewise.
179         * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
181 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
183         Introduce gimple_phi and use it in various places
185         * coretypes.h (gimple_phi): New typedef.
186         (const_gimple_phi): New typedef.
188         * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
189         variants, using the gimple printer.
191         * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
192         vecs of more concrete gimple subclasses as appropriate; also the
193         comment is about to become misleading.
195         * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
196         rather than spelling out the full type.
197         (gimple_phi_num_args): Likewise.
198         (gimple_phi_result): Likewise.
199         (gimple_phi_result_ptr): Use gimple_phi typedef.
200         (gimple_phi_set_result): Likewise.
201         (gimple_phi_arg): Likewise.
202         (gimple_phi_set_arg): Likewise.
203         * tree-phinodes.c (allocate_phi_node): Likewise.
204         (resize_phi_node): Likewise.
205         (reserve_phi_args_for_new_edge): Likewise.
206         (remove_phi_arg_num): Likewise.
208         * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
209         rather than just a gimple.
210         * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
212         * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
213         just a gimple.
214         (create_phi_node): Likewise.
215         * tree-phinodes.h (create_phi_node): Likewise.
217         * trans-mem.c (struct struct tm_log_entry): Replace use of
218         now-removed gimple_vec with a plain vec<gimple>.
220         * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
221         vec<gimple_vec> to a vec< vec<gimple_phi> >.
223         * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
224         gimple_phi.
225         * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
226         "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
227         a gimple_phi.
228         * tree-into-ssa.c (delete_update_ssa): Strengthen local
229         "phis" from a gimple_vec to a vec<gimple_phi>.
231         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
232         gimple_phi in regions where a stmt is known to have code
233         GIMPLE_PHI.
234         * tree-into-ssa.c (mark_use_interesting): Likewise.
236 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
238         Introduce gimple_debug and use it in a few places
240         * coretypes.h (gimple_debug): New typedef.
241         (const_gimple_debug): New typedef.
243         * gimple.h (struct gimple_statement_debug): New subclass of
244         gimple_statement_with_ops, adding the invariant that
245         stmt->code == GIMPLE_DEBUG.
246         (is_a_helper <gimple_statement_debug>::test): New.
248         * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
249         variants, using the gimple printer.
251         * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
252         rather than just a gimple.
253         * tree-inline.c (copy_debug_stmt): Likewise.
255         * tree-inline.h (struct copy_body_data): Strengthen field
256         "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
258         * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
259         rather than just a gimple.
260         (gimple_build_debug_source_bind_stat): Likewise.
261         * gimple.h (gimple_build_debug_bind_stat): Likewise.
262         (gimple_build_debug_source_bind_stat): Likewise.
264         * tree-inline.c (remap_gimple_stmt): Update locals to be a
265         gimple_debug.
266         (maybe_move_debug_stmts_to_successors): Likewise.
267         (copy_debug_stmts): Likewise.
269         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
270         gimple_debug in regions where a stmt is known to have code
271         GIMPLE_DEBUG.
273 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
275         Introduce gimple_label and use it in a few places
277         * coretypes.h (gimple_label): New typedef.
278         (const_gimple_label): New typedef.
280         * gimple.h (struct gimple_statement_label): New subclass of
281         gimple_statement_with_ops, adding the invariant that
282         stmt->code == GIMPLE_LABEL.
283         (is_a_helper <gimple_statement_label>::test): New.
285         * gdbhooks.py (build_pretty_printer): Add gimple_label and its
286         variants, reusing the gimple printer.
288         * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
289         rather than just a gimple.
290         * tree-cfg.c (verify_gimple_label): Likewise.
292         * gimple.c (gimple_build_label): Return a gimple_label rather than
293         just a gimple.
294         * gimple.h (gimple_build_label): Likewise.
296         * gimplify.c (gimplify_case_label_expr): Update local to be a
297         gimple_label.
298         * tree-switch-conversion.c (gen_inbound_check): Likewise.
300         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
301         gimple_label in regions where a stmt is known to have code
302         GIMPLE_LABEL.
303         * tree-cfg.c (verify_gimple_stmt): Likewise.
305 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
307         Introduce gimple_assign and use it in various places
309         * coretypes.h (gimple_assign): New typedef.
310         (const_gimple_assign): New typedef.
312         * gimple.h (struct gimple_statement_assign): New subclass of
313         gimple_statement_with_memory_ops, adding the invariant that
314         stmt->code == GIMPLE_ASSIGN.
315         (is_a_helper <gimple_statement_assign>::test): New.
317         * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
318         variants, using the gimple printer.
320         * gimple-builder.c (build_assign): Return a gimple_assign rather
321         than just a gimple from each of the overloaded variants.
322         (build_type_cast): Likewise.
323         * gimple-builder.h (build_assign): Likewise.
324         (build_type_cast): Likewise.
325         * gimple.c (gimple_build_assign_stat): Likewise.
326         (gimple_build_assign_with_ops): Likewise.
327         * gimple.h (gimple_build_assign_stat): Likewise.
328         (gimple_build_assign_with_ops): Likewise.
330         * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
331         rather than just a "const gimple" (the latter is not a
332         "const_gimple").
333         * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
334         rather than just a gimple.
335         (dump_binary_rhs): Likewise.
336         (dump_ternary_rhs): Likewise.
337         * tree-cfg.c (verify_gimple_assign_unary): Likewise.
338         (verify_gimple_assign_binary): Likewise.
339         (verify_gimple_assign_ternary): Likewise.
340         (verify_gimple_assign_single): Likewise.
341         (verify_gimple_assign): Likewise.
342         * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
343         (try_to_simplify): Likewise.
344         * tree-tailcall.c (process_assignment): Likewise.
345         * tree-vect-generic.c (expand_vector_operation): Likewise.
346         * tree-vrp.c (extract_range_from_cond_expr): Likewise.
347         (extract_range_from_assignment): Likewise.
349         * asan.c (has_stmt_been_instrumented_p): Add checked cast to
350         gimple_assign in regions where a stmt is known to have code
351         GIMPLE_ASSIGN.
352         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
353         * tree-cfg.c (verify_gimple_stmt): Likewise.
354         * tree-ssa-sccvn.c (visit_use): Likewise.
355         * tree-tailcall.c (find_tail_calls): Likewise.
356         * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
358         * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
359         against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
360         a gimple_assign local.
362         * tree-vect-generic.c (expand_vector_condition): Convert local to a
363         gimple_assign, adding a checked cast when extracting from gsi, since
364         this is only called when  underlying stmt has code GIMPLE_ASSIGN.
365         (optimize_vector_constructor): Likewise.
366         (lower_vec_perm): Likewise.
367         (expand_vector_operations_1): Convert local to a gimple_assign,
368         introducing a dyn_cast.
370 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
372         Introduce gimple_cond and use it in various places
374         * coretypes.h (gimple_cond): New typedef.
375         (const_gimple_cond): Likewise.
377         * gimple.h (struct gimple_statement_cond): New subclass of
378         gimple_statement_with_ops, adding the invariant that
379         stmt->code == GIMPLE_COND.
380         (is_a_helper <gimple_statement_cond>::test): New.
381         (gimple_build_cond): Return a gimple_cond, rather than just
382         a gimple.
383         (gimple_build_cond_from_tree): Likewise.
385         * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
386         variants, using the gimple printer.
388         * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
389         than just a gimple.
390         * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
391         (gimple_cond_true_p): Likewise.
392         (gimple_cond_false_p): Likewise.
393         (gimple_cond_set_condition): Likewise.
394         * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
395         * gimple-fold.c (fold_gimple_cond): Likewise.
396         * gimple-pretty-print.c (dump_gimple_cond): Likewise.
397         * tree-ssa-dom.c (canonicalize_comparison): Likewise.
398         * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
399         * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
400         (recognize_bits_test): Likewise.
401         * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
402         (thread_around_empty_blocks): Likewise.
403         (thread_through_normal_block): Likewise.
404         (thread_across_edge): Likewise.
405         * tree-ssa-threadedge.h (thread_across_edge): Likewise.
406         * tree-vrp.c (range_fits_type_p): Likewise.
408         * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
409         gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
410         * gimple-fold.c (fold_stmt_1): Likewise.
411         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
412         * tree-ssa-dom.c (optimize_stmt): Likewise.
413         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
414         * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
415         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
416         Likewise.
417         * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
419         * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
420         gimple_cond.
421         * tree-vrp.c (identify_jump_threads): Likewise.
423         * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
424         just a gimple.
425         (gimple_build_cond_from_tree): Likewise.
427         * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
428         field "m_dummy_cond" from a plain gimple to a gimple_cond.
430         * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
431         inner_stmt and outer_stmt so that inner_cond and outer_cond can be
432         of type gimple_cond once we know that we have code == GIMPLE_COND.
433         * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
434         "last" so that stmt can be of type gimple_cond.
436 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
438         Introduce gimple_bind and use it for accessors.
440         * coretypes.h (gimple_bind): New typedef.
441         (const_gimple_bind): New typedef.
443         * gdbhooks.py (build_pretty_printer): Add gimple_bind
444         and its variants, using the gimple printer.
446         * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
447         require a gimple_bind rather than just a gimple.
449         * gimple.c (gimple_build_bind): Return a gimple_bind rather than
450         just a gimple.
451         * gimple.h (gimple_build_bind): Likewise.
453         * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
455         * gimple.h (gimple_bind_vars): Update type-signature to
456         require a gimple_bind rather than just a gimple, removing
457         as_a and hence run-time check.
458         (gimple_bind_set_vars): Likewise.
459         (gimple_bind_append_vars): Likewise.
460         (gimple_bind_body_ptr): Likewise.
461         (gimple_bind_body): Likewise.
462         (gimple_bind_set_body): Likewise.
463         (gimple_bind_add_stmt): Likewise.
464         (gimple_bind_add_seq): Likewise.
465         (gimple_bind_block): Likewise.
466         (gimple_bind_set_block): Likewise.
467         * gimplify.c (gimple_push_bind_expr): Likewise.
468         (gimple_current_bind_expr): Likewise.
469         * tree-inline.c (copy_gimple_bind): Likewise.
471         * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
472         rather than a plain gimple.
473         (gimplify_body): Likewise.
474         (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
475         a vec<gimple>.
477         * gimplify.c (struct gimplify_ctx): Strengthen field
478         "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
479         (gimple_bind_expr_stack): Likewise for type of returned value.
481         * gimplify.c (gimplify_body): Strengthen various types from gimple
482         to gimple_bind, including the return type.
484         * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
485         so that local "scope" can be of type gimple_bind once we've reached
486         the region where it must be of code GIMPLE_BIND.
488         * gimple-low.c (lower_gimple_bind): Add checked cast to
489         gimple_bind, since both callers (lower_function_body and
490         lower_stmt) have checked the code for us.
492         * gimple.c (gimple_copy): Add checked cast to gimple_bind in
493         region guarded by check for code GIMPLE_BIND.
494         * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
495         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
496         * gimple-walk.c (walk_gimple_stmt): Likewise.
497         * omp-low.c (scan_omp_1_stmt): Likewise.
498         (lower_omp_1): Likewise.
499         (lower_omp_for): Likewise.
500         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
501         (do_warn_unused_result): Likewise.
502         * tree-inline.c (remap_gimple_stmt): Likewise.
503         (estimate_num_insns): Likewise.
504         * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
506         * gimplify.c (gimplify_bind_expr): Update local(s) to be a
507         gimple_bind rather than just a gimple.
508         (gimplify_function_tree): Likewise.
509         * omp-low.c (lower_omp_sections): Likewise.
510         (lower_omp_single): Likewise.
511         (lower_omp_master): Likewise.
512         (lower_omp_taskgroup): Likewise.
513         (lower_omp_ordered): Likewise.
514         (lower_omp_critical): Likewise.
515         (lower_omp_taskreg): Likewise.
516         (lower_omp_teams): Likewise.
517         * omp-low.c (lower_omp_for): Likewise; use
518         gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
519         (lower_omp_target): Likewise.
520         * tree-nested.c (finalize_nesting_tree_1): Likewise.
522         * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
523         * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
525 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
527         Introduce gimple_switch and use it in various places
529         * gimple.h (gimple_statement_switch): New subclass of
530         gimple_statement_with_ops, adding the invariant that
531         stmt->code == GIMPLE_SWITCH.
532         (is_a_helper <gimple_statement_switch>::test (gimple)): New.
534         * coretypes.h (gimple_switch): New typedef
535         (const_gimple_switch): Likewise.
537         * gdbhooks.py (build_pretty_printer): Add gimple_switch
538         and its variants, using the gimple printer.
540         * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
541         rather than just a gimple.
542         (gimple_build_switch): Likewise.
543         * gimple.h (gimple_build_switch_nlabels): Likewise.
544         (gimple_build_switch): Likewise.
546         * gimple.h (gimple_switch_num_labels): Update type-signature to
547         require a gimple_switch rather than just a gimple.
548         (gimple_switch_set_num_labels): Likewise.
549         (gimple_switch_set_index): Likewise.
550         (gimple_switch_label): Likewise.
551         (gimple_switch_set_label): Likewise.
552         (gimple_switch_default_label): Likewise.
553         (gimple_switch_set_default_label): Likewise.
554         * expr.h (expand_case): Likewise.
555         * gimple-pretty-print.c (dump_gimple_call): Likewise.
556         * stmt.c (compute_cases_per_edge): Likewise.
557         (expand_case): Likewise.
558         * tree-cfg.h (group_case_labels_stmt): Likewise.
559         * tree-cfg.c (make_gimple_switch_edges): Likewise.
560         (find_taken_edge_switch_expr) Likewise.
561         (find_case_label_for_value) Likewise.
562         (get_cases_for_edge): Likewise.
563         (group_case_labels_stmt): Likewise.
564         (verify_gimple_switch): Likewise.
565         * tree-eh.c (verify_norecord_switch_expr): Likewise.
566         * tree-eh.c (lower_eh_constructs_2): Likewise.
567         * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
568         * tree-ssa-dom.c (record_edge_info): Likewise.
569         * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
570         (simplify_gimple_switch): Likewise.
571         * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
572         (collect_switch_conv_info): Likewise.
573         (build_constructors): Likewise.
574         (array_value_type): Likewise.
575         (build_one_array): Likewise.
576         (build_arrays): Likewise.
577         (gen_inbound_check): Likewise.
578         * tree-vrp.c (find_switch_asserts): Likewise.
579         (find_case_label_range): Likewise.
580         (find_case_label_ranges): Likewise.
581         (vrp_visit_switch_stmt): Likewise.
582         (simplify_switch_using_ranges): Likewise.
584         * tree-vrp.c (switch_update): Strengthen field "stmt" from being
585         merely a gimple to being a gimple_switch.
587         * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
588         gimple_switch in regions where the stmt code has been tested as
589         GIMPLE_SWITCH.
590         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
591         * tree-cfg.c (make_edges): Likewise.
592         (end_recording_case_labels): Likewise.
593         (cleanup_dead_labels): Likewise.
594         (cleanup_dead_labels): Likewise.
595         (group_case_labels): Likewise.
596         (find_taken_edge): Likewise.
597         (find_case_label_for_value): Likewise.
598         (verify_gimple_stmt): Likewise.
599         (gimple_verify_flow_info): Likewise.
600         (gimple_redirect_edge_and_branch): Likewise.
601         * tree-inline.c (estimate_num_insns): Likewise.
602         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
603         * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
604         * tree-switch-conversion.c (do_switchconv): Likewise.
605         * tree-vrp.c  (find_assert_locations_1): Likewise.
606         (vrp_visit_stmt): Likewise.
607         (simplify_stmt_using_ranges): Likewise.
609         * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
610         Introduce local "lastg" as a generic gimple, so that local "last"
611         can be of type gimple_switch once lastg's code has been verified.
613         * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
614         the GIMPLE_SWITCH case.
616         * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
617         argument, since the caller (find_taken_edge) has checked that
618         last_stmt is a switch.
620 Copyright (C) 2014 Free Software Foundation, Inc.
622 Copying and distribution of this file, with or without modification,
623 are permitted in any medium without royalty provided the copyright
624 notice and this notice are preserved.