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