Make gimple_phi_arg_set_location require a gimple_phi
[official-gcc.git] / gcc / ChangeLog.gimple-classes
blobf7d2c73e37dbed51b552ca6582c1965611bb9d60
1 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
3         Make gimple_phi_arg_set_location require a gimple_phi
5         * gimple.h (gimple_phi_arg_set_location): Require a gimple_phi
6         rather than a plain gimple.
8 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
10         Make add_phi_arg require a gimple_phi
12         * tree-phinodes.h (add_phi_arg): Require a gimple_phi rather than
13         a plain gimple.
14         * tree-phinodes.c (add_phi_arg): Likewise.
16         * gimple-ssa-strength-reduction.c (create_phi_basis): Strengthen
17         local "phi" from plain gimple to gimple_phi.
19         * graphite-scop-detection.c (canonicalize_loop_closed_ssa):
20         Likewise for "close_phi".
22         * ipa-split.c (split_function): Convert "psi" to
23         gimple_phi_iterator.
25         * omp-low.c (expand_omp_for_static_nochunk): Introduce
26         gimple_phi_iterator gpi, using it to strengthen "phi" to be a
27         gimple_phi.
28         (expand_omp_for_static_chunk): Likewise.
30         * tree-cfg.c (gimple_duplicate_bb): Make topmost "gsi" decl more
31         tightly-scoped, and eliminate decls "phis", "phi", "stmt", "copy"
32         in favor of more tightly-scoped gimple_phi_iterator gpi and
33         gimple_phi decls "phi" and "copy", and gimple decls "stmt" and
34         "copy".
36         * tree-parloops.c (create_parallel_loop): Introduce
37         gimple_phi_iterator gpi, using it to strengthen "phi" to be a
38         gimple_phi.
40         * tree-ssa-loop-im.c (execute_sm_if_changed): Likewise.
42         * tree-ssa-loop-manip.c (create_iv): Split out new gimple_phi
43         local "phi" from "stmt", and convert the latter into being a
44         gimple_assign.
46         * tree-ssa-pre.c (insert_into_preds_of_block): Strengthen local
47         "phi" to be a gimple_phi.
49         * tree-ssa-tail-merge.c (vop_phi): Require a gimple_phi rather
50         than a plain gimple.
51         (replace_block_by): Strengthen local "bb2_phi" to be a gimple_phi.
53         * tree-tailcall.c (add_successor_phi_arg): Use gsi.phi when
54         invoking add_phi_arg.
55         (eliminate_tail_call): Introduce gimple_phi_iterator gpi, using it
56         to strengthen "phi" to be a gimple_phi.
57         (create_tailcall_accumulator): Strengthen local "phi" to be a
58         gimple_phi.
59         (tree_optimize_tail_calls_1): Likewise.
61         * tree-vect-data-refs.c (vect_setup_realignment): Strengthen
62         local "phi_stmt" to be a gimple_phi.
64         * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg):
65         Strengthen "gsi", "gsi_orig", "gsi_new" to be
66         gimple_phi_iterators, and "phi" "orig_phi", "new_phi" to be
67         gimple_phi instances.
68         (slpeel_tree_peel_loop_to_edge): Strengthen local "new_phi" to be
69         a gimple_phi.
71         * tree-vect-loop.c (get_initial_def_for_induction): Likewise for
72         "induction_phi".
73         (vect_create_epilog_for_reduction): Add checked casts to
74         gimple_phi; strengthen local "outer_phi" to gimple_phi and
75         "new_vec_stmt" to gimple_assign.
76         (vect_finalize_reduction): Strengthen local "vect_phi" to
77         gimple_phi.
78         (vectorizable_reduction): Likewise for "new_phi".
80         * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise.
81         (vectorizable_load): Likewise for "phi".
83 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
85         Make gimple_phi_arg_def_ptr and gimple_phi_arg_has_location require a gimple_phi
87         * gimple.h (gimple_phi_arg_def_ptr): Require a gimple_phi rather
88         than a plain gimple.
89         (gimple_phi_arg_has_location): Likewise.
91         * gimple-streamer-in.c (input_phi): Return a gimple_phi rather
92         than a plain gimple.
93         * gimple-streamer-out.c (output_phi): Require a gimple_phi rather
94         than a plain gimple.
95         (output_bb): Convert iteration to a gimple_phi_iterator, and local
96         "phi" to gimple_phi.
98         * omp-low.c (expand_omp_for_static_chunk): Convert iterator "psi"
99         to a gimple_phi_iterator; convert locals "phi" and "nphi" to be
100         gimple_phi.
102         * tree-cfg.c (gimple_duplicate_sese_tail): Likewise for "psi" and
103         "phi".
104         (move_block_to_fn): Introduce new gimple_phi_iterator "psi", using
105         it in place of "gsi" where necessary.  Convert "phi" to be a
106         gimple_phi.
108         * tree-cfgcleanup.c (remove_forwarder_block): Likewise.
110         * tree-vect-loop-manip.c (vect_loop_versioning): Convert "gsi" to
111         a gimple_phi_iterator, and "orig_phi" and "new_phi" to be
112         gimple_phi.
114         * tree.c (find_decls_types_in_node): Introduce new
115         gimple_phi_iterator "psi", using it in place of "si" where
116         necessary.  Convert "phi" to be a gimple_phi.
118 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
120         omp-low.c: Use more concrete types of gimple statement for various locals
122         * omp-low.c (finalize_task_copyfn): Strengthen local "bind" from
123         plain gimple to gimple_bind.
124         (lower_rec_input_clauses): Strengthen local "g" from
125         plain gimple to gimple_assign.
126         (lower_lastprivate_clauses): Likewise for "stmt" to gimple_cond
127         and "g" to gimple_call.
128         (expand_omp_for_init_vars): Likewise, for two decls of "stmt" to
129         gimple_assign.
130         (expand_omp_atomic_pipeline): Likewise for one decl of "stmt".
131         (expand_omp_atomic_mutex): Likewise.
132         (lower_omp_master): Likewise for "x" to gimple_call.
133         (lower_omp_ordered): Likewise.
135 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
137         tree-parloops.c: Use gimple_phi in various places
139         * tree-parloops.c (reduction_info::keep_res): Strengthen field
140         from plain gimple to gimple_phi.
141         (transform_to_exit_first_loop): Strengthen locals "phi", "nphi"
142         to gimple_phi.  Eliminate early decl of gimple_stmt_iterator gsi
143         in favor of more tightly scoped gimple_phi_iterators, and a final
144         later decl as a gimple_stmt_iterator.
146 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
148         Introduce gimple_omp_sections
150         * coretypes.h (gimple_omp_sections): New typedef.
151         (const_gimple_omp_sections): New typedef.
153         * gimple-pretty-print.c (dump_gimple_omp_sections): Require a
154         gimple_omp_sections rather than a plain gimple.
155         (pp_gimple_stmt_1): Add checked cast to gimple_omp_sections within
156         GIMPLE_OMP_SECTIONS case of switch statement.
158         * gimple.c (gimple_build_omp_sections): Return a
159         gimple_omp_sections rather than a plain gimple.
161         * gimple.h (gimple_build_omp_sections): Return a
162         gimple_omp_sections rather than a plain gimple.
164         * omp-low.c (scan_omp_sections): Require a gimple_omp_sections
165         rather than a plain gimple.
166         (scan_omp_1_stmt): Add checked cast to gimple_omp_sections within
167         GIMPLE_OMP_SECTIONS case of switch statement.
168         (expand_omp_sections): Strengthen local "sections_stmt" from gimple
169         to gimple_omp_sections.
170         (lower_omp_sections): Likewise for "stmt".
172 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
174         Introduce gimple_omp_teams
176         * coretypes.h (gimple_omp_teams): New typedef.
177         (const_gimple_omp_teams): New typedef.
179         * gimple.h (gimple_build_omp_teams): Return a gimple_omp_teams
180         rather than a plain gimple.
181         (gimple_omp_teams_set_clauses): Require a gimple_omp_teams rather
182         than a plain gimple.
184         * gimple-pretty-print.c (dump_gimple_omp_teams): Require a
185         gimple_omp_teams rather than a plain gimple.
186         (pp_gimple_stmt_1): Add checked cast to gimple_omp_teams within
187         GIMPLE_OMP_TEAMS case of switch statement.
189         * gimple.c (gimple_build_omp_teams): Return a gimple_omp_teams
190         rather than a plain gimple.
192         * omp-low.c (scan_omp_teams): Likewise.
193         (scan_omp_1_stmt): Add checked cast to gimple_omp_teams within
194         GIMPLE_OMP_TEAMS case of switch statement.
195         (lower_omp_teams): Strengthen local "teams_stmt" from gimple to
196         gimple_omp_teams.
198 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
200         Introduce gimple_omp_target
202         * coretypes.h (gimple_omp_target): New typedef.
203         (const_gimple_omp_target): New typedef.
205         * gimple.h (gimple_build_omp_target): Return a gimple_omp_target
206         rather than a plain gimple.
207         (gimple_omp_target_set_clauses): Require a gimple_omp_target
208         rather than a plain gimple.
209         (gimple_omp_target_set_kind): Likewise.
210         (gimple_omp_target_child_fn_ptr): Likewise.
211         (gimple_omp_target_set_child_fn): Likewise.
212         (gimple_omp_target_data_arg_ptr): Likewise.
213         (gimple_omp_target_set_data_arg): Likewise.
214         (gimple_omp_target_child_fn): Require a const_gimple_omp_target
215         rather than a plain const_gimple.
216         (gimple_omp_target_data_arg): Likewise.
218         * gimple-pretty-print.c (dump_gimple_omp_target): Require a
219         gimple_omp_target rather than a plain gimple.
220         (pp_gimple_stmt_1): Add checked cast to gimple_omp_target within
221         GIMPLE_OMP_TARGET case of switch statement.
223         * gimple.c (gimple_build_omp_target): Return a gimple_omp_target
224         rather than a plain gimple.
226         * gimplify.c (gimplify_omp_target_update): Strengthen local "stmt"
227         from gimple to gimple_omp_target.
229         * omp-low.c (scan_omp_target): Require a gimple_omp_target rather
230         than a plain gimple.
231         (scan_omp_1_stmt): Add checked cast to gimple_omp_target within
232         GIMPLE_OMP_TARGET case of switch statement.
233         (expand_omp_target): Strengthen local "entry_stmt" from gimple to
234         gimple_omp_target.
235         (lower_omp_target): Likewise for "stmt".
237         * tree-nested.c (convert_nonlocal_reference_stmt): Add checked
238         cast to gimple_omp_target.
239         (convert_local_reference_stmt): Likewise.
240         (convert_gimple_call): Likewise.
242 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
244         Introduce gimple_omp_single
246         * coretypes.h (gimple_omp_single): New typedef.
247         (const_gimple_omp_single): New typedef.
249         * gimple.h (gimple_build_omp_single): Return a gimple_omp_single
250         rather than a plain gimple.
251         (gimple_omp_single_set_clauses): Require a gimple_omp_single
252         rather than a plain gimple.
254         * gimple-pretty-print.c (dump_gimple_omp_single): Require a
255         gimple_omp_single rather than a plain gimple.
256         (pp_gimple_stmt_1): Add checked cast to gimple_omp_single within
257         GIMPLE_OMP_SINGLE case of switch statement.
259         * gimple.c (gimple_build_omp_single): Return a gimple_omp_single
260         rather than a plain gimple.
262         * omp-low.c (scan_omp_single): Require a gimple_omp_single rather
263         than a plain gimple.
264         (scan_omp_1_stmt): Add checked cast to gimple_omp_single within
265         GIMPLE_OMP_SINGLE case of switch statement.
266         (lower_omp_single_simple): Require a gimple_omp_single rather
267         than a plain gimple.
268         (lower_omp_single_copy): Likewise.
269         (lower_omp_single): Strengthen local "single_stmt" from gimple to
270         gimple_omp_single.
272 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
274         Introduce gimple_omp_task
276         * coretypes.h (gimple_omp_task): New typedef.
277         (const_gimple_omp_task): New typedef.
279         * gimple.h (gimple_build_omp_task): Return a gimple_omp_task
280         rather than a plain gimple.
282         * gimple-pretty-print.c (dump_gimple_omp_task): Require a
283         gimple_omp_task rather than a plain gimple.
284         (pp_gimple_stmt_1): Add checked cast to gimple_omp_task within
285         GIMPLE_OMP_TASK case of switch statement.
287         * gimple.c (gimple_build_omp_task): Return a gimple_omp_task
288         rather than a plain gimple.
290         * omp-low.c (finalize_task_copyfn): Require a gimple_omp_task
291         rather than a plain gimple.
292         (delete_omp_context): Add checked cast to gimple_omp_task.
293         (scan_omp_task): Strengthen local "stmt" from gimple to
294         gimple_omp_task.
295         (expand_task_call): Require a gimple_omp_task rather than a plain
296         gimple.
297         (expand_omp_taskreg): Add checked cast to gimple_omp_task.
298         (create_task_copyfn): Require a gimple_omp_task rather than a
299         plain gimple.
300         (lower_omp_taskreg): Add checked cast to gimple_omp_task.
302 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
304         tree-cfg.c: Make verify_gimple_call require a gimple_call
306         * tree-cfg.c (verify_gimple_call): Require a gimple_call rather
307         than a plain gimple.
308         (verify_gimple_stmt): Add checked cast to gimple_call within
309         GIMPLE_CALL case of switch statement.
311 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
313         Introduce gimple_omp_parallel
315         * coretypes.h (gimple_omp_parallel): New typedef.
316         (const_gimple_omp_parallel): New typedef.
318         * cgraphbuild.c (build_cgraph_edges): Convert check of code
319         against GIMPLE_OMP_PARALLEL to a dyn_cast <gimple_omp_parallel>
320         and new local.
322         * gimple-pretty-print.c (dump_gimple_omp_parallel): Require a
323         gimple_omp_parallel rather than a plain gimple.
324         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_parallel
325         within GIMPLE_OMP_PARALLEL case of switch statement.
327         * gimple-walk.c (walk_gimple_op): Likewise, introducing a local.
329         * gimple.c (gimple_build_omp_parallel): Return a
330         gimple_omp_parallel rather than a plain gimple.
331         (gimple_copy): Add checked casts to gimple_omp_parallel within
332         GIMPLE_OMP_PARALLEL case of switch statement, introducing locals.
334         * gimple.h (gimple_build_omp_parallel): Return a
335         gimple_omp_parallel rather than a plain gimple.
336         (gimple_omp_parallel_clauses_ptr): Require a gimple_omp_parallel
337         rather than a plain gimple.
338         (gimple_omp_parallel_set_clauses): Likewise.
339         (gimple_omp_parallel_data_arg_ptr): Likewise.
340         (gimple_omp_parallel_set_data_arg): Likewise.
341         (gimple_omp_parallel_child_fn_ptr): Likewise.
342         (gimple_omp_parallel_set_child_fn): Likewise.
343         (gimple_omp_parallel_child_fn): Require a
344         const_gimple_omp_parallel rather than a plain const_gimple.
345         (gimple_omp_parallel_data_arg): Likewise.
347         * omp-low.c (scan_omp_parallel): Strengthen local "stmt" from
348         gimple to gimple_omp_parallel.
349         (expand_parallel_call): Require a gimple_omp_parallel for
350         "entry_stmt" rather than a plain gimple.
351         (remove_exit_barrier):  Strengthen local "parallel_stmt" from
352         gimple to gimple_omp_parallel.
353         (expand_omp_taskreg): Add checked casts to gimple_omp_parallel.
355         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
356         gimple_omp_parallel within GIMPLE_OMP_PARALLEL case of switch
357         statement, introducing local.
359 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
361         Introduce gimple_omp_for
363         * coretypes.h (gimple_omp_for): New.
364         (const_gimple_omp_for): New.
366         * gimple.h (gimple_build_omp_for): Return a gimple_omp_for rather
367         than a plain gimple.
368         (gimple_omp_for_set_kind): Require a gimple_omp_for rather than a
369         plain gimple.
370         (gimple_omp_for_set_combined_p): Likewise.
371         (gimple_omp_for_set_combined_into_p): Likewise.
373         * gimple-pretty-print.c (dump_gimple_omp_for): Require a
374         gimple_omp_for rather than a plain gimple.
375         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_for in
376         GIMPLE_OMP_FOR case of switch statement.
378         * gimple.c (gimple_build_omp_for): Return a gimple_omp_for rather
379         than a plain gimple.
380         (gimple_copy): Add a checked cast to gimple_omp_for and a new local.
382         * gimplify.c (gimplify_omp_for): Strengthen local "gfor" from
383         gimple to gimple_omp_for.
385         * omp-low.c (omp_for_data::for_stmt): Strengthen field from gimple
386         to gimple_omp_for.
387         (extract_omp_for_data): Require a gimple_omp_for rather than a
388         plain gimple.
389         (workshare_safe_to_combine_p): Add a checked cast to
390         gimple_omp_for.
391         (get_ws_args_for): Convert check of code against GIMPLE_OMP_FOR
392         with a dyn_cast<gimple_omp_for> and a new local.
393         (scan_omp_parallel): Add a checked cast to gimple_omp_for and a
394         new local.
395         (scan_omp_for): Require a gimple_omp_for rather than a plain
396         gimple.
397         (scan_omp_1_stmt): Add a checked cast to gimple_omp_for in
398         GIMPLE_OMP_FOR case of switch statement.
399         (expand_omp_for): Add a checked cast to gimple_omp_for.
400         (lower_omp_for): Strengthen local "stmt" from gimple to
401         gimple_omp_for.
403         * tree-nested.c (walk_gimple_omp_for): Require a gimple_omp_for
404         rather than a plain gimple.
405         (convert_nonlocal_reference_stmt): Add a checked cast to
406         gimple_omp_for in GIMPLE_OMP_FOR case of switch statement.
407         (convert_local_reference_stmt): Likewise.
409         * tree-parloops.c (create_parallel_loop): Strengthen local
410         "for_stmt" from gimple to gimple_omp_for.
412 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
414         Introduce gimple_omp_critical
416         * coretypes.h (gimple_omp_critical): New typedef.
417         (const_gimple_omp_critical): New typedef.
419         * gimple-pretty-print.c (dump_gimple_omp_critical): Require a
420         gimple_omp_critical rather than a plain gimple.
421         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_critical
422         within GIMPLE_OMP_CRITICAL case of switch statement.
424         * gimple-walk.c (walk_gimple_op): Likewise.
426         * gimple.c (gimple_build_omp_critical): Return a gimple_omp_critical
427         rather than a plain gimple.
428         (gimple_copy): Add checked casts to gimple_omp_critical
429         within GIMPLE_OMP_CRITICAL case of switch statement.
431         * gimple.h (gimple_debug): Likewise.
432         (gimple_build_omp_critical): Return a gimple_omp_critical rather
433         than a plain gimple.
434         (gimple_omp_critical_name): Require a const_gimple_omp_critical
435         rather than a plain const_gimple.
436         (gimple_omp_critical_name_ptr): Require a gimple_omp_critical
437         rather than a plain gimple.
438         (gimple_omp_critical_set_name): Likewise.
440         * omp-low.c (check_omp_nesting_restrictions): Add a checked cast
441         to gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
442         statement, introducing a new local "other_crit" for type-safety.
443         (lower_omp_critical): Strengthen local "stmt" to
444         gimple_omp_critical.
446         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
447         gimple_omp_critical within GIMPLE_OMP_CRITICAL case of switch
448         statement.
450 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
452         Introduce gimple_omp_continue
454         * coretypes.h (gimple_omp_continue): New typedef.
455         (const_gimple_omp_continue): New typedef.
457         * gimple.h (gimple_build_omp_continue): Return a
458         gimple_omp_continue rather than a plain gimple.
459         (gimple_omp_continue_control_def): Require a
460         const_gimple_omp_continue rather than a plain const_gimple.
461         (gimple_omp_continue_control_use): Likewise.
462         (gimple_omp_continue_control_def_ptr): Require a gimple_omp_continue
463         rather than a plain gimple.
464         (gimple_omp_continue_set_control_def): Likewise.
465         (gimple_omp_continue_control_use_ptr): Likewise.
466         (gimple_omp_continue_set_control_use): Likewise.
468         * gimple-pretty-print.c (dump_gimple_omp_continue): Require a
469         gimple_omp_continue rather than a plain gimple.
470         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_continue
471         within GIMPLE_OMP_CONTINUE case of switch statement.
473         * gimple-walk.c (walk_gimple_op): Likewise, adding a new local.
475         * gimple.c (gimple_build_omp_continue): Return a
476         gimple_omp_continue rather than a plain gimple.
478         * omp-low.c (gimple_build_cond_empty): Return a gimple_cond
479         rather than a plain gimple.
480         (expand_omp_for_generic): Split local "stmt" into "assign_stmt",
481         "cont_stmt", "cond_stmt", "call_stmt" of types gimple_assign,
482         gimple_omp_continue, gimple_cond, gimple_call respectively.
483         (expand_omp_for_static_nochunk): Likewise, splitting into two
484         "cond_stmt" decls. "assign_stmt", "cont_stmt"
485         (expand_omp_for_static_chunk): Likewise, splitting into
486         "cond_stmt", "assign_stmt", "cont_stmt".
487         (expand_omp_sections): Strengthen local "cont" from gimple to
488         gimple_omp_continue.
490 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
492         Introduce gimple_omp_atomic_store
494         * coretypes.h (gimple_omp_atomic_store): New typedef.
495         (const_gimple_omp_atomic_store): New typedef.
497         * gimple-pretty-print.c (dump_gimple_omp_atomic_store): Require
498         a gimple_omp_atomic_store rather than a plain gimple.
499         (pp_gimple_stmt_1): Add checked cast to gimple_omp_atomic_store
500         within GIMPLE_OMP_ATOMIC_STORE case of switch statement.
501         * gimple-walk.c (walk_gimple_op): Likewise.
503         * gimple.c (gimple_build_omp_atomic_store): Return a
504         gimple_omp_atomic_store rather than a plain gimple.
506         * gimple.h (gimple_build_omp_atomic_store): Return a
507         gimple_omp_atomic_store rather than a plain gimple.
508         (gimple_omp_atomic_store_set_val): Require a gimple_omp_atomic_store
509         rather than a plain gimple.
510         (gimple_omp_atomic_store_val_ptr): Likewise.
511         (gimple_omp_atomic_store_val): Require a
512         const_gimple_omp_atomic_store rather than a plain const_gimple.
514         * gimplify.c (gimplify_omp_atomic): Strengthen locals "loadstmt" and
515         "storestmt" from gimple to gimple_omp_atomic_load loadstmt and
516         gimple_omp_atomic_store storestmt respectively.
518         * omp-low.c (expand_omp_atomic): Strengthen local "store" from
519         gimple to gimple_omp_atomic_store.
521 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
523         Introduce gimple_omp_atomic_load
525         * coretypes.h (gimple_omp_atomic_load): New typedef.
526         (const_gimple_omp_atomic_load): New typedef.
528         * gimple-pretty-print.c (dump_gimple_omp_atomic_load): Require a
529         gimple_omp_atomic_load rather than a plain gimple.
530         (pp_gimple_stmt_1): Add a checked cast to gimple_omp_atomic_load
531         within GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
533         * gimple-walk.c (walk_gimple_op): Likewise, introducing a new local.
535         * gimple.c (gimple_build_omp_atomic_load): Return a
536         gimple_omp_atomic_load rather than a plain gimple.
538         * gimple.h (gimple_build_omp_atomic_load): Return a
539         gimple_omp_atomic_load rather than a plain gimple.
540         (gimple_omp_atomic_load_set_lhs): Require a
541         gimple_omp_atomic_load rather than a plain gimple.
542         (gimple_omp_atomic_load_lhs_ptr): Likewise.
543         (gimple_omp_atomic_load_set_rhs): Likewise.
544         (gimple_omp_atomic_load_rhs_ptr): Likewise.
545         (gimple_omp_atomic_load_lhs): Require a
546         const_gimple_omp_atomic_load rather than a plain const_gimple.
547         (gimple_omp_atomic_load_rhs): Likewise.
549         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
550         to gimple_omp_atomic_load within GIMPLE_OMP_ATOMIC_LOAD case of
551         switch statement.
553         * omp-low.c (expand_omp_atomic): Strengthen type of local "load"
554         from gimple to gimple_omp_atomic_load.
555         (lower_omp_1): Add a checked cast to gimple_omp_atomic_load within
556         GIMPLE_OMP_ATOMIC_LOAD case of switch statement.
558 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
560         Use more concrete types for various gimple statements
562         * cgraphunit.c (thunk_adjust): Strengthen local "stmt" from gimple
563         to gimple_assign.
565         * gimple-ssa-isolate-paths.c
566         (insert_trap_and_remove_trailing_statements): Strengthen local
567         "new_stmt" from gimple to gimple_call.
569         * gimple-ssa-strength-reduction.c (replace_mult_candidate):
570         Strengthen local "copy_stmt" from gimple to gimple_assign.
571         (create_add_on_incoming_edge): Likewise, for "new_stmt".
572         (insert_initializers): Likewise, for "init_stmt".
573         (introduce_cast_before_cand): Likewise, for "cast_stmt".
574         (replace_one_candidate): Likewise, for "copy_stmt" and
575         "cast_stmt".
577         * gimplify.c (build_stack_save_restore): Require gimple_calls
578         rather than plain gimples.
579         (gimplify_bind_expr): Strengthen locals "stack_save" and
580         "stack_restore" from gimple to gimple_call.  Strengthen "gs"
581         to gimple_try.
582         (gimplify_switch_expr): Strengthen local "gimple_switch" from
583         gimple to gimple_switch, and "new_default" to gimple_label.
584         (gimplify_cond_expr): Strengthen local "gimple_cond" from gimple
585         to gimple_cond.
586         (gimplify_init_constructor): Strengthen local "init" from gimple
587         to gimple_assign.
588         (gimplify_cleanup_point_expr): Strengthen local "gtry" from gimple
589         to gimple_try.
590         (gimple_push_cleanup): Strengthen locals "ffalse" and "ftrue" from
591         gimple to gimple_assign.
593         * tree-eh.c (do_goto_redirection): Strengthen local to gimple_goto.
594         (emit_post_landing_pad): Strengthen local to gimple_label.
596         * tree-outof-ssa.c (insert_backedge_copies): Strengthen local
597         "stmt" from gimple to gimple_assign.
599         * tree-parloops.c (take_address_of): Likewise.
601         * tree-predcom.c (replace_ref_with): Likewise, for "new_stmt".
602         (initialize_root_vars_lm): Likewise, for "init_stmt".
603         (reassociate_to_the_same_stmt): Likewise, for "new_stmt" and "tmp_stmt".
605         * tree-profile.c (gimple_gen_edge_profiler): Likewise, for "stmt1",
606         "stmt2", "stmt3".
607         (gimple_gen_ic_profiler): Likewise.
608         (gimple_gen_ic_func_profiler): Strengthen local "stmt1" from
609         gimple to gimple_call, and "stmt2" to gimple_assign.
611         * tree-scalar-evolution.c (scev_const_prop): Strengthen local
612         "ass" from gimple to gimple_assign.
614         * tree-sra.c (build_ref_for_offset): Likewise for "stmt".
615         (generate_subtree_copies): Likewise; also strengthen "ds" to
616         gimple_debug.
617         (init_subtree_with_zero): Likewise.
618         (sra_modify_expr): Likewise.
619         (load_assign_lhs_subreplacements): Likewise.
620         (sra_modify_assign): Strengthen "ds" to gimple_debug.
621         (sra_ipa_reset_debug_stmts): Likewise for "def_temp".
623         * tree-ssa-ccp.c (insert_clobber_before_stack_restore):
624         Strengthen local "clobber_stmt" from gimple to gimple_assign.
626         * tree-ssa-dce.c (remove_dead_stmt): Strengthen "note" to
627         gimple_debug.
629         * tree-ssa-dom.c (record_equivalences_from_stmt): Strengthen
630         local "new_stmt" from gimple to gimple_assign.
631         (optimize_stmt): Likewise.
633         * tree-ssa-forwprop.c (simplify_bitwise_binary): Likewise for
634         4 declarations of "newop".
635         (simplify_rotate): Likewise for "g".
637         * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise for 3 locals.
638         (rewrite_bittest): Likewise for "stmt" and "stmt2".
639         (move_computations_dom_walker::before_dom_children): Likewise for
640         "new_stmt".
641         (execute_sm): Likewise for "load" and "store".
643         * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts):
644         Strengthen local "stmt" from gimple to gimple_call.
645         (unloop_loops): Likewise.
647         * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Strengthen
648         local "ass" from gimple to gimple_assign.
649         (remove_unused_ivs): Strengthen "def_temp" to gimple_debug.
651         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Strengthen local "stmt"
652         from gimple to gimple_assign.
654         * tree-ssa-loop-prefetch.c (issue_prefetch_ref): Strengthen local
655         "prefetch" from gimple to gimple_call.
657         * tree-ssa-math-opts.c (insert_reciprocals): Strengthen local
658         "new_stmt" from gimple to gimple_assign.
659         (powi_as_mults_1): Likewise for "mult_stmt".
660         (powi_as_mults): Likewise for "div_stmt".
661         (build_and_insert_binop): Likewise for "stmt".
662         (build_and_insert_cast): Likewise.
663         (pass_cse_sincos::execute): Likewise for "stmt" and various decls
664         of "new_stmt".
665         (convert_mult_to_fma): Likewise for "fma_stmt".
667         * tree-ssa-phiopt.c (conditional_replacement): Likewise for "new_stmt".
668         (abs_replacement): Likewise.
670         * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise for "tmp".
672         * tree-ssa-pre.c (create_expression_by_pieces): Likewise for "newstmt".
673         (eliminate_insert): Likewise for "tem".
675         * tree-ssa-propagate.c (update_gimple_call): Strengthen locals
676         "new_stmt" and "stmt" from gimple to gimple_call.
677         (update_call_from_tree): Likewise for "new_stmt".
679         * tree-ssa-reassoc.c (build_and_add_sum): Likewise for "sum".
680         (update_ops): Likewise for "g".
681         (maybe_optimize_range_tests): Likewise.
682         (rewrite_expr_tree_parallel): Require a gimple_assign rather than
683         a plain gimple.
684         (reassociate_bb): Add a checked cast to gimple_assign.
686         * tree-ssa.c (insert_debug_temp_for_var_def): Strengthen local
687         "def_temp" from gimple to gimple_debug.
689         * tree-switch-conversion.c (emit_case_bit_tests): Strengthen local
690         "shift_stmt" from gimple to gimple_assign.
692         * tree-tailcall.c (adjust_return_value_with_ops): Likewise for
693         "stmt".
694         (update_accumulator_with_ops): Likewise.
696         * tree-vect-data-refs.c (bump_vector_ptr): Likewise for
697         "incr_stmt".
699         * tree-vect-stmts.c (vectorizable_condition): Likewise for
700         "new_stmt".
702         * tree-vrp.c (build_assert_expr_for): Likewise for "assertion".
703         (simplify_truth_ops_using_ranges): Likewise for "newop".
704         (simplify_float_conversion_using_ranges): Likewise for "conv".
706         * ubsan.c (instrument_mem_ref): Strengthen local "g" from gimple
707         to gimple_call.
709         * value-prof.c (gimple_divmod_fixed_value): Require a
710         gimple_assign rather than a plain gimple; strengthen types of locals.
711         (gimple_mod_pow2): Likewise.
712         (gimple_mod_subtract): Likewise.
713         (gimple_divmod_fixed_value_transform): Strengthen local
714         "stmt" from gimple to gimple_assign.
715         (gimple_mod_pow2_value_transform): Likewise.
716         (gimple_mod_subtract_transform): Likewise.
717         (gimple_ic): Strengthen types of locals.
719 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
721         Introduce gimple_try
723         * coretypes.h (gimple_try): New typedef.
724         (const_gimple_try): New typedef.
726         * gimple-low.c (gimple_try_catch_may_fallthru): Require a
727         gimple_try rather than a plain gimple.
728         (gimple_stmt_may_fallthru): Add checked cast to gimple_try.
730         * gimple-pretty-print.c (dump_gimple_try): Require a gimple_try
731         rather than a plain gimple.
732         (pp_gimple_stmt_1): Add checked cast to gimple_try within
733         GIMPLE_TRY case of switch statement.
735         * tree-eh.c (finally_tree_node::parent): Strengthen field from
736         gimple to gimple_try.
737         (record_in_finally_tree): Require a gimple_try rather than a plain
738         gimple.
739         (collect_finally_tree): Likewise.
740         (collect_finally_tree_1): Likewise.
741         (struct leh_tf_state::try_finally_expr): Strengthen field from
742         gimple to gimple_try.
743         (struct leh_tf_state::top_p): Likewise.
744         (lower_eh_must_not_throw): Require a gimple_try rather than a
745         plain gimple.
746         (frob_into_branch_around): Likewise.
747         (lower_try_finally_dup_block): Strengthen local from gimple to
748         gimple_try.
749         (honor_protect_cleanup_actions): Split out uses of "x" into new
750         locals "eh_mnt" and "try_stmt" with stronger types.
751         (lower_try_finally): Require a gimple_try rather than a plain
752         gimple.
753         (lower_catch): Likewise.
754         (lower_eh_filter): Likewise.
755         (lower_eh_must_not_throw): Likewise.
756         (lower_cleanup): Likewise.
757         (lower_eh_constructs_2): Add checked cast to gimple_try within
758         GIMPLE_TRY case of switch statement, introducing new local
759         "try_stmt", using it for type-safety.
761 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
763         Use subclasses of gimple in various places
765         * asan.c (insert_if_then_before_iter): Require a gimple cond
766         rathern than a plain gimple.
767         (asan_expand_check_ifn): Add a checked cast to gimple_cond.
769         * cfgloopmanip.c (create_empty_if_region_on_edge): Likewise.
771         * omp-low.c (simd_clone_adjust): Strengthen local from gimple
772         to gimple_phi.
774         * sese.c (set_ifsese_condition): Strengthen local from gimple to
775         gimple_cond.
777         * tree-call-cdce.c (gen_one_condition): Strengthen locals from
778         gimple to gimple_assign and gimple_cond.
780         * tree-ssa-phiopt.c (minmax_replacement): Likewise.
781         (cond_store_replacement): Strengthen locals from gimple to
782         gimple_phi and gimple_assign.
783         (cond_if_else_store_replacement_1): Likewise.
785         * tree-ssa-pre.c (do_regular_insertion): Strengthen local from
786         gimple to gimple_assign.
788         * tree-switch-conversion.c (hoist_edge_and_branch_if_true):
789         Strengthen local from gimple to gimple_cond.
790         (gen_def_assigns): Return a gimple_assign rather than a plain
791         gimple.
792         (gen_inbound_check): Strengthen locals from gimple to gimple_cond
793         and gimple_assign.
795         * tree-vect-loop-manip.c (slpeel_add_loop_guard): Strengthen local
796         from gimple to gimple_cond.
797         (set_prologue_iterations): Strengthen locals from gimple to
798         gimple_phi and gimple_cond.
800         * value-prof.c (gimple_ic): Strengthen local from gimple to
801         gimple_phi.
802         (gimple_stringop_fixed_value): Strengthen locals from gimple to
803         gimple_assign, gimple_cond, gimple_call, and gimple_phi.
805 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
807         Introduce gimple_eh_dispatch
809         * coretypes.h (gimple_eh_dispatch): New typedef.
810         (const_gimple_eh_dispatch): New typedef.
812         * gimple-pretty-print.c (dump_gimple_eh_dispatch): Require a
813         gimple_eh_dispatch rather than a plain gimple.
814         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_dispatch
815         within GIMPLE_EH_DISPATCH case of switch statement.
817         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
819         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
821         * gimple.c (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
822         rather than a plain gimple.
824         * gimple.h (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
825         rather than a plain gimple.
826         (gimple_eh_dispatch_region): Require a const_gimple_eh_dispatch
827         rather than a plain const_gimple.
828         (gimple_eh_dispatch_set_region): Require a gimple_eh_dispatch
829         rather than a plain gimple.
831         * tree-cfg.c (make_edges): Add a checked cast to gimple_eh_dispatch
832         within GIMPLE_EH_DISPATCH case of switch statement.
833         (gimple_verify_flow_info): Likewise.
834         (gimple_redirect_edge_and_branch): Likewise.
835         (move_stmt_r): Likewise, adding a local.
837         * tree-eh.c (emit_eh_dispatch): Convert local from gimple to
838         gimple_eh_dispatch.
839         (make_eh_dispatch_edges): Require a gimple_eh_dispatch rather than
840         a plain gimple.
841         (redirect_eh_dispatch_edge): Likewise.
842         (lower_eh_dispatch): Likewise.
843         (execute_lower_eh_dispatch): Add a checked cast to
844         gimple_eh_dispatch.
845         (mark_reachable_handlers): Likewise.
846         (verify_eh_dispatch_edge): Require a gimple_eh_dispatch rather
847         than a plain gimple.
849         * tree-eh.h (make_eh_dispatch_edges): Likewise.
850         (redirect_eh_dispatch_edge): Likewise.
851         (verify_eh_dispatch_edge): Likewise.
853         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
854         gimple_eh_dispatch within GIMPLE_EH_DISPATCH case of switch
855         statement, adding a local.
856         (copy_edges_for_bb): Add a checked cast to gimple_eh_dispatch.
858 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
860         Introduce gimple_resx
862         * coretypes.h (gimple_resx): New typedef.
863         (const_gimple_resx): New typedef.
865         * gimple.h (gimple_build_resx): Return a gimple_resx rather than a
866         plain gimple.
867         (gimple_resx_region): Require a const_gimple_resx rather than a
868         plain const_gimple.
869         (gimple_resx_set_region): Require a gimple_resx rather than a
870         plain gimple.
872         * gimple-pretty-print.c (dump_gimple_resx): Require a gimple_resx
873         rather than a plain gimple.
874         (pp_gimple_stmt_1): Add a checked cast to gimple_resx within
875         GIMPLE_RESX case of switch statement.
877         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
879         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
881         * gimple.c (gimple_build_resx): Return a gimple_resx rather than
882         a plain gimple.
884         * tree-cfg.c (move_stmt_r): Add a checked cast to gimple_resx
885         within GIMPLE_RESX case of switch statement, adding a new local.
887         * tree-eh.c (emit_resx): Convert local "x" from gimple to
888         gimple_resx.
889         (lower_resx): Require a gimple_resx rather than a plain gimple.
890         (pass_lower_resx::execute): Add a checked cast to gimple_resx.
891         (mark_reachable_handlers): Likewise.
893         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
894         gimple_resx within GIMPLE_RESX case of switch statement, adding
895         a new local.
897 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
899         Introduce gimple_eh_else
901         * coretypes.h (gimple_eh_else): New typedef.
902         (const_gimple_eh_else): New typedef.
904         * gimple.h (gimple_build_eh_else): Return a gimple_eh_else rather
905         than a plain gimple.
906         (gimple_eh_else_n_body_ptr): Require a gimple_eh_else rather than
907         a plain gimple.
908         (gimple_eh_else_n_body): Likewise.
909         (gimple_eh_else_e_body_ptr): Likewise.
910         (gimple_eh_else_e_body): Likewise.
911         (gimple_eh_else_set_n_body): Likewise.
912         (gimple_eh_else_set_e_body): Likewise.
914         * gimple-low.c (lower_stmt): Add checked cast to gimple_eh_else
915         within GIMPLE_EH_ELSE case of switch statement, introducing a new
916         local.
917         (gimple_stmt_may_fallthru): Likewise.
919         * gimple-pretty-print.c (dump_gimple_eh_else): Require a
920         gimple_eh_else rather than a plain gimple.
921         (pp_gimple_stmt_1): Add checked cast to gimple_eh_else within
922         GIMPLE_EH_ELSE case of switch statement
924         * gimple-walk.c (walk_gimple_stmt): Add checked cast to
925         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
926         introducing a new local.
928         * gimple.c (gimple_build_eh_else): Return a gimple_eh_else
929         rather than a plain gimple.
930         (gimple_copy): Add checked casts to gimple_eh_else within
931         GIMPLE_EH_ELSE case of switch statement, introducing new locals.
933         * tree-cfg.c (verify_gimple_in_seq_2): Add checked cast to
934         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
935         introducing a new local.
937         * tree-eh.c (collect_finally_tree): Likewise.
938         (replace_goto_queue_1): Likewise.
939         (get_eh_else): Return a gimple_eh_else rather than a plain gimple.
940         (honor_protect_cleanup_actions): Convert local "eh_else" from
941         gimple to gimple_eh_else.
942         (lower_try_finally_nofallthru): Likewise.
943         (lower_try_finally_onedest): Introduce locals "eh_else" and
944         "label_stmt", using them in favor of "x" for the gimple_eh_else
945         and the gimple_label.
946         (lower_try_finally_copy): Convert local "eh_else" from gimple to
947         gimple_eh_else.
948         (lower_try_finally_switch): Likewise.
949         (decide_copy_try_finally): Likewise.
950         (refactor_eh_r): Add checked cast to gimple_eh_else within
951         GIMPLE_EH_ELSE case of switch statement, introducing a new local.
953 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
955         Introduce gimple_eh_must_not_throw
957         * coretypes.h (gimple_eh_must_not_throw): New typedef.
958         (const_gimple_eh_must_not_throw): New typedef.
960         * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
961         a gimple_eh_must_not_throw rather than a plain gimple.
962         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
963         within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
965         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
967         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
969         * gimple.c (gimple_build_eh_must_not_throw): Return a
970         gimple_eh_must_not_throw rather than a plain gimple.
972         * gimple.h (gimple_build_eh_must_not_throw): Return a
973         gimple_eh_must_not_throw rather than a plain gimple.
974         (gimple_eh_must_not_throw_fndecl): Require a
975         gimple_eh_must_not_throw rather than a plain gimple.
976         (gimple_eh_must_not_throw_set_fndecl): Likewise.
978         * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
980 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
982         Introduce gimple_eh_filter
984         * coretypes.h (gimple_eh_filter): New typedef.
985         (const_gimple_eh_filter): New typedef.
987         * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
988         rather than a plain gimple.
990         * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
991         gimple_eh_filter rather than a plain gimple.
992         (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
993         GIMPLE_EH_FILTER case of switch statement.
995         * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
996         rather than a plain gimple.
998 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1000         Introduce gimple_catch
1002         * coretypes.h (gimple_catch): New typedef.
1003         (const_gimple_catch): New typedef.
1005         * gimple-low.c (lower_try_catch): Add checked cast to gimple_catch.
1006         (gimple_try_catch_may_fallthru): Likewise.
1008         * gimple-pretty-print.c (dump_gimple_catch): Require a gimple_catch
1009         rather than a plain gimple.
1010         (pp_gimple_stmt_1): Add checked cast to gimple_catch within
1011         GIMPLE_CATCH case of switch statement.
1013         * gimple-walk.c (walk_gimple_op): Likewise.
1014         (walk_gimple_stmt): Likewise.
1016         * gimple.c (gimple_build_catch): Return a gimple_catch rather than
1017         a plain gimple.
1018         (gimple_copy): Add checked casts to gimple_catch within
1019         GIMPLE_CATCH case of switch statement, introducing new locals.
1021         * gimple.h (gimple_build_catch): Return a gimple_catch rather than
1022         a plain gimple.
1023         (gimple_catch_types_ptr): Require a gimple_catch rather than a
1024         plain gimple.
1025         (gimple_catch_handler_ptr): Likewise.
1026         (gimple_catch_handler): Likewise.
1027         (gimple_catch_set_types): Likewise.
1028         (gimple_catch_set_handler): Likewise.
1030         * omp-low.c (lower_omp_1): Add checked cast to gimple_catch within
1031         GIMPLE_CATCH case of switch statement.
1033         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
1034         (do_warn_unused_result): Likewise.
1036         * tree-eh.c (collect_finally_tree): Likewise.
1037         (replace_goto_queue_1): Likewise.
1038         (lower_catch): Convert local from gimple to gimple_catch.
1039         (refactor_eh_r): Add checked cast to gimple_catch within
1040         GIMPLE_CATCH case of switch statement.
1042         * tree-inline.c (remap_gimple_stmt): Likewise.
1043         (estimate_num_insns): Add checked cast to gimple_catch within
1044         GIMPLE_CATCH case of switch statement, introducing new local.
1046 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1048         Introduce gimple_transaction
1050         * coretypes.h (gimple_transaction): New typedef.
1051         (const_gimple_transaction): New typedef.
1053         * gimple.h (gimple_build_transaction): Return a gimple_transaction
1054         rather than a plain gimple.
1055         (gimple_transaction_body_ptr): Require a gimple_transaction rather
1056         than a plain gimple.
1057         (gimple_transaction_body): Likewise.
1058         (gimple_transaction_label_ptr): Likewise.
1059         (gimple_transaction_set_body): Likewise.
1060         (gimple_transaction_set_label): Likewise.
1061         (gimple_transaction_set_subcode): Likewise.
1062         (gimple_transaction_label): Require a const_gimple_transaction
1063         rather than a plain const_gimple.
1064         (gimple_transaction_subcode): Likewise.
1066         * gimple-low.c (lower_stmt): Add checked cast to
1067         gimple_transaction within GIMPLE_TRANSACTION case of switch
1068         statement.
1070         * gimple-pretty-print.c (dump_gimple_transaction): Require a
1071         gimple_transaction rather than a plain gimple.
1072         (pp_gimple_stmt_1): Add checked cast to gimple_transaction within
1073         GIMPLE_TRANSACTION case of switch statement.
1074         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
1075         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
1076         * gimple-walk.c (walk_gimple_op): Likewise.
1077         (walk_gimple_stmt): Likewise.
1079         * gimple.c (gimple_build_transaction): Return a gimple_transaction
1080         rather than a plain gimple.
1081         (gimple_copy): Add checked casts to gimple_transaction within
1082         GIMPLE_TRANSACTION case of switch statement.
1084         * gimplify.c (gimplify_transaction): Split local "g" into
1085         "body_stmt" and "trans_stmt", strengthening the type of the latter
1086         from gimple to gimple_transaction.
1088         * omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
1089         within GIMPLE_TRANSACTION case of switch statement.
1091         * trans-mem.c (diagnose_tm_1): Add checked cast within
1092         GIMPLE_TRANSACTION case of switch statement, introducing a new
1093         local "trans_stmt".  Use it in place of "stmt".
1094         (examine_call_tm): Convert local from gimple to gimple_transaction.
1095         (tm_region::get_transaction_stmt): New method.
1096         (tm_region::transaction_stmt): Add clarification of type to the
1097         comment.
1098         (tm_region_init_0): Require a gimple_transaction rather than a
1099         plain gimple.
1100         (tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
1101         dyn_cast<gimple_transaction> and new local.
1102         (transaction_subcode_ior): Add a new local, using the new
1103         get_transaction_stmt method to perform a checked cast.
1104         (propagate_tm_flags_out): Likewise.
1105         (expand_transaction): Add a checked cast using the new
1106         get_transaction_stmt method.
1107         (generate_tm_state): Likewise.
1108         (execute_tm_mark): Likewise.
1109         (ipa_tm_diagnose_transaction): Likewise.
1111         * tree-cfg.c (verify_gimple_transaction): Require a
1112         gimple_transaction rather than a plain gimple.
1113         (make_edges): Add checked cast within GIMPLE_TRANSACTION case of
1114         switch statement
1115         (cleanup_dead_labels): Likewise.
1116         (verify_gimple_stmt): Likewise.
1117         (verify_gimple_in_seq_2): Likewise.
1118         (verify_gimple_in_seq_2): Likewise.
1119         (gimple_redirect_edge_and_branch): Add checked cast.
1121         * tree-inline.c (remap_gimple_stmt): Add checked cast within
1122         GIMPLE_TRANSACTION case of switch statement, introducing a new
1123         local "old_trans_stmt".  Use it in place of "stmt".  Add new
1124         local "new_trans_stmt", using it to initialize "copy", and for
1125         type-safe operations as a transaction.
1126         (estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
1127         case of switch statement.
1129 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1131         Introduce gimple_asm
1133         * coretypes.h (gimple_asm): New typedef.
1134         (const_gimple_asm): New typedef.
1136         * gimple.h (gimple_build_asm_vec): Return a gimple_asm rather than
1137         just a gimple.
1138         (gimple_asm_clobbers_memory_p): Require a const_gimple_asm rather
1139         than just a const_gimple.
1140         (gimple_asm_ninputs): Likewise.
1141         (gimple_asm_noutputs): Likewise.
1142         (gimple_asm_nclobbers): Likewise.
1143         (gimple_asm_nlabels): Likewise.
1144         (gimple_asm_input_op): Likewise.
1145         (gimple_asm_input_op_ptr): Likewise.
1146         (gimple_asm_output_op): Likewise.
1147         (gimple_asm_output_op_ptr): Likewise.
1148         (gimple_asm_clobber_op): Likewise.
1149         (gimple_asm_label_op): Likewise.
1150         (gimple_asm_string): Likewise.
1151         (gimple_asm_volatile_p): Likewise.
1152         (gimple_asm_input_p): Likewise.
1153         (gimple_asm_set_input_op): Require a gimple_asm rather than a plain
1154         gimple.
1155         (gimple_asm_set_output_op): Likewise.
1156         (gimple_asm_set_clobber_op): Likewise.
1157         (gimple_asm_set_label_op): Likewise.
1158         (gimple_asm_set_volatile): Likewise.
1159         (gimple_asm_set_input): Likewise.
1161         * cfgexpand.c (expand_asm_stmt): Require a gimple_asm rather than
1162         a plain gimple.
1163         (expand_gimple_stmt_1): Add checked cast to gimple_asm within
1164         GIMPLE_ASM case of switch statement.
1166         * gimple-fold.c (fold_stmt_1): Add new local from checked cast to
1167         gimple_asm within case GIMPLE_ASM.
1169         * gimple-pretty-print.c (dump_gimple_asm): Require a gimple_asm
1170         rather than a plain gimple.
1171         (pp_gimple_stmt_1): Add checked cast to gimple_asm within
1172         GIMPLE_ASM case of switch statement.
1174         * gimple-streamer-in.c (input_gimple_stmt): Rework existing
1175         checked cast to gimple_asm; add a new one.
1177         * gimple-streamer-out.c (output_gimple_stmt): Add new local from
1178         checked cast to gimple_asm within case GIMPLE_ASM.
1180         * gimple-walk.c (walk_gimple_asm): Require a gimple_asm rather
1181         than a plain gimple.
1182         (walk_gimple_op): Add checked cast to gimple_asm within GIMPLE_ASM
1183         case of switch statement.
1184         (walk_stmt_load_store_addr_ops): Use dyn_cast<gimple_asm> in place
1185         of a code check against GIMPLE_ASM to introduce a new gimple_asm
1186         local.
1188         * gimple.c (gimple_build_asm_1): Return a gimple_asm rather than
1189         a plain gimple.
1190         (gimple_build_asm_vec): Likewise.
1191         (gimple_has_side_effects): Add a checked cast to gimple_asm.
1192         (gimple_could_trap_p_1): Likewise.
1193         (gimple_call_builtin_p): Require a const_gimple_asm rather then
1194         a const_gimple.
1196         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
1197         and a new local of type gimple_asm within GIMPLE_ASM case.
1199         * gimplify.c (gimplify_asm_expr): Convert a local from gimple to
1200         gimple_asm.
1202         * ipa-pure-const.c (check_stmt): Add checked casts within
1203         GIMPLE_ASM case.
1205         * ssa-iterators.h (op_iter_init): Likewise.
1207         * tree-cfg.c (make_goto_expr_edges): Convert a local from gimple
1208         to gimple_asm.
1209         (cleanup_dead_labels): Add a checked cast and a new local of type
1210         gimple_asm within GIMPLE_ASM case.
1211         (gimple_redirect_edge_and_branch): Likewise.
1212         (is_ctrl_altering_stmt): Add a checked cast.
1213         (need_fake_edge_p): Replace a code check against GIMPLE_ASM with a
1214         dyn_cast<gimple_asm>.
1216         * tree-complex.c (expand_complex_comparison): Convert a local from
1217         gimple to gimple_asm.
1219         * tree-data-ref.c (get_references_in_stmt): Add a checked cast to
1220         gimple_asm.
1222         * tree-eh.c (stmt_could_throw_p): Likewise.
1224         * tree-inline.c (estimate_num_insns): Likewise.
1226         * tree-sra.c (scan_function): Add a checked cast and a new local
1227         of type gimple_asm within GIMPLE_ASM case.
1228         (sra_modify_function_body): Likewise.
1229         (ipa_sra_modify_function_body): Likewise.
1231         * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
1233         * tree-ssa-dce.c (propagate_necessity): Replace a code check
1234         against GIMPLE_ASM with a dyn_cast<gimple_asm>.
1236         * tree-ssa-operands.c (maybe_add_call_vops): Require a gimple_asm
1237         rather than a plain gimple.
1238         (parse_ssa_operands): Add a checked cast to gimple_asm.
1240         * tree-ssa-structalias.c (find_func_aliases): Replace a check for
1241         GIMPLE_ASM with a dyn_cast<gimple_asm>, introducing  a new local
1242         "asm_stmt", using it in place of "t" for typesafety.
1244         * tree-ssa-threadedge.c
1245         (record_temporary_equivalences_from_stmts_at_dest): Add a checked
1246         cast to gimple_asm.
1248         * tree-ssa.c (execute_update_addresses_taken): Add checked casts
1249         and new locals of type gimple_asm within clauses guarded by code
1250         check.
1252 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1254         Introduce gimple_goto
1256         * coretypes.h (gimple_goto): New typedef.
1257         (const_gimple_goto): New typedef.
1259         * gimple.h (gimple_statement_goto): New subclass of
1260         gimple_statement_with_ops, adding the invariant that
1261         stmt->code == GIMPLE_GOTO.
1262         (is_a_helper <gimple_statement_goto>::test): New.
1263         (gimple_build_goto): Return a gimple_goto rather than a
1264         plain gimple.
1266         * gimple-pretty-print.c (dump_gimple_goto): Require a gimple_goto
1267         rather than a plain gimple.
1268         (pp_gimple_stmt_1): Add a checked cast to gimple_goto within
1269         GIMPLE_GOTO case of switch statement.
1271         * gimple.c (gimple_build_goto): Return a gimple_goto rather than a
1272         plain gimple.
1274         * tree-cfg.c (verify_gimple_goto): Require a gimple_goto rather
1275         than a plain gimple.
1276         (verify_gimple_stmt): Add a checked cast to gimple_goto within
1277         GIMPLE_GOTO case of switch statement.
1279 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1281         Introduce gimple_return
1283         * coretypes.h (gimple_return): New typedef.
1284         (const_gimple_return): New typedef.
1286         * gimple.h (gimple_statement_return): New subclass of
1287         gimple_statement_with_memory_ops, adding the invariant that
1288         stmt->code == GIMPLE_RETURN.
1289         (is_a_helper <gimple_statement_return>::test): New.
1290         (gimple_build_return): Return a gimple_return rather
1291         than a plain gimple.
1293         * gimple.c (gimple_build_return): Return a gimple_return rather
1294         than a plain gimple.
1296         * cgraphunit.c (expand_thunk): Convert local from a gimple to
1297         a gimple_return.
1299         * gimple-low.c (struct return_statements_t): Convert field "stmt"
1300         from a gimple to a gimple_return.
1301         (lower_gimple_return): Convert local from a gimple to a
1302         gimple_return.
1304         * gimple-pretty-print.c (dump_gimple_return): Require a
1305         gimple_return rather than a plain gimple.
1306         (pp_gimple_stmt_1): Add a checked cast to gimple_return within
1307         case GIMPLE_RETURN of switch statement.
1309         * gimplify.c (gimplify_return_expr): Convert locals from
1310         gimple to gimple_return.
1312         * ipa-split.c (split_function): Likewise.
1314         * tree-cfg.c (verify_gimple_assign): Require a gimple_return
1315         rather than a plain gimple.
1316         (verify_gimple_stmt): Add checked cast to gimple_return within
1317         case GIMPLE_RETURN of switch statement.
1319         * tree-tailcall.c (adjust_return_value): Convert local from
1320         gimple to gimple_return.
1322 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1324         Introduce gimple_call
1326         * coretypes.h (gimple_call): New typedef.
1327         (const_gimple_call): New typedef.
1329         * asan.c (get_mem_refs_of_builtin_call): Require a
1330         const_gimple_call rather than a const gimple.
1331         (has_stmt_been_instrumented_p): Add a checked cast to
1332         gimple_call.
1333         (instrument_strlen_call): Likewise.
1334         (instrument_builtin_call): Likewise.
1335         * builtins.c (validate_gimple_arglist): Require a
1336         const_gimple_call rather than a const gimple.
1337         (fold_call_stmt): Require a gimple_call rather than a gimple.
1338         * builtins.h (validate_gimple_arglist): Require a
1339         const_gimple_call rather than a const gimple.
1340         (fold_call_stmt): Require a gimple_call rather than a gimple.
1341         * cfgexpand.c (expand_call_stmt): Likewise.
1342         (expand_gimple_stmt_1): Add a checked cast to gimple_call within
1343         GIMPLE_CALL case.
1344         * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Strengthen
1345         local "new_stmt" from gimple to gimple_call, adding a checked
1346         cast.
1347         * cgraphunit.c (cgraph_node::expand_thunk): Likewise for local
1348         "call".
1349         * gimple-fold.c (gimple_fold_builtin_snprintf_chk): Likewise for
1350         local "stmt".
1351         (gimple_fold_builtin_snprintf): Likewise.
1352         (gimple_fold_builtin): Likewise.
1353         (gimple_fold_call): Likewise.
1354         (gimple_fold_stmt_to_constant_1): Introduce local "call_stmt" via
1355         checked cast of "stmt" to gimple_call, using it in various places
1356         for typesafety.
1357         * gimple-pretty-print.c (dump_gimple_call_args): Strengthen param
1358         2 from gimple to gimple_call.
1359         (dump_gimple_call): Likewise.
1360         (pp_gimple_stmt_1): Add a checked cast to gimple_call within
1361         GIMPLE_CALL case.
1362         * gimple-streamer-in.c (input_gimple_stmt): Replace is_gimple_call
1363         with a dyn_cast<gimple_call>, introducing local "call_stmt", and
1364         using it in place of "stmt" for typesafety.  Add a checked cast
1365         in statement guarded by check for GIMPLE_CALL.
1366         * gimple-walk.c (walk_gimple_op): Add a checked cast to
1367         gimple_call.
1368         * gimple.c (gimple_call_reset_alias_info): Strengthen param from
1369         gimple to gimple_call.
1370         (gimple_build_call_1): Strengthen return type and local from
1371         gimple to gimple_call.
1372         (gimple_build_call_vec): Likewise.
1373         (gimple_build_call): Likewise.
1374         (gimple_build_call_valist): Likewise.
1375         (gimple_build_call_internal_1): Likewise.
1376         (gimple_build_call_internal): Likewise.
1377         (gimple_build_call_internal_vec): Likewise.
1378         (gimple_build_call_from_tree): Likewise.
1379         (gimple_call_return_flags): Strengthen param from
1380         const_gimple to const_gimple_call.
1381         (gimple_call_copy_skip_args): Strengthen return type and local from
1382         gimple to gimple_call.
1383         * gimple.h (gimple_call_reset_alias_info): Strengthen param from
1384         gimple to gimple_call.
1385         (gimple_build_call_vec): Strengthen return type from gimple to
1386         gimple_call.
1387         (gimple_build_call): Likewise.
1388         (gimple_build_call_valist): Likewise.
1389         (gimple_build_call_internal): Likewise.
1390         (gimple_build_call_internal_vec): Likewise.
1391         (gimple_build_call_from_tree): Likewise.
1392         (gimple_call_return_flags): Strengthen param from const_gimple to
1393         const_gimple_call.
1394         (gimple_call_copy_skip_args): Strengthen return type from gimple
1395         to gimple_call.
1396         (gimple_call_set_internal_fn): Strengthen param "call_stmt" from
1397         gimple to gimple_call.
1398         (gimple_call_return_type): Strengthen param from const_gimple to
1399         const_gimple_call.
1400         (gimple_call_chain_ptr): Likewise.
1401         (gimple_call_set_chain): Strengthen param from gimple to
1402         gimple_call.
1403         (gimple_call_set_return_slot_opt): Likewise.
1404         (gimple_call_set_from_thunk): Likewise.
1405         (gimple_call_from_thunk_p): Likewise.
1406         (gimple_call_set_va_arg_pack): Likewise.
1407         (gimple_call_va_arg_pack_p): Likewise.
1408         (gimple_call_set_alloca_for_var): Likewise.
1409         (gimple_call_alloca_for_var_p): Likewise.
1410         (gimple_expr_type): Introduce local "call_stmt" via a checked cast
1411         and use it for typesafety.
1412         * gimplify.c (gimplify_call_expr): Strengthen local "call" from
1413         gimple to gimple_call.
1414         (gimplify_modify_expr_to_memcpy): Likewise for local "gs".
1415         (gimplify_modify_expr_to_memset): Likewise.
1416         (gimplify_modify_expr): Add a checked cast to gimple_call.
1417         (gimplify_expr): Strengthen local "call" from gimple to
1418         gimple_call.
1419         (gimplify_function_tree): Likewise.
1420         * internal-fn.c (expand_LOAD_LANES): Strengthen param from gimple
1421         to gimple_call.
1422         (expand_STORE_LANES): Likewise.
1423         (expand_ANNOTATE): Likewise.
1424         (expand_GOMP_SIMD_LANE): Likewise.
1425         (expand_GOMP_SIMD_VF): Likewise.
1426         (expand_GOMP_SIMD_LAST_LANE): Likewise.
1427         (expand_UBSAN_NULL): Likewise.
1428         (expand_UBSAN_BOUNDS): Likewise.
1429         (expand_UBSAN_OBJECT_SIZE): Likewise.
1430         (expand_ASAN_CHECK): Likewise.
1431         (ubsan_expand_si_overflow_addsub_check): Likewise.
1432         (ubsan_expand_si_overflow_neg_check): Likewise.
1433         (ubsan_expand_si_overflow_mul_check): Likewise.
1434         (expand_UBSAN_CHECK_ADD): Likewise.
1435         (expand_UBSAN_CHECK_SUB): Likewise.
1436         (expand_UBSAN_CHECK_MUL): Likewise.
1437         (expand_LOOP_VECTORIZED): Likewise.
1438         (expand_MASK_LOAD): Likewise.
1439         (expand_MASK_STORE): Likewise.
1440         (expand_ABNORMAL_DISPATCHER): Likewise.
1441         (expand_BUILTIN_EXPECT): Likewise.
1442         (internal_fn_expanders): Likewise for entries in this table.
1443         (expand_internal_call): Likewise.
1444         * internal-fn.def: Update comment to reflect strengthening of
1445         param of expanders.
1446         * internal-fn.h (expand_internal_call): Strengthen param from
1447         gimple to gimple_call.
1448         * ipa-prop.c (ipa_modify_call_arguments): Likewise for local
1449         "new_stmt".
1450         * ipa-pure-const.c (check_call): Likewise for param "call".
1451         (check_stmt): Add a checked cast to gimple_call within GIMPLE_CALL
1452         case.
1453         * ipa-split.c (split_function): Strengthen local "call" from
1454         gimple to gimple_call.
1455         * omp-low.c (build_omp_barrier): Likewise for local "g".
1456         (lower_rec_input_clauses): Likewise for local "stmt".
1457         * trans-mem.c (build_tm_load): Likewise for return type and local
1458         "gcall".
1459         (build_tm_store): Likewise.
1460         (expand_transaction): Likewise for local "call".
1461         * tree-call-cdce.c (check_pow): Likewise for param.
1462         (check_builtin_call): Likewise.
1463         (is_call_dce_candidate): Likewise.
1464         (gen_conditions_for_pow): Likewise.
1465         (gen_shrink_wrap_conditions): Likewise.
1466         (shrink_wrap_one_built_in_call): Likewise.
1467         (shrink_wrap_conditional_dead_built_in_calls): Strengthen param
1468         from vec<gimple> to vec<gimple_call>, and local "bi_call" from
1469         gimple to gimple_call.
1470         (pass_call_cdce::execute): Strengthen local
1471         "cond_dead_built_in_calls" from auto_vec<gimple> to
1472         auto_vec<gimple_call> and local "stmt" from gimple to gimple_call,
1473         * tree-cfg.c (notice_special_calls): Strengthen param from gimple
1474         to gimple_call.
1475         * tree-cfg.h (notice_special_calls): Likewise.
1476         * tree-complex.c (expand_complex_libcall): Likewise for local
1477         "stmt".
1478         * tree-inline.c (remap_gimple_stmt): Add checked cast to
1479         gimple_call.
1480         (copy_bb): Likewise.  Strengthen local "new_call" from gimple to
1481         gimple_call.
1482         (inline_forbidden_p_stmt): Add checked cast to gimple_call.
1483         * tree-nested.c (init_tmp_var_with_call): Strengthen param "call"
1484         from gimple to gimple_call.
1485         (convert_nl_goto_reference): Likewise for local "call".
1486         (convert_tramp_reference_op): Likewise.
1487         (convert_gimple_call): Add checked cast to gimple_call.
1488         * tree-nrv.c (dest_safe_for_nrv_p): Strengthen param "call" from
1489         gimple to gimple_call.
1490         (pass_return_slot::execute): Likewise for local "stmt", using a
1491         dyn_cast<gimple_call> rather than an is_gimple_call call.
1492         * tree-object-size.c (alloc_object_size): Strengthen param "call"
1493         from const_gimple to const_gimple_call.
1494         (pass_through_call): Likewise.
1495         (call_object_size): Strengthen param "call" from gimple to
1496         gimple_call.
1497         (collect_object_sizes_for): Introduce local "call_stmt" via a
1498         checked cast, using it for typesafety.
1499         (check_for_plus_in_loops_1): Likewise.
1500         (pass_object_sizes::execute): Add a checked cast to gimple_call.
1501         * tree-profile.c (gimple_gen_interval_profiler): Strengthen local
1502         "call" from gimple to gimple_call.
1503         (gimple_gen_pow2_profiler): Likewise.
1504         (gimple_gen_one_value_profiler): Likewise.
1505         (gimple_gen_time_profiler): Likewise.
1506         (gimple_gen_average_profiler): Likewise.
1507         (gimple_gen_ior_profiler): Likewise.
1508         * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise for
1509         param "call".
1510         (ref_maybe_used_by_call_p): Likewise.
1511         (ref_maybe_used_by_stmt_p): Add a checked cast to gimple_call.
1512         (call_may_clobber_ref_p_1): Strengthen param "call" from gimple to
1513         gimple_call.
1514         (call_may_clobber_ref_p): Likewise.
1515         (stmt_may_clobber_ref_p_1): Add a checked cast to gimple_call.
1516         * tree-ssa-alias.h (call_may_clobber_ref_p): Strengthen param 1
1517         from gimple to gimple_call.
1518         (call_may_clobber_ref_p_1): Likewise.
1519         * tree-ssa-dce.c (eliminate_unnecessary_stmts): Add a checked cast
1520         to gimple_call.
1521         * tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Strengthen
1522         local "call" from gimple to gimple_call.
1523         * tree-ssa-math-opts.c (build_and_insert_call): Likewise for local
1524         "call_stmt".
1525         * tree-ssa-operands.c (maybe_add_call_vops): Likewise for param
1526         "stmt".
1527         (parse_ssa_operands): Add a checked cast to gimple_call within
1528         GIMPLE_CALL case.
1529         * tree-ssa-pre.c (compute_avail): Add a checked cast to
1530         gimple_call.
1531         * tree-ssa-sccvn.c (copy_reference_ops_from_call): Strengthen
1532         param "call" from gimple to gimple_call.
1533         (valueize_shared_reference_ops_from_call): Likewise.
1534         (vn_reference_lookup_3): Add a checked cast to gimple_call.
1535         (vn_reference_lookup_call): Strengthen param "call" from gimple to
1536         gimple_call.
1537         (visit_reference_op_call): Likewise for param "stmt".
1538         (visit_use): Replace is_gimple_call with a dyn_cast, introducing
1539         local "call_stmt", using it in place of "stmt" for type-safety.
1540         * tree-ssa-sccvn.h (vn_reference_lookup_call): Strengthen param 1
1541         from gimple to gimple_call.
1542         * tree-ssa-structalias.c (get_call_vi): Likewise.
1543         (lookup_call_use_vi): Likewise.
1544         (lookup_call_clobber_vi): Likewise.
1545         (get_call_use_vi): Likewise.
1546         (get_call_clobber_vi): Likewise.
1547         (handle_rhs_call): Likewise.
1548         (handle_lhs_call): Likewise.
1549         (handle_const_call): Likewise.
1550         (handle_pure_call): Likewise.
1551         (get_fi_for_callee): Likewise.
1552         (find_func_aliases_for_builtin_call): Likewise for param 2.
1553         (find_func_aliases_for_call): Likewise.
1554         (find_func_aliases): Add a checked cast to gimple_call.
1555         (find_func_clobbers): Replace is_gimple_call with a dyn_cast,
1556         introducing local "call_stmt", using it in place of "stmt" for
1557         type-safety.
1558         (compute_points_to_sets): Strengthen local "stmt" from gimple to
1559         gimple_call, replacing is_gimple_call with a
1560         dyn_cast <gimple_call>.
1561         (ipa_pta_execute): Likewise.
1562         * tree-ssa-threadedge.c
1563         (record_temporary_equivalences_from_stmts_at_dest): Add checked
1564         cast to gimple_call.
1565         * tree-tailcall.c (find_tail_calls): Strengthen local "call" from
1566         gimple to gimple_call, adding a checked cast.
1567         * tree-vect-data-refs.c (vect_setup_realignment): Eliminate
1568         top-level local "new_stmt" in favor of more tightly-scoped locals
1569         "new_stmt" of type gimple_assign and gimple_call.
1570         * tree-vect-patterns.c (vect_recog_pow_pattern): Strenghthen local
1571         "stmt" from gimple to gimple_call.
1572         * tree-vect-stmts.c (vectorizable_function): Likewise for param
1573         "call".
1574         (vectorizable_call): Rename param 1 from "stmt" to "gs",
1575         reintroducing "stmt" as a gimple_call once we've established that
1576         we're working with a GIMPLE_CALL.
1577         * tree-vectorizer.h (vectorizable_function): Strengthen param 1
1578         from gimple to gimple_call.
1579         * value-prof.c (check_ic_target): Likewise.
1580         (gimple_ic_transform): Likewise for local "stmt", replacing a
1581         check for GIMPLE_CALL with a dyn_cast.
1582         (interesting_stringop_to_profile_p): Strengthen param "call"
1583         from gimple to gimple_call.
1584         (gimple_stringop_fixed_value): Likewise for param "vcall_stmt".
1585         (gimple_stringops_transform): Likewise for local "stmt",
1586         replacing a check for GIMPLE_CALL with a dyn_cast.
1587         (gimple_stringops_values_to_profile): Rename param 1 from "stmt"
1588         to "gs", reintroducing "stmt" as a gimple_call once we've
1589         established that we're working with a GIMPLE_CALL.
1590         * vtable-verify.c (verify_bb_vtables): Strengthen local
1591         "call_stmt" from gimple to gimple_call.
1593 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1595         Concretize get_loop_exit_condition et al to working on gimple_cond
1597         * tree-scalar-evolution.h (get_loop_exit_condition): Return a
1598         gimple_cond.
1599         * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
1600         concretizing local "res" from gimple to gimple_cond.
1601         * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
1602         locals from gimple to gimple_cond.
1603         (slpeel_can_duplicate_loop_p): Likewise.
1604         * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
1605         (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
1607 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1609         Update various expressions within tree-scalar-evolution.c to be gimple_phi
1611         * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
1612         rather than a gimple.
1613         (follow_ssa_edge_binary): Likewise.
1614         (follow_ssa_edge_expr): Likewise.
1615         (follow_ssa_edge_in_rhs): Likewise.
1616         (backedge_phi_arg_p): Likewise.
1617         (follow_ssa_edge_in_condition_phi_branch): Likewise.
1618         (follow_ssa_edge_in_condition_phi): Likewise.
1619         (follow_ssa_edge_inner_loop_phi): Likewise.
1620         (analyze_evolution_in_loop): Likewise.
1621         (analyze_initial_condition): Likewise.
1622         (interpret_loop_phi): Likewise.
1623         (interpret_condition_phi): Likewise.
1624         (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
1626         (analyze_scalar_evolution_1): Add checked casts to gimple_phi
1627         within "case GIMPLE_PHI".
1629 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1631         tree-ssa-loop-ivopts.c: use gimple_phi in a few places
1633         * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
1634         (find_bivs): Convert local "phi" into a gimple_phi.
1635         (mark_bivs): Likewise.
1637 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1639         tree-ssa-loop-manip.c: use gimple_phi in three places
1641         * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
1642         gimple_phi.
1643         (split_loop_exit_edge): Likewise for "phi" and "new_phi".
1645 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1647         tree-ssa-loop-niter.c: use gimple_phi in a few places
1649         * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
1650         rather than a gimple.
1651         (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
1652         (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
1654 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1656         tree-ssa-phiprop.c: use gimple_phi
1658         * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
1659         parameter "phi" and local "new_phi" from gimple to gimple_phi.
1661 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1663         tree-predcom.c: use gimple_phi in various places
1665         * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
1666         than just a gimple.
1667         (insert_looparound_copy): Require a gimple_phi rather than just a
1668         gimple.
1669         (add_looparound_copies): Convert local "phi" to be a gimple_phi.
1670         (initialize_root_vars): Likewise.
1671         (initialize_root_vars_lm): Likewise.
1673 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1675         tree-parloops.c: use gimple_phi in various places
1677         * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
1678         from gimple to gimple_phi.
1679         (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
1680         (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
1681         (gather_scalar_reductions): Convert to a gimple_phi_iterator and
1682         gimple_phi.
1683         (try_create_reduction_list): Likewise.
1685 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1687         Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
1689         * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
1690         type of parameter from gimple to gimple_phi.
1692         * tree-complex.c (complex_visit_phi): Update signature of callback
1693         implementation accordingly.
1694         * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
1695         * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
1696         * tree-vrp.c (vrp_visit_phi_node): Likewise.
1698         * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
1699         gimple_phi when invoking the ssa_prop_visit_phi callback.
1701 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1703         Introduce gimple_phi_iterator
1705         * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
1706         gimple_stmt_iterator with identical layout, but adding...
1707         (gimple_phi_iterator::phi): ...new method, equivalent to
1708         gsi_stmt (), but casting the underlying gimple to gimple_phi,
1709         checking that code == GIMPLE_PHI in a checked build.
1710         (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
1711         gimple_stmt_iterator.
1713         * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
1714         than just a gimple.
1715         (if_convertible_phi_p): Likewise.
1716         * tree-phinodes.h (add_phi_node_to_bb): Likewise.
1717         * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
1719         * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
1720         and a vec<gimple_phi> *, rather than just a gimple and
1721         vec<gimple> *, and a hash_set<gimple_phi> * rather than a
1722         hash_set<gimple> *.
1723         (find_uninit_use): Likewise; add checked cast to gimple_phi when
1724         adding to worklist.
1725         (pass_late_warn_uninitialized::execute): Strengthen types of
1726         various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
1727         "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
1728         gimple_phi, "added_to_worklist" from hash_set<gimple> to
1729         hash_set<gimple_phi>.
1731         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
1732         gimple_phi_iterator * rather than a gimple_stmt_iterator *;
1733         use it to strengthen local from a gimple to a gimple_phi.
1735         * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
1736         gimple_stmt_iterator to a gimple_phi_iterator.  Use the iterator's
1737         "phi" method rather than gsi_stmt.  Use this checked cast to convert
1738         the type of related local from a plain gimple to a gimple_phi.
1739         * gimple-pretty-print.c (dump_phi_nodes): Likewise.
1740         * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
1741         Likewise.
1742         * sese.c (sese_add_exit_phis_edge): Likewise.
1743         * tree-cfg.c (reinstall_phi_args): Likewise.
1744         (gimple_make_forwarder_block): Likewise.
1745         (add_phi_args_after_copy_edge): Likewise.
1746         (gimple_lv_adjust_loop_header_phi): Likewise.
1747         * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
1748         (remove_forwarder_block_with_phi): Likewise.
1749         (merge_phi_nodes): Likewise.
1750         * tree-complex.c (update_phi_components): Likewise.
1751         * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
1752         * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
1753         (copy_phis_for_bb): Likewise.
1754         * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
1755         * tree-outof-ssa.c (eliminate_build): Likewise.
1756         (eliminate_useless_phis): Likewise.
1757         (rewrite_trees): Likewise.
1758         (insert_backedge_copies): Likewise.
1759         * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
1760         (remove_phi_args): Likewise.
1761         (remove_phi_nodes): Likewise.
1762         * tree-predcom.c (find_looparound_phi): Likewise.
1763         (eliminate_temp_copies): Likewise.
1764         * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
1765         (scev_const_prop): Likewise; also, add checked cast to phi.
1766         * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
1767         * tree-ssa-dce.c (remove_dead_phis): Likewise.
1768         (forward_edge_to_pdom): Likewise.
1769         * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
1770         (cprop_into_successor_phis): Likewise.
1771         (propagate_rhs_into_lhs): Likewise.
1772         (eliminate_degenerate_phis_1): Likewise.
1773         * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
1774         * tree-ssa-live.c (calculate_live_on_exit): Likewise.
1775         (verify_live_on_entry): Likewise.
1776         * tree-ssa-loop-im.c
1777         (move_computations_dom_walker::before_dom_children): Likewise.
1778         * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
1779         (mark_bivs): Likewise.
1780         (find_interesting_uses_outside): Likewise.
1781         (determine_set_costs): Likewise.
1782         * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
1783         (tree_transform_and_unroll_loop): Likewise.
1784         (rewrite_all_phi_nodes_with_iv): Likewise.
1785         (canonicalize_loop_ivs): Likewise.
1786         * tree-ssa-loop-niter.c (determine_value_range): Likewise.
1787         * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
1788         * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
1789         * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
1790         * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
1791         (vop_phi): Likewise.
1792         * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
1793         Likewise.
1794         * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
1795         (copy_phi_args): Likewise.
1796         (phi_args_equal_on_edges): Likewise.
1797         * tree-ssa.c (ssa_redirect_edge): Likewise.
1798         (flush_pending_stmts): Likewise.
1799         * tree-switch-conversion.c (check_final_bb): Likewise.
1800         (gather_default_values): Likewise.
1801         (build_constructors): Likewise.
1802         (fix_phi_nodes): Likewise.
1803         * tree-tailcall.c (propagate_through_phis): Likewise.
1804         (add_successor_phi_arg): Likewise.
1805         * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
1806         Likewise.
1807         (slpeel_update_phi_nodes_for_guard2): Likewise.
1808         (slpeel_tree_peel_loop_to_edge): Likewise.
1809         (vect_can_advance_ivs_p): Likewise.
1810         (vect_update_ivs_after_vectorizer): Likewise.
1811         * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
1812         * tree-vrp.c (find_assert_locations): Likewise.
1813         * value-prof.c (gimple_ic): Likewise.
1815         * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
1817 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1819         Introduce gimple_phi and use it in various places
1821         * coretypes.h (gimple_phi): New typedef.
1822         (const_gimple_phi): New typedef.
1824         * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
1825         variants, using the gimple printer.
1827         * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
1828         vecs of more concrete gimple subclasses as appropriate; also the
1829         comment is about to become misleading.
1831         * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
1832         rather than spelling out the full type.
1833         (gimple_phi_num_args): Likewise.
1834         (gimple_phi_result): Likewise.
1835         (gimple_phi_result_ptr): Use gimple_phi typedef.
1836         (gimple_phi_set_result): Likewise.
1837         (gimple_phi_arg): Likewise.
1838         (gimple_phi_set_arg): Likewise.
1839         * tree-phinodes.c (allocate_phi_node): Likewise.
1840         (resize_phi_node): Likewise.
1841         (reserve_phi_args_for_new_edge): Likewise.
1842         (remove_phi_arg_num): Likewise.
1844         * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
1845         rather than just a gimple.
1846         * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
1848         * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
1849         just a gimple.
1850         (create_phi_node): Likewise.
1851         * tree-phinodes.h (create_phi_node): Likewise.
1853         * trans-mem.c (struct struct tm_log_entry): Replace use of
1854         now-removed gimple_vec with a plain vec<gimple>.
1856         * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
1857         vec<gimple_vec> to a vec< vec<gimple_phi> >.
1859         * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
1860         gimple_phi.
1861         * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
1862         "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
1863         a gimple_phi.
1864         * tree-into-ssa.c (delete_update_ssa): Strengthen local
1865         "phis" from a gimple_vec to a vec<gimple_phi>.
1867         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
1868         gimple_phi in regions where a stmt is known to have code
1869         GIMPLE_PHI.
1870         * tree-into-ssa.c (mark_use_interesting): Likewise.
1872 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1874         Introduce gimple_debug and use it in a few places
1876         * coretypes.h (gimple_debug): New typedef.
1877         (const_gimple_debug): New typedef.
1879         * gimple.h (struct gimple_statement_debug): New subclass of
1880         gimple_statement_with_ops, adding the invariant that
1881         stmt->code == GIMPLE_DEBUG.
1882         (is_a_helper <gimple_statement_debug>::test): New.
1884         * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
1885         variants, using the gimple printer.
1887         * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
1888         rather than just a gimple.
1889         * tree-inline.c (copy_debug_stmt): Likewise.
1891         * tree-inline.h (struct copy_body_data): Strengthen field
1892         "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
1894         * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
1895         rather than just a gimple.
1896         (gimple_build_debug_source_bind_stat): Likewise.
1897         * gimple.h (gimple_build_debug_bind_stat): Likewise.
1898         (gimple_build_debug_source_bind_stat): Likewise.
1900         * tree-inline.c (remap_gimple_stmt): Update locals to be a
1901         gimple_debug.
1902         (maybe_move_debug_stmts_to_successors): Likewise.
1903         (copy_debug_stmts): Likewise.
1905         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
1906         gimple_debug in regions where a stmt is known to have code
1907         GIMPLE_DEBUG.
1909 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1911         Introduce gimple_label and use it in a few places
1913         * coretypes.h (gimple_label): New typedef.
1914         (const_gimple_label): New typedef.
1916         * gimple.h (struct gimple_statement_label): New subclass of
1917         gimple_statement_with_ops, adding the invariant that
1918         stmt->code == GIMPLE_LABEL.
1919         (is_a_helper <gimple_statement_label>::test): New.
1921         * gdbhooks.py (build_pretty_printer): Add gimple_label and its
1922         variants, reusing the gimple printer.
1924         * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
1925         rather than just a gimple.
1926         * tree-cfg.c (verify_gimple_label): Likewise.
1928         * gimple.c (gimple_build_label): Return a gimple_label rather than
1929         just a gimple.
1930         * gimple.h (gimple_build_label): Likewise.
1932         * gimplify.c (gimplify_case_label_expr): Update local to be a
1933         gimple_label.
1934         * tree-switch-conversion.c (gen_inbound_check): Likewise.
1936         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
1937         gimple_label in regions where a stmt is known to have code
1938         GIMPLE_LABEL.
1939         * tree-cfg.c (verify_gimple_stmt): Likewise.
1941 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1943         Introduce gimple_assign and use it in various places
1945         * coretypes.h (gimple_assign): New typedef.
1946         (const_gimple_assign): New typedef.
1948         * gimple.h (struct gimple_statement_assign): New subclass of
1949         gimple_statement_with_memory_ops, adding the invariant that
1950         stmt->code == GIMPLE_ASSIGN.
1951         (is_a_helper <gimple_statement_assign>::test): New.
1953         * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
1954         variants, using the gimple printer.
1956         * gimple-builder.c (build_assign): Return a gimple_assign rather
1957         than just a gimple from each of the overloaded variants.
1958         (build_type_cast): Likewise.
1959         * gimple-builder.h (build_assign): Likewise.
1960         (build_type_cast): Likewise.
1961         * gimple.c (gimple_build_assign_stat): Likewise.
1962         (gimple_build_assign_with_ops): Likewise.
1963         * gimple.h (gimple_build_assign_stat): Likewise.
1964         (gimple_build_assign_with_ops): Likewise.
1966         * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
1967         rather than just a "const gimple" (the latter is not a
1968         "const_gimple").
1969         * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
1970         rather than just a gimple.
1971         (dump_binary_rhs): Likewise.
1972         (dump_ternary_rhs): Likewise.
1973         * tree-cfg.c (verify_gimple_assign_unary): Likewise.
1974         (verify_gimple_assign_binary): Likewise.
1975         (verify_gimple_assign_ternary): Likewise.
1976         (verify_gimple_assign_single): Likewise.
1977         (verify_gimple_assign): Likewise.
1978         * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
1979         (try_to_simplify): Likewise.
1980         * tree-tailcall.c (process_assignment): Likewise.
1981         * tree-vect-generic.c (expand_vector_operation): Likewise.
1982         * tree-vrp.c (extract_range_from_cond_expr): Likewise.
1983         (extract_range_from_assignment): Likewise.
1985         * asan.c (has_stmt_been_instrumented_p): Add checked cast to
1986         gimple_assign in regions where a stmt is known to have code
1987         GIMPLE_ASSIGN.
1988         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1989         * tree-cfg.c (verify_gimple_stmt): Likewise.
1990         * tree-ssa-sccvn.c (visit_use): Likewise.
1991         * tree-tailcall.c (find_tail_calls): Likewise.
1992         * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
1994         * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
1995         against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
1996         a gimple_assign local.
1998         * tree-vect-generic.c (expand_vector_condition): Convert local to a
1999         gimple_assign, adding a checked cast when extracting from gsi, since
2000         this is only called when  underlying stmt has code GIMPLE_ASSIGN.
2001         (optimize_vector_constructor): Likewise.
2002         (lower_vec_perm): Likewise.
2003         (expand_vector_operations_1): Convert local to a gimple_assign,
2004         introducing a dyn_cast.
2006 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2008         Introduce gimple_cond and use it in various places
2010         * coretypes.h (gimple_cond): New typedef.
2011         (const_gimple_cond): Likewise.
2013         * gimple.h (struct gimple_statement_cond): New subclass of
2014         gimple_statement_with_ops, adding the invariant that
2015         stmt->code == GIMPLE_COND.
2016         (is_a_helper <gimple_statement_cond>::test): New.
2017         (gimple_build_cond): Return a gimple_cond, rather than just
2018         a gimple.
2019         (gimple_build_cond_from_tree): Likewise.
2021         * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
2022         variants, using the gimple printer.
2024         * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
2025         than just a gimple.
2026         * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
2027         (gimple_cond_true_p): Likewise.
2028         (gimple_cond_false_p): Likewise.
2029         (gimple_cond_set_condition): Likewise.
2030         * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
2031         * gimple-fold.c (fold_gimple_cond): Likewise.
2032         * gimple-pretty-print.c (dump_gimple_cond): Likewise.
2033         * tree-ssa-dom.c (canonicalize_comparison): Likewise.
2034         * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
2035         * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
2036         (recognize_bits_test): Likewise.
2037         * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
2038         (thread_around_empty_blocks): Likewise.
2039         (thread_through_normal_block): Likewise.
2040         (thread_across_edge): Likewise.
2041         * tree-ssa-threadedge.h (thread_across_edge): Likewise.
2042         * tree-vrp.c (range_fits_type_p): Likewise.
2044         * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
2045         gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
2046         * gimple-fold.c (fold_stmt_1): Likewise.
2047         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2048         * tree-ssa-dom.c (optimize_stmt): Likewise.
2049         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2050         * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
2051         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
2052         Likewise.
2053         * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
2055         * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
2056         gimple_cond.
2057         * tree-vrp.c (identify_jump_threads): Likewise.
2059         * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
2060         just a gimple.
2061         (gimple_build_cond_from_tree): Likewise.
2063         * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
2064         field "m_dummy_cond" from a plain gimple to a gimple_cond.
2066         * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
2067         inner_stmt and outer_stmt so that inner_cond and outer_cond can be
2068         of type gimple_cond once we know that we have code == GIMPLE_COND.
2069         * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
2070         "last" so that stmt can be of type gimple_cond.
2072 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2074         Introduce gimple_bind and use it for accessors.
2076         * coretypes.h (gimple_bind): New typedef.
2077         (const_gimple_bind): New typedef.
2079         * gdbhooks.py (build_pretty_printer): Add gimple_bind
2080         and its variants, using the gimple printer.
2082         * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
2083         require a gimple_bind rather than just a gimple.
2085         * gimple.c (gimple_build_bind): Return a gimple_bind rather than
2086         just a gimple.
2087         * gimple.h (gimple_build_bind): Likewise.
2089         * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
2091         * gimple.h (gimple_bind_vars): Update type-signature to
2092         require a gimple_bind rather than just a gimple, removing
2093         as_a and hence run-time check.
2094         (gimple_bind_set_vars): Likewise.
2095         (gimple_bind_append_vars): Likewise.
2096         (gimple_bind_body_ptr): Likewise.
2097         (gimple_bind_body): Likewise.
2098         (gimple_bind_set_body): Likewise.
2099         (gimple_bind_add_stmt): Likewise.
2100         (gimple_bind_add_seq): Likewise.
2101         (gimple_bind_block): Likewise.
2102         (gimple_bind_set_block): Likewise.
2103         * gimplify.c (gimple_push_bind_expr): Likewise.
2104         (gimple_current_bind_expr): Likewise.
2105         * tree-inline.c (copy_gimple_bind): Likewise.
2107         * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
2108         rather than a plain gimple.
2109         (gimplify_body): Likewise.
2110         (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
2111         a vec<gimple>.
2113         * gimplify.c (struct gimplify_ctx): Strengthen field
2114         "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
2115         (gimple_bind_expr_stack): Likewise for type of returned value.
2117         * gimplify.c (gimplify_body): Strengthen various types from gimple
2118         to gimple_bind, including the return type.
2120         * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
2121         so that local "scope" can be of type gimple_bind once we've reached
2122         the region where it must be of code GIMPLE_BIND.
2124         * gimple-low.c (lower_gimple_bind): Add checked cast to
2125         gimple_bind, since both callers (lower_function_body and
2126         lower_stmt) have checked the code for us.
2128         * gimple.c (gimple_copy): Add checked cast to gimple_bind in
2129         region guarded by check for code GIMPLE_BIND.
2130         * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
2131         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2132         * gimple-walk.c (walk_gimple_stmt): Likewise.
2133         * omp-low.c (scan_omp_1_stmt): Likewise.
2134         (lower_omp_1): Likewise.
2135         (lower_omp_for): Likewise.
2136         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
2137         (do_warn_unused_result): Likewise.
2138         * tree-inline.c (remap_gimple_stmt): Likewise.
2139         (estimate_num_insns): Likewise.
2140         * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
2142         * gimplify.c (gimplify_bind_expr): Update local(s) to be a
2143         gimple_bind rather than just a gimple.
2144         (gimplify_function_tree): Likewise.
2145         * omp-low.c (lower_omp_sections): Likewise.
2146         (lower_omp_single): Likewise.
2147         (lower_omp_master): Likewise.
2148         (lower_omp_taskgroup): Likewise.
2149         (lower_omp_ordered): Likewise.
2150         (lower_omp_critical): Likewise.
2151         (lower_omp_taskreg): Likewise.
2152         (lower_omp_teams): Likewise.
2153         * omp-low.c (lower_omp_for): Likewise; use
2154         gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
2155         (lower_omp_target): Likewise.
2156         * tree-nested.c (finalize_nesting_tree_1): Likewise.
2158         * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
2159         * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
2161 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
2163         Introduce gimple_switch and use it in various places
2165         * gimple.h (gimple_statement_switch): New subclass of
2166         gimple_statement_with_ops, adding the invariant that
2167         stmt->code == GIMPLE_SWITCH.
2168         (is_a_helper <gimple_statement_switch>::test (gimple)): New.
2170         * coretypes.h (gimple_switch): New typedef
2171         (const_gimple_switch): Likewise.
2173         * gdbhooks.py (build_pretty_printer): Add gimple_switch
2174         and its variants, using the gimple printer.
2176         * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
2177         rather than just a gimple.
2178         (gimple_build_switch): Likewise.
2179         * gimple.h (gimple_build_switch_nlabels): Likewise.
2180         (gimple_build_switch): Likewise.
2182         * gimple.h (gimple_switch_num_labels): Update type-signature to
2183         require a gimple_switch rather than just a gimple.
2184         (gimple_switch_set_num_labels): Likewise.
2185         (gimple_switch_set_index): Likewise.
2186         (gimple_switch_label): Likewise.
2187         (gimple_switch_set_label): Likewise.
2188         (gimple_switch_default_label): Likewise.
2189         (gimple_switch_set_default_label): Likewise.
2190         * expr.h (expand_case): Likewise.
2191         * gimple-pretty-print.c (dump_gimple_call): Likewise.
2192         * stmt.c (compute_cases_per_edge): Likewise.
2193         (expand_case): Likewise.
2194         * tree-cfg.h (group_case_labels_stmt): Likewise.
2195         * tree-cfg.c (make_gimple_switch_edges): Likewise.
2196         (find_taken_edge_switch_expr) Likewise.
2197         (find_case_label_for_value) Likewise.
2198         (get_cases_for_edge): Likewise.
2199         (group_case_labels_stmt): Likewise.
2200         (verify_gimple_switch): Likewise.
2201         * tree-eh.c (verify_norecord_switch_expr): Likewise.
2202         * tree-eh.c (lower_eh_constructs_2): Likewise.
2203         * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
2204         * tree-ssa-dom.c (record_edge_info): Likewise.
2205         * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
2206         (simplify_gimple_switch): Likewise.
2207         * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
2208         (collect_switch_conv_info): Likewise.
2209         (build_constructors): Likewise.
2210         (array_value_type): Likewise.
2211         (build_one_array): Likewise.
2212         (build_arrays): Likewise.
2213         (gen_inbound_check): Likewise.
2214         * tree-vrp.c (find_switch_asserts): Likewise.
2215         (find_case_label_range): Likewise.
2216         (find_case_label_ranges): Likewise.
2217         (vrp_visit_switch_stmt): Likewise.
2218         (simplify_switch_using_ranges): Likewise.
2220         * tree-vrp.c (switch_update): Strengthen field "stmt" from being
2221         merely a gimple to being a gimple_switch.
2223         * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
2224         gimple_switch in regions where the stmt code has been tested as
2225         GIMPLE_SWITCH.
2226         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
2227         * tree-cfg.c (make_edges): Likewise.
2228         (end_recording_case_labels): Likewise.
2229         (cleanup_dead_labels): Likewise.
2230         (cleanup_dead_labels): Likewise.
2231         (group_case_labels): Likewise.
2232         (find_taken_edge): Likewise.
2233         (find_case_label_for_value): Likewise.
2234         (verify_gimple_stmt): Likewise.
2235         (gimple_verify_flow_info): Likewise.
2236         (gimple_redirect_edge_and_branch): Likewise.
2237         * tree-inline.c (estimate_num_insns): Likewise.
2238         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
2239         * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
2240         * tree-switch-conversion.c (do_switchconv): Likewise.
2241         * tree-vrp.c  (find_assert_locations_1): Likewise.
2242         (vrp_visit_stmt): Likewise.
2243         (simplify_stmt_using_ranges): Likewise.
2245         * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
2246         Introduce local "lastg" as a generic gimple, so that local "last"
2247         can be of type gimple_switch once lastg's code has been verified.
2249         * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
2250         the GIMPLE_SWITCH case.
2252         * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
2253         argument, since the caller (find_taken_edge) has checked that
2254         last_stmt is a switch.
2256 Copyright (C) 2014 Free Software Foundation, Inc.
2258 Copying and distribution of this file, with or without modification,
2259 are permitted in any medium without royalty provided the copyright
2260 notice and this notice are preserved.