Introduce gimple_eh_must_not_throw
[official-gcc.git] / gcc / ChangeLog.gimple-classes
blobdd39ce6e7dcf90c917ff8f5fc9dea415e33e8eef
1 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
3         Introduce gimple_eh_must_not_throw
5         * coretypes.h (gimple_eh_must_not_throw): New typedef.
6         (const_gimple_eh_must_not_throw): New typedef.
8         * gimple-pretty-print.c (dump_gimple_eh_must_not_throw): Require
9         a gimple_eh_must_not_throw rather than a plain gimple.
10         (pp_gimple_stmt_1): Add a checked cast to gimple_eh_must_not_throw
11         within GIMPLE_EH_MUST_NOT_THROW case of switch statement.
13         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
15         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
17         * gimple.c (gimple_build_eh_must_not_throw): Return a
18         gimple_eh_must_not_throw rather than a plain gimple.
20         * gimple.h (gimple_build_eh_must_not_throw): Return a
21         gimple_eh_must_not_throw rather than a plain gimple.
22         (gimple_eh_must_not_throw_fndecl): Require a
23         gimple_eh_must_not_throw rather than a plain gimple.
24         (gimple_eh_must_not_throw_set_fndecl): Likewise.
26         * tree-eh.c (lower_eh_must_not_throw): Add checked cast.
28 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
30         Introduce gimple_eh_filter
32         * coretypes.h (gimple_eh_filter): New typedef.
33         (const_gimple_eh_filter): New typedef.
35         * gimple.h (gimple_build_eh_filter): Return a gimple_eh_filter
36         rather than a plain gimple.
38         * gimple-pretty-print.c (dump_gimple_eh_filter): Require a
39         gimple_eh_filter rather than a plain gimple.
40         (pp_gimple_stmt_1): Add checked cast to gimple_eh_filter within
41         GIMPLE_EH_FILTER case of switch statement.
43         * gimple.c (gimple_build_eh_filter): Return a gimple_eh_filter
44         rather than a plain gimple.
46 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
48         Introduce gimple_catch
50         * coretypes.h (gimple_catch): New typedef.
51         (const_gimple_catch): New typedef.
53         * gimple-low.c (lower_try_catch): Add checked cast to gimple_catch.
54         (gimple_try_catch_may_fallthru): Likewise.
56         * gimple-pretty-print.c (dump_gimple_catch): Require a gimple_catch
57         rather than a plain gimple.
58         (pp_gimple_stmt_1): Add checked cast to gimple_catch within
59         GIMPLE_CATCH case of switch statement.
61         * gimple-walk.c (walk_gimple_op): Likewise.
62         (walk_gimple_stmt): Likewise.
64         * gimple.c (gimple_build_catch): Return a gimple_catch rather than
65         a plain gimple.
66         (gimple_copy): Add checked casts to gimple_catch within
67         GIMPLE_CATCH case of switch statement, introducing new locals.
69         * gimple.h (gimple_build_catch): Return a gimple_catch rather than
70         a plain gimple.
71         (gimple_catch_types_ptr): Require a gimple_catch rather than a
72         plain gimple.
73         (gimple_catch_handler_ptr): Likewise.
74         (gimple_catch_handler): Likewise.
75         (gimple_catch_set_types): Likewise.
76         (gimple_catch_set_handler): Likewise.
78         * omp-low.c (lower_omp_1): Add checked cast to gimple_catch within
79         GIMPLE_CATCH case of switch statement.
81         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
82         (do_warn_unused_result): Likewise.
84         * tree-eh.c (collect_finally_tree): Likewise.
85         (replace_goto_queue_1): Likewise.
86         (lower_catch): Convert local from gimple to gimple_catch.
87         (refactor_eh_r): Add checked cast to gimple_catch within
88         GIMPLE_CATCH case of switch statement.
90         * tree-inline.c (remap_gimple_stmt): Likewise.
91         (estimate_num_insns): Add checked cast to gimple_catch within
92         GIMPLE_CATCH case of switch statement, introducing new local.
94 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
96         Introduce gimple_transaction
98         * coretypes.h (gimple_transaction): New typedef.
99         (const_gimple_transaction): New typedef.
101         * gimple.h (gimple_build_transaction): Return a gimple_transaction
102         rather than a plain gimple.
103         (gimple_transaction_body_ptr): Require a gimple_transaction rather
104         than a plain gimple.
105         (gimple_transaction_body): Likewise.
106         (gimple_transaction_label_ptr): Likewise.
107         (gimple_transaction_set_body): Likewise.
108         (gimple_transaction_set_label): Likewise.
109         (gimple_transaction_set_subcode): Likewise.
110         (gimple_transaction_label): Require a const_gimple_transaction
111         rather than a plain const_gimple.
112         (gimple_transaction_subcode): Likewise.
114         * gimple-low.c (lower_stmt): Add checked cast to
115         gimple_transaction within GIMPLE_TRANSACTION case of switch
116         statement.
118         * gimple-pretty-print.c (dump_gimple_transaction): Require a
119         gimple_transaction rather than a plain gimple.
120         (pp_gimple_stmt_1): Add checked cast to gimple_transaction within
121         GIMPLE_TRANSACTION case of switch statement.
122         * gimple-streamer-in.c (input_gimple_stmt): Likewise.
123         * gimple-streamer-out.c (output_gimple_stmt): Likewise.
124         * gimple-walk.c (walk_gimple_op): Likewise.
125         (walk_gimple_stmt): Likewise.
127         * gimple.c (gimple_build_transaction): Return a gimple_transaction
128         rather than a plain gimple.
129         (gimple_copy): Add checked casts to gimple_transaction within
130         GIMPLE_TRANSACTION case of switch statement.
132         * gimplify.c (gimplify_transaction): Split local "g" into
133         "body_stmt" and "trans_stmt", strengthening the type of the latter
134         from gimple to gimple_transaction.
136         * omp-low.c (lower_omp_1): Add checked cast to gimple_transaction
137         within GIMPLE_TRANSACTION case of switch statement.
139         * trans-mem.c (diagnose_tm_1): Add checked cast within
140         GIMPLE_TRANSACTION case of switch statement, introducing a new
141         local "trans_stmt".  Use it in place of "stmt".
142         (examine_call_tm): Convert local from gimple to gimple_transaction.
143         (tm_region::get_transaction_stmt): New method.
144         (tm_region::transaction_stmt): Add clarification of type to the
145         comment.
146         (tm_region_init_0): Require a gimple_transaction rather than a
147         plain gimple.
148         (tm_region_init): Convert a check against GIMPLE_TRANSACTION to a
149         dyn_cast<gimple_transaction> and new local.
150         (transaction_subcode_ior): Add a new local, using the new
151         get_transaction_stmt method to perform a checked cast.
152         (propagate_tm_flags_out): Likewise.
153         (expand_transaction): Add a checked cast using the new
154         get_transaction_stmt method.
155         (generate_tm_state): Likewise.
156         (execute_tm_mark): Likewise.
157         (ipa_tm_diagnose_transaction): Likewise.
159         * tree-cfg.c (verify_gimple_transaction): Require a
160         gimple_transaction rather than a plain gimple.
161         (make_edges): Add checked cast within GIMPLE_TRANSACTION case of
162         switch statement
163         (cleanup_dead_labels): Likewise.
164         (verify_gimple_stmt): Likewise.
165         (verify_gimple_in_seq_2): Likewise.
166         (verify_gimple_in_seq_2): Likewise.
167         (gimple_redirect_edge_and_branch): Add checked cast.
169         * tree-inline.c (remap_gimple_stmt): Add checked cast within
170         GIMPLE_TRANSACTION case of switch statement, introducing a new
171         local "old_trans_stmt".  Use it in place of "stmt".  Add new
172         local "new_trans_stmt", using it to initialize "copy", and for
173         type-safe operations as a transaction.
174         (estimate_num_insns): Add checked cast within GIMPLE_TRANSACTION
175         case of switch statement.
177 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
179         Introduce gimple_asm
181         * coretypes.h (gimple_asm): New typedef.
182         (const_gimple_asm): New typedef.
184         * gimple.h (gimple_build_asm_vec): Return a gimple_asm rather than
185         just a gimple.
186         (gimple_asm_clobbers_memory_p): Require a const_gimple_asm rather
187         than just a const_gimple.
188         (gimple_asm_ninputs): Likewise.
189         (gimple_asm_noutputs): Likewise.
190         (gimple_asm_nclobbers): Likewise.
191         (gimple_asm_nlabels): Likewise.
192         (gimple_asm_input_op): Likewise.
193         (gimple_asm_input_op_ptr): Likewise.
194         (gimple_asm_output_op): Likewise.
195         (gimple_asm_output_op_ptr): Likewise.
196         (gimple_asm_clobber_op): Likewise.
197         (gimple_asm_label_op): Likewise.
198         (gimple_asm_string): Likewise.
199         (gimple_asm_volatile_p): Likewise.
200         (gimple_asm_input_p): Likewise.
201         (gimple_asm_set_input_op): Require a gimple_asm rather than a plain
202         gimple.
203         (gimple_asm_set_output_op): Likewise.
204         (gimple_asm_set_clobber_op): Likewise.
205         (gimple_asm_set_label_op): Likewise.
206         (gimple_asm_set_volatile): Likewise.
207         (gimple_asm_set_input): Likewise.
209         * cfgexpand.c (expand_asm_stmt): Require a gimple_asm rather than
210         a plain gimple.
211         (expand_gimple_stmt_1): Add checked cast to gimple_asm within
212         GIMPLE_ASM case of switch statement.
214         * gimple-fold.c (fold_stmt_1): Add new local from checked cast to
215         gimple_asm within case GIMPLE_ASM.
217         * gimple-pretty-print.c (dump_gimple_asm): Require a gimple_asm
218         rather than a plain gimple.
219         (pp_gimple_stmt_1): Add checked cast to gimple_asm within
220         GIMPLE_ASM case of switch statement.
222         * gimple-streamer-in.c (input_gimple_stmt): Rework existing
223         checked cast to gimple_asm; add a new one.
225         * gimple-streamer-out.c (output_gimple_stmt): Add new local from
226         checked cast to gimple_asm within case GIMPLE_ASM.
228         * gimple-walk.c (walk_gimple_asm): Require a gimple_asm rather
229         than a plain gimple.
230         (walk_gimple_op): Add checked cast to gimple_asm within GIMPLE_ASM
231         case of switch statement.
232         (walk_stmt_load_store_addr_ops): Use dyn_cast<gimple_asm> in place
233         of a code check against GIMPLE_ASM to introduce a new gimple_asm
234         local.
236         * gimple.c (gimple_build_asm_1): Return a gimple_asm rather than
237         a plain gimple.
238         (gimple_build_asm_vec): Likewise.
239         (gimple_has_side_effects): Add a checked cast to gimple_asm.
240         (gimple_could_trap_p_1): Likewise.
241         (gimple_call_builtin_p): Require a const_gimple_asm rather then
242         a const_gimple.
244         * gimplify-me.c (gimple_regimplify_operands): Add a checked cast
245         and a new local of type gimple_asm within GIMPLE_ASM case.
247         * gimplify.c (gimplify_asm_expr): Convert a local from gimple to
248         gimple_asm.
250         * ipa-pure-const.c (check_stmt): Add checked casts within
251         GIMPLE_ASM case.
253         * ssa-iterators.h (op_iter_init): Likewise.
255         * tree-cfg.c (make_goto_expr_edges): Convert a local from gimple
256         to gimple_asm.
257         (cleanup_dead_labels): Add a checked cast and a new local of type
258         gimple_asm within GIMPLE_ASM case.
259         (gimple_redirect_edge_and_branch): Likewise.
260         (is_ctrl_altering_stmt): Add a checked cast.
261         (need_fake_edge_p): Replace a code check against GIMPLE_ASM with a
262         dyn_cast<gimple_asm>.
264         * tree-complex.c (expand_complex_comparison): Convert a local from
265         gimple to gimple_asm.
267         * tree-data-ref.c (get_references_in_stmt): Add a checked cast to
268         gimple_asm.
270         * tree-eh.c (stmt_could_throw_p): Likewise.
272         * tree-inline.c (estimate_num_insns): Likewise.
274         * tree-sra.c (scan_function): Add a checked cast and a new local
275         of type gimple_asm within GIMPLE_ASM case.
276         (sra_modify_function_body): Likewise.
277         (ipa_sra_modify_function_body): Likewise.
279         * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise.
281         * tree-ssa-dce.c (propagate_necessity): Replace a code check
282         against GIMPLE_ASM with a dyn_cast<gimple_asm>.
284         * tree-ssa-operands.c (maybe_add_call_vops): Require a gimple_asm
285         rather than a plain gimple.
286         (parse_ssa_operands): Add a checked cast to gimple_asm.
288         * tree-ssa-structalias.c (find_func_aliases): Replace a check for
289         GIMPLE_ASM with a dyn_cast<gimple_asm>, introducing  a new local
290         "asm_stmt", using it in place of "t" for typesafety.
292         * tree-ssa-threadedge.c
293         (record_temporary_equivalences_from_stmts_at_dest): Add a checked
294         cast to gimple_asm.
296         * tree-ssa.c (execute_update_addresses_taken): Add checked casts
297         and new locals of type gimple_asm within clauses guarded by code
298         check.
300 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
302         Introduce gimple_goto
304         * coretypes.h (gimple_goto): New typedef.
305         (const_gimple_goto): New typedef.
307         * gimple.h (gimple_statement_goto): New subclass of
308         gimple_statement_with_ops, adding the invariant that
309         stmt->code == GIMPLE_GOTO.
310         (is_a_helper <gimple_statement_goto>::test): New.
311         (gimple_build_goto): Return a gimple_goto rather than a
312         plain gimple.
314         * gimple-pretty-print.c (dump_gimple_goto): Require a gimple_goto
315         rather than a plain gimple.
316         (pp_gimple_stmt_1): Add a checked cast to gimple_goto within
317         GIMPLE_GOTO case of switch statement.
319         * gimple.c (gimple_build_goto): Return a gimple_goto rather than a
320         plain gimple.
322         * tree-cfg.c (verify_gimple_goto): Require a gimple_goto rather
323         than a plain gimple.
324         (verify_gimple_stmt): Add a checked cast to gimple_goto within
325         GIMPLE_GOTO case of switch statement.
327 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
329         Introduce gimple_return
331         * coretypes.h (gimple_return): New typedef.
332         (const_gimple_return): New typedef.
334         * gimple.h (gimple_statement_return): New subclass of
335         gimple_statement_with_memory_ops, adding the invariant that
336         stmt->code == GIMPLE_RETURN.
337         (is_a_helper <gimple_statement_return>::test): New.
338         (gimple_build_return): Return a gimple_return rather
339         than a plain gimple.
341         * gimple.c (gimple_build_return): Return a gimple_return rather
342         than a plain gimple.
344         * cgraphunit.c (expand_thunk): Convert local from a gimple to
345         a gimple_return.
347         * gimple-low.c (struct return_statements_t): Convert field "stmt"
348         from a gimple to a gimple_return.
349         (lower_gimple_return): Convert local from a gimple to a
350         gimple_return.
352         * gimple-pretty-print.c (dump_gimple_return): Require a
353         gimple_return rather than a plain gimple.
354         (pp_gimple_stmt_1): Add a checked cast to gimple_return within
355         case GIMPLE_RETURN of switch statement.
357         * gimplify.c (gimplify_return_expr): Convert locals from
358         gimple to gimple_return.
360         * ipa-split.c (split_function): Likewise.
362         * tree-cfg.c (verify_gimple_assign): Require a gimple_return
363         rather than a plain gimple.
364         (verify_gimple_stmt): Add checked cast to gimple_return within
365         case GIMPLE_RETURN of switch statement.
367         * tree-tailcall.c (adjust_return_value): Convert local from
368         gimple to gimple_return.
370 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
372         Introduce gimple_call
374         * coretypes.h (gimple_call): New typedef.
375         (const_gimple_call): New typedef.
377         * asan.c (get_mem_refs_of_builtin_call): Require a
378         const_gimple_call rather than a const gimple.
379         (has_stmt_been_instrumented_p): Add a checked cast to
380         gimple_call.
381         (instrument_strlen_call): Likewise.
382         (instrument_builtin_call): Likewise.
383         * builtins.c (validate_gimple_arglist): Require a
384         const_gimple_call rather than a const gimple.
385         (fold_call_stmt): Require a gimple_call rather than a gimple.
386         * builtins.h (validate_gimple_arglist): Require a
387         const_gimple_call rather than a const gimple.
388         (fold_call_stmt): Require a gimple_call rather than a gimple.
389         * cfgexpand.c (expand_call_stmt): Likewise.
390         (expand_gimple_stmt_1): Add a checked cast to gimple_call within
391         GIMPLE_CALL case.
392         * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Strengthen
393         local "new_stmt" from gimple to gimple_call, adding a checked
394         cast.
395         * cgraphunit.c (cgraph_node::expand_thunk): Likewise for local
396         "call".
397         * gimple-fold.c (gimple_fold_builtin_snprintf_chk): Likewise for
398         local "stmt".
399         (gimple_fold_builtin_snprintf): Likewise.
400         (gimple_fold_builtin): Likewise.
401         (gimple_fold_call): Likewise.
402         (gimple_fold_stmt_to_constant_1): Introduce local "call_stmt" via
403         checked cast of "stmt" to gimple_call, using it in various places
404         for typesafety.
405         * gimple-pretty-print.c (dump_gimple_call_args): Strengthen param
406         2 from gimple to gimple_call.
407         (dump_gimple_call): Likewise.
408         (pp_gimple_stmt_1): Add a checked cast to gimple_call within
409         GIMPLE_CALL case.
410         * gimple-streamer-in.c (input_gimple_stmt): Replace is_gimple_call
411         with a dyn_cast<gimple_call>, introducing local "call_stmt", and
412         using it in place of "stmt" for typesafety.  Add a checked cast
413         in statement guarded by check for GIMPLE_CALL.
414         * gimple-walk.c (walk_gimple_op): Add a checked cast to
415         gimple_call.
416         * gimple.c (gimple_call_reset_alias_info): Strengthen param from
417         gimple to gimple_call.
418         (gimple_build_call_1): Strengthen return type and local from
419         gimple to gimple_call.
420         (gimple_build_call_vec): Likewise.
421         (gimple_build_call): Likewise.
422         (gimple_build_call_valist): Likewise.
423         (gimple_build_call_internal_1): Likewise.
424         (gimple_build_call_internal): Likewise.
425         (gimple_build_call_internal_vec): Likewise.
426         (gimple_build_call_from_tree): Likewise.
427         (gimple_call_return_flags): Strengthen param from
428         const_gimple to const_gimple_call.
429         (gimple_call_copy_skip_args): Strengthen return type and local from
430         gimple to gimple_call.
431         * gimple.h (gimple_call_reset_alias_info): Strengthen param from
432         gimple to gimple_call.
433         (gimple_build_call_vec): Strengthen return type from gimple to
434         gimple_call.
435         (gimple_build_call): Likewise.
436         (gimple_build_call_valist): Likewise.
437         (gimple_build_call_internal): Likewise.
438         (gimple_build_call_internal_vec): Likewise.
439         (gimple_build_call_from_tree): Likewise.
440         (gimple_call_return_flags): Strengthen param from const_gimple to
441         const_gimple_call.
442         (gimple_call_copy_skip_args): Strengthen return type from gimple
443         to gimple_call.
444         (gimple_call_set_internal_fn): Strengthen param "call_stmt" from
445         gimple to gimple_call.
446         (gimple_call_return_type): Strengthen param from const_gimple to
447         const_gimple_call.
448         (gimple_call_chain_ptr): Likewise.
449         (gimple_call_set_chain): Strengthen param from gimple to
450         gimple_call.
451         (gimple_call_set_return_slot_opt): Likewise.
452         (gimple_call_set_from_thunk): Likewise.
453         (gimple_call_from_thunk_p): Likewise.
454         (gimple_call_set_va_arg_pack): Likewise.
455         (gimple_call_va_arg_pack_p): Likewise.
456         (gimple_call_set_alloca_for_var): Likewise.
457         (gimple_call_alloca_for_var_p): Likewise.
458         (gimple_expr_type): Introduce local "call_stmt" via a checked cast
459         and use it for typesafety.
460         * gimplify.c (gimplify_call_expr): Strengthen local "call" from
461         gimple to gimple_call.
462         (gimplify_modify_expr_to_memcpy): Likewise for local "gs".
463         (gimplify_modify_expr_to_memset): Likewise.
464         (gimplify_modify_expr): Add a checked cast to gimple_call.
465         (gimplify_expr): Strengthen local "call" from gimple to
466         gimple_call.
467         (gimplify_function_tree): Likewise.
468         * internal-fn.c (expand_LOAD_LANES): Strengthen param from gimple
469         to gimple_call.
470         (expand_STORE_LANES): Likewise.
471         (expand_ANNOTATE): Likewise.
472         (expand_GOMP_SIMD_LANE): Likewise.
473         (expand_GOMP_SIMD_VF): Likewise.
474         (expand_GOMP_SIMD_LAST_LANE): Likewise.
475         (expand_UBSAN_NULL): Likewise.
476         (expand_UBSAN_BOUNDS): Likewise.
477         (expand_UBSAN_OBJECT_SIZE): Likewise.
478         (expand_ASAN_CHECK): Likewise.
479         (ubsan_expand_si_overflow_addsub_check): Likewise.
480         (ubsan_expand_si_overflow_neg_check): Likewise.
481         (ubsan_expand_si_overflow_mul_check): Likewise.
482         (expand_UBSAN_CHECK_ADD): Likewise.
483         (expand_UBSAN_CHECK_SUB): Likewise.
484         (expand_UBSAN_CHECK_MUL): Likewise.
485         (expand_LOOP_VECTORIZED): Likewise.
486         (expand_MASK_LOAD): Likewise.
487         (expand_MASK_STORE): Likewise.
488         (expand_ABNORMAL_DISPATCHER): Likewise.
489         (expand_BUILTIN_EXPECT): Likewise.
490         (internal_fn_expanders): Likewise for entries in this table.
491         (expand_internal_call): Likewise.
492         * internal-fn.def: Update comment to reflect strengthening of
493         param of expanders.
494         * internal-fn.h (expand_internal_call): Strengthen param from
495         gimple to gimple_call.
496         * ipa-prop.c (ipa_modify_call_arguments): Likewise for local
497         "new_stmt".
498         * ipa-pure-const.c (check_call): Likewise for param "call".
499         (check_stmt): Add a checked cast to gimple_call within GIMPLE_CALL
500         case.
501         * ipa-split.c (split_function): Strengthen local "call" from
502         gimple to gimple_call.
503         * omp-low.c (build_omp_barrier): Likewise for local "g".
504         (lower_rec_input_clauses): Likewise for local "stmt".
505         * trans-mem.c (build_tm_load): Likewise for return type and local
506         "gcall".
507         (build_tm_store): Likewise.
508         (expand_transaction): Likewise for local "call".
509         * tree-call-cdce.c (check_pow): Likewise for param.
510         (check_builtin_call): Likewise.
511         (is_call_dce_candidate): Likewise.
512         (gen_conditions_for_pow): Likewise.
513         (gen_shrink_wrap_conditions): Likewise.
514         (shrink_wrap_one_built_in_call): Likewise.
515         (shrink_wrap_conditional_dead_built_in_calls): Strengthen param
516         from vec<gimple> to vec<gimple_call>, and local "bi_call" from
517         gimple to gimple_call.
518         (pass_call_cdce::execute): Strengthen local
519         "cond_dead_built_in_calls" from auto_vec<gimple> to
520         auto_vec<gimple_call> and local "stmt" from gimple to gimple_call,
521         * tree-cfg.c (notice_special_calls): Strengthen param from gimple
522         to gimple_call.
523         * tree-cfg.h (notice_special_calls): Likewise.
524         * tree-complex.c (expand_complex_libcall): Likewise for local
525         "stmt".
526         * tree-inline.c (remap_gimple_stmt): Add checked cast to
527         gimple_call.
528         (copy_bb): Likewise.  Strengthen local "new_call" from gimple to
529         gimple_call.
530         (inline_forbidden_p_stmt): Add checked cast to gimple_call.
531         * tree-nested.c (init_tmp_var_with_call): Strengthen param "call"
532         from gimple to gimple_call.
533         (convert_nl_goto_reference): Likewise for local "call".
534         (convert_tramp_reference_op): Likewise.
535         (convert_gimple_call): Add checked cast to gimple_call.
536         * tree-nrv.c (dest_safe_for_nrv_p): Strengthen param "call" from
537         gimple to gimple_call.
538         (pass_return_slot::execute): Likewise for local "stmt", using a
539         dyn_cast<gimple_call> rather than an is_gimple_call call.
540         * tree-object-size.c (alloc_object_size): Strengthen param "call"
541         from const_gimple to const_gimple_call.
542         (pass_through_call): Likewise.
543         (call_object_size): Strengthen param "call" from gimple to
544         gimple_call.
545         (collect_object_sizes_for): Introduce local "call_stmt" via a
546         checked cast, using it for typesafety.
547         (check_for_plus_in_loops_1): Likewise.
548         (pass_object_sizes::execute): Add a checked cast to gimple_call.
549         * tree-profile.c (gimple_gen_interval_profiler): Strengthen local
550         "call" from gimple to gimple_call.
551         (gimple_gen_pow2_profiler): Likewise.
552         (gimple_gen_one_value_profiler): Likewise.
553         (gimple_gen_time_profiler): Likewise.
554         (gimple_gen_average_profiler): Likewise.
555         (gimple_gen_ior_profiler): Likewise.
556         * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise for
557         param "call".
558         (ref_maybe_used_by_call_p): Likewise.
559         (ref_maybe_used_by_stmt_p): Add a checked cast to gimple_call.
560         (call_may_clobber_ref_p_1): Strengthen param "call" from gimple to
561         gimple_call.
562         (call_may_clobber_ref_p): Likewise.
563         (stmt_may_clobber_ref_p_1): Add a checked cast to gimple_call.
564         * tree-ssa-alias.h (call_may_clobber_ref_p): Strengthen param 1
565         from gimple to gimple_call.
566         (call_may_clobber_ref_p_1): Likewise.
567         * tree-ssa-dce.c (eliminate_unnecessary_stmts): Add a checked cast
568         to gimple_call.
569         * tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Strengthen
570         local "call" from gimple to gimple_call.
571         * tree-ssa-math-opts.c (build_and_insert_call): Likewise for local
572         "call_stmt".
573         * tree-ssa-operands.c (maybe_add_call_vops): Likewise for param
574         "stmt".
575         (parse_ssa_operands): Add a checked cast to gimple_call within
576         GIMPLE_CALL case.
577         * tree-ssa-pre.c (compute_avail): Add a checked cast to
578         gimple_call.
579         * tree-ssa-sccvn.c (copy_reference_ops_from_call): Strengthen
580         param "call" from gimple to gimple_call.
581         (valueize_shared_reference_ops_from_call): Likewise.
582         (vn_reference_lookup_3): Add a checked cast to gimple_call.
583         (vn_reference_lookup_call): Strengthen param "call" from gimple to
584         gimple_call.
585         (visit_reference_op_call): Likewise for param "stmt".
586         (visit_use): Replace is_gimple_call with a dyn_cast, introducing
587         local "call_stmt", using it in place of "stmt" for type-safety.
588         * tree-ssa-sccvn.h (vn_reference_lookup_call): Strengthen param 1
589         from gimple to gimple_call.
590         * tree-ssa-structalias.c (get_call_vi): Likewise.
591         (lookup_call_use_vi): Likewise.
592         (lookup_call_clobber_vi): Likewise.
593         (get_call_use_vi): Likewise.
594         (get_call_clobber_vi): Likewise.
595         (handle_rhs_call): Likewise.
596         (handle_lhs_call): Likewise.
597         (handle_const_call): Likewise.
598         (handle_pure_call): Likewise.
599         (get_fi_for_callee): Likewise.
600         (find_func_aliases_for_builtin_call): Likewise for param 2.
601         (find_func_aliases_for_call): Likewise.
602         (find_func_aliases): Add a checked cast to gimple_call.
603         (find_func_clobbers): Replace is_gimple_call with a dyn_cast,
604         introducing local "call_stmt", using it in place of "stmt" for
605         type-safety.
606         (compute_points_to_sets): Strengthen local "stmt" from gimple to
607         gimple_call, replacing is_gimple_call with a
608         dyn_cast <gimple_call>.
609         (ipa_pta_execute): Likewise.
610         * tree-ssa-threadedge.c
611         (record_temporary_equivalences_from_stmts_at_dest): Add checked
612         cast to gimple_call.
613         * tree-tailcall.c (find_tail_calls): Strengthen local "call" from
614         gimple to gimple_call, adding a checked cast.
615         * tree-vect-data-refs.c (vect_setup_realignment): Eliminate
616         top-level local "new_stmt" in favor of more tightly-scoped locals
617         "new_stmt" of type gimple_assign and gimple_call.
618         * tree-vect-patterns.c (vect_recog_pow_pattern): Strenghthen local
619         "stmt" from gimple to gimple_call.
620         * tree-vect-stmts.c (vectorizable_function): Likewise for param
621         "call".
622         (vectorizable_call): Rename param 1 from "stmt" to "gs",
623         reintroducing "stmt" as a gimple_call once we've established that
624         we're working with a GIMPLE_CALL.
625         * tree-vectorizer.h (vectorizable_function): Strengthen param 1
626         from gimple to gimple_call.
627         * value-prof.c (check_ic_target): Likewise.
628         (gimple_ic_transform): Likewise for local "stmt", replacing a
629         check for GIMPLE_CALL with a dyn_cast.
630         (interesting_stringop_to_profile_p): Strengthen param "call"
631         from gimple to gimple_call.
632         (gimple_stringop_fixed_value): Likewise for param "vcall_stmt".
633         (gimple_stringops_transform): Likewise for local "stmt",
634         replacing a check for GIMPLE_CALL with a dyn_cast.
635         (gimple_stringops_values_to_profile): Rename param 1 from "stmt"
636         to "gs", reintroducing "stmt" as a gimple_call once we've
637         established that we're working with a GIMPLE_CALL.
638         * vtable-verify.c (verify_bb_vtables): Strengthen local
639         "call_stmt" from gimple to gimple_call.
641 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
643         Concretize get_loop_exit_condition et al to working on gimple_cond
645         * tree-scalar-evolution.h (get_loop_exit_condition): Return a
646         gimple_cond.
647         * tree-scalar-evolution.c (get_loop_exit_condition): Likewise, also
648         concretizing local "res" from gimple to gimple_cond.
649         * tree-vect-loop-manip.c (slpeel_make_loop_iterate_ntimes): Convert
650         locals from gimple to gimple_cond.
651         (slpeel_can_duplicate_loop_p): Likewise.
652         * tree-vect-loop.c (vect_get_loop_niters): Return a gimple_cond.
653         (vect_analyze_loop_form): Convert local from gimple to gimple_cond.
655 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
657         Update various expressions within tree-scalar-evolution.c to be gimple_phi
659         * tree-scalar-evolution.c (follow_ssa_edge): Require a gimple_phi,
660         rather than a gimple.
661         (follow_ssa_edge_binary): Likewise.
662         (follow_ssa_edge_expr): Likewise.
663         (follow_ssa_edge_in_rhs): Likewise.
664         (backedge_phi_arg_p): Likewise.
665         (follow_ssa_edge_in_condition_phi_branch): Likewise.
666         (follow_ssa_edge_in_condition_phi): Likewise.
667         (follow_ssa_edge_inner_loop_phi): Likewise.
668         (analyze_evolution_in_loop): Likewise.
669         (analyze_initial_condition): Likewise.
670         (interpret_loop_phi): Likewise.
671         (interpret_condition_phi): Likewise.
672         (follow_ssa_edge): Likewise; also, add checked casts to gimple_phi.
674         (analyze_scalar_evolution_1): Add checked casts to gimple_phi
675         within "case GIMPLE_PHI".
677 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
679         tree-ssa-loop-ivopts.c: use gimple_phi in a few places
681         * tree-ssa-loop-ivopts.c (determine_biv_step): Require a gimple_phi.
682         (find_bivs): Convert local "phi" into a gimple_phi.
683         (mark_bivs): Likewise.
685 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
687         tree-ssa-loop-manip.c: use gimple_phi in three places
689         * tree-ssa-loop-manip.c (add_exit_phi): Convert local "phi" to be a
690         gimple_phi.
691         (split_loop_exit_edge): Likewise for "phi" and "new_phi".
693 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
695         tree-ssa-loop-niter.c: use gimple_phi in a few places
697         * tree-ssa-loop-niter.c (chain_of_csts_start): Return a gimple_phi
698         rather than a gimple.
699         (get_base_for): Likewise; convert local "phi" to be a gimple_phi.
700         (loop_niter_by_eval): Convert local "phi" to be a gimple_phi.
702 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
704         tree-ssa-phiprop.c: use gimple_phi
706         * tree-ssa-phiprop.c (phiprop_insert_phi): Strengthen types of
707         parameter "phi" and local "new_phi" from gimple to gimple_phi.
709 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
711         tree-predcom.c: use gimple_phi in various places
713         * tree-predcom.c (find_looparound_phi): Return a gimple_phi rather
714         than just a gimple.
715         (insert_looparound_copy): Require a gimple_phi rather than just a
716         gimple.
717         (add_looparound_copies): Convert local "phi" to be a gimple_phi.
718         (initialize_root_vars): Likewise.
719         (initialize_root_vars_lm): Likewise.
721 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
723         tree-parloops.c: use gimple_phi in various places
725         * tree-parloops.c (struct reduction_info): Strengthen field "new_phi"
726         from gimple to gimple_phi.
727         (create_phi_for_local_result): Convert local "new_phi" to gimple_phi.
728         (loop_has_vector_phi_nodes): Require a gimple_phi rather than a gimple.
729         (gather_scalar_reductions): Convert to a gimple_phi_iterator and
730         gimple_phi.
731         (try_create_reduction_list): Likewise.
733 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
735         Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi
737         * tree-ssa-propagate.h (typedef ssa_prop_visit_phi_fn): Strengthen
738         type of parameter from gimple to gimple_phi.
740         * tree-complex.c (complex_visit_phi): Update signature of callback
741         implementation accordingly.
742         * tree-ssa-ccp.c (ccp_visit_phi_node): Likewise.
743         * tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
744         * tree-vrp.c (vrp_visit_phi_node): Likewise.
746         * tree-ssa-propagate.c (simulate_stmt): Add a checked cast to
747         gimple_phi when invoking the ssa_prop_visit_phi callback.
749 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
751         Introduce gimple_phi_iterator
753         * gimple-iterator.h (struct gimple_phi_iterator): New subclass of
754         gimple_stmt_iterator with identical layout, but adding...
755         (gimple_phi_iterator::phi): ...new method, equivalent to
756         gsi_stmt (), but casting the underlying gimple to gimple_phi,
757         checking that code == GIMPLE_PHI in a checked build.
758         (gsi_start_phis): Return a gimple_phi_iterator, rather than just a
759         gimple_stmt_iterator.
761         * tree-if-conv.c (bb_with_exit_edge_p): Require a gimple_phi rather
762         than just a gimple.
763         (if_convertible_phi_p): Likewise.
764         * tree-phinodes.h (add_phi_node_to_bb): Likewise.
765         * tree-ssa-phiprop.c (propagate_with_phi): Likewise.
767         * tree-ssa-uninit.c (warn_uninitialized_phi): Require a gimple_phi
768         and a vec<gimple_phi> *, rather than just a gimple and
769         vec<gimple> *, and a hash_set<gimple_phi> * rather than a
770         hash_set<gimple> *.
771         (find_uninit_use): Likewise; add checked cast to gimple_phi when
772         adding to worklist.
773         (pass_late_warn_uninitialized::execute): Strengthen types of
774         various locals, "worklist" from vec<gimple> to vec<gimple_phi>,
775         "gsi" to a gimple_phi_iterator, "phi" and "cur_phi" to a
776         gimple_phi, "added_to_worklist" from hash_set<gimple> to
777         hash_set<gimple_phi>.
779         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Require a
780         gimple_phi_iterator * rather than a gimple_stmt_iterator *;
781         use it to strengthen local from a gimple to a gimple_phi.
783         * cfgloop.c (find_subloop_latch_edge_by_ivs): Convert local from a
784         gimple_stmt_iterator to a gimple_phi_iterator.  Use the iterator's
785         "phi" method rather than gsi_stmt.  Use this checked cast to convert
786         the type of related local from a plain gimple to a gimple_phi.
787         * gimple-pretty-print.c (dump_phi_nodes): Likewise.
788         * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
789         Likewise.
790         * sese.c (sese_add_exit_phis_edge): Likewise.
791         * tree-cfg.c (reinstall_phi_args): Likewise.
792         (gimple_make_forwarder_block): Likewise.
793         (add_phi_args_after_copy_edge): Likewise.
794         (gimple_lv_adjust_loop_header_phi): Likewise.
795         * tree-cfgcleanup.c (phi_alternatives_equal): Likewise.
796         (remove_forwarder_block_with_phi): Likewise.
797         (merge_phi_nodes): Likewise.
798         * tree-complex.c (update_phi_components): Likewise.
799         * tree-if-conv.c (if_convertible_loop_p_1): Likewise.
800         * tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
801         (copy_phis_for_bb): Likewise.
802         * tree-into-ssa.c (rewrite_add_phi_arguments): Likewise.
803         * tree-outof-ssa.c (eliminate_build): Likewise.
804         (eliminate_useless_phis): Likewise.
805         (rewrite_trees): Likewise.
806         (insert_backedge_copies): Likewise.
807         * tree-phinodes.c (reserve_phi_args_for_new_edge): Likewise.
808         (remove_phi_args): Likewise.
809         (remove_phi_nodes): Likewise.
810         * tree-predcom.c (find_looparound_phi): Likewise.
811         (eliminate_temp_copies): Likewise.
812         * tree-scalar-evolution.c (loop_closed_phi_def): Likewise.
813         (scev_const_prop): Likewise; also, add checked cast to phi.
814         * tree-ssa-coalesce.c (coalesce_partitions): Likewise.
815         * tree-ssa-dce.c (remove_dead_phis): Likewise.
816         (forward_edge_to_pdom): Likewise.
817         * tree-ssa-dom.c (record_equivalences_from_phis): Likewise.
818         (cprop_into_successor_phis): Likewise.
819         (propagate_rhs_into_lhs): Likewise.
820         (eliminate_degenerate_phis_1): Likewise.
821         * tree-ssa-ifcombine.c (same_phi_args_p): Likewise.
822         * tree-ssa-live.c (calculate_live_on_exit): Likewise.
823         (verify_live_on_entry): Likewise.
824         * tree-ssa-loop-im.c
825         (move_computations_dom_walker::before_dom_children): Likewise.
826         * tree-ssa-loop-ivopts.c (find_bivs): Likewise.
827         (mark_bivs): Likewise.
828         (find_interesting_uses_outside): Likewise.
829         (determine_set_costs): Likewise.
830         * tree-ssa-loop-manip.c (split_loop_exit_edge): Likewise.
831         (tree_transform_and_unroll_loop): Likewise.
832         (rewrite_all_phi_nodes_with_iv): Likewise.
833         (canonicalize_loop_ivs): Likewise.
834         * tree-ssa-loop-niter.c (determine_value_range): Likewise.
835         * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise.
836         * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise.
837         * tree-ssa-reassoc.c (suitable_cond_bb): Likewise.
838         * tree-ssa-tail-merge.c (same_phi_alternatives_1): Likewise.
839         (vop_phi): Likewise.
840         * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis):
841         Likewise.
842         * tree-ssa-threadupdate.c (copy_phi_arg_into_existing_phi): Likewise.
843         (copy_phi_args): Likewise.
844         (phi_args_equal_on_edges): Likewise.
845         * tree-ssa.c (ssa_redirect_edge): Likewise.
846         (flush_pending_stmts): Likewise.
847         * tree-switch-conversion.c (check_final_bb): Likewise.
848         (gather_default_values): Likewise.
849         (build_constructors): Likewise.
850         (fix_phi_nodes): Likewise.
851         * tree-tailcall.c (propagate_through_phis): Likewise.
852         (add_successor_phi_arg): Likewise.
853         * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1):
854         Likewise.
855         (slpeel_update_phi_nodes_for_guard2): Likewise.
856         (slpeel_tree_peel_loop_to_edge): Likewise.
857         (vect_can_advance_ivs_p): Likewise.
858         (vect_update_ivs_after_vectorizer): Likewise.
859         * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
860         * tree-vrp.c (find_assert_locations): Likewise.
861         * value-prof.c (gimple_ic): Likewise.
863         * omp-low.c (expand_parallel_call): Convert local to a gimple_phi.
865 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
867         Introduce gimple_phi and use it in various places
869         * coretypes.h (gimple_phi): New typedef.
870         (const_gimple_phi): New typedef.
872         * gdbhooks.py (build_pretty_printer): Add gimple_phi and its
873         variants, using the gimple printer.
875         * gimple.h (gimple_vec): Eliminate thie typedef in the hope of using
876         vecs of more concrete gimple subclasses as appropriate; also the
877         comment is about to become misleading.
879         * gimple.h (gimple_phi_capacity): Use const_gimple_phi typedef
880         rather than spelling out the full type.
881         (gimple_phi_num_args): Likewise.
882         (gimple_phi_result): Likewise.
883         (gimple_phi_result_ptr): Use gimple_phi typedef.
884         (gimple_phi_set_result): Likewise.
885         (gimple_phi_arg): Likewise.
886         (gimple_phi_set_arg): Likewise.
887         * tree-phinodes.c (allocate_phi_node): Likewise.
888         (resize_phi_node): Likewise.
889         (reserve_phi_args_for_new_edge): Likewise.
890         (remove_phi_arg_num): Likewise.
892         * gimple-pretty-print.c (dump_gimple_phi): Require a gimple_phi
893         rather than just a gimple.
894         * tree-into-ssa.c (mark_phi_for_rewrite): Likewise.
896         * tree-phinodes.c (make_phi_node): Return a gimple_phi rather than
897         just a gimple.
898         (create_phi_node): Likewise.
899         * tree-phinodes.h (create_phi_node): Likewise.
901         * trans-mem.c (struct struct tm_log_entry): Replace use of
902         now-removed gimple_vec with a plain vec<gimple>.
904         * tree-into-ssa.c (phis_to_rewrite): Strengthen from a
905         vec<gimple_vec> to a vec< vec<gimple_phi> >.
907         * tree-into-ssa.c (insert_phi_nodes_for): Update local to be a
908         gimple_phi.
909         * tree-into-ssa.c (rewrite_update_phi_arguments): Strengthen local
910         "phis" from a gimple_vec to a vec<gimple_phi>, and local "phi" to
911         a gimple_phi.
912         * tree-into-ssa.c (delete_update_ssa): Strengthen local
913         "phis" from a gimple_vec to a vec<gimple_phi>.
915         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
916         gimple_phi in regions where a stmt is known to have code
917         GIMPLE_PHI.
918         * tree-into-ssa.c (mark_use_interesting): Likewise.
920 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
922         Introduce gimple_debug and use it in a few places
924         * coretypes.h (gimple_debug): New typedef.
925         (const_gimple_debug): New typedef.
927         * gimple.h (struct gimple_statement_debug): New subclass of
928         gimple_statement_with_ops, adding the invariant that
929         stmt->code == GIMPLE_DEBUG.
930         (is_a_helper <gimple_statement_debug>::test): New.
932         * gdbhooks.py (build_pretty_printer): Add gimple_debug and its
933         variants, using the gimple printer.
935         * gimple-pretty-print.c (dump_gimple_debug): Require a gimple_debug
936         rather than just a gimple.
937         * tree-inline.c (copy_debug_stmt): Likewise.
939         * tree-inline.h (struct copy_body_data): Strengthen field
940         "debug_stmts" from a vec<gimple> to a vec<gimple_debug>.
942         * gimple.c (gimple_build_debug_bind_stat): Return a gimple_debug
943         rather than just a gimple.
944         (gimple_build_debug_source_bind_stat): Likewise.
945         * gimple.h (gimple_build_debug_bind_stat): Likewise.
946         (gimple_build_debug_source_bind_stat): Likewise.
948         * tree-inline.c (remap_gimple_stmt): Update locals to be a
949         gimple_debug.
950         (maybe_move_debug_stmts_to_successors): Likewise.
951         (copy_debug_stmts): Likewise.
953         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
954         gimple_debug in regions where a stmt is known to have code
955         GIMPLE_DEBUG.
957 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
959         Introduce gimple_label and use it in a few places
961         * coretypes.h (gimple_label): New typedef.
962         (const_gimple_label): New typedef.
964         * gimple.h (struct gimple_statement_label): New subclass of
965         gimple_statement_with_ops, adding the invariant that
966         stmt->code == GIMPLE_LABEL.
967         (is_a_helper <gimple_statement_label>::test): New.
969         * gdbhooks.py (build_pretty_printer): Add gimple_label and its
970         variants, reusing the gimple printer.
972         * gimple-pretty-print.c (dump_gimple_label): Require a gimple_label
973         rather than just a gimple.
974         * tree-cfg.c (verify_gimple_label): Likewise.
976         * gimple.c (gimple_build_label): Return a gimple_label rather than
977         just a gimple.
978         * gimple.h (gimple_build_label): Likewise.
980         * gimplify.c (gimplify_case_label_expr): Update local to be a
981         gimple_label.
982         * tree-switch-conversion.c (gen_inbound_check): Likewise.
984         * gimple-pretty-print.c (pp_gimple_stmt_1): Add checked cast to
985         gimple_label in regions where a stmt is known to have code
986         GIMPLE_LABEL.
987         * tree-cfg.c (verify_gimple_stmt): Likewise.
989 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
991         Introduce gimple_assign and use it in various places
993         * coretypes.h (gimple_assign): New typedef.
994         (const_gimple_assign): New typedef.
996         * gimple.h (struct gimple_statement_assign): New subclass of
997         gimple_statement_with_memory_ops, adding the invariant that
998         stmt->code == GIMPLE_ASSIGN.
999         (is_a_helper <gimple_statement_assign>::test): New.
1001         * gdbhooks.py (build_pretty_printer): Add gimple_assign and its
1002         variants, using the gimple printer.
1004         * gimple-builder.c (build_assign): Return a gimple_assign rather
1005         than just a gimple from each of the overloaded variants.
1006         (build_type_cast): Likewise.
1007         * gimple-builder.h (build_assign): Likewise.
1008         (build_type_cast): Likewise.
1009         * gimple.c (gimple_build_assign_stat): Likewise.
1010         (gimple_build_assign_with_ops): Likewise.
1011         * gimple.h (gimple_build_assign_stat): Likewise.
1012         (gimple_build_assign_with_ops): Likewise.
1014         * asan.c (get_mem_ref_of_assignment): Require a const_gimple_assign
1015         rather than just a "const gimple" (the latter is not a
1016         "const_gimple").
1017         * gimple-pretty-print.c (dump_unary_rhs): Require a gimple_assign
1018         rather than just a gimple.
1019         (dump_binary_rhs): Likewise.
1020         (dump_ternary_rhs): Likewise.
1021         * tree-cfg.c (verify_gimple_assign_unary): Likewise.
1022         (verify_gimple_assign_binary): Likewise.
1023         (verify_gimple_assign_ternary): Likewise.
1024         (verify_gimple_assign_single): Likewise.
1025         (verify_gimple_assign): Likewise.
1026         * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
1027         (try_to_simplify): Likewise.
1028         * tree-tailcall.c (process_assignment): Likewise.
1029         * tree-vect-generic.c (expand_vector_operation): Likewise.
1030         * tree-vrp.c (extract_range_from_cond_expr): Likewise.
1031         (extract_range_from_assignment): Likewise.
1033         * asan.c (has_stmt_been_instrumented_p): Add checked cast to
1034         gimple_assign in regions where a stmt is known to have code
1035         GIMPLE_ASSIGN.
1036         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1037         * tree-cfg.c (verify_gimple_stmt): Likewise.
1038         * tree-ssa-sccvn.c (visit_use): Likewise.
1039         * tree-tailcall.c (find_tail_calls): Likewise.
1040         * tree-vrp.c (vrp_visit_assignment_or_call): Likewise.
1042         * tree-vrp.c (simplify_stmt_for_jump_threading): Replace a check
1043         against GIMPLE_ASSIGN with a dyn_cast<gimple_assign>, introducing
1044         a gimple_assign local.
1046         * tree-vect-generic.c (expand_vector_condition): Convert local to a
1047         gimple_assign, adding a checked cast when extracting from gsi, since
1048         this is only called when  underlying stmt has code GIMPLE_ASSIGN.
1049         (optimize_vector_constructor): Likewise.
1050         (lower_vec_perm): Likewise.
1051         (expand_vector_operations_1): Convert local to a gimple_assign,
1052         introducing a dyn_cast.
1054 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1056         Introduce gimple_cond and use it in various places
1058         * coretypes.h (gimple_cond): New typedef.
1059         (const_gimple_cond): Likewise.
1061         * gimple.h (struct gimple_statement_cond): New subclass of
1062         gimple_statement_with_ops, adding the invariant that
1063         stmt->code == GIMPLE_COND.
1064         (is_a_helper <gimple_statement_cond>::test): New.
1065         (gimple_build_cond): Return a gimple_cond, rather than just
1066         a gimple.
1067         (gimple_build_cond_from_tree): Likewise.
1069         * gdbhooks.py (build_pretty_printer): Add gimple_cond and its
1070         variants, using the gimple printer.
1072         * cfgexpand.c (expand_gimple_cond): Require a gimple_cond rather
1073         than just a gimple.
1074         * gimple.h (gimple_cond_set_condition_from_tree): Likewise.
1075         (gimple_cond_true_p): Likewise.
1076         (gimple_cond_false_p): Likewise.
1077         (gimple_cond_set_condition): Likewise.
1078         * gimple.c (gimple_cond_set_condition_from_tree): Likewise.
1079         * gimple-fold.c (fold_gimple_cond): Likewise.
1080         * gimple-pretty-print.c (dump_gimple_cond): Likewise.
1081         * tree-ssa-dom.c (canonicalize_comparison): Likewise.
1082         * tree-ssa-forwprop.c (forward_propagate_into_gimple_cond): Likewise.
1083         * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
1084         (recognize_bits_test): Likewise.
1085         * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
1086         (thread_around_empty_blocks): Likewise.
1087         (thread_through_normal_block): Likewise.
1088         (thread_across_edge): Likewise.
1089         * tree-ssa-threadedge.h (thread_across_edge): Likewise.
1090         * tree-vrp.c (range_fits_type_p): Likewise.
1092         * cfgexpand.c (expand_gimple_basic_block): Add checked cast to
1093         gimple_cond in regions where a stmt is known to have code GIMPLE_COND.
1094         * gimple-fold.c (fold_stmt_1): Likewise.
1095         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1096         * tree-ssa-dom.c (optimize_stmt): Likewise.
1097         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
1098         * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Likewise.
1099         * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
1100         Likewise.
1101         * tree-vrp.c (simplify_stmt_using_ranges): Likewise.
1103         * cfgloopmanip.c (create_empty_loop_on_edge): Update local to be a
1104         gimple_cond.
1105         * tree-vrp.c (identify_jump_threads): Likewise.
1107         * gimple.c (gimple_build_cond): Return a gimple_cond, rather than
1108         just a gimple.
1109         (gimple_build_cond_from_tree): Likewise.
1111         * tree-ssa-dom.c (class dom_opt_dom_walker): Strengthen type of
1112         field "m_dummy_cond" from a plain gimple to a gimple_cond.
1114         * tree-ssa-ifcombine.c (ifcombine_ifandif): Introduce locals
1115         inner_stmt and outer_stmt so that inner_cond and outer_cond can be
1116         of type gimple_cond once we know that we have code == GIMPLE_COND.
1117         * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Introduce local
1118         "last" so that stmt can be of type gimple_cond.
1120 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1122         Introduce gimple_bind and use it for accessors.
1124         * coretypes.h (gimple_bind): New typedef.
1125         (const_gimple_bind): New typedef.
1127         * gdbhooks.py (build_pretty_printer): Add gimple_bind
1128         and its variants, using the gimple printer.
1130         * gimple-pretty-print.c (dump_gimple_bind): Update type-signature to
1131         require a gimple_bind rather than just a gimple.
1133         * gimple.c (gimple_build_bind): Return a gimple_bind rather than
1134         just a gimple.
1135         * gimple.h (gimple_build_bind): Likewise.
1137         * gimple.h (gimple_seq_first_stmt_as_a_bind): New.
1139         * gimple.h (gimple_bind_vars): Update type-signature to
1140         require a gimple_bind rather than just a gimple, removing
1141         as_a and hence run-time check.
1142         (gimple_bind_set_vars): Likewise.
1143         (gimple_bind_append_vars): Likewise.
1144         (gimple_bind_body_ptr): Likewise.
1145         (gimple_bind_body): Likewise.
1146         (gimple_bind_set_body): Likewise.
1147         (gimple_bind_add_stmt): Likewise.
1148         (gimple_bind_add_seq): Likewise.
1149         (gimple_bind_block): Likewise.
1150         (gimple_bind_set_block): Likewise.
1151         * gimplify.c (gimple_push_bind_expr): Likewise.
1152         (gimple_current_bind_expr): Likewise.
1153         * tree-inline.c (copy_gimple_bind): Likewise.
1155         * gimplify.h (gimple_current_bind_expr): Return a gimple_bind
1156         rather than a plain gimple.
1157         (gimplify_body): Likewise.
1158         (gimple_bind_expr_stack): Return a vec<gimple_bind> rather than
1159         a vec<gimple>.
1161         * gimplify.c (struct gimplify_ctx): Strengthen field
1162         "bind_expr_stack" from vec<gimple> to vec<gimple_bind>.
1163         (gimple_bind_expr_stack): Likewise for type of returned value.
1165         * gimplify.c (gimplify_body): Strengthen various types from gimple
1166         to gimple_bind, including the return type.
1168         * gimplify.c (declare_vars): Introduce "gs" as a generic gimple,
1169         so that local "scope" can be of type gimple_bind once we've reached
1170         the region where it must be of code GIMPLE_BIND.
1172         * gimple-low.c (lower_gimple_bind): Add checked cast to
1173         gimple_bind, since both callers (lower_function_body and
1174         lower_stmt) have checked the code for us.
1176         * gimple.c (gimple_copy): Add checked cast to gimple_bind in
1177         region guarded by check for code GIMPLE_BIND.
1178         * gimple-low.c (gimple_stmt_may_fallthru): Likewise.
1179         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1180         * gimple-walk.c (walk_gimple_stmt): Likewise.
1181         * omp-low.c (scan_omp_1_stmt): Likewise.
1182         (lower_omp_1): Likewise.
1183         (lower_omp_for): Likewise.
1184         * tree-cfg.c (verify_gimple_in_seq_2): Likewise.
1185         (do_warn_unused_result): Likewise.
1186         * tree-inline.c (remap_gimple_stmt): Likewise.
1187         (estimate_num_insns): Likewise.
1188         * tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
1190         * gimplify.c (gimplify_bind_expr): Update local(s) to be a
1191         gimple_bind rather than just a gimple.
1192         (gimplify_function_tree): Likewise.
1193         * omp-low.c (lower_omp_sections): Likewise.
1194         (lower_omp_single): Likewise.
1195         (lower_omp_master): Likewise.
1196         (lower_omp_taskgroup): Likewise.
1197         (lower_omp_ordered): Likewise.
1198         (lower_omp_critical): Likewise.
1199         (lower_omp_taskreg): Likewise.
1200         (lower_omp_teams): Likewise.
1201         * omp-low.c (lower_omp_for): Likewise; use
1202         gimple_seq_first_stmt_as_a_bind to encapsulate the checked cast.
1203         (lower_omp_target): Likewise.
1204         * tree-nested.c (finalize_nesting_tree_1): Likewise.
1206         * gimple.c (empty_stmt_p): Add dyn_cast to a gimple_bind.
1207         * tree-inline.c (replace_locals_stmt): Add dyn_cast to gimple_bind.
1209 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
1211         Introduce gimple_switch and use it in various places
1213         * gimple.h (gimple_statement_switch): New subclass of
1214         gimple_statement_with_ops, adding the invariant that
1215         stmt->code == GIMPLE_SWITCH.
1216         (is_a_helper <gimple_statement_switch>::test (gimple)): New.
1218         * coretypes.h (gimple_switch): New typedef
1219         (const_gimple_switch): Likewise.
1221         * gdbhooks.py (build_pretty_printer): Add gimple_switch
1222         and its variants, using the gimple printer.
1224         * gimple.c (gimple_build_switch_nlabels): Return a gimple_switch
1225         rather than just a gimple.
1226         (gimple_build_switch): Likewise.
1227         * gimple.h (gimple_build_switch_nlabels): Likewise.
1228         (gimple_build_switch): Likewise.
1230         * gimple.h (gimple_switch_num_labels): Update type-signature to
1231         require a gimple_switch rather than just a gimple.
1232         (gimple_switch_set_num_labels): Likewise.
1233         (gimple_switch_set_index): Likewise.
1234         (gimple_switch_label): Likewise.
1235         (gimple_switch_set_label): Likewise.
1236         (gimple_switch_default_label): Likewise.
1237         (gimple_switch_set_default_label): Likewise.
1238         * expr.h (expand_case): Likewise.
1239         * gimple-pretty-print.c (dump_gimple_call): Likewise.
1240         * stmt.c (compute_cases_per_edge): Likewise.
1241         (expand_case): Likewise.
1242         * tree-cfg.h (group_case_labels_stmt): Likewise.
1243         * tree-cfg.c (make_gimple_switch_edges): Likewise.
1244         (find_taken_edge_switch_expr) Likewise.
1245         (find_case_label_for_value) Likewise.
1246         (get_cases_for_edge): Likewise.
1247         (group_case_labels_stmt): Likewise.
1248         (verify_gimple_switch): Likewise.
1249         * tree-eh.c (verify_norecord_switch_expr): Likewise.
1250         * tree-eh.c (lower_eh_constructs_2): Likewise.
1251         * tree-loop-distribution.c (generate_loops_for_partition): Likewise.
1252         * tree-ssa-dom.c (record_edge_info): Likewise.
1253         * tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
1254         (simplify_gimple_switch): Likewise.
1255         * tree-switch-conversion.c (emit_case_bit_tests): Likewise.
1256         (collect_switch_conv_info): Likewise.
1257         (build_constructors): Likewise.
1258         (array_value_type): Likewise.
1259         (build_one_array): Likewise.
1260         (build_arrays): Likewise.
1261         (gen_inbound_check): Likewise.
1262         * tree-vrp.c (find_switch_asserts): Likewise.
1263         (find_case_label_range): Likewise.
1264         (find_case_label_ranges): Likewise.
1265         (vrp_visit_switch_stmt): Likewise.
1266         (simplify_switch_using_ranges): Likewise.
1268         * tree-vrp.c (switch_update): Strengthen field "stmt" from being
1269         merely a gimple to being a gimple_switch.
1271         * cfgexpand.c (expand_gimple_stmt_1): Add checked cast to
1272         gimple_switch in regions where the stmt code has been tested as
1273         GIMPLE_SWITCH.
1274         * gimple-pretty-print.c (pp_gimple_stmt_1): Likewise.
1275         * tree-cfg.c (make_edges): Likewise.
1276         (end_recording_case_labels): Likewise.
1277         (cleanup_dead_labels): Likewise.
1278         (cleanup_dead_labels): Likewise.
1279         (group_case_labels): Likewise.
1280         (find_taken_edge): Likewise.
1281         (find_case_label_for_value): Likewise.
1282         (verify_gimple_stmt): Likewise.
1283         (gimple_verify_flow_info): Likewise.
1284         (gimple_redirect_edge_and_branch): Likewise.
1285         * tree-inline.c (estimate_num_insns): Likewise.
1286         * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
1287         * tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
1288         * tree-switch-conversion.c (do_switchconv): Likewise.
1289         * tree-vrp.c  (find_assert_locations_1): Likewise.
1290         (vrp_visit_stmt): Likewise.
1291         (simplify_stmt_using_ranges): Likewise.
1293         * ipa-inline-analysis.c (set_switch_stmt_execution_predicate):
1294         Introduce local "lastg" as a generic gimple, so that local "last"
1295         can be of type gimple_switch once lastg's code has been verified.
1297         * omp-low.c (diagnose_sb_2): Introduce switch_stmt local to handle
1298         the GIMPLE_SWITCH case.
1300         * tree-cfg.c (find_taken_edge_switch_expr): Add gimple_switch
1301         argument, since the caller (find_taken_edge) has checked that
1302         last_stmt is a switch.
1304 Copyright (C) 2014 Free Software Foundation, Inc.
1306 Copying and distribution of this file, with or without modification,
1307 are permitted in any medium without royalty provided the copyright
1308 notice and this notice are preserved.