Use subclasses of gimple in various places
[official-gcc.git] / gcc / ChangeLog.gimple-classes
blobafdccbe1951c22315196c93824b356846a6c1ad5
1 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
3         Use subclasses of gimple in various places
5         * asan.c (insert_if_then_before_iter): Require a gimple cond
6         rathern than a plain gimple.
7         (asan_expand_check_ifn): Add a checked cast to gimple_cond.
9         * cfgloopmanip.c (create_empty_if_region_on_edge): Likewise.
11         * omp-low.c (simd_clone_adjust): Strengthen local from gimple
12         to gimple_phi.
14         * sese.c (set_ifsese_condition): Strengthen local from gimple to
15         gimple_cond.
17         * tree-call-cdce.c (gen_one_condition): Strengthen locals from
18         gimple to gimple_assign and gimple_cond.
20         * tree-ssa-phiopt.c (minmax_replacement): Likewise.
21         (cond_store_replacement): Strengthen locals from gimple to
22         gimple_phi and gimple_assign.
23         (cond_if_else_store_replacement_1): Likewise.
25         * tree-ssa-pre.c (do_regular_insertion): Strengthen local from
26         gimple to gimple_assign.
28         * tree-switch-conversion.c (hoist_edge_and_branch_if_true):
29         Strengthen local from gimple to gimple_cond.
30         (gen_def_assigns): Return a gimple_assign rather than a plain
31         gimple.
32         (gen_inbound_check): Strengthen locals from gimple to gimple_cond
33         and gimple_assign.
35         * tree-vect-loop-manip.c (slpeel_add_loop_guard): Strengthen local
36         from gimple to gimple_cond.
37         (set_prologue_iterations): Strengthen locals from gimple to
38         gimple_phi and gimple_cond.
40         * value-prof.c (gimple_ic): Strengthen local from gimple to
41         gimple_phi.
42         (gimple_stringop_fixed_value): Strengthen locals from gimple to
43         gimple_assign, gimple_cond, gimple_call, and gimple_phi.
45 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
47         Introduce gimple_eh_dispatch
49         * coretypes.h (gimple_eh_dispatch): New typedef.
50         (const_gimple_eh_dispatch): New typedef.
52         * gimple-pretty-print.c (dump_gimple_eh_dispatch): Require a
53         gimple_eh_dispatch rather than a plain gimple.
54         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_dispatch
55         within GIMPLE_EH_DISPATCH case of switch statement.
57         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
59         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
61         * gimple.c (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
62         rather than a plain gimple.
64         * gimple.h (gimple_build_eh_dispatch): Return a gimple_eh_dispatch
65         rather than a plain gimple.
66         (gimple_eh_dispatch_region): Require a const_gimple_eh_dispatch
67         rather than a plain const_gimple.
68         (gimple_eh_dispatch_set_region): Require a gimple_eh_dispatch
69         rather than a plain gimple.
71         * tree-cfg.c (make_edges): Add a checked cast to gimple_eh_dispatch
72         within GIMPLE_EH_DISPATCH case of switch statement.
73         (gimple_verify_flow_info): Likewise.
74         (gimple_redirect_edge_and_branch): Likewise.
75         (move_stmt_r): Likewise, adding a local.
77         * tree-eh.c (emit_eh_dispatch): Convert local from gimple to
78         gimple_eh_dispatch.
79         (make_eh_dispatch_edges): Require a gimple_eh_dispatch rather than
80         a plain gimple.
81         (redirect_eh_dispatch_edge): Likewise.
82         (lower_eh_dispatch): Likewise.
83         (execute_lower_eh_dispatch): Add a checked cast to
84         gimple_eh_dispatch.
85         (mark_reachable_handlers): Likewise.
86         (verify_eh_dispatch_edge): Require a gimple_eh_dispatch rather
87         than a plain gimple.
89         * tree-eh.h (make_eh_dispatch_edges): Likewise.
90         (redirect_eh_dispatch_edge): Likewise.
91         (verify_eh_dispatch_edge): Likewise.
93         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
94         gimple_eh_dispatch within GIMPLE_EH_DISPATCH case of switch
95         statement, adding a local.
96         (copy_edges_for_bb): Add a checked cast to gimple_eh_dispatch.
98 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
100         Introduce gimple_resx
102         * coretypes.h (gimple_resx): New typedef.
103         (const_gimple_resx): New typedef.
105         * gimple.h (gimple_build_resx): Return a gimple_resx rather than a
106         plain gimple.
107         (gimple_resx_region): Require a const_gimple_resx rather than a
108         plain const_gimple.
109         (gimple_resx_set_region): Require a gimple_resx rather than a
110         plain gimple.
112         * gimple-pretty-print.c (dump_gimple_resx): Require a gimple_resx
113         rather than a plain gimple.
114         (pp_gimple_stmt_1): Add a checked cast to gimple_resx within
115         GIMPLE_RESX case of switch statement.
117         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
119         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
121         * gimple.c (gimple_build_resx): Return a gimple_resx rather than
122         a plain gimple.
124         * tree-cfg.c (move_stmt_r): Add a checked cast to gimple_resx
125         within GIMPLE_RESX case of switch statement, adding a new local.
127         * tree-eh.c (emit_resx): Convert local "x" from gimple to
128         gimple_resx.
129         (lower_resx): Require a gimple_resx rather than a plain gimple.
130         (pass_lower_resx::execute): Add a checked cast to gimple_resx.
131         (mark_reachable_handlers): Likewise.
133         * tree-inline.c (remap_gimple_stmt): Add a checked cast to
134         gimple_resx within GIMPLE_RESX case of switch statement, adding
135         a new local.
137 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
139         Introduce gimple_eh_else
141         * coretypes.h (gimple_eh_else): New typedef.
142         (const_gimple_eh_else): New typedef.
144         * gimple.h (gimple_build_eh_else): Return a gimple_eh_else rather
145         than a plain gimple.
146         (gimple_eh_else_n_body_ptr): Require a gimple_eh_else rather than
147         a plain gimple.
148         (gimple_eh_else_n_body): Likewise.
149         (gimple_eh_else_e_body_ptr): Likewise.
150         (gimple_eh_else_e_body): Likewise.
151         (gimple_eh_else_set_n_body): Likewise.
152         (gimple_eh_else_set_e_body): Likewise.
154         * gimple-low.c (lower_stmt): Add checked cast to gimple_eh_else
155         within GIMPLE_EH_ELSE case of switch statement, introducing a new
156         local.
157         (gimple_stmt_may_fallthru): Likewise.
159         * gimple-pretty-print.c (dump_gimple_eh_else): Require a
160         gimple_eh_else rather than a plain gimple.
161         (pp_gimple_stmt_1): Add checked cast to gimple_eh_else within
162         GIMPLE_EH_ELSE case of switch statement
164         * gimple-walk.c (walk_gimple_stmt): Add checked cast to
165         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
166         introducing a new local.
168         * gimple.c (gimple_build_eh_else): Return a gimple_eh_else
169         rather than a plain gimple.
170         (gimple_copy): Add checked casts to gimple_eh_else within
171         GIMPLE_EH_ELSE case of switch statement, introducing new locals.
173         * tree-cfg.c (verify_gimple_in_seq_2): Add checked cast to
174         gimple_eh_else within GIMPLE_EH_ELSE case of switch statement,
175         introducing a new local.
177         * tree-eh.c (collect_finally_tree): Likewise.
178         (replace_goto_queue_1): Likewise.
179         (get_eh_else): Return a gimple_eh_else rather than a plain gimple.
180         (honor_protect_cleanup_actions): Convert local "eh_else" from
181         gimple to gimple_eh_else.
182         (lower_try_finally_nofallthru): Likewise.
183         (lower_try_finally_onedest): Introduce locals "eh_else" and
184         "label_stmt", using them in favor of "x" for the gimple_eh_else
185         and the gimple_label.
186         (lower_try_finally_copy): Convert local "eh_else" from gimple to
187         gimple_eh_else.
188         (lower_try_finally_switch): Likewise.
189         (decide_copy_try_finally): Likewise.
190         (refactor_eh_r): Add checked cast to gimple_eh_else within
191         GIMPLE_EH_ELSE case of switch statement, introducing a new local.
193 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
195         Introduce gimple_eh_must_not_throw
197         * coretypes.h (gimple_eh_must_not_throw): New typedef.
198         (const_gimple_eh_must_not_throw): New typedef.
200         * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
201         a gimple_eh_must_not_throw rather than a plain gimple.
202         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
203         within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
205         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
207         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
209         * gimple.c (gimple_build_eh_must_not_throw): Return a
210         gimple_eh_must_not_throw rather than a plain gimple.
212         * gimple.h (gimple_build_eh_must_not_throw): Return a
213         gimple_eh_must_not_throw rather than a plain gimple.
214         (gimple_eh_must_not_throw_fndecl): Require a
215         gimple_eh_must_not_throw rather than a plain gimple.
216         (gimple_eh_must_not_throw_set_fndecl): Likewise.
218         * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
220 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
222         Introduce gimple_eh_filter
224         * coretypes.h (gimple_eh_filter): New typedef.
225         (const_gimple_eh_filter): New typedef.
227         * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
228         rather than a plain gimple.
230         * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
231         gimple_eh_filter rather than a plain gimple.
232         (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
233         GIMPLE_EH_FILTER case of switch statement.
235         * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
236         rather than a plain gimple.
238 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
240         Introduce gimple_catch
242         * coretypes.h (gimple_catch): New typedef.
243         (const_gimple_catch): New typedef.
245         * gimple-low.c (lower_try_catch): Add checked cast to gimple_catch.
246         (gimple_try_catch_may_fallthru): Likewise.
248         * gimple-pretty-print.c (dump_gimple_catch): Require a gimple_catch
249         rather than a plain gimple.
250         (pp_gimple_stmt_1): Add checked cast to gimple_catch within
251         GIMPLE_CATCH case of switch statement.
253         * gimple-walk.c (walk_gimple_op): Likewise.
254         (walk_gimple_stmt): Likewise.
256         * gimple.c (gimple_build_catch): Return a gimple_catch rather than
257         a plain gimple.
258         (gimple_copy): Add checked casts to gimple_catch within
259         GIMPLE_CATCH case of switch statement, introducing new locals.
261         * gimple.h (gimple_build_catch): Return a gimple_catch rather than
262         a plain gimple.
263         (gimple_catch_types_ptr): Require a gimple_catch rather than a
264         plain gimple.
265         (gimple_catch_handler_ptr): Likewise.
266         (gimple_catch_handler): Likewise.
267         (gimple_catch_set_types): Likewise.
268         (gimple_catch_set_handler): Likewise.
270         * omp-low.c (lower_omp_1): Add checked cast to gimple_catch within
271         GIMPLE_CATCH case of switch statement.
273         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
274         (do_warn_unused_result): Likewise.
276         * tree-eh.c (collect_finally_tree): Likewise.
277         (replace_goto_queue_1): Likewise.
278         (lower_catch): Convert local from gimple to gimple_catch.
279         (refactor_eh_r): Add checked cast to gimple_catch within
280         GIMPLE_CATCH case of switch statement.
282         * tree-inline.c (remap_gimple_stmt): Likewise.
283         (estimate_num_insns): Add checked cast to gimple_catch within
284         GIMPLE_CATCH case of switch statement, introducing new local.
286 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
288         Introduce gimple_transaction
290         * coretypes.h (gimple_transaction): New typedef.
291         (const_gimple_transaction): New typedef.
293         * gimple.h (gimple_build_transaction): Return a gimple_transaction
294         rather than a plain gimple.
295         (gimple_transaction_body_ptr): Require a gimple_transaction rather
296         than a plain gimple.
297         (gimple_transaction_body): Likewise.
298         (gimple_transaction_label_ptr): Likewise.
299         (gimple_transaction_set_body): Likewise.
300         (gimple_transaction_set_label): Likewise.
301         (gimple_transaction_set_subcode): Likewise.
302         (gimple_transaction_label): Require a const_gimple_transaction
303         rather than a plain const_gimple.
304         (gimple_transaction_subcode): Likewise.
306         * gimple-low.c (lower_stmt): Add checked cast to
307         gimple_transaction within GIMPLE_TRANSACTION case of switch
308         statement.
310         * gimple-pretty-print.c (dump_gimple_transaction): Require a
311         gimple_transaction rather than a plain gimple.
312         (pp_gimple_stmt_1): Add checked cast to gimple_transaction within
313         GIMPLE_TRANSACTION case of switch statement.
314         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
315         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
316         * gimple-walk.c (walk_gimple_op): Likewise.
317         (walk_gimple_stmt): Likewise.
319         * gimple.c (gimple_build_transaction): Return a gimple_transaction
320         rather than a plain gimple.
321         (gimple_copy): Add checked casts to gimple_transaction within
322         GIMPLE_TRANSACTION case of switch statement.
324         * gimplify.c (gimplify_transaction): Split local "g" into
325         "body_stmt" and "trans_stmt", strengthening the type of the latter
326         from gimple to gimple_transaction.
328         * omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
329         within GIMPLE_TRANSACTION case of switch statement.
331         * trans-mem.c (diagnose_tm_1): Add checked cast within
332         GIMPLE_TRANSACTION case of switch statement, introducing a new
333         local "trans_stmt".  Use it in place of "stmt".
334         (examine_call_tm): Convert local from gimple to gimple_transaction.
335         (tm_region::get_transaction_stmt): New method.
336         (tm_region::transaction_stmt): Add clarification of type to the
337         comment.
338         (tm_region_init_0): Require a gimple_transaction rather than a
339         plain gimple.
340         (tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
341         dyn_cast<gimple_transaction> and new local.
342         (transaction_subcode_ior): Add a new local, using the new
343         get_transaction_stmt method to perform a checked cast.
344         (propagate_tm_flags_out): Likewise.
345         (expand_transaction): Add a checked cast using the new
346         get_transaction_stmt method.
347         (generate_tm_state): Likewise.
348         (execute_tm_mark): Likewise.
349         (ipa_tm_diagnose_transaction): Likewise.
351         * tree-cfg.c (verify_gimple_transaction): Require a
352         gimple_transaction rather than a plain gimple.
353         (make_edges): Add checked cast within GIMPLE_TRANSACTION case of
354         switch statement
355         (cleanup_dead_labels): Likewise.
356         (verify_gimple_stmt): Likewise.
357         (verify_gimple_in_seq_2): Likewise.
358         (verify_gimple_in_seq_2): Likewise.
359         (gimple_redirect_edge_and_branch): Add checked cast.
361         * tree-inline.c (remap_gimple_stmt): Add checked cast within
362         GIMPLE_TRANSACTION case of switch statement, introducing a new
363         local "old_trans_stmt".  Use it in place of "stmt".  Add new
364         local "new_trans_stmt", using it to initialize "copy", and for
365         type-safe operations as a transaction.
366         (estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
367         case of switch statement.
369 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
371         Introduce gimple_asm
373         * coretypes.h (gimple_asm): New typedef.
374         (const_gimple_asm): New typedef.
376         * gimple.h (gimple_build_asm_vec): Return a gimple_asm rather than
377         just a gimple.
378         (gimple_asm_clobbers_memory_p): Require a const_gimple_asm rather
379         than just a const_gimple.
380         (gimple_asm_ninputs): Likewise.
381         (gimple_asm_noutputs): Likewise.
382         (gimple_asm_nclobbers): Likewise.
383         (gimple_asm_nlabels): Likewise.
384         (gimple_asm_input_op): Likewise.
385         (gimple_asm_input_op_ptr): Likewise.
386         (gimple_asm_output_op): Likewise.
387         (gimple_asm_output_op_ptr): Likewise.
388         (gimple_asm_clobber_op): Likewise.
389         (gimple_asm_label_op): Likewise.
390         (gimple_asm_string): Likewise.
391         (gimple_asm_volatile_p): Likewise.
392         (gimple_asm_input_p): Likewise.
393         (gimple_asm_set_input_op): Require a gimple_asm rather than a plain
394         gimple.
395         (gimple_asm_set_output_op): Likewise.
396         (gimple_asm_set_clobber_op): Likewise.
397         (gimple_asm_set_label_op): Likewise.
398         (gimple_asm_set_volatile): Likewise.
399         (gimple_asm_set_input): Likewise.
401         * cfgexpand.c (expand_asm_stmt): Require a gimple_asm rather than
402         a plain gimple.
403         (expand_gimple_stmt_1): Add checked cast to gimple_asm within
404         GIMPLE_ASM case of switch statement.
406         * gimple-fold.c (fold_stmt_1): Add new local from checked cast to
407         gimple_asm within case GIMPLE_ASM.
409         * gimple-pretty-print.c (dump_gimple_asm): Require a gimple_asm
410         rather than a plain gimple.
411         (pp_gimple_stmt_1): Add checked cast to gimple_asm within
412         GIMPLE_ASM case of switch statement.
414         * gimple-streamer-in.c (input_gimple_stmt): Rework existing
415         checked cast to gimple_asm; add a new one.
417         * gimple-streamer-out.c (output_gimple_stmt): Add new local from
418         checked cast to gimple_asm within case GIMPLE_ASM.
420         * gimple-walk.c (walk_gimple_asm): Require a gimple_asm rather
421         than a plain gimple.
422         (walk_gimple_op): Add checked cast to gimple_asm within GIMPLE_ASM
423         case of switch statement.
424         (walk_stmt_load_store_addr_ops): Use dyn_cast<gimple_asm> in place
425         of a code check against GIMPLE_ASM to introduce a new gimple_asm
426         local.
428         * gimple.c (gimple_build_asm_1): Return a gimple_asm rather than
429         a plain gimple.
430         (gimple_build_asm_vec): Likewise.
431         (gimple_has_side_effects): Add a checked cast to gimple_asm.
432         (gimple_could_trap_p_1): Likewise.
433         (gimple_call_builtin_p): Require a const_gimple_asm rather then
434         a const_gimple.
436         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
437         and a new local of type gimple_asm within GIMPLE_ASM case.
439         * gimplify.c (gimplify_asm_expr): Convert a local from gimple to
440         gimple_asm.
442         * ipa-pure-const.c (check_stmt): Add checked casts within
443         GIMPLE_ASM case.
445         * ssa-iterators.h (op_iter_init): Likewise.
447         * tree-cfg.c (make_goto_expr_edges): Convert a local from gimple
448         to gimple_asm.
449         (cleanup_dead_labels): Add a checked cast and a new local of type
450         gimple_asm within GIMPLE_ASM case.
451         (gimple_redirect_edge_and_branch): Likewise.
452         (is_ctrl_altering_stmt): Add a checked cast.
453         (need_fake_edge_p): Replace a code check against GIMPLE_ASM with a
454         dyn_cast<gimple_asm>.
456         * tree-complex.c (expand_complex_comparison): Convert a local from
457         gimple to gimple_asm.
459         * tree-data-ref.c (get_references_in_stmt): Add a checked cast to
460         gimple_asm.
462         * tree-eh.c (stmt_could_throw_p): Likewise.
464         * tree-inline.c (estimate_num_insns): Likewise.
466         * tree-sra.c (scan_function): Add a checked cast and a new local
467         of type gimple_asm within GIMPLE_ASM case.
468         (sra_modify_function_body): Likewise.
469         (ipa_sra_modify_function_body): Likewise.
471         * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
473         * tree-ssa-dce.c (propagate_necessity): Replace a code check
474         against GIMPLE_ASM with a dyn_cast<gimple_asm>.
476         * tree-ssa-operands.c (maybe_add_call_vops): Require a gimple_asm
477         rather than a plain gimple.
478         (parse_ssa_operands): Add a checked cast to gimple_asm.
480         * tree-ssa-structalias.c (find_func_aliases): Replace a check for
481         GIMPLE_ASM with a dyn_cast<gimple_asm>, introducing  a new local
482         "asm_stmt", using it in place of "t" for typesafety.
484         * tree-ssa-threadedge.c
485         (record_temporary_equivalences_from_stmts_at_dest): Add a checked
486         cast to gimple_asm.
488         * tree-ssa.c (execute_update_addresses_taken): Add checked casts
489         and new locals of type gimple_asm within clauses guarded by code
490         check.
492 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
494         Introduce gimple_goto
496         * coretypes.h (gimple_goto): New typedef.
497         (const_gimple_goto): New typedef.
499         * gimple.h (gimple_statement_goto): New subclass of
500         gimple_statement_with_ops, adding the invariant that
501         stmt->code == GIMPLE_GOTO.
502         (is_a_helper <gimple_statement_goto>::test): New.
503         (gimple_build_goto): Return a gimple_goto rather than a
504         plain gimple.
506         * gimple-pretty-print.c (dump_gimple_goto): Require a gimple_goto
507         rather than a plain gimple.
508         (pp_gimple_stmt_1): Add a checked cast to gimple_goto within
509         GIMPLE_GOTO case of switch statement.
511         * gimple.c (gimple_build_goto): Return a gimple_goto rather than a
512         plain gimple.
514         * tree-cfg.c (verify_gimple_goto): Require a gimple_goto rather
515         than a plain gimple.
516         (verify_gimple_stmt): Add a checked cast to gimple_goto within
517         GIMPLE_GOTO case of switch statement.
519 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
521         Introduce gimple_return
523         * coretypes.h (gimple_return): New typedef.
524         (const_gimple_return): New typedef.
526         * gimple.h (gimple_statement_return): New subclass of
527         gimple_statement_with_memory_ops, adding the invariant that
528         stmt->code == GIMPLE_RETURN.
529         (is_a_helper <gimple_statement_return>::test): New.
530         (gimple_build_return): Return a gimple_return rather
531         than a plain gimple.
533         * gimple.c (gimple_build_return): Return a gimple_return rather
534         than a plain gimple.
536         * cgraphunit.c (expand_thunk): Convert local from a gimple to
537         a gimple_return.
539         * gimple-low.c (struct return_statements_t): Convert field "stmt"
540         from a gimple to a gimple_return.
541         (lower_gimple_return): Convert local from a gimple to a
542         gimple_return.
544         * gimple-pretty-print.c (dump_gimple_return): Require a
545         gimple_return rather than a plain gimple.
546         (pp_gimple_stmt_1): Add a checked cast to gimple_return within
547         case GIMPLE_RETURN of switch statement.
549         * gimplify.c (gimplify_return_expr): Convert locals from
550         gimple to gimple_return.
552         * ipa-split.c (split_function): Likewise.
554         * tree-cfg.c (verify_gimple_assign): Require a gimple_return
555         rather than a plain gimple.
556         (verify_gimple_stmt): Add checked cast to gimple_return within
557         case GIMPLE_RETURN of switch statement.
559         * tree-tailcall.c (adjust_return_value): Convert local from
560         gimple to gimple_return.
562 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
564         Introduce gimple_call
566         * coretypes.h (gimple_call): New typedef.
567         (const_gimple_call): New typedef.
569         * asan.c (get_mem_refs_of_builtin_call): Require a
570         const_gimple_call rather than a const gimple.
571         (has_stmt_been_instrumented_p): Add a checked cast to
572         gimple_call.
573         (instrument_strlen_call): Likewise.
574         (instrument_builtin_call): Likewise.
575         * builtins.c (validate_gimple_arglist): Require a
576         const_gimple_call rather than a const gimple.
577         (fold_call_stmt): Require a gimple_call rather than a gimple.
578         * builtins.h (validate_gimple_arglist): Require a
579         const_gimple_call rather than a const gimple.
580         (fold_call_stmt): Require a gimple_call rather than a gimple.
581         * cfgexpand.c (expand_call_stmt): Likewise.
582         (expand_gimple_stmt_1): Add a checked cast to gimple_call within
583         GIMPLE_CALL case.
584         * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Strengthen
585         local "new_stmt" from gimple to gimple_call, adding a checked
586         cast.
587         * cgraphunit.c (cgraph_node::expand_thunk): Likewise for local
588         "call".
589         * gimple-fold.c (gimple_fold_builtin_snprintf_chk): Likewise for
590         local "stmt".
591         (gimple_fold_builtin_snprintf): Likewise.
592         (gimple_fold_builtin): Likewise.
593         (gimple_fold_call): Likewise.
594         (gimple_fold_stmt_to_constant_1): Introduce local "call_stmt" via
595         checked cast of "stmt" to gimple_call, using it in various places
596         for typesafety.
597         * gimple-pretty-print.c (dump_gimple_call_args): Strengthen param
598         2 from gimple to gimple_call.
599         (dump_gimple_call): Likewise.
600         (pp_gimple_stmt_1): Add a checked cast to gimple_call within
601         GIMPLE_CALL case.
602         * gimple-streamer-in.c (input_gimple_stmt): Replace is_gimple_call
603         with a dyn_cast<gimple_call>, introducing local "call_stmt", and
604         using it in place of "stmt" for typesafety.  Add a checked cast
605         in statement guarded by check for GIMPLE_CALL.
606         * gimple-walk.c (walk_gimple_op): Add a checked cast to
607         gimple_call.
608         * gimple.c (gimple_call_reset_alias_info): Strengthen param from
609         gimple to gimple_call.
610         (gimple_build_call_1): Strengthen return type and local from
611         gimple to gimple_call.
612         (gimple_build_call_vec): Likewise.
613         (gimple_build_call): Likewise.
614         (gimple_build_call_valist): Likewise.
615         (gimple_build_call_internal_1): Likewise.
616         (gimple_build_call_internal): Likewise.
617         (gimple_build_call_internal_vec): Likewise.
618         (gimple_build_call_from_tree): Likewise.
619         (gimple_call_return_flags): Strengthen param from
620         const_gimple to const_gimple_call.
621         (gimple_call_copy_skip_args): Strengthen return type and local from
622         gimple to gimple_call.
623         * gimple.h (gimple_call_reset_alias_info): Strengthen param from
624         gimple to gimple_call.
625         (gimple_build_call_vec): Strengthen return type from gimple to
626         gimple_call.
627         (gimple_build_call): Likewise.
628         (gimple_build_call_valist): Likewise.
629         (gimple_build_call_internal): Likewise.
630         (gimple_build_call_internal_vec): Likewise.
631         (gimple_build_call_from_tree): Likewise.
632         (gimple_call_return_flags): Strengthen param from const_gimple to
633         const_gimple_call.
634         (gimple_call_copy_skip_args): Strengthen return type from gimple
635         to gimple_call.
636         (gimple_call_set_internal_fn): Strengthen param "call_stmt" from
637         gimple to gimple_call.
638         (gimple_call_return_type): Strengthen param from const_gimple to
639         const_gimple_call.
640         (gimple_call_chain_ptr): Likewise.
641         (gimple_call_set_chain): Strengthen param from gimple to
642         gimple_call.
643         (gimple_call_set_return_slot_opt): Likewise.
644         (gimple_call_set_from_thunk): Likewise.
645         (gimple_call_from_thunk_p): Likewise.
646         (gimple_call_set_va_arg_pack): Likewise.
647         (gimple_call_va_arg_pack_p): Likewise.
648         (gimple_call_set_alloca_for_var): Likewise.
649         (gimple_call_alloca_for_var_p): Likewise.
650         (gimple_expr_type): Introduce local "call_stmt" via a checked cast
651         and use it for typesafety.
652         * gimplify.c (gimplify_call_expr): Strengthen local "call" from
653         gimple to gimple_call.
654         (gimplify_modify_expr_to_memcpy): Likewise for local "gs".
655         (gimplify_modify_expr_to_memset): Likewise.
656         (gimplify_modify_expr): Add a checked cast to gimple_call.
657         (gimplify_expr): Strengthen local "call" from gimple to
658         gimple_call.
659         (gimplify_function_tree): Likewise.
660         * internal-fn.c (expand_LOAD_LANES): Strengthen param from gimple
661         to gimple_call.
662         (expand_STORE_LANES): Likewise.
663         (expand_ANNOTATE): Likewise.
664         (expand_GOMP_SIMD_LANE): Likewise.
665         (expand_GOMP_SIMD_VF): Likewise.
666         (expand_GOMP_SIMD_LAST_LANE): Likewise.
667         (expand_UBSAN_NULL): Likewise.
668         (expand_UBSAN_BOUNDS): Likewise.
669         (expand_UBSAN_OBJECT_SIZE): Likewise.
670         (expand_ASAN_CHECK): Likewise.
671         (ubsan_expand_si_overflow_addsub_check): Likewise.
672         (ubsan_expand_si_overflow_neg_check): Likewise.
673         (ubsan_expand_si_overflow_mul_check): Likewise.
674         (expand_UBSAN_CHECK_ADD): Likewise.
675         (expand_UBSAN_CHECK_SUB): Likewise.
676         (expand_UBSAN_CHECK_MUL): Likewise.
677         (expand_LOOP_VECTORIZED): Likewise.
678         (expand_MASK_LOAD): Likewise.
679         (expand_MASK_STORE): Likewise.
680         (expand_ABNORMAL_DISPATCHER): Likewise.
681         (expand_BUILTIN_EXPECT): Likewise.
682         (internal_fn_expanders): Likewise for entries in this table.
683         (expand_internal_call): Likewise.
684         * internal-fn.def: Update comment to reflect strengthening of
685         param of expanders.
686         * internal-fn.h (expand_internal_call): Strengthen param from
687         gimple to gimple_call.
688         * ipa-prop.c (ipa_modify_call_arguments): Likewise for local
689         "new_stmt".
690         * ipa-pure-const.c (check_call): Likewise for param "call".
691         (check_stmt): Add a checked cast to gimple_call within GIMPLE_CALL
692         case.
693         * ipa-split.c (split_function): Strengthen local "call" from
694         gimple to gimple_call.
695         * omp-low.c (build_omp_barrier): Likewise for local "g".
696         (lower_rec_input_clauses): Likewise for local "stmt".
697         * trans-mem.c (build_tm_load): Likewise for return type and local
698         "gcall".
699         (build_tm_store): Likewise.
700         (expand_transaction): Likewise for local "call".
701         * tree-call-cdce.c (check_pow): Likewise for param.
702         (check_builtin_call): Likewise.
703         (is_call_dce_candidate): Likewise.
704         (gen_conditions_for_pow): Likewise.
705         (gen_shrink_wrap_conditions): Likewise.
706         (shrink_wrap_one_built_in_call): Likewise.
707         (shrink_wrap_conditional_dead_built_in_calls): Strengthen param
708         from vec<gimple> to vec<gimple_call>, and local "bi_call" from
709         gimple to gimple_call.
710         (pass_call_cdce::execute): Strengthen local
711         "cond_dead_built_in_calls" from auto_vec<gimple> to
712         auto_vec<gimple_call> and local "stmt" from gimple to gimple_call,
713         * tree-cfg.c (notice_special_calls): Strengthen param from gimple
714         to gimple_call.
715         * tree-cfg.h (notice_special_calls): Likewise.
716         * tree-complex.c (expand_complex_libcall): Likewise for local
717         "stmt".
718         * tree-inline.c (remap_gimple_stmt): Add checked cast to
719         gimple_call.
720         (copy_bb): Likewise.  Strengthen local "new_call" from gimple to
721         gimple_call.
722         (inline_forbidden_p_stmt): Add checked cast to gimple_call.
723         * tree-nested.c (init_tmp_var_with_call): Strengthen param "call"
724         from gimple to gimple_call.
725         (convert_nl_goto_reference): Likewise for local "call".
726         (convert_tramp_reference_op): Likewise.
727         (convert_gimple_call): Add checked cast to gimple_call.
728         * tree-nrv.c (dest_safe_for_nrv_p): Strengthen param "call" from
729         gimple to gimple_call.
730         (pass_return_slot::execute): Likewise for local "stmt", using a
731         dyn_cast<gimple_call> rather than an is_gimple_call call.
732         * tree-object-size.c (alloc_object_size): Strengthen param "call"
733         from const_gimple to const_gimple_call.
734         (pass_through_call): Likewise.
735         (call_object_size): Strengthen param "call" from gimple to
736         gimple_call.
737         (collect_object_sizes_for): Introduce local "call_stmt" via a
738         checked cast, using it for typesafety.
739         (check_for_plus_in_loops_1): Likewise.
740         (pass_object_sizes::execute): Add a checked cast to gimple_call.
741         * tree-profile.c (gimple_gen_interval_profiler): Strengthen local
742         "call" from gimple to gimple_call.
743         (gimple_gen_pow2_profiler): Likewise.
744         (gimple_gen_one_value_profiler): Likewise.
745         (gimple_gen_time_profiler): Likewise.
746         (gimple_gen_average_profiler): Likewise.
747         (gimple_gen_ior_profiler): Likewise.
748         * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise for
749         param "call".
750         (ref_maybe_used_by_call_p): Likewise.
751         (ref_maybe_used_by_stmt_p): Add a checked cast to gimple_call.
752         (call_may_clobber_ref_p_1): Strengthen param "call" from gimple to
753         gimple_call.
754         (call_may_clobber_ref_p): Likewise.
755         (stmt_may_clobber_ref_p_1): Add a checked cast to gimple_call.
756         * tree-ssa-alias.h (call_may_clobber_ref_p): Strengthen param 1
757         from gimple to gimple_call.
758         (call_may_clobber_ref_p_1): Likewise.
759         * tree-ssa-dce.c (eliminate_unnecessary_stmts): Add a checked cast
760         to gimple_call.
761         * tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Strengthen
762         local "call" from gimple to gimple_call.
763         * tree-ssa-math-opts.c (build_and_insert_call): Likewise for local
764         "call_stmt".
765         * tree-ssa-operands.c (maybe_add_call_vops): Likewise for param
766         "stmt".
767         (parse_ssa_operands): Add a checked cast to gimple_call within
768         GIMPLE_CALL case.
769         * tree-ssa-pre.c (compute_avail): Add a checked cast to
770         gimple_call.
771         * tree-ssa-sccvn.c (copy_reference_ops_from_call): Strengthen
772         param "call" from gimple to gimple_call.
773         (valueize_shared_reference_ops_from_call): Likewise.
774         (vn_reference_lookup_3): Add a checked cast to gimple_call.
775         (vn_reference_lookup_call): Strengthen param "call" from gimple to
776         gimple_call.
777         (visit_reference_op_call): Likewise for param "stmt".
778         (visit_use): Replace is_gimple_call with a dyn_cast, introducing
779         local "call_stmt", using it in place of "stmt" for type-safety.
780         * tree-ssa-sccvn.h (vn_reference_lookup_call): Strengthen param 1
781         from gimple to gimple_call.
782         * tree-ssa-structalias.c (get_call_vi): Likewise.
783         (lookup_call_use_vi): Likewise.
784         (lookup_call_clobber_vi): Likewise.
785         (get_call_use_vi): Likewise.
786         (get_call_clobber_vi): Likewise.
787         (handle_rhs_call): Likewise.
788         (handle_lhs_call): Likewise.
789         (handle_const_call): Likewise.
790         (handle_pure_call): Likewise.
791         (get_fi_for_callee): Likewise.
792         (find_func_aliases_for_builtin_call): Likewise for param 2.
793         (find_func_aliases_for_call): Likewise.
794         (find_func_aliases): Add a checked cast to gimple_call.
795         (find_func_clobbers): Replace is_gimple_call with a dyn_cast,
796         introducing local "call_stmt", using it in place of "stmt" for
797         type-safety.
798         (compute_points_to_sets): Strengthen local "stmt" from gimple to
799         gimple_call, replacing is_gimple_call with a
800         dyn_cast <gimple_call>.
801         (ipa_pta_execute): Likewise.
802         * tree-ssa-threadedge.c
803         (record_temporary_equivalences_from_stmts_at_dest): Add checked
804         cast to gimple_call.
805         * tree-tailcall.c (find_tail_calls): Strengthen local "call" from
806         gimple to gimple_call, adding a checked cast.
807         * tree-vect-data-refs.c (vect_setup_realignment): Eliminate
808         top-level local "new_stmt" in favor of more tightly-scoped locals
809         "new_stmt" of type gimple_assign and gimple_call.
810         * tree-vect-patterns.c (vect_recog_pow_pattern): Strenghthen local
811         "stmt" from gimple to gimple_call.
812         * tree-vect-stmts.c (vectorizable_function): Likewise for param
813         "call".
814         (vectorizable_call): Rename param 1 from "stmt" to "gs",
815         reintroducing "stmt" as a gimple_call once we've established that
816         we're working with a GIMPLE_CALL.
817         * tree-vectorizer.h (vectorizable_function): Strengthen param 1
818         from gimple to gimple_call.
819         * value-prof.c (check_ic_target): Likewise.
820         (gimple_ic_transform): Likewise for local "stmt", replacing a
821         check for GIMPLE_CALL with a dyn_cast.
822         (interesting_stringop_to_profile_p): Strengthen param "call"
823         from gimple to gimple_call.
824         (gimple_stringop_fixed_value): Likewise for param "vcall_stmt".
825         (gimple_stringops_transform): Likewise for local "stmt",
826         replacing a check for GIMPLE_CALL with a dyn_cast.
827         (gimple_stringops_values_to_profile): Rename param 1 from "stmt"
828         to "gs", reintroducing "stmt" as a gimple_call once we've
829         established that we're working with a GIMPLE_CALL.
830         * vtable-verify.c (verify_bb_vtables): Strengthen local
831         "call_stmt" from gimple to gimple_call.
833 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
835         Concretize get_loop_exit_condition et al to working on gimple_cond
837         * tree-scalar-evolution.h (get_loop_exit_condition): Return a
838         gimple_cond.
839         * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
840         concretizing local "res" from gimple to gimple_cond.
841         * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
842         locals from gimple to gimple_cond.
843         (slpeel_can_duplicate_loop_p): Likewise.
844         * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
845         (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
847 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
849         Update various expressions within tree-scalar-evolution.c to be gimple_phi
851         * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
852         rather than a gimple.
853         (follow_ssa_edge_binary): Likewise.
854         (follow_ssa_edge_expr): Likewise.
855         (follow_ssa_edge_in_rhs): Likewise.
856         (backedge_phi_arg_p): Likewise.
857         (follow_ssa_edge_in_condition_phi_branch): Likewise.
858         (follow_ssa_edge_in_condition_phi): Likewise.
859         (follow_ssa_edge_inner_loop_phi): Likewise.
860         (analyze_evolution_in_loop): Likewise.
861         (analyze_initial_condition): Likewise.
862         (interpret_loop_phi): Likewise.
863         (interpret_condition_phi): Likewise.
864         (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
866         (analyze_scalar_evolution_1): Add checked casts to gimple_phi
867         within "case GIMPLE_PHI".
869 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
871         tree-ssa-loop-ivopts.c: use gimple_phi in a few places
873         * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
874         (find_bivs): Convert local "phi" into a gimple_phi.
875         (mark_bivs): Likewise.
877 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
879         tree-ssa-loop-manip.c: use gimple_phi in three places
881         * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
882         gimple_phi.
883         (split_loop_exit_edge): Likewise for "phi" and "new_phi".
885 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
887         tree-ssa-loop-niter.c: use gimple_phi in a few places
889         * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
890         rather than a gimple.
891         (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
892         (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
894 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
896         tree-ssa-phiprop.c: use gimple_phi
898         * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
899         parameter "phi" and local "new_phi" from gimple to gimple_phi.
901 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
903         tree-predcom.c: use gimple_phi in various places
905         * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
906         than just a gimple.
907         (insert_looparound_copy): Require a gimple_phi rather than just a
908         gimple.
909         (add_looparound_copies): Convert local "phi" to be a gimple_phi.
910         (initialize_root_vars): Likewise.
911         (initialize_root_vars_lm): Likewise.
913 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
915         tree-parloops.c: use gimple_phi in various places
917         * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
918         from gimple to gimple_phi.
919         (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
920         (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
921         (gather_scalar_reductions): Convert to a gimple_phi_iterator and
922         gimple_phi.
923         (try_create_reduction_list): Likewise.
925 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
927         Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
929         * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
930         type of parameter from gimple to gimple_phi.
932         * tree-complex.c (complex_visit_phi): Update signature of callback
933         implementation accordingly.
934         * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
935         * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
936         * tree-vrp.c (vrp_visit_phi_node): Likewise.
938         * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
939         gimple_phi when invoking the ssa_prop_visit_phi callback.
941 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
943         Introduce gimple_phi_iterator
945         * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
946         gimple_stmt_iterator with identical layout, but adding...
947         (gimple_phi_iterator::phi): ...new method, equivalent to
948         gsi_stmt (), but casting the underlying gimple to gimple_phi,
949         checking that code == GIMPLE_PHI in a checked build.
950         (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
951         gimple_stmt_iterator.
953         * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
954         than just a gimple.
955         (if_convertible_phi_p): Likewise.
956         * tree-phinodes.h (add_phi_node_to_bb): Likewise.
957         * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
959         * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
960         and a vec<gimple_phi> *, rather than just a gimple and
961         vec<gimple> *, and a hash_set<gimple_phi> * rather than a
962         hash_set<gimple> *.
963         (find_uninit_use): Likewise; add checked cast to gimple_phi when
964         adding to worklist.
965         (pass_late_warn_uninitialized::execute): Strengthen types of
966         various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
967         "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
968         gimple_phi, "added_to_worklist" from hash_set<gimple> to
969         hash_set<gimple_phi>.
971         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
972         gimple_phi_iterator * rather than a gimple_stmt_iterator *;
973         use it to strengthen local from a gimple to a gimple_phi.
975         * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
976         gimple_stmt_iterator to a gimple_phi_iterator.  Use the iterator's
977         "phi" method rather than gsi_stmt.  Use this checked cast to convert
978         the type of related local from a plain gimple to a gimple_phi.
979         * gimple-pretty-print.c (dump_phi_nodes): Likewise.
980         * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
981         Likewise.
982         * sese.c (sese_add_exit_phis_edge): Likewise.
983         * tree-cfg.c (reinstall_phi_args): Likewise.
984         (gimple_make_forwarder_block): Likewise.
985         (add_phi_args_after_copy_edge): Likewise.
986         (gimple_lv_adjust_loop_header_phi): Likewise.
987         * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
988         (remove_forwarder_block_with_phi): Likewise.
989         (merge_phi_nodes): Likewise.
990         * tree-complex.c (update_phi_components): Likewise.
991         * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
992         * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
993         (copy_phis_for_bb): Likewise.
994         * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
995         * tree-outof-ssa.c (eliminate_build): Likewise.
996         (eliminate_useless_phis): Likewise.
997         (rewrite_trees): Likewise.
998         (insert_backedge_copies): Likewise.
999         * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
1000         (remove_phi_args): Likewise.
1001         (remove_phi_nodes): Likewise.
1002         * tree-predcom.c (find_looparound_phi): Likewise.
1003         (eliminate_temp_copies): Likewise.
1004         * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
1005         (scev_const_prop): Likewise; also, add checked cast to phi.
1006         * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
1007         * tree-ssa-dce.c (remove_dead_phis): Likewise.
1008         (forward_edge_to_pdom): Likewise.
1009         * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
1010         (cprop_into_successor_phis): Likewise.
1011         (propagate_rhs_into_lhs): Likewise.
1012         (eliminate_degenerate_phis_1): Likewise.
1013         * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
1014         * tree-ssa-live.c (calculate_live_on_exit): Likewise.
1015         (verify_live_on_entry): Likewise.
1016         * tree-ssa-loop-im.c
1017         (move_computations_dom_walker::before_dom_children): Likewise.
1018         * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
1019         (mark_bivs): Likewise.
1020         (find_interesting_uses_outside): Likewise.
1021         (determine_set_costs): Likewise.
1022         * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
1023         (tree_transform_and_unroll_loop): Likewise.
1024         (rewrite_all_phi_nodes_with_iv): Likewise.
1025         (canonicalize_loop_ivs): Likewise.
1026         * tree-ssa-loop-niter.c (determine_value_range): Likewise.
1027         * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
1028         * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
1029         * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
1030         * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
1031         (vop_phi): Likewise.
1032         * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
1033         Likewise.
1034         * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
1035         (copy_phi_args): Likewise.
1036         (phi_args_equal_on_edges): Likewise.
1037         * tree-ssa.c (ssa_redirect_edge): Likewise.
1038         (flush_pending_stmts): Likewise.
1039         * tree-switch-conversion.c (check_final_bb): Likewise.
1040         (gather_default_values): Likewise.
1041         (build_constructors): Likewise.
1042         (fix_phi_nodes): Likewise.
1043         * tree-tailcall.c (propagate_through_phis): Likewise.
1044         (add_successor_phi_arg): Likewise.
1045         * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
1046         Likewise.
1047         (slpeel_update_phi_nodes_for_guard2): Likewise.
1048         (slpeel_tree_peel_loop_to_edge): Likewise.
1049         (vect_can_advance_ivs_p): Likewise.
1050         (vect_update_ivs_after_vectorizer): Likewise.
1051         * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
1052         * tree-vrp.c (find_assert_locations): Likewise.
1053         * value-prof.c (gimple_ic): Likewise.
1055         * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
1057 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1059         Introduce gimple_phi and use it in various places
1061         * coretypes.h (gimple_phi): New typedef.
1062         (const_gimple_phi): New typedef.
1064         * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
1065         variants, using the gimple printer.
1067         * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
1068         vecs of more concrete gimple subclasses as appropriate; also the
1069         comment is about to become misleading.
1071         * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
1072         rather than spelling out the full type.
1073         (gimple_phi_num_args): Likewise.
1074         (gimple_phi_result): Likewise.
1075         (gimple_phi_result_ptr): Use gimple_phi typedef.
1076         (gimple_phi_set_result): Likewise.
1077         (gimple_phi_arg): Likewise.
1078         (gimple_phi_set_arg): Likewise.
1079         * tree-phinodes.c (allocate_phi_node): Likewise.
1080         (resize_phi_node): Likewise.
1081         (reserve_phi_args_for_new_edge): Likewise.
1082         (remove_phi_arg_num): Likewise.
1084         * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
1085         rather than just a gimple.
1086         * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
1088         * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
1089         just a gimple.
1090         (create_phi_node): Likewise.
1091         * tree-phinodes.h (create_phi_node): Likewise.
1093         * trans-mem.c (struct struct tm_log_entry): Replace use of
1094         now-removed gimple_vec with a plain vec<gimple>.
1096         * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
1097         vec<gimple_vec> to a vec< vec<gimple_phi> >.
1099         * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
1100         gimple_phi.
1101         * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
1102         "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
1103         a gimple_phi.
1104         * tree-into-ssa.c (delete_update_ssa): Strengthen local
1105         "phis" from a gimple_vec to a vec<gimple_phi>.
1107         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
1108         gimple_phi in regions where a stmt is known to have code
1109         GIMPLE_PHI.
1110         * tree-into-ssa.c (mark_use_interesting): Likewise.
1112 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1114         Introduce gimple_debug and use it in a few places
1116         * coretypes.h (gimple_debug): New typedef.
1117         (const_gimple_debug): New typedef.
1119         * gimple.h (struct gimple_statement_debug): New subclass of
1120         gimple_statement_with_ops, adding the invariant that
1121         stmt->code == GIMPLE_DEBUG.
1122         (is_a_helper <gimple_statement_debug>::test): New.
1124         * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
1125         variants, using the gimple printer.
1127         * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
1128         rather than just a gimple.
1129         * tree-inline.c (copy_debug_stmt): Likewise.
1131         * tree-inline.h (struct copy_body_data): Strengthen field
1132         "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
1134         * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
1135         rather than just a gimple.
1136         (gimple_build_debug_source_bind_stat): Likewise.
1137         * gimple.h (gimple_build_debug_bind_stat): Likewise.
1138         (gimple_build_debug_source_bind_stat): Likewise.
1140         * tree-inline.c (remap_gimple_stmt): Update locals to be a
1141         gimple_debug.
1142         (maybe_move_debug_stmts_to_successors): Likewise.
1143         (copy_debug_stmts): Likewise.
1145         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
1146         gimple_debug in regions where a stmt is known to have code
1147         GIMPLE_DEBUG.
1149 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1151         Introduce gimple_label and use it in a few places
1153         * coretypes.h (gimple_label): New typedef.
1154         (const_gimple_label): New typedef.
1156         * gimple.h (struct gimple_statement_label): New subclass of
1157         gimple_statement_with_ops, adding the invariant that
1158         stmt->code == GIMPLE_LABEL.
1159         (is_a_helper <gimple_statement_label>::test): New.
1161         * gdbhooks.py (build_pretty_printer): Add gimple_label and its
1162         variants, reusing the gimple printer.
1164         * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
1165         rather than just a gimple.
1166         * tree-cfg.c (verify_gimple_label): Likewise.
1168         * gimple.c (gimple_build_label): Return a gimple_label rather than
1169         just a gimple.
1170         * gimple.h (gimple_build_label): Likewise.
1172         * gimplify.c (gimplify_case_label_expr): Update local to be a
1173         gimple_label.
1174         * tree-switch-conversion.c (gen_inbound_check): Likewise.
1176         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
1177         gimple_label in regions where a stmt is known to have code
1178         GIMPLE_LABEL.
1179         * tree-cfg.c (verify_gimple_stmt): Likewise.
1181 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1183         Introduce gimple_assign and use it in various places
1185         * coretypes.h (gimple_assign): New typedef.
1186         (const_gimple_assign): New typedef.
1188         * gimple.h (struct gimple_statement_assign): New subclass of
1189         gimple_statement_with_memory_ops, adding the invariant that
1190         stmt->code == GIMPLE_ASSIGN.
1191         (is_a_helper <gimple_statement_assign>::test): New.
1193         * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
1194         variants, using the gimple printer.
1196         * gimple-builder.c (build_assign): Return a gimple_assign rather
1197         than just a gimple from each of the overloaded variants.
1198         (build_type_cast): Likewise.
1199         * gimple-builder.h (build_assign): Likewise.
1200         (build_type_cast): Likewise.
1201         * gimple.c (gimple_build_assign_stat): Likewise.
1202         (gimple_build_assign_with_ops): Likewise.
1203         * gimple.h (gimple_build_assign_stat): Likewise.
1204         (gimple_build_assign_with_ops): Likewise.
1206         * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
1207         rather than just a "const gimple" (the latter is not a
1208         "const_gimple").
1209         * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
1210         rather than just a gimple.
1211         (dump_binary_rhs): Likewise.
1212         (dump_ternary_rhs): Likewise.
1213         * tree-cfg.c (verify_gimple_assign_unary): Likewise.
1214         (verify_gimple_assign_binary): Likewise.
1215         (verify_gimple_assign_ternary): Likewise.
1216         (verify_gimple_assign_single): Likewise.
1217         (verify_gimple_assign): Likewise.
1218         * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
1219         (try_to_simplify): Likewise.
1220         * tree-tailcall.c (process_assignment): Likewise.
1221         * tree-vect-generic.c (expand_vector_operation): Likewise.
1222         * tree-vrp.c (extract_range_from_cond_expr): Likewise.
1223         (extract_range_from_assignment): Likewise.
1225         * asan.c (has_stmt_been_instrumented_p): Add checked cast to
1226         gimple_assign in regions where a stmt is known to have code
1227         GIMPLE_ASSIGN.
1228         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1229         * tree-cfg.c (verify_gimple_stmt): Likewise.
1230         * tree-ssa-sccvn.c (visit_use): Likewise.
1231         * tree-tailcall.c (find_tail_calls): Likewise.
1232         * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
1234         * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
1235         against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
1236         a gimple_assign local.
1238         * tree-vect-generic.c (expand_vector_condition): Convert local to a
1239         gimple_assign, adding a checked cast when extracting from gsi, since
1240         this is only called when  underlying stmt has code GIMPLE_ASSIGN.
1241         (optimize_vector_constructor): Likewise.
1242         (lower_vec_perm): Likewise.
1243         (expand_vector_operations_1): Convert local to a gimple_assign,
1244         introducing a dyn_cast.
1246 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1248         Introduce gimple_cond and use it in various places
1250         * coretypes.h (gimple_cond): New typedef.
1251         (const_gimple_cond): Likewise.
1253         * gimple.h (struct gimple_statement_cond): New subclass of
1254         gimple_statement_with_ops, adding the invariant that
1255         stmt->code == GIMPLE_COND.
1256         (is_a_helper <gimple_statement_cond>::test): New.
1257         (gimple_build_cond): Return a gimple_cond, rather than just
1258         a gimple.
1259         (gimple_build_cond_from_tree): Likewise.
1261         * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
1262         variants, using the gimple printer.
1264         * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
1265         than just a gimple.
1266         * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
1267         (gimple_cond_true_p): Likewise.
1268         (gimple_cond_false_p): Likewise.
1269         (gimple_cond_set_condition): Likewise.
1270         * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
1271         * gimple-fold.c (fold_gimple_cond): Likewise.
1272         * gimple-pretty-print.c (dump_gimple_cond): Likewise.
1273         * tree-ssa-dom.c (canonicalize_comparison): Likewise.
1274         * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
1275         * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
1276         (recognize_bits_test): Likewise.
1277         * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
1278         (thread_around_empty_blocks): Likewise.
1279         (thread_through_normal_block): Likewise.
1280         (thread_across_edge): Likewise.
1281         * tree-ssa-threadedge.h (thread_across_edge): Likewise.
1282         * tree-vrp.c (range_fits_type_p): Likewise.
1284         * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
1285         gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
1286         * gimple-fold.c (fold_stmt_1): Likewise.
1287         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1288         * tree-ssa-dom.c (optimize_stmt): Likewise.
1289         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
1290         * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
1291         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
1292         Likewise.
1293         * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
1295         * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
1296         gimple_cond.
1297         * tree-vrp.c (identify_jump_threads): Likewise.
1299         * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
1300         just a gimple.
1301         (gimple_build_cond_from_tree): Likewise.
1303         * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
1304         field "m_dummy_cond" from a plain gimple to a gimple_cond.
1306         * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
1307         inner_stmt and outer_stmt so that inner_cond and outer_cond can be
1308         of type gimple_cond once we know that we have code == GIMPLE_COND.
1309         * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
1310         "last" so that stmt can be of type gimple_cond.
1312 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1314         Introduce gimple_bind and use it for accessors.
1316         * coretypes.h (gimple_bind): New typedef.
1317         (const_gimple_bind): New typedef.
1319         * gdbhooks.py (build_pretty_printer): Add gimple_bind
1320         and its variants, using the gimple printer.
1322         * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
1323         require a gimple_bind rather than just a gimple.
1325         * gimple.c (gimple_build_bind): Return a gimple_bind rather than
1326         just a gimple.
1327         * gimple.h (gimple_build_bind): Likewise.
1329         * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
1331         * gimple.h (gimple_bind_vars): Update type-signature to
1332         require a gimple_bind rather than just a gimple, removing
1333         as_a and hence run-time check.
1334         (gimple_bind_set_vars): Likewise.
1335         (gimple_bind_append_vars): Likewise.
1336         (gimple_bind_body_ptr): Likewise.
1337         (gimple_bind_body): Likewise.
1338         (gimple_bind_set_body): Likewise.
1339         (gimple_bind_add_stmt): Likewise.
1340         (gimple_bind_add_seq): Likewise.
1341         (gimple_bind_block): Likewise.
1342         (gimple_bind_set_block): Likewise.
1343         * gimplify.c (gimple_push_bind_expr): Likewise.
1344         (gimple_current_bind_expr): Likewise.
1345         * tree-inline.c (copy_gimple_bind): Likewise.
1347         * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
1348         rather than a plain gimple.
1349         (gimplify_body): Likewise.
1350         (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
1351         a vec<gimple>.
1353         * gimplify.c (struct gimplify_ctx): Strengthen field
1354         "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
1355         (gimple_bind_expr_stack): Likewise for type of returned value.
1357         * gimplify.c (gimplify_body): Strengthen various types from gimple
1358         to gimple_bind, including the return type.
1360         * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
1361         so that local "scope" can be of type gimple_bind once we've reached
1362         the region where it must be of code GIMPLE_BIND.
1364         * gimple-low.c (lower_gimple_bind): Add checked cast to
1365         gimple_bind, since both callers (lower_function_body and
1366         lower_stmt) have checked the code for us.
1368         * gimple.c (gimple_copy): Add checked cast to gimple_bind in
1369         region guarded by check for code GIMPLE_BIND.
1370         * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
1371         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1372         * gimple-walk.c (walk_gimple_stmt): Likewise.
1373         * omp-low.c (scan_omp_1_stmt): Likewise.
1374         (lower_omp_1): Likewise.
1375         (lower_omp_for): Likewise.
1376         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
1377         (do_warn_unused_result): Likewise.
1378         * tree-inline.c (remap_gimple_stmt): Likewise.
1379         (estimate_num_insns): Likewise.
1380         * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
1382         * gimplify.c (gimplify_bind_expr): Update local(s) to be a
1383         gimple_bind rather than just a gimple.
1384         (gimplify_function_tree): Likewise.
1385         * omp-low.c (lower_omp_sections): Likewise.
1386         (lower_omp_single): Likewise.
1387         (lower_omp_master): Likewise.
1388         (lower_omp_taskgroup): Likewise.
1389         (lower_omp_ordered): Likewise.
1390         (lower_omp_critical): Likewise.
1391         (lower_omp_taskreg): Likewise.
1392         (lower_omp_teams): Likewise.
1393         * omp-low.c (lower_omp_for): Likewise; use
1394         gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
1395         (lower_omp_target): Likewise.
1396         * tree-nested.c (finalize_nesting_tree_1): Likewise.
1398         * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
1399         * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
1401 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1403         Introduce gimple_switch and use it in various places
1405         * gimple.h (gimple_statement_switch): New subclass of
1406         gimple_statement_with_ops, adding the invariant that
1407         stmt->code == GIMPLE_SWITCH.
1408         (is_a_helper <gimple_statement_switch>::test (gimple)): New.
1410         * coretypes.h (gimple_switch): New typedef
1411         (const_gimple_switch): Likewise.
1413         * gdbhooks.py (build_pretty_printer): Add gimple_switch
1414         and its variants, using the gimple printer.
1416         * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
1417         rather than just a gimple.
1418         (gimple_build_switch): Likewise.
1419         * gimple.h (gimple_build_switch_nlabels): Likewise.
1420         (gimple_build_switch): Likewise.
1422         * gimple.h (gimple_switch_num_labels): Update type-signature to
1423         require a gimple_switch rather than just a gimple.
1424         (gimple_switch_set_num_labels): Likewise.
1425         (gimple_switch_set_index): Likewise.
1426         (gimple_switch_label): Likewise.
1427         (gimple_switch_set_label): Likewise.
1428         (gimple_switch_default_label): Likewise.
1429         (gimple_switch_set_default_label): Likewise.
1430         * expr.h (expand_case): Likewise.
1431         * gimple-pretty-print.c (dump_gimple_call): Likewise.
1432         * stmt.c (compute_cases_per_edge): Likewise.
1433         (expand_case): Likewise.
1434         * tree-cfg.h (group_case_labels_stmt): Likewise.
1435         * tree-cfg.c (make_gimple_switch_edges): Likewise.
1436         (find_taken_edge_switch_expr) Likewise.
1437         (find_case_label_for_value) Likewise.
1438         (get_cases_for_edge): Likewise.
1439         (group_case_labels_stmt): Likewise.
1440         (verify_gimple_switch): Likewise.
1441         * tree-eh.c (verify_norecord_switch_expr): Likewise.
1442         * tree-eh.c (lower_eh_constructs_2): Likewise.
1443         * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
1444         * tree-ssa-dom.c (record_edge_info): Likewise.
1445         * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
1446         (simplify_gimple_switch): Likewise.
1447         * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
1448         (collect_switch_conv_info): Likewise.
1449         (build_constructors): Likewise.
1450         (array_value_type): Likewise.
1451         (build_one_array): Likewise.
1452         (build_arrays): Likewise.
1453         (gen_inbound_check): Likewise.
1454         * tree-vrp.c (find_switch_asserts): Likewise.
1455         (find_case_label_range): Likewise.
1456         (find_case_label_ranges): Likewise.
1457         (vrp_visit_switch_stmt): Likewise.
1458         (simplify_switch_using_ranges): Likewise.
1460         * tree-vrp.c (switch_update): Strengthen field "stmt" from being
1461         merely a gimple to being a gimple_switch.
1463         * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
1464         gimple_switch in regions where the stmt code has been tested as
1465         GIMPLE_SWITCH.
1466         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1467         * tree-cfg.c (make_edges): Likewise.
1468         (end_recording_case_labels): Likewise.
1469         (cleanup_dead_labels): Likewise.
1470         (cleanup_dead_labels): Likewise.
1471         (group_case_labels): Likewise.
1472         (find_taken_edge): Likewise.
1473         (find_case_label_for_value): Likewise.
1474         (verify_gimple_stmt): Likewise.
1475         (gimple_verify_flow_info): Likewise.
1476         (gimple_redirect_edge_and_branch): Likewise.
1477         * tree-inline.c (estimate_num_insns): Likewise.
1478         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
1479         * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
1480         * tree-switch-conversion.c (do_switchconv): Likewise.
1481         * tree-vrp.c  (find_assert_locations_1): Likewise.
1482         (vrp_visit_stmt): Likewise.
1483         (simplify_stmt_using_ranges): Likewise.
1485         * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
1486         Introduce local "lastg" as a generic gimple, so that local "last"
1487         can be of type gimple_switch once lastg's code has been verified.
1489         * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
1490         the GIMPLE_SWITCH case.
1492         * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
1493         argument, since the caller (find_taken_edge) has checked that
1494         last_stmt is a switch.
1496 Copyright (C) 2014 Free Software Foundation, Inc.
1498 Copying and distribution of this file, with or without modification,
1499 are permitted in any medium without royalty provided the copyright
1500 notice and this notice are preserved.