1 2004-05-11 Diego Novillo <dnovillo@redhat.com>
3 * tree-cfg.c (delete_tree_cfg): Update call to
6 2004-05-10 Diego Novillo <dnovillo@redhat.com>
8 * tree-ssa-live.h: Fix typo in #include guard.
10 2004-05-08 Jeff Sturm <jsturm@one-point.com>
12 * tree-eh.c (lower_catch): Lower catch body in context of
15 2004-05-07 Richard Henderson <rth@redhat.com>
17 * tree-eh.c (tree_could_trap_p): Use get_base_address on references.
19 2004-05-07 Diego Novillo <dnovillo@redhat.com>
21 * doc/invoke.texi: Remove documentation for -ftree-copyprop.
22 Update documentation for -ftree-pre.
24 2004-05-06 Richard Henderson <rth@redhat.com>
26 * stmt.c (parse_output_constraint): Don't warn for read-write
28 * gimplify.c (gimplify_asm_expr): Force in-out memory operands
29 to minimal lvalues, then expand to non-matching constraints.
31 2004-05-06 Zack Weinberg <zack@codesourcery.com>
33 * c-decl.c (finish_function): When !targetm.have_ctors_dtors,
34 record static constructors and destructors here...
35 (c_expand_body_1): ... not here.
36 * c-objc-common.c (start_cdtor, finish_cdtor): Collapse
38 (build_cdtor): ...here. Update to construct a complete tree
39 for the function. No need to call push_scope, pop_scope, or
40 clear_last_expr, or set current_function_cannot_inline.
41 (c_objc_common_finish_file): Just call build_cdtor for static
42 ctors/dtors, then clear the variables. Do this before calling
43 cgraph_finalize_compilation_unit and cgraph_optimize.
45 2004-05-06 Richard Henderson <rth@redhat.com>
47 * fold-const.c (fold): Don't build COND_EXPR from comparisons for
48 boolean and integer result types. Handle X ^ X for TRUTH_XOR_EXPR.
50 2004-05-05 Richard Henderson <rth@redhat.com>
52 * tree-nested.c (create_tmp_var_for): Disallow variable sized types.
53 (convert_nonlocal_reference): Set val_only false for the base of a
54 component or array reference.
55 (convert_local_reference): Likewise.
57 2004-05-05 Richard Henderson <rth@redhat.com>
59 * gimplify.c (create_tmp_var): Disallow variable sized objects.
60 (gimplify_modify_expr): Don't memcpy for VA_ARG_EXPR.
62 2004-05-05 Richard Henderson <rth@redhat.com>
64 * fold-const.c (operand_equal_p): Replace only_const argument with
65 flags. Allow pure functions if OEP_PURE_SAME.
66 (fold, nondestructive_fold_binary_to_constant): Use OEP_ONLY_CONST.
67 * tree-cfg.c (phi_alternatives_equal): Fix operand_equal_p flag type.
68 * tree-ssa-dom.c (avail_expr_eq): Use OEP_PURE_SAME.
69 * tree.h (enum operand_equal_flag): New.
70 (operand_equal_p): Update argument list.
72 2004-05-05 Richard Henderson <rth@redhat.com>
74 * tree-ssa-operands.c (get_call_flags): Remove.
75 (get_expr_operands): Use call_expr_flags.
76 * tree-alias-common.c (call_may_clobber): Likewise.
77 (call_may_return): Likewise.
79 2004-04-05 Andrew Pinski <pinskia@physics.uc.edu>
82 * c-typeck.c (build_asm_expr): Mark the output operands
83 to an asm addressable, if necessary.
85 2004-05-05 Steven Bosscher <stevenb@suse.de>
87 * Makefile.in (GTFILES): Remove duplicate basic-block.h.
89 2004-05-04 Richard Henderson <rth@redhat.com>
91 * gimplify.c (build_addr_expr_with_type): Set TREE_ADDRESSABLE.
92 (gimplify_modify_expr): Turn variable-width assignment into memcpy.
93 * tree-nested.c (convert_local_reference): Set val_only after default.
95 2004-05-04 Diego Novillo <dnovillo@redhat.com>
97 * tree-cfg.c (tree_cfg2vcg): Rename from tree_cfg2dot. Update all
99 Emit flowgraph using VCG syntax.
100 * tree-dump.c (dump_files): Rename -fdump-tree-dot to
102 * tree.h (enum tree_dump_index): Rename TDI_dot to TDI_vcg.
103 * doc/invoke.texi: Update documentation to describe
106 2004-05-03 Andrew Pinski <pinskia@physics.uc.edu>
108 * objc/objc-act.c (build_objc_string_object):
109 Add the fields to the purpose of the list for
112 2004-05-03 Richard Henderson <rth@redhat.com>
114 * c-simplify.c (gimplify_if_stmt): Loop for else-if.
116 2004-05-03 Andrew Pinski <pinskia@physics.uc.edu>
118 PR optimization/15245
119 * tree-ssa-phiopt.c (conditional_replacement): Use fold_convert
122 2004-05-03 Diego Novillo <dnovillo@redhat.com>
124 * gimplify.c (gimplify_compound_lval): Gimplify non-constant
125 array indices into a temporary variable.
127 2004-04-30 Richard Henderson <rth@redhat.com>
129 * builtins.c (validate_arglist): Don't reject side effects.
130 (simplify_builtin_strcpy): Do reject side effects in length.
132 2004-04-30 Jeff Law <law@redhat.com>
134 * tree-outof-ssa.c (eliminate_build): Move code which verifies
135 that all of a PHI's arguments do not have a partition if the
136 result does not have a partition from here to...
137 (rewrite_trees): Here.
139 2004-04-24 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
141 * tree-cfg.c (factored_computed_goto_label,
142 factored_computed_goto): Removed.
143 (disband_implicit_edges): Unfactor computed gotos without
146 2004-04-23 Per Bothner <per@bothner.com>
148 * expr.c (expr_wfl_stack): Remove unused global.
150 Pre-patches for future source_location / location_t merge.
151 * tree.h (EXPR_LOCATION, EXPR_HAS_LOCATION): New macros.
152 * expr.c (expand_expr_real, expand_expr_real_1): Use new macros.
153 * gimple-low.c (lower_stmt): Likewise.
154 * gimplify.c (annotate_all_with_locus): Likewise.
155 * print-tree.c (print_node): Likewise.
156 * tree-inline.c (expand_call_inline): Likewise.
157 * tree-pretty-print.c (tree-pretty-print.c): Likewise.
158 * tree-sra.c (scalarize_structure_assignment, emit_scalar_copies,
159 scalarize_call_expr): Likewise.
160 * tree-ssa-pre.c (code_motion): Likewise.
162 2004-04-23 Andrew Pinski <pinskia@physics.uc.edu>
164 * c-simplify.c (gimplify_decl_stmt) [TYPE_DECL]:
165 Do not check the type.
167 2004-04-22 Jeff Law <law@redhat.com>
169 * tree-into-ssa.c (rewrite_initialize_block_local_data): Mark all
170 arguments as potentially unused. Do not bother to VARRAY_CLEAR
171 the block_defs. Instead abort if we are presented with a block
172 which has a nonempty block_defs. Wrap entire thing inside
173 #ifdef ENABLE_CHECKING.
174 * tree-ssa-dom.c (dom_opt_initialize_block_local_data): Similarly
176 * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Do not mark
177 arguments to bypassed PHIs as needing to be rewritten.
179 2004-04-21 Richard Henderson <rth@redhat.com>
182 * tree-nested.c (convert_nonlocal_reference): Set val_only when
183 processing any otherwise unhandled expression.
185 2004-04-21 Jeff Law <law@redhat.com>
187 * tree-ssa-copy.c (cprop_operand): Break out of cprop_into_stmt.
188 (cprop_into_stmt): Use cprop_operand. Rearrange slightly to avoid
189 switch statement inside a loop.
191 * tree-flow.h (var_ann_d): Add "current_def" field.
192 (register_new_def): Lose last argument (currdefs table).
193 * tree-into-ssa.c (currdefs): Remove.
194 (rewrite_into_ssa): Initialize current_def field on each variable's
195 annotation. Remove initialization/clearing of currdefs.
196 (set_value_for, get_value_for): Kill.
197 (rewrite_initialize_block): Update call to register_new_def.
198 (rewrite_stmt): Similarly.
199 (rewrite_finalize_block): Get/set a _DECL node's current
200 definition from its annotation.
201 (get_reaching_def): Similarly.
202 (register_new_def): Similarly. Lose last argument.
203 * tree-ssa-dom.c (currdefs): Remove.
204 (get_value_for, set_value_for): Simplify.
205 (tree_ssa_dominator_optimize): Initialize current_def on each
206 variable's annotation. Remove initialization/clearing of currdefs.
207 (thread_across_edge): Lose unnecessary argument to register_new_def.
208 (record_equivalences_from_phis): Likewise.
209 (register_definitions_for_stmt): Likewise.
210 (restore_currdefs_to_original_value): Get/set a _DECL node's current
211 definition from its annotation. Lose unnecessary "table" argument.
212 (dom_opt_finalize_block): Corresponding changes.
214 * tree-dfa.c (free_df_for_stmt): Release memory back to the GC
217 2004-04-21 Ben Elliston <bje@au.ibm.com>
220 * expr.c (expand_expr_real_1) <SWITCH_EXPR>: Discard out of bounds
221 case label values and ranges. Saturate case range values that
222 exceed the minimum or maximum permitted value for the controlling
223 expression type to TYPE_MIN_VALUE or TYPE_MAX_VALUE.
225 2004-04-20 Jeff Law <law@redhat.com>
227 * tree-into-ssa.c (register_new_def): Avoid pushing useless
228 information onto the block local definition stack.
230 * tree-into-ssa.c (register_new_def): If there is no current
231 reaching definition for SSA_NAME_VAR (DEF), then just push
232 SSA_NAME_VAR (DEF) onto the stack.
233 (rewrite_finalize_block): If we pop a _DECL node from the stack,
234 then the _DECL node has no current reaching definition.
235 * tree-ssa-dom.c (restore_currdefs_to_original_value): Similarly.
237 2004-04-19 Jeff Law <law@redhat.com>
239 * tree-ssa-dom.c: Reinstate all changes from 2004-04-12.
240 (lookup_avail_expr): Do not access a hash table object after
243 2004-04-19 Daniel Berlin <dberlin@dberlin.org>
245 * doc/passes.texi: Add blurb about PRE.
247 2004-04-19 Andrew Pinski <pinskia@physics.uc.edu>
249 * tree-ssa-phiopt.c (conditional_replacement):
250 Catch some more non-gimple.
252 2004-04-19 Jan Hubicka <jh@suse.cz>
254 * predict.c (combine_predictions_for_bb): Fix pasto.
256 2004-04-18 Jan Hubicka <jh@suse.cz>
258 * tree-inline.c (estimate_num_insn_1): Deal properly with
259 builtin_constant_p and builtin_expect.
261 2004-04-17 Andrew MacLeod <amacleod@redhat.com>
263 * doc/invoke.texi (tree-ter, tree-lrs): Document options.
265 2004-04-17 Paul Brook <paul@codesourcery.com>
267 * Makefile.in: Set GMPLIBS and GMPINC.
268 * configure.ac: Add GMPLIBS and GMPINC.
269 * configure: Regenerate.
271 2004-04-16 Andrew MacLeod <amacleod@redhat.com>
273 * common.opt (ftree-lrs): New common option.
274 * flags.h (flag_tree_live_range_split): New flag.
275 * opts.c (decode_options): Turn on LRS by default.
276 (common_handle_option): Set LRS flag to specified value.
277 * toplev.c (flag_tree_live_range_split): Initialize.
278 (lang_independent_options f_): Add tree-lrs.
279 * tree-outof-ssa.c (rewrite_out_of_ssa): Use LRS flag.
280 * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Don't coalesce
281 variables if one is a hardware register. Coalesce inlined user vars.
282 (rename_ssa_copies): Scan blocks first, then PHI nodes.
284 2004-04-15 Andrew Pinski <pinskia@physics.uc.edu>
286 * builtins.c (fold_builtin_isascii): Do not return non-gimple
287 code when we are in gimple form.
288 (fold_builtin_isdigit): Do not return non-gimple
289 code when we are in gimple form.
291 * c-simplify.c (gimplify_decl_stmt): Handle TYPE_DECL.
293 2004-04-14 Paul Brook <paul@codesourcery.com>
295 * Makefile.in (GMPLIBS, GMPINC): Don't set.
296 * configure.ac: Remove checks for GMP.
297 * configure: Regenerate.
299 2004-04-13 Diego Novillo <dnovillo@redhat.com>
301 * fold-const.c, tree-ssa-ccp.c, tree-ssa-dom.c,
302 tree-ssa.c, tree.c: Replace all uses of TREE_UNSIGNED with
303 TYPE_UNSIGNED or DECL_UNSIGNED.
305 * c-semantics.c (build_stmt): Don't check type nodes for
308 2004-04-13 Jeff Law <law@redhat.com>
310 * tree-ssa-dom.c: Revert all changes from 2004-04-12.
312 2004-04-12 Jeff Law <law@redhat.com>
314 * tree-ssa-dom.c (struct expr_hash_elt): Add new field for hash value.
315 (initialize_hash_element): New LHS argument. Callers changed.
316 Initialize the hash value field.
317 (remove_local_expressions_from_table): Use htab_remove_elt_with_hash.
318 (update_rhs_and_lookup_avail_expr): Similary.
319 (lookup_avail_expr): Use htab_find_slot_with_hash. Simplify slightly
320 and pass LHS to initialize_hash_element.
321 (record_cond): Also use htab_find_slot_with_hash. Initialize the
322 hash table entry with initialize_hash_element.
323 (avail_expr_eq): Use the saved hash value rather than calling into
324 the hash functions again.
326 * tree-ssa-dom.c (tree_ssa_dominator_optimize): Slightly rearrange
327 code to clear tables before each iteration to be clearer.
329 * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Use
330 DEF_OPS and VDEF_OPS instead of STMT_DEF_OPS and STMT_VDEF_OPS.
332 2004-04-12 Diego Novillo <dnovillo@redhat.com>
334 * flags.h (flag_tree_loop): Remove. Update all users.
335 * opts.c (common_handle_option) <OPT_ftree_loop_optimize>: Remove.
336 * toplev.c (f_options): Remove -ftree-loop-optimize.
337 * tree-optimize.c (init_tree_optimization_passes): Don't
339 * tree-ssa-loop.c (tree_ssa_loop_opt): Remove.
341 * doc/invoke.texi: Remove documentation for -ftree-loop-optimize.
343 2004-04-12 Diego Novillo <dnovillo@redhat.com>
345 * c-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Remove.
346 * c-semantics.c (expand_stmt_toplev): Remove.
347 * langhooks-def.h (LANG_HOOKS_RTL_EXPAND_INITIALIZER): Remove.
348 (LANG_HOOKS_RTL_EXPAND_START): Remove.
349 (LANG_HOOKS_RTL_EXPAND_STMT): Remove.
350 (LANG_HOOKS_RTL_EXPAND_END): Remove.
351 * langhooks.h (struct lang_hooks_for_rtl_expansion): Remove.
352 (struct lang_hooks): Update.
353 * tree-optimize.c (tree_rest_of_compilation): Don't call
354 lang_hooks.rtl_expand.start nor lang_hooks.rtl_expand.end.
355 Call expand_expr_stmt_value instead of
356 lang_hooks.rtl_expand.stmt.
357 * objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Remove.
360 2004-04-12 Richard Henderson <rth@redhat.com>
362 * c-common.c (c_do_switch_warnings): Use EXPR_LOCUS instead
364 (c_walk_subtrees): Likewise.
365 (c_estimate_num_insns_1): Remove FILE_STMT.
366 * c-common.def (FILE_STMT): Remove.
367 * c-common.h (FILE_STMT_FILENAME_NODE): Remove.
368 (FILE_STMT_FILENAME, STMT_LINENO, STMT_LINENO_FOR_FN_P): Remove.
369 (c_common_stmt_codes): Remove FILE_STMT.
370 * c-dump.c (dump_stmt): Use EXPR_LOCUS instead of STMT_LINENO.
371 * c-parse.in (lineno_stmt, lineno_label): Likewise.
372 * c-pretty-print.c (pp_c_statement): Remove FILE_STMT.
373 * c-semantics.c (add_stmt): Don't emit FILE_STMT. Do set
374 EXPR_LOCUS if not yet set.
375 (finish_stmt_tree): Don't set line for end of function.
376 (build_stmt): Set EXPR_LOCUS instead of STMT_LINENO.
377 (prep_stmt): Use EXPR_LOCUS instead of STMT_LINENO.
378 * c-simplify.c (c_gimplify_stmt): Remove FILE_STMT.
379 (gimplify_block): Save and restore entire locus.
380 (stmt_expr_last_stmt): Use EXPR_LOCUS instead of STMT_LINENO.
381 * doc/c-tree.texi (FILE_STMT, FILE_STMT_FILENAME, STMT_LINENO): Remove.
383 2004-04-12 Jeff Law <law@redhat.com>
385 * tree-ssa-dom.c (true_exprs, false_exprs): Kill.
386 (struct expr_hash_elt): New structure for the expression hash table.
387 (struct dom_walk_block_data): Kill block local true_exprs and
389 (get_eq_expr_value): One less local varray argument. Fix prototype.
390 Use record_cond rather than record_cond_is_{true,false}.
391 (true_false_expr_hash, true_false_expr_eq): Kill.
392 (record_cond_is_true, record_cond_is_false): Collapse into ...
393 (record_cond): New function.
394 (tree_ssa_dominator_optimize): Kill references to true_exprs and
395 false_exprs. Use "free" as the free function for the avail_exprs
397 (dom_opt_initialize_block_local_data): No longer initialize
398 block local true/false expressions.
399 (initialize_hash_element): New function.
400 (remove_local_expressions_from_table): Use initialize_hash_element.
401 (update_rhs_and_lookup_avail_expr): Similarly.
402 (dom_opt_finalize_block): Record true/false expressions into the
403 main avail_expr hash table. Unwind main hash table appropriately.
404 Use record_cond rather than record_cond_is_{true,false}.
405 (record_equivalences_from_incoming_edge): Pass block local avail_exprs
406 varray instead of block local true/false varrays to get_eq_expr_value.
407 (dump_dominator_optimization_stats): Update to reflect that the
408 true/false expression hash tables are gone.
409 (lookup_avail_expr): Simplify slightly now that we only have one
410 expression hash table.
411 (avail_expr_hash, avail_expr_eq): Generalize slightly to handle new
412 hash table entry structure and having true/false expression information
413 in the available expression hash table.
415 2004-04-09 Jeff Law <law@redhat.com>
417 * tree-ssa_dom.c (register_definitions_for_stmt): Accept a statement
418 annotation rather than the statement itself. Callers changed.
419 Use [V]DEF_OPS rather than STMT_[V]DEF_OPS.
420 * tree-ssa-operands.c (get_stmt_operands): Slightly reorganize to
421 avoid unnecessary calls to stmt_ann.
422 * tree-ssa-pre.c (expr_phi_insertion): Get the statement's annotation
423 and use [V]USE_OPS rather than STMT_[V]USE_OPS.
424 (same_e_version_phi_result): Similarly
425 (process_left_occs_and_kills): Similarly for [V]DEF_OPS and
427 * tree-ssa.c (replace_immediate_uses): Similarly.
428 (verify_ssa): Similarly. Also verify that VDEF_OPs uses are dominated
431 * tree-into-ssa.c (insert_phi_nodes_for): Use passed in worklist
432 varray instead of allocated one for every variable we rewrite into
434 (insert_phi_nodes_1): Pass worklist varray from caller to
435 insert_phi_nodes_for.
436 (insert_phi_nodes): Allocate a worklist for insert_phi_nodes_for
437 and pass it to insert_phi_nodes_1.
439 2004-04-08 Jeff Law <law@redhat.com>
441 * tree-ssa-dom.c (nonzero_vars): Turn it into a bitmap.
442 (tree_ssa_dominator_optimize): Update initialization, clearing and
443 freeing of nonzero_vars.
444 (restore_nonzero_vars_to_original_value): New function.
445 (dom_opt_finalize_block): Use it.
446 (record_var_is_nonzero): Only record the variable into the block
447 local nonzero vars array if it did not already have a nonzero property.
448 (lookup_avail_expr): Lookup the nonzero property of an SSA_NAME with
451 * fold-const.c (fold): Remove attempt to share code which
452 simplifies tests against the highest/lowest value of a
453 range between the main folder and the nondestructive folder.
455 2004-04-08 Brian Booth <bbooth@redhat.com>
456 Diego Novillo <dnovillo@redhat.com>
458 * tree-into-ssa.c (invalidate_name_tags): New function.
459 Mark aliases of invalidated name tags for renaming.
460 (rewrite_into_ssa): Call invalidate_name_tags.
462 2004-04-07 Diego Novillo <dnovillo@redhat.com>
464 * gimplify.c (gimplify_call_expr): Remove argument POST_P.
466 Don't use POST_P when gimplifying the call expression.
468 2004-04-07 Diego Novillo <dnovillo@redhat.com>
470 * doc/tree-ssa.texi: Add documentation for the dominator
473 2004-04-07 Andrew MacLeod <amacleod@redhat.com>
475 * tree-outof-ssa.c: Update comments and reformat for legibility.
476 * tree-ssa-copyrename.c: Update comments and reformat for legibility.
477 * tree-ssa-live.c: Update comments and reformat for legibility.
478 * tree-ssa-live.h: Update comments and reformat for legibility.
480 2004-04-07 Diego Novillo <dnovillo@redhat.com>
482 * gimplify.c (gimplify_call_expr): Don't use POST_P when
483 gimplifying CALL_EXPR arguments.
485 2004-04-06 Diego Novillo <dnovillo@redhat.com>
487 * tree-dfa.c: Update comments and reformat for legibility.
488 (find_vars_r): Remove special casing of MODIFY_EXPR and
490 (compute_reached_uses, compute_reaching_defs, remove_decl,
491 find_decl_location): Remove.
492 (discover_nonconstat_array_refs_r,
493 discover_nonconstant_array_refs): Move ...
494 * tree-outof-ssa.c: ... here.
496 2004-04-05 Richard Henderson <rth@redhat.com>
498 * tree-simple.c (is_gimple_min_invariant): Disallow &a+i.
499 * tree-ssa-ccp.c (maybe_fold_stmt_addition): Rename from
500 maybe_fold_stmt_plus. Handle MINUS_EXPR.
501 (fold_stmt_r): Pass MINUS_EXPR to it.
503 2004-04-05 Ben Elliston <bje@au.ibm.com>
505 * Makefile.in (OBJS-common): Remove tree-browser.o.
506 (cc1): Depend on @TREEBROWSER@ and include in list of objects.
507 * configure.ac: Add --enable-tree-browser option.
508 * configure: Rebuild.
510 2004-04-05 Andrew Pinski <pinskia@physics.uc.edu>
512 * tree-ssa-ccp.c (fold_stmt_r): Fix whitespace formatting.
515 2004-04-03 Paolo Bonzini <bonzini@gnu.org>
516 Diego Novillo <dnovillo@redhat.com>
518 * tree-alias-common.c (find_func_aliases): Support
519 assigning to BIT_FIELD_REFs.
520 * tree-cfg.c (verify_expr): Don't allow assign to
521 a register with BIT_FIELD_REF.
522 * tree-dfa.c (get_virtual_var): Add consistency check on
523 the shape of expected VARs.
524 (discover_nonconstant_array_refs_r): Go through BIT_FIELD_REFs.
525 * tree-simple.c: Document that BIT_FIELD_REFs are valid lvalues.
526 * tree-ssa.c (set_is_used): Go through BIT_FIELD_REFs.
527 * tree-ssa-operands.c (get_expr_operands): Mark VA_ARG_EXPR
528 nodes as making volatile references.
530 2004-04-02 Fariborz Jahanian <fjahanian@apple.com>
532 * c-convert.c (convert): Make convert work when converting
533 to compatible types across translation unit.
535 2004-04-02 Andrew Pinski <pinskia@physics.uc.edu>
537 * Makefile.in (stage2_build): Remove support for
538 rebuilding libbanshee.
539 * configure.ac: Remove support for rebuilding
541 * config.gcc (powerpc-*-darwin*): Do not rebuild
544 2004-04-01 Kazu Hirata <kazu@cs.umass.edu>
546 * tree-ssa-forwprop.c: Add a comment about forward propagation
549 2004-04-01 Diego Novillo <dnovillo@redhat.com>
551 * tree-optimize.c (tree_rest_of_compilation): Fix typo in
552 setting of in_gimple_form.
554 2004-04-01 Jeff Law <law@redhat.com>
556 * fold-const.c (fold_relational_hi_lo): Do not return non-gimple
557 code when we are in gimple form.
558 * tree-optimize.c (tree_rest_of_compilation): Note when we are in
560 * tree-ssa-ccp.c (ccp_fold): Tighten tests on return value from
561 nondestructive_fold_{unary,binary}_to_constant.
562 * tree.h (in_gimple_form): Declare.
564 * tree-ssa.c (ssa_remove_edge): Correct looping structure.
565 (ssa_redirect_edge): Similarly
567 2004-03-30 Brian Booth <bbooth@redhat.com>
569 * tree-pretty-print.c (dump_vops): Add flags argument and
570 propagate it to dump_generic_node calls.
571 (dump_generic_node): Update dump_vops call.
573 2004-03-29 Diego Novillo <dnovillo@redhat.com>
575 * configure.ac: Emit confirmation messages for libbanshee.
576 * configure: Regenerate.
578 2004-03-29 Jan Hubicka <jh@suse.cz>
581 * cgraphunit.c (cgraph_decide_inlining): Rewrite handling of
582 always_inline functions.
584 2004-03-28 Jan Hubicka <jh@suse.cz>
586 * tree-inline.c (expand_call_inline): Remove fixme introduced by
587 nested function patch.
589 2004-03-26 Diego Novillo <dnovillo@redhat.com>
591 * tree-ssa-operands.c (get_stmt_operands): Remove always-true
594 * tree-ssa-alias.c (maybe_create_global_var): Create
595 .GLOBAL_VAR if there are no call-clobbered variables.
596 * tree-ssa-operands.c (get_stmt_operands): Add call-clobbering
597 VDEFs for asm ("":::"memory") if there are call-clobbered
598 variables or if .GLOBAL_VAR has been created.
601 2004-03-26 Diego Novillo <dnovillo@redhat.com>
603 * passes.c (rest_of_compilation): Re-enable .01.rtl
606 2004-03-25 Diego Novillo <dnovillo@redhat.com>
608 * tree-pretty-print.c (dump_generic_node) <WITH_RECORD_EXPR>: Remove.
609 * tree-inline.c (estimate_num_insns_1) <WITH_RECORD_EXPR>: Remove.
610 * fold-const.c (fold_relational_hi_lo): Change type of argument
611 'type_p' to const tree and rename it to 'type'. Update
614 2004-03-25 Diego Novillo <dnovillo@redhat.com>
616 * Makefile.in (C_AND_OBJC_OBJS): Remove c-call-graph.o
617 (c-call-graph.o): Remove.
618 * c-call-graph.c: Remove.
619 * c-tree.h (print_call_graph): Remove.
620 (debug_call_graph): Remove.
621 * tree-cfg.c: Update/add comments everywhere.
622 (pre_insert_on_edge): Rename from bsi_insert_on_edge_immediate.
623 * tree-flow.h (build_tree_cfg): Make static.
624 (tree_cfg2dot): Likewise.
625 (verify_stmt): Likewise.
626 * tree-ssa-pre.c (insert_one_operand): Call pre_insert_on_edge.
628 2004-03-25 Diego Novillo <dnovillo@redhat.com>
630 * tree-ssa-alias.c (struct alias_info): Change type of field
631 'num_references' to varray_type. Update all users.
633 2004-03-24 Jeff Law <law@redhat.com>
635 * c-mudflap (mflang_flush_calls): Use push_scope/pop_scope instead
636 of pushlevel and poplevel.
638 2004-03-23 Richard Henderson <rth@redhat.com>
641 * c-common.c (handle_alias_attribute): Mark aliased variables
644 2004-03-23 Jeff Law <law@redhat.com>
646 * tree-into-ssa.c (register_new_def): Lose unnecessary VAR argument,
647 instead derive VAR from DEF argument.
648 (rewrite_initialize_block, rewrite_stmt, rewrite_operand): Corresponding
650 * tree-ssa-dom.c (register_definitions_for_stmt): Corresponding changes.
651 (record_equivalences_from_phis): Likewise.
652 (restore_currdefs_to_original_value): New, extracted from ...
653 (dom_opt_finalize_block): Use restore_currdefs_to_original_value.
654 Restore currdefs after threading across a true edge.
655 (thread_across_edge): Register new defintions when we walk through
656 a PHI node or real statement.
657 * tree-flow.h (register_new_def): Updated.
659 2004-03-23 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
661 * tree-ssa-dce.c (find_obviously_necessary_stmts,
662 perform_tree_ssa_dce): Do not remove loops.
664 2004-03-19 Diego Novillo <dnovillo@redhat.com>
666 PR optimization/14643
667 * tree-ssa-alias.c (group_aliases_into): Don't add a variable
668 to its own may-alias set.
669 (create_alias_map_for): New.
670 (setup_pointers_and_addressables): Call it.
671 Fix allocation of AI->ADDRESSABLE_VARS and AI->POINTERS.
672 If there are no addressable variables and more than one
673 dereferenced pointers, add type tags to the ADDRESSABLE_VARS
675 (get_tmt_for): Add comment about using alias set equality when
676 checking for existing tags.
678 2004-03-19 Kazu Hirata <kazu@cs.umass.edu>
680 * fold-const.c (fold_relational_const): Remove dead code.
682 2004-03-19 Dale Johannesen <dalej@apple.com>
684 * tree-ssa-dse.c (dse_optimize_stmt): Redirect uses feeding into
685 a deleted store correctly.
687 2004-03-19 Jeff Law <law@redhat.com>
689 * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Fix typo.
690 Eliminate unnecessary test of VAL.
692 * tree-dfa.c (find_hidden_use_vars): Also look inside the
693 PENDING_SIZES list for hidden uses.
694 * tree-optimize.c (tree_rest_of_compilation): Expand used variables
695 before setting up parameters.
696 * tree-ssa-copyrename.c (rename_ssa_copies): Do nothing for copies
697 where the LHS has a hidden use.
699 2004-03-18 Diego Novillo <dnovillo@redhat.com>
701 * Makefile.in (TREE_FLOW_H): Reformat.
702 (OBJS-common): Add tree-into-ssa.o and tree-outof-ssa.o.
703 (tree-ssa.o): Remove dependency on domwalk.h and tree-ssa-live.h
704 (tree-into-ssa.o): New.
705 (tree-outof-ssa.o): New.
706 (GTFILES): Remove tree-ssa.c.
707 (gt-tree-ssa.h): Remove.
708 * tree-into-ssa.c: New file.
709 Move all the functions used to rename into SSA from tree-ssa.c.
711 Remove unused variables and structures.
712 Don't use GGC for memory allocation.
713 * tree-outof-ssa.c: New file.
714 Move all the functions used to rename out of SSA from
717 * tree-ssa-alias.c (compute_points_to_and_addr_escape): Add
718 bibliographic reference.
720 2004-03-18 Jeff Law <law@redhat.com>
722 * Makefile.in (tree-tailcall.o): Depend on langhooks.h.
723 * tree-tailcall.c: Include langhooks.h.
724 (find_tail_calls): Use types_compatible_p langhook instead of
725 equality test of TYPE_MAIN_VARIANT.
727 * tree-nested.c (get_chain_decl): Mark the chain decl with
730 2004-03-18 Devang Patel <dpatel@apple.com>
732 * tree-ssa-live.c (new_tree_live_info): Set num_blocks to
733 last_basic_block instead of n_basic_blocks.
734 (calculate_live_on_entry): Use last_basic_block instead of
736 (calculate_live_on_exit): Same.
738 2004-03-17 Jeff Law <law@redhat.com>
740 * tree-tailcall.c (find_tail_calls): Tighten test for tail recursion.
742 2004-03-17 Diego Novillo <dnovillo@redhat.com>
744 PR optimization/14511
745 * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Do not
746 ignore read-only variables.
747 (may_alias_p): Fix pointer-to-var calculation when 'var' is an
750 2004-03-17 Jan Hubicka <jh@suse.cz>
752 * tree-ssa.c (rewrite_into_ssa, compute_global_livein): Fix.
754 2004-03-17 Paolo Bonzini <bonzini@gnu.org>
756 * builtins.c (expand_builtin_constant_p,
757 purge_builtin_constant_p): Remove.
758 (expand_builtin): Expand __builtin_constant_p to zero.
759 * function.c (struct function): Remove calls_constant_p.
760 (current_function_calls_constant_p): Remove.
761 * passes.c (rest_of_handle_gcse): Do not run
762 purge_builtin_constant_p.
763 * rtl.def (CONSTANT_P_RTX): Die die die.
765 * cse.c (fold_rtx): Do not handle CONSTANT_P_RTX.
766 * expr.c (emit_move_insn): Likewise.
767 * gcse.c (want_to_gcse_p, gcse_constant_p): Likewise.
768 * genrecog.c (validate_pattern): Likewise.
769 * recog.c (immediate_operand): Likewise.
770 * rtl.h (CONSTANT_P): Likewise.
771 * simplify-rtx.c (simplify_rtx): Likewise.
772 * config/alpha/alpha.c (input_operand): Likewise.
773 * config/arm/arm.c (THUMB_LEGITIMATE_CONSTANT_P): Likewise.
774 * config/c4x/c4x.c (const_operand): Likewise.
775 * config/cris/cris.c (cris_gotless_symbol,
776 cris_got_symbol): Likewise.
777 * config/frv/frv.h (LEGITIMATE_PIC_OPERAND_P): Likewise.
778 * config/ia64/ia64.c (gr_reg_or_5bit_operand,
779 gr_reg_or_6bit_operand, gr_reg_or_8bit_operand,
780 gr_reg_or_8bit_adjusted_operand,
781 gr_reg_or_8bit_and_adjusted_operand,
782 gr_reg_or_14bit_operand, gr_reg_or_22bit_operand,
783 shift_count_operand, shift_32bit_count_operand): Likewise.
784 * config/m32r/m32r.c (move_src_operand): Likewise.
785 * config/mips/mips.c (mips_const_insns): Likewise.
786 * config/mmix/mmix.c (mmix_constant_address_p): Likewise.
787 * config/pa/pa.c (move_src_operand): Likewise.
788 * config/rs6000/rs6000.c (input_operand): Likewise.
789 * config/sparc/sparc.c (input_operand): Likewise.
790 * config/v850/v850.c (movsi_source_operand): Likewise.
791 * config/xtensa/xtensa.c (move_operand,
792 xtensa_emit_move_sequence): Likewise.
793 * config/ia64/ia64.h (PREDICATE_CODES): Do not mention CONSTANT_P_RTX.
794 * config/pa/pa.h (PREDICATE_CODES): Likewise.
796 2004-03-16 Diego Novillo <dnovillo@redhat.com>
798 * tree-dump.c (struct dump_option_value_info): Add TDF_UID.
799 * tree.h (TDF_UID): Define.
800 * doc/invoke.texi: Document -ftree-dump-...-uid.
801 * tree-pretty-print.c (debug_generic_expr): Add TDF_UID.
802 (debug_generic_stmt): Likewise.
803 (dump_decl_name): New function.
804 (dump_generic_node): Call it.
805 (print_declaration): Add new argument 'flags'. Update all users.
806 (print_struct_decl): Likewise.
807 * tree-alias-ander.c, tree-cfg.c, tree-dfa.c, tree-mudflap.c,
808 tree-nrv.c, tree-sra.c, tree-ssa-alias.c, tree-ssa-ccp.c,
809 tree-ssa-copy.c, tree-ssa-dom.c, tree-ssa-dse.c,
810 tree-ssa-forwprop.c, tree-ssa-operands.c, tree-ssa-pre.c,
811 tree-ssa.c, tree-tail-call.c: Call print_generic_* with
814 2004-03-16 Dale Johannesen <dalej@apple.com>
816 * Makefile.in (tree-ssa-phiopt.o): add langhooks.h dependency.
818 (tree-ssa-copy.o): Ditto.
819 (tree-ssa-dom.o): Ditto.
820 (tree-ssa-ccp.o): Ditto.
821 * c-common.c: Add #include hashtab.h.
823 (c_common_get_alias_set): Handle multiple type nodes referring
824 to "the same" type, currently for C90 only.
825 * c-decl.c (current_file_decl): Move to toplev.c.
826 * c-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Define to
827 c_types_compatible_p.
828 (c_types_compatible_p): New.
829 * c-tree.h (c_types_compatible_p): New declaration.
830 * c-typeck.c (tagged_types_tu_compatible_p): Allow for
831 compiler-generated TYPE_DECLs without a DECL_ORIGINAL_TYPE.
832 * gimplify.c (canonicalize_addr_expr): Use types_compatible_p langhook.
833 (cpt_same_type): Ditto.
834 * langhooks-def.h (lhd_types_compatible_p): New declaration.
835 LANG_HOOKS_TYPES_COMPATIBLE_P: New.
836 * langhooks.c (lhd_types_compatible_p): New.
837 * langhooks.h (struct lang_hooks): Add types_compatible_p.
838 * stmt.c (tail_recursion_args): Use types_compatible_p langhook.
839 * toplev.c (current_file_decl): New, moved from c-decl.c.
840 * tree-nrv.c: Include langhooks.h.
841 (tree_nrv): Use types_compatible_p langhook.
842 * tree-ssa-ccp.c: Include langhooks.h.
843 (maybe_fold_offset_to_array_ref): Use types_compatible_p langhook.
844 (maybe_fold_offset_to_component_ref): Ditto (2 places).
845 (fold_stmt_r): Make sure rhs of COMPONENT_REF is in lhs type.
846 * tree-ssa-copy.c: Include langhooks.h.
847 (cprop_into_stmt): Use types_compatible_p langhook.
848 * tree-ssa-dom.c: Include langhooks.h.
849 (avail_expr_p): Use types_compatible_p langhook.
850 * tree-ssa-phiopt.c: Include langhooks.h.
851 (conditional_replacement): Use types_compatible_p langhook.
852 * tree-ssa.c (tree_ssa_useless_type_conversion_1): Use
853 types_compatible_p langhook.
854 * tree.h (current_file_decl): New declaration.
856 2004-03-16 Dale Johannesen <dalej@apple.com>
858 PR optimization/14498
859 * gimplify.c (copy_if_shared_r): Mark VA_ARGS_EXPRs as volatile.
860 (mark_decls_volatile_r): Moved higher in file (unchanged).
862 2004-03-16 Daniel Berlin <dberlin@dberlin.org>
864 PR optimization/14562
865 * tree-ssa-pre.c (generate_expr_as_of_bb): Don't use names_match_p.
866 (generate_vops_as_of_bb): Ditto.
868 2004-03-12 Diego Novillo <dnovillo@redhat.com>
870 PR optimization/14553
871 * tree-ssa.c (replace_immediate_uses): Call propagate_value to
874 2004-03-12 Diego Novillo <dnovillo@redhat.com>
876 * tree-alias-common.c (create_alias_vars): Add #if
877 HAVE_BANSHEE around test for PTA_ANDERSEN.
879 2004-03-11 Diego Novillo <dnovillo@redhat.com>
881 * tree-dfa.c (struct walk_state): Remove fields 'is_store' and
882 'is_indirect_ref'. Update all users.
883 * tree-flow.h (struct var_ann_d): Remove fields 'is_stored',
884 'is_dereferenced_store' and 'is_dereferenced_load'. Update
886 * tree-simple.c (get_base_address): Handle BIT_FIELD_REF.
887 * tree-ssa-alias.c (struct alias_info): Add fields
888 'written_vars', 'dereferenced_ptrs_store' and
889 'dereferenced_ptrs_load'.
890 (init_alias_info): Initialize them.
891 (delete_alias_info): Free them.
892 (find_ptr_dereference): New.
893 (ptr_is_dereferenced_by): Call it.
894 Add new argument 'is_store'. Set to true if the
895 expression is an indirect store operation.
896 (compute_points_to_and_addr_escape): If the statement
897 makes a store, load or write operation, update the
898 corresponding bitmap.
899 (compute_flow_insensitive_aliasing): Test the
900 'written_vars' bitmap to determine if alias sets should
902 (setup_pointers_and_addressables): Always assume that
903 volatile pointers and hidden pointers have been used in a
904 memory store operation.
905 * tree-ssa-operands.c (add_stmt_operand): Do add an
906 operand for may-aliased variables before computing
909 2004-03-11 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
911 * tree-optimize.c (init_tree_optimization_passes): Move
912 pass_tail_recursion and pass_ch after pass_may_alias.
913 * tree-ssa-loop.c (mark_defs_for_rewrite): Mark type tags
915 * tree-ssa.c (mark_def_sites): Process the operand of a
916 VDEF before the result.
918 2004-03-11 Richard Henderson <rth@redhat.com>
921 * tree-ssa.c (warn_uninit): Don't warn for hard register variables.
923 2004-03-10 Richard Henderson <rth@redhat.com>
925 * tree-simple.c (get_base_var, get_base_decl): Remove.
926 * tree-simple.h: Likewise.
927 * tree-dfa.c (discover_nonconstant_array_refs_r): Use get_base_address.
928 * tree-ssa-alias.c (ptr_is_dereferenced_by): Likewise.
929 (add_pointed_to_var, is_escape_site): Likewise.
930 * tree-ssa-ccp.c (get_default_value): Expect only SSA_NAME and DECLs.
931 * tree-ssa-operands.c (add_stmt_operand): Likewise.
932 (note_addressable): Use get_base_address.
933 * tree-ssa-dce.c (need_to_preserve_store): Expect only SSA_NAME.
934 * tree-ssa.c (set_is_used): Inline get_base_decl.
936 2004-03-10 Richard Henderson <rth@redhat.com>
938 * tree-nested.c (convert_nonlocal_reference): Clear TREE_INVARIANT
939 on modified ADDR_EXPRs.
941 2004-03-10 Andrew Pinski <apinski@apple.com
944 * c-decl.c (check_bitfield_type_and_width): Check for null
945 lang_type_specific when check the precision of an enum.
947 2004-03-09 Andrew Pinski <apinski@apple.com>
949 * Makefile.in (tree-ssa-forwprop.o): Fix the dependences.
951 2004-03-09 Jeff Law <law@redhat.com>
953 * tree-flow-inline.h (may_propagate_copy): Do not allow propagation of
954 a constant for a virtual operand.
956 2004-03-08 Richard Henderson <rth@redhat.com>
958 * calls.c (initialize_argument_information): Add
959 parameter may_tail_call. Set to false for invisible
960 pass-by-reference arguments that require stack
964 2004-03-07 Jeff Law <law@redhat.com>
966 * tree-ssa-dom.c: (get_eq_expr_value): Fix typo when comparing a
967 boolean against a constant.
968 * tree-ssa-forwprop.c (record_single_argument_cond_exprs): Do not
969 record the same SSA_NAME more than once. Only record the SSA_NAME
970 tested, not the COND_EXPR.
971 (substitute_single_use_vars): Substitute booleans which are
972 set from a TRUTH_NOT_EXPR even if they have more than one use site.
974 2004-03-05 Jeff Law <law@redhat.com>
976 * tree-ssa-dce.c (remove_dead_stmt): Clear PENDING_STMT after
977 redirect_edge_and_branch call.
979 * tree-ssa-forwprop.c (record_single_argument_cond_exprs): Also
980 record COND_EXPRs with single use vars defined by SSA_NAME + CONST
982 (substitute_single_use_vars): Corresponding changes to rewrite
983 COND_EXPRs using single use vars defined by SSA_NAME + CONST
986 2004-03-05 Ulrich Weigand <uweigand@de.ibm.com>
988 * config/s390/s390.c (s390_expand_movstr): Do not use
989 expand_exit_loop_top_cond, manually copy loop header.
990 (s390_expand_clrstr): Likewise.
991 (s390_expand_cmpmem): Likewise.
993 2004-03-04 Diego Novillo <dnovillo@redhat.com>
995 * tree-ssa-alias.c (compute_flow_sensitive_aliasing): If
996 a name tag has been marked call-clobbered, also mark the
997 corresponding type tag.
999 2004-03-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
1001 * tree-ssa-loop-live.c (coalesce_tpa_members): Update the root
1002 variable of the partition.
1004 2004-03-04 Jeff Law <law@redhat.com>
1006 * tree-ssa-dce.c (remove_dead_stmt): Redirect an existing edge
1007 rather than deleting the old ones and creating a new one when
1008 removing a dead conditional.
1010 * fold-const.c (fold): When rebuilding the expression after a
1011 call to fold_relational_hi_lo, make sure to convert the type of
1012 the second argument to the type of the first.
1014 2004-03-04 Diego Novillo <dnovillo@redhat.com>
1016 * cgraphunit.c (cgraph_optimize): Do not do memory release
1017 check if there have been errors.
1019 2004-03-03 Jeff Law <law@redhat.com>
1021 * tree-ssa-phiopt.c (conditional_replacement): Clear EDGE_TRUE_VALUE
1022 and EDGE_FALSE_VALUE on the remaining edge after eliminating a PHI.
1024 2004-03-03 Andrew MacLeod <amacleod@redhat.com>
1026 * tree-ssa-copyrename.c (gate_copyrename): Really check it in.
1027 * tree-ssa.c (create_temp): Use DECL_ARTIFICIAL from original decl.
1029 2004-03-02 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
1031 * tree-tailcall.c (struct tailcall): Remove return_block and return_bsi
1032 fields, add m and a fields.
1033 (m_acc, a_acc): New.
1034 (find_tail_calls): Find tail calls on whose results simple operations
1036 (independent_on_stmt_p, process_assignment,
1037 propagate_through_phis, adjust_accumulator_values,
1038 adjust_return_value): New.
1039 (eliminate_tail_call): Update the accumulators if needed.
1040 (optimize_tail_call): Do not create phis.
1041 (tree_optimize_tail_calls): Create phis and accumulators as needed.
1042 Adjust return values.
1044 2004-03-02 Diego Novillo <dnovillo@redhat.com>
1046 * tree-ssa-operands.c (get_expr_operands): Mark CALL_EXPRs
1047 with has_volatile_ops if aliases haven't been computed yet.
1048 (add_stmt_operand): Use 'true' instead of '1'.
1050 2004-03-02 Diego Novillo <dnovillo@redhat.com>
1052 PR optimization/14266
1053 * tree-ssa-alias.c (create_global_var): Mark GLOBAL_VAR for
1056 2004-03-01 Richard Henderson <rth@redhat.com>
1058 * tree.c (associative_tree_code): Remove MINUS_EXPR, LSHIFT_EXPR,
1060 * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Use
1061 is_gimple_min_invariant and is_gimple_var. Handle minus_expr
1064 2004-03-01 Richard Henderson <rth@redhat.com>
1066 * cfgbuild.c (rtl_make_eh_edge): Rename from make_eh_edge.
1067 * basic-block.h, except.c: Update decl and uses.
1069 2004-03-01 Frank Ch. Eigler <fche@redhat.com>
1071 * doc/passes.texi: Add information about mudflap.
1073 2004-03-01 Andrew Pinski <pinskia@physics.uc.edu>
1076 * fold-const (fold): Call fold_convert when building
1077 a TRUTH_*_EXPR tree.
1079 2004-03-01 Andrew MacLeod <amacleod@redhat.com>
1081 * common.opt : Add tree-copyrename option. Remove duplicate tree-sra.
1082 * flags.h (flag_tree_copyrename): Declare.
1083 * opts.c (decode_options): Turn copyrename on by default at -O.
1084 (common_handle_option): Handle -ftree-copyrename.
1085 * toplev.c (flag_tree_copyrename): Declare.
1086 * tree-ssa-copyrename.c (gate_copyrename): New. Check flag.
1087 (pass_rename_ssa_copies): Initialize with gated routine.
1088 (lang_independent_options f_): Add tree-copyrename.
1089 * doc/invoke.texi: Add -fdump-tree-copyrename and -ftree-copyrename.
1090 * doc/passes.texi: Add blurb for copy renaming.
1092 2004-03-01 Jeff Law <law@redhat.com>
1094 * tree-ssa-dom.c (true_false_expr_hash): Update comments slightly.
1095 (true_false_expr_eq): Update comments slightly. Avoid using
1096 operand_equal_p, instead check the code and operands directly.
1098 2004-03-01 Andrew MacLeod <amacleod@redhat.com>
1100 * Makefile.in (tree-ssa-copyrename.o): New object.
1101 * timevar.def (TV_TREE_COPY_RENAME): New time variable.
1102 * tree-optimize.c (init_tree_optimization_passes): Add copy rename
1104 * tree-pass.h (pass_rename_ssa_copies): New pass structure.
1105 * tree-sra.c (lookup_scalar): Copy DECL_ARITIFICIAL flag from base.
1106 * tree-ssa-copyrename.c : New file.
1107 (copy_rename_partition_coalesce): Coalesce partitions for renaming.
1108 (rename_ssa_copies): Find renamable copies.
1109 (pass_rename_ssa_copies): Initialize.
1110 * tree-ssa-live.c (register_ssa_partition): Move to tree-ssa-live.h.
1111 * tree-ssa-live.h (register_ssa_partition): Moved from tree-ssa-live.c.
1113 2004-02-29 David Edelsohn <edelsohn@gnu.org>
1115 * doloop.c (doloop_optimize): Increment n_iterations if loop->top
1118 2004-02-29 Diego Novillo <dnovillo@redhat.com>
1120 * gimple-low.c (pass_remove_useless_vars): Add TODO_dump_func.
1122 2004-02-27 Richard Henderson <rth@redhat.com>
1125 * explow.c (emit_stack_save): Remove savearea mode check.
1127 2004-02-27 Richard Henderson <rth@redhat.com>
1129 * builtins.c (simplify_builtin_strcmp): Don't export. Remove
1130 length parameters. Remove conversion to memcmp.
1131 (simplify_builtin_strncmp): Likewise.
1132 * expr.h: Don't declare them.
1133 * tree-ssa-ccp.c (ccp_fold_builtin): Don't call them.
1135 2004-02-27 Dale Johannesen <dalej@apple.com>
1137 * tree-cfg.c (cleanup_control_expr_graph): Prevent edge
1138 probability from overflowing due to roundoff errors.
1140 2004-02-27 Jeff Law <law@redhat.com>
1142 * tree-cfg.c (verify_expr): Do not walk down into types.
1143 Expand checking to verify that unary/binary operators have
1145 * tree-ssa-ccp.c (ccp_fold_builtin, case BUILT_IN_STRLEN): Do not
1146 create non-gimple code. Similarly for BUILTIN_IN_STRCPY and
1148 * tree-ssa-phiopt.c (conditional_replacement): Do not create
1150 * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise.
1152 * tree-simple.c (is_gimple_min_invariant): Subtraction of a
1153 constant from a constant pointer is a gimple invariant as well.
1154 * tree-ssa-operands.c (get_expr_operands): Handle subtraction
1155 of a constant from a constant pointer too.
1157 * fold-const.c (fold): Tighten test for optimizing an equality
1158 comparison of the address of two variables.
1160 * tree-inline.c (setup_one_parameter): Improve test for when we
1161 need to gimplify the initialization statements.
1163 2004-02-27 Diego Novillo <dnovillo@redhat.com>
1165 PR optimization/14312
1166 * tree-pretty-print.c (dump_generic_node): Mark tail calls.
1167 * tree-ssa-alias.c (compute_may_aliases): Restore call to
1168 dump_referenced_vars.
1169 (compute_points_to_and_addr_escape): If the address of a
1170 variable V is stored into a non-pointer variable, mark V as
1172 * tree-tailcall.c (suitable_for_tail_opt_p): Check for
1173 call-clobbered instead of TREE_ADDRESSABLE.
1175 (optimize_tail_call): Add newline to dump output.
1177 2004-02-27 Diego Novillo <dnovillo@redhat.com>
1179 PR optimization/13347
1180 * tree-sra.c (scalarize_structure_assignment): Use STRIP_NOPS
1181 instead of STRIP_USELESS_TYPE_CONVERSION to remove type casts
1182 from RHS of the assignment.
1184 * tree-ssa.c (tree_ssa_useless_type_conversion_1): Reformat
1185 and rephrase comments.
1186 * tree.h (STRIP_USELESS_TYPE_CONVERSION): Reformat comment.
1188 2004-02-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
1190 * tree-cfg.c (tree_redirect_edge_and_branch_1): Allow to redirect
1191 RETURN_EXPR branches.
1193 2004-02-26 Jeff Law <law@redhat.com>
1195 * tree-nrv.c (tree_nrv): Only perform NRV optimization when the
1196 return value lives in memory.
1198 * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): If an
1199 operand is unsigned, then we can eliminate more ABS expressions
1200 and turned div/mod expression into shift/and expressions.
1202 * fold-const.c (fold): An equality comparison of the address of
1203 two non-weak variables has known compile-time result.
1205 2004-02-26 Andrew Pinski <pinskia@physics.uc.edu>
1207 * tree-ssa-phiopt.c (conditional_replacement):
1208 s/tree_dump_flags/dump_flags/.
1210 * tree-ssa-phiopt.c (tree_ssa_phiopt): Split into ...
1211 (conditional_replacement): Here.
1213 2004-02-26 Andrew MacLeod <amacleod@redhat.com>
1215 * tree-ssa.c (find_replaceable_in_bb): Don't repalce expressions in
1216 volatile statements.
1218 2004-02-25 Richard Henderson <rth@redhat.com>
1221 * gimplify.c (gimple_push_cleanup): Add VAR argument. Set
1222 TREE_NO_WARNING if in a conditional context.
1223 (gimplify_target_expr): Pass new argument.
1224 * tree-sra.c (lookup_scalar): Copy TREE_NO_WARNING to replacement.
1226 2004-02-24 Kazu Hirata <kazu@cs.umass.edu>
1228 * doc/invoke.texi: Replace -fdump-tree-all-ssa with
1231 2004-02-24 Kazu Hirata <kazu@cs.umass.edu>
1234 * config/arm/arm.c (arm_compute_func_type): Replace
1235 "current_function_needs_context" with "cfun->static_chain_decl
1237 (arm_compute_initial_elimination_offset): Likewise.
1238 * config/h8300/h8300.c (h8300_emit_stack_adjustment):
1240 * config/sh/sh.c (output_stack_adjust): Likewise.
1241 (sh5_schedule_saves): Likewise.
1242 * config/xtensa/xtensa.c (compute_frame_size): Likewise.
1244 2004-02-24 Richard Henderson <rth@redhat.com>
1246 * c-simplify.c (c_genericize): s/dump_flags/local_dump_flags/.
1247 * predict.c, tree-alias-ander.c, tree-cfg.c, tree-nrv.c,
1248 tree-optimize.c, tree-pass.h, tree-sra.c, tree-ssa-alias.c,
1249 tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c,
1250 tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-loop.c,
1251 tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa.c, tree-tailcall.c:
1252 s/tree_dump_flags/dump_flags/.
1254 2004-02-24 Richard Henderson <rth@redhat.com>
1256 * predict.c, tree-alias-ander.c, tree-cfg.c, tree-mudflap.c,
1257 tree-nrv.c, tree-optimize.c, tree-pass.h, tree-profile.c, tree-sra.c,
1258 tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-dce.c,
1259 tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-loop.c,
1260 tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa.c,
1261 tree-tailcall.c: s/tree_dump_file/dump_file/g.
1263 2004-02-24 Diego Novillo <dnovillo@redhat.com>
1265 * doc/tree-ssa.texi: Fix formatting mark ups.
1267 2004-02-24 Jeff Law <law@redhat.com>
1269 * gimple-low.c (remove_useless_vars): Now static.
1270 (pass_remove_useless_vars): New.
1271 * tree-flow.h (remove_useless_vars): Remove prototype.
1272 * tree-nrv.c (struct nrv_data): Remove visited hashtable.
1273 (finalize_nrv_r): Do not descend into types. No need to update
1274 the visited hashtable.
1275 (tree_nrv): No need to allocate/free the visited hashtable.
1276 Clear the used flag on the variable's annotation.
1277 * tree-optimize.c (init_tree_optimizatio_passes): Link in
1278 pass_remove_useless_vars.
1279 * tree-pass.h (pass_remove_useless_vars): Declare.
1280 * tree-ssa.c (rewrite_out_of_ssa): Do not remove useless vars here.
1282 * Makefile.in (OBJS-common): Add tree-nrv.o.
1283 (tree-nrv.o): Add dependencies.
1284 * timevar.def (TV_TREE_NRV): New timevar.
1285 * tree-nrv.c: New file implementing NRV on generic trees.
1286 * tree-optimize.c (init_tree_optimization_passes): Link in
1287 tree_nrv optimization pass.
1288 * tree-pass.h (tree_nrv): Declare.
1289 * doc/invoke.texi: Add -fdump-tree-nrv documentation.
1291 2004-02-24 Sebastian Pop <sebastian.pop@cri.ensmp.fr>
1293 * tree-flow.h (walk_use_def_chains_fn): Return a boolean.
1294 True for stopping the use-def walk, false otherwise.
1295 * tree-ssa-alias.c (collect_points_to_info_r): Same.
1296 Always return false, and never stopping the def-use walk as before.
1297 * tree-ssa.c (walk_use_def_chains_1): Stop when the result of the
1298 callback function is true.
1299 * doc/tree-ssa.texi: Document the behavior of the callback
1300 function for walk_use_def_chains.
1302 2004-02-24 Richard Henderson <rth@redhat.com>
1304 * doc/passes.texi: Rewrite.
1306 2004-02-23 Diego Novillo <dnovillo@redhat.com>
1308 * Makefile.in (TEXI_GCCINT_FILES): Add cfg.texi and tree-ssa.texi
1309 * tree-ssa-alias.c (compute_may_aliases): Update documentation.
1310 * doc/gccint.texi: Add node for Tree SSA documentation.
1311 Include tree-ssa.texi.
1312 * doc/tree-ssa.texi: New file.
1314 2004-02-23 Dale Johannesen <dalej@apple.com>
1316 * config/rs6000/rs6000.md: Roll in changes from mainline:
1317 (movdf_softfloat64): Add POWER form of nop.
1318 (movsf_hardfloat): Ditto, and accept CTR-to-CTR copy.
1319 (movdf_hardfloat64): Ditto.
1321 2004-02-23 Jeff Law <law@redhat.com>
1323 * ggc-page.c (struct page_entry): New field PREV.
1324 (ggc_alloc): Update PREV field appropriately.
1325 (sweep_pages): Likewise.
1326 (ggc_free): Likewise. Use PREV field rather than loop to
1327 improve ggc_free performance.
1329 * Makefile.in (OBJC-common): Add tree-ssa-copy.o.
1330 (tree-ssa-copy.o): Add dependencies.
1331 * tree-flow.h (propagate_value, replace_exp): Prototype.
1332 (cprop_into_stmt, cprop_into_successor_phis): Likewise.
1333 * tree-ssa-copy.c: New file, most functions copied from tree-ssa-dom.c
1334 (cprop_into_stmt): Handle pointer & reference types better.
1335 * tree-ssa-dom.c (opt_stats_d): Kill uninteresting stats.
1336 (dump_dominator_optimization_stats): Corresponding changes.
1337 (cprop_into_stmt): Moved into tree-ssa-copy.c.
1338 (propagate_value): Likewise.
1339 (cprop_into_phis): Simplify using code fromi tree-ssa-copy.c.
1340 (optimize_stmt): Pass additional argument to cprop_into_stmt.
1341 * tree-ssa-pre.c (generate_expr_as_of_bb): Use replace_exp.
1342 (generate_vops_as_of_bb): Similarly.
1344 2004-02-21 Jan Hubicka <jh@suse.cz>
1346 * cgraphunit.c (decide_is_function_needed): Nested functions of extern
1347 inline functions don't need to be output.
1348 (expand_function): Re-enable sanity check.
1350 2004-02-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
1352 * tree-ssa-loop.c (do_while_loop_p): New function.
1353 (copy_loop_headers): Do not peel do-while loops.
1355 2004-02-21 Jan Hubicka <jh@suse.cz>
1357 * tree-cfg.c (cleanup_control_expr_graph): Update profile.
1359 * tree-cfg.c (disband_implicit_edges): Set fallthru edges correctly.
1361 * cfg.c (dump_flow_info): Work on trees too.
1363 * tree-pretty-print.c (dump_generic_bb_stuff): Do not touch bb
1364 annotations when not allocated.
1366 2004-02-21 Jeff Law <law@redhat.com>
1368 * tree-ssa-dom.c (cprop_into_stmt): Look at the type's main variant
1369 to determine if the two operands of a copy have equivalent types.
1371 2004-02-20 Jeff Law <law@redhat.com>
1373 * tree-flow-inline.h (may_propagate_copy): Do not perform ABNORMAL_PHI
1374 and DECL_HARD_REGISTER tests on virtual operands.
1375 * tree-flow.h (propagate_copy): Kill prototype.
1376 (propagate_value): New prototype.
1377 * tree-ssa-dom.c (propagate_copy): Now static.
1378 (propagate_value): No longer static.
1380 2004-02-20 Richard Henderson <rth@redhat.com>
1383 * c-simplify.c (mark_labels_r): Move to ...
1384 * gimplify.c (force_labels_r): ... here, and rename.
1385 (gimplify_init_constructor): Invoke it.
1386 * tree-simple.h (force_labels_r): Declare.
1388 2004-02-20 Richard Henderson <rth@redhat.com>
1391 * tree-ssa-ccp.c (substitute_and_fold): Also mark new vars
1392 if fold_stmt was successful.
1394 2004-02-20 Diego Novillo <dnovillo@redhat.com>
1396 * doc/invoke.texi: Add documentation for parameters
1397 global-var-threshold and max-aliased-vops.
1398 * params.def (PARAM_GLOBAL_VAR_THRESHOLD): Reformat help message.
1399 (PARAM_MAX_ALIASED_VOPS): Rename from PARAM_MAX_ALIAS_SET_SIZE.
1400 * params.h (MAX_ALIASED_VOPS): Rename from MAX_ALIAS_SET_SIZE.
1402 * tree-ssa-alias.c (struct alias_map_d): Document fields.
1403 Add fields total_alias_vops, grouped_p and may_aliases.
1404 (struct alias_info): Change fields addressable_vars and
1405 pointers to malloc'd arrays. Update all users.
1406 Add fields num_references and total_alias_vops.
1407 (compute_may_aliases): Add more comments.
1408 (init_alias_info): Initialize new fields in struct alias_info.
1409 (delete_alias_info): Corresponding changes.
1410 (compute_points_to_and_addr_escape): Count references to
1411 potentially aliased variables and pointer dereferences.
1412 (compute_flow_insensitive_aliasing): Remove old grouping
1414 Count the number of virtual operands induced by all the alias
1415 sets created and call group_aliases if the number exceeds the
1416 threshold set by --param max-aliased-vops.
1417 (total_alias_vops_cmp): New.
1418 (group_aliases_into): New.
1419 (group_aliases): New.
1420 * tree-ssa-operands.c (get_expr_operands): Change dump file
1421 message when no flow-sensitive alias information is available.
1422 (add_stmt_operand): Reformat comment.
1423 * tree-ssa.c (init_tree_ssa): Don't call bitmap_clear.
1425 * tree-simple.c (get_base_decl): Fix typo in comment.
1427 * tree-pretty-print.c (print_call_name): Handle matrices of
1430 2004-02-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
1432 * Makefile.in (tree-ssa-loop.o): Add tree-inline.h dependency.
1433 * basic-block.h (struct reorder_block_def): Moved from cfglayout.h.
1434 (alloc_rbi_pool, initialize_bb_rbi, free_rbi_pool): New.
1435 * bb-reorder.c (copy_bb): Use cfghooks for bb duplication.
1436 * cfg.c (rbi_pool): New variable.
1437 (alloc_rbi_pool, free_rbi_pool, initialize_bb_rbi): New functions.
1438 * cfghooks.c (can_duplicate_block_p, duplicate_block): New functions.
1439 * cfghooks.h (struct cfg_hooks): Add can_duplicate_block_p and
1440 duplicate_block hooks.
1441 (can_duplicate_block_p, duplicate_block): Declare.
1442 * cfglayout.c (cfg_layout_pool, cfg_layout_initialize_rbi): Removed.
1443 (fixup_reorder_chain): Use initialize_bb_rbi.
1444 (cfg_layout_can_duplicate_bb_p, cfg_layout_duplicate_bb): Hookized.
1445 (cfg_layout_initialize): Use cfg.c rbi pool manipulation functions.
1446 (can_copy_bbs_p, copy_bbs): Use cfghooks for bb duplication.
1447 * cfglayout.h (typedef struct reorder_block_def): Moved to
1449 (cfg_layout_can_duplicate_bb_p, cfg_layout_duplicate_bb): Declaration
1451 * cfgrtl.c (cfg_layout_create_basic_block): Use initialize_bb_rbi.
1452 (rtl_cfg_hooks, cfg_layout_rtl_cfg_hook): Fill in can_duplicate_block_p
1453 and duplicate_block fields.
1454 * common.opt (ftree-ch): Add.
1455 * flags.h (flag_tree_ch): Declare.
1456 * jump.c (next_nonnote_insn_in_loop, duplicate_loop_exit_test,
1457 copy_loop_headers): Removed.
1458 * loop-unswitch.c (unswitch_loop): Use cfghooks for bb duplication.
1459 * opts.c (decode_options): Enable flag_tree_ch at -O1.
1460 (common_handle_option): Handle -ftree_ch.
1461 * rtl.h (copy_loop_headers): Declaration removed.
1462 * timevar.def (TV_TREE_CH): New.
1463 * toplev.c (flag_tree_ch): New.
1464 (rest_of_compilation): Do not call copy_loop_headers.
1465 * tracer.c (tail_duplicate): Use cfghooks for bb duplication.
1466 * tree-cfg.c (build_tree_cfg): Call alloc_rbi_pool.
1467 (create_bb): Call initialize_bb_rbi.
1468 (delete_tree_cfg): Call free_rbi_pool.
1469 (tree_duplicate_bb): Hookize.
1470 (tree_can_duplicate_bb_p): New.
1471 (tree_cfg_hooks): Fill in can_duplicate_block_p and duplicate_block
1473 * tree-flow.h (tree_duplicate_bb): Declaration removed.
1474 * tree-optimize.c (init_tree_optimization_passes): Add pass_ch.
1475 * tree-pass.h (pass_ch): Declare.
1476 * tree-ssa-loop.c: Include tree-inline.h.
1477 (call_expr_p, should_duplicate_loop_header_p, mark_defs_for_rewrite,
1478 duplicate_blocks, copy_loop_headers, gate_ch): New functions.
1480 * doc/invoke.texi (-fdump-tree-ch, -ftree-ch): Document.
1482 2004-02-19 David Edelsohn <edelsohn@gnu.org>
1484 * config/rs6000/aix.h (MFWRAP_SPEC): Define.
1485 (MFLIB_SPEC): Define.
1487 2004-02-19 Jeff Law <law@redhat.com>
1489 * tree-ssa-phiopt.c (tree_ssa_phiopt): TRUTH_NOT_EXPR is valid
1492 2004-02-19 Steven Bosscher <stevenb@suse.de>
1494 * tree-cfg.c (cleanup_dead_labels): New function to remove
1497 Remove the RTL inliner.
1498 * calls.c (try_to_integrate): Remove.
1499 (expand_call): Do not try to expand calls inline.
1500 * dbxout.c (dbxout_symbol_location): Don't mention integrate.c
1502 * expmed.c (extract_fixed_bit_field): Always propagate the
1503 target for the shift if it is a REG.
1504 * expr.c (emit_move_insn_1): Don't generate inline warnings.
1505 (expand_expr_real_1): Don't look at inline_function_decl.
1506 Don't output inlined functions here.
1507 * expr.h (expand_inline_function): Remove prototype.
1508 * emit-rtl.c (copy_most_rtx): Don't copy the integrated flag.
1509 Copy the new return_val flag.
1510 * final.c (final): Don't look at RTX_INTEGRATED_P.
1511 * cfgrtl.c (create_basic_block_structure): Likewise.
1512 * haifa-sched.c (priority): Likewise.
1513 (restore_line_notes): Likewise.
1514 * function.c (inline_function_decl): Remove.
1515 (put_var_into_stack): Don't use it.
1516 (fix_lexical_addr): Likewise.
1517 * function.c (inline_function_decl): Remove extern declaration.
1518 * genattrtab.c (ATTR_PERMANENT_P): Use the return_val flag
1519 instead of the integrated flag.
1520 * integrate.c (INTEGRATE_THRESHOLD): Remove.
1521 (setup_initial_hard_reg_value_integration): Likewise.
1522 (initialize_for_inline): Likewise.
1523 (note_modified_parmregs): Likewise.
1524 (integrate_parm_decls): Likewise.
1525 (process_reg_param): Likewise.
1526 (save_parm_insns): Likewise.
1527 (copy_insn_list): Likewise.
1528 (copy_insn_notes): Likewise.
1529 (compare_blocks): Likewise.
1530 (find_block): Likewise.
1531 (inlining): Likewise.
1532 (function_cannot_inline_p): Likewise.
1533 (parmdecl_map): Likewise.
1534 (in_nonparam_insns): Likewise.
1535 (save_for_inline): Likewise.
1536 (FIXED_BASE_PLUS): Likewise.
1537 (expand_inline_function): Likewise.
1538 (copy_rtx_and_substitute): Don't look at map->integrating,
1539 map->inline_target, and inlining, since we are never copying
1541 Don't abort on RTX_INTEGRATED_P.
1543 (output_inline_function): Remove.
1544 * integrate.h (struct inline_map): Remove fields integrating,
1545 block_map, leaf_reg_map, inline_target, and local_return_label.
1546 * print-rtl.c (print_rtx): Don't print the integrated flag.
1547 Print the return_val flag.
1548 * rtl.h (struct rtx_def): Replace the integrated flag with the
1550 (RTX_INTEGRATED_P): Remove.
1551 (notice_rtl_inlining_of_deferred_constant): Remove prototype.
1552 * stmt.c (force_label_rtx): Don't look at inline_function_decl.
1553 * toplev.c (rest_of_handle_inlining): Remove.
1554 (rest_of_compilation): Don't call it, and never jump to exit.
1555 Call convert_from_eh_region_ranges.
1556 (wrapup_global_declarations): Don't output nested inlined functions.
1557 * tree.h (function_cannot_inline_p): Remove prototype.
1558 (save_for_inline): Ditto.
1559 (output_inline_function): Ditto.
1560 * unroll.c (unroll_loop): Don't clear map->inline_target.
1561 * varasm.c (notice_rtl_inlining_of_deferred_constant): Remove.
1563 * system.h: Poison INTEGRATE_THRESHOLD.
1564 * config/avr/avr.h: Remove define.
1565 * config/ip2k/ip2k.h: Likewise.
1567 * unwind-sjlj.c (uw_install_context): Make a proper static inline
1570 * doc/rtl.texi: Remove references to the integrated flag.
1571 * doc/tm.texi: Remove documentation of INTEGRATE_THRESHOLD.
1573 2004-02-17 Andrew Macleod <amacleod@redhat.com>
1575 * tree-ssa-live.c (coalesce_tpa_members): Don't coalesce partitions
1576 which are not in the same TPA group.
1577 * tree-ssa.c (rewrite_out_of_ssa): Coalesce via list first.
1579 2004-02-17 Brian Booth <bbooth@redhat.com>
1581 * tree-ssa-ccp.c (substitute_and_fold): Update stmt after
1584 2004-02-16 Andrew Pinski <pinskia@physics.uc.edu>
1586 * config/rs6000/rs6000.c (output_function_profiler): Check
1587 cfun->static_chain_decl instead of current_function_needs_context.
1589 2004-02-16 Jeff Law <law@redhat.com>
1591 * tree-ssa.dse.c (dse_optimize_stmt): Dump info when we delete
1594 * tree-ssa-dse.c: Update comments.
1596 * Makefile.in (OBJS-common): Add tree-ssa-dse.o
1597 (tree-ssa-dse.o): Add dependencies.
1598 * common.opt (ftree-dse): New option.
1599 * flags.h (flag_tree_dse): New.
1600 (flag_tree_dom): Fix comments.
1601 * opts.c (decode_options): Turn on flag_tree_dse.
1602 (common_handle_option): Handle OPT_ftree_dse.
1603 * timevar.def (TV_TREE_PHIOPT): Update text.
1604 (TV_TREE_DSE): New timevar.
1605 * toplev.c (flag_tree_dse): New.
1606 (flag_tree_dom): Fix comments.
1607 (lang_independent_options): Add -ftree-dse.
1608 * tree-dfa.c (redirect_immediate_use): New function.
1609 (redirect_immediate_uses): New function.
1610 * tree-flow.h (stmt_ann_d): Add UID field.
1611 (redirect_immediate_uses): Declare.
1612 * tree-optimize.c (init_tree_optimization_passes): Link in DSE pass.
1613 * tree-pass.h (pass_dse): Declare.
1614 * tree-ssa-dse.c: New file implementing DSE.
1615 * doc/invoke.texi: Document new option.
1617 2004-02-16 Richard Henderson <rth@redhat.com>
1619 * tree-nested.c: New file.
1620 * Makefile.in (OBJS-common, GTFILES, tree-nested.o): Add it.
1621 * builtin-types.def (BT_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR_PTR): New.
1622 * builtins.c (expand_builtin_nonlocal_goto): New.
1623 (expand_builtin_apply): Fix prepare_call_address args.
1624 (round_trampoline_addr): Move from function.c.
1625 (expand_builtin_init_trampoline): New.
1626 (expand_builtin_adjust_trampoline): New.
1627 (expand_builtin): Invoke them.
1628 (build_function_call_expr): Add CALL_EXPR chain operand.
1629 * builtins.def (BUILT_IN_INIT_TRAMPOLINE,
1630 BUILT_IN_ADJUST_TRAMPOLINE, BUILT_IN_NONLOCAL_GOTO): New.
1631 * c-decl.c (finish_function): Call lower_nested_functions.
1632 (c_expand_decl): Don't declare_nonlocal_label.
1633 * calls.c (prepare_call_address): Replace fndecl arg with a
1634 precomputed static chain value.
1635 (expand_call): Precompute the static chain value. Use
1636 update_nonlocal_goto_save_area.
1637 * cgraph.c (cgraph_mark_reachable_node): Don't force nested
1638 functions to be reachable.
1639 (cgraph_clone_node): Don't abort cloning functions containing
1641 * cgraphunit.c (cgraph_assemble_pending_functions): Don't do
1642 anything special for nested functions.
1643 (cgraph_mark_functions_to_output): Likewise.
1644 (cgraph_estimate_growth, cgraph_clone_inlined_nodes): Likewise.
1645 (cgraph_optimize): Likewise.
1646 (cgraph_finalize_function): Don't zap DECL_SAVED_INSNS.
1647 (cgraph_expand_function): Allow functions to not be emitted.
1648 * defaults.h (TRAMPOLINE_ALIGNMENT): Move from function.c.
1649 * dwarf2out.c (gen_subprogram_die): Generate DW_AT_static_link.
1650 * emit-rtl.c (maybe_set_first_label_num): New.
1651 * explow.c (update_nonlocal_goto_save_area): New.
1652 (allocate_dynamic_stack_space): Use it.
1653 * expr.c (expand_expr_real_1) <LABEL_DECL>: Don't force_label_rtx.
1654 <COND_EXPR>: Ignore the possibility of non-local labels.
1655 <ADDR_EXPR>: Don't do trampoline_address.
1656 * expr.h (lookup_static_chain): Remove.
1657 (prepare_call_address): Update 2nd arg.
1658 (update_nonlocal_goto_save_area): Declare.
1659 * final.c (profile_function): Update static chain test.
1660 * function.c (TRAMPOLINE_ALIGNMENT): Move to defaults.h.
1661 (trampolines_created): Move to varasm.c.
1662 (free_after_compilation): Update for removed fields.
1663 (allocate_struct_function): Likewise.
1664 (delete_handlers, lookup_static_chain): Remove.
1665 (fix_lexical_addr): Don't consider non-local variable refs.
1666 (trampoline_address): Remove.
1667 (round_trampoline_addr): Move to builtins.c.
1668 (adjust_trampoline_addr): Remove.
1669 (expand_function_start): Update for changes to static chain
1670 and nonlocal goto handling.
1671 (initial_trampoline): Move to varasm.c.
1672 (expand_function_end): Don't build trampolines or kill
1673 unreferenced nonlocal goto labels.
1674 * function.h (struct function): Remove x_nonlocal_labels,
1675 x_nonlocal_goto_handler_slots, x_nonlocal_goto_stack_level,
1676 x_context_display, x_trampoline_list, needs_context.
1677 Add static_chain_decl, nonlocal_goto_save_area.
1678 * gimple-low.c (record_vars): Don't record functions.
1679 * gimplify.c (declare_tmp_vars): Export.
1680 (create_artificial_label): Set type.
1681 (gimplify_expr): Don't consider nonlocal gotos.
1682 * integrate.c (expand_inline_function): Kill lookup_static_chain ref.
1683 * jump.c (any_uncondjump_p): Reject nonlocal goto.
1684 * rtl.h (maybe_set_first_label_num): Declare.
1685 * stmt.c (label_rtx): Set LABEL_PRESERVE_P appropriately.
1686 (expand_label): Handle DECL_NONLOCAL and FORCED_LABEL.
1687 (declare_nonlocal_label): Remove.
1688 (expand_goto): Don't handle nonlocal gotos.
1689 (expand_nl_handler_label): Remove.
1690 (expand_nl_goto_receivers): Remove.
1691 (expand_end_bindings): Don't expand_nl_goto_receivers. Use
1692 update_nonlocal_goto_save_area.
1693 * tree-cfg.c (make_edges): Handle abnormal edges out of block
1694 falling through to EXIT.
1695 (make_ctrl_stmt_edges): Don't check GOTO_EXPR for nonlocal goto.
1696 Handle computed goto with no destinations.
1697 (tree_can_merge_blocks_p): Don't merge blocks with nonlocal labels.
1698 (remove_useless_stmts_label, stmt_starts_bb_p): Likewise.
1699 (tree_forwarder_block_p): Likewise.
1700 (nonlocal_goto_p): Remove.
1701 (tree_verify_flow_info): Update to match.
1702 * tree-dump.c (dump_files): Add tree-nested.
1703 * tree-flow.h (nonlocal_goto_p): Remove.
1704 * tree-inline.c (setup_one_parameter): Split out from ...
1705 (initialize_inlined_parameters): ... here. Handle static chain.
1706 (inline_forbidden_p_1): Update nonlocal goto check.
1707 (expand_call_inline): Disable mysterious cgraph abort.
1708 * tree-optimize.c (tree_rest_of_compilation): Save DECL_SAVED_INSNS.
1709 * tree-pretty-print.c (dump_generic_node): Print static chain
1711 * tree-simple.h (declare_tmp_vars): Declare.
1712 (lower_nested_functions): Declare.
1713 * tree-ssa-dom.c (propagate_value): Avoid sharing problems.
1714 * tree-ssa-operands.c (get_expr_operands): Walk static chain
1716 * tree.def (CALL_EXPR): Add static chain operand.
1717 * tree.h (NONLOCAL_LABEL): Remove.
1719 * varasm.c (TRAMPOLINE_ALIGNMENT): Remove.
1720 (initial_trampoline): Move from function.c.
1721 (assemble_trampoline_template): Set and return it.
1722 (trampolines_created): Move from function.c.
1724 2004-02-16 Steven Bosscher <stevenb@suse.de>
1726 * tree-flow.h (cleanup_control_expr_graph): Don't declare here.
1727 * tree-cfg.c (cleanup_control_expr_graph): Make static.
1728 (find_edge_taken_cond_expr): Return an edge if the true and false
1729 edges of a branch lead to the same basic block.
1731 2004-02-13 Diego Novillo <dnovillo@redhat.com>
1733 * tree-phinodes.c (resize_phi_node): Do not use ggc_realloc to
1734 allocate a new PHI node.
1736 2004-02-12 Diego Novillo <dnovillo@redhat.com>
1738 * tree-flow.h (kill_redundant_phi_nodes): Remove declaration.
1739 * tree-optimize.c (init_tree_optimization_passes): Add
1740 pass_redundant_phi after DOM and CCP.
1741 (execute_todo): Do not call kill_redundant_phi_nodes.
1742 * tree-pass.h (TODO_redundant_phi): Remove.
1744 Adjust values for all the other TODO_* entries.
1745 (pass_redundant_phi): Declare.
1746 * tree-ssa.c (replace_immediate_uses): Call mark_new_vars_to_rename
1747 if a pointer was replaced.
1748 (kill_redundant_phi_nodes): Make static.
1749 (pass_redundant_phi): Define.
1751 2004-02-12 Dale Johannesen <dalej@apple.com>
1753 * Makefile.in (OBJS-common): Add rtl-profile.o, tree-profile.o.
1754 (profile.o): Add tree-flow.h dependency.
1755 (rtl-profile.o): New rule.
1756 (tree-profile.o): New rule.
1757 (GTFILES): Add tree-profile.c, rtl-profile.c.
1758 * basic-block.h (flow_call_edges_add): Remove.
1759 * cfganal.c (need_fake_edge_p): Move to cfgrtl.c.
1760 (flow_call_edges_add): Move to cfgrtl.c.
1761 * cfghooks.c: (block_ends_with_call_p): New.
1762 (block_ends_with_condjump_p): New.
1763 (flow_call_edges_add): New.
1764 * cfghooks.h: (struct cfg_hooks): add block_ends_with_call_p,
1765 block_ends_with_condjump_p, flow_call_edges_add.
1766 (block_ends_with_call_p): New declaration.
1767 (block_ends_with_condjump_p): New declaration.
1768 (flow_call_edges_add): New declaration.
1769 * cfgrtl.c (rtl_block_ends_with_call_p): New.
1770 (rtl_block_ends_with_condjump_p): New.
1771 (need_fake_edge_p): Moved from cfganal.c.
1772 (rtl_flow_call_edges_add): Moved from cfganal.c (flow_call_edges_add).
1773 (rtl_cfg_hooks): Add rtl_block_ends_with_call_p,
1774 rtl_block_ends_with_condjump_p, rtl_flow_call_edges_add.
1775 (cfg_layout_rtl_cfg_hooks): Ditto.
1776 * common.opt (ftree-based-profiling): New.
1777 * coverage.c (tree_ctr_tables): New.
1778 (coverage_counter_alloc): Use it.
1779 (build_ctr_info_value): Ditto.
1780 (coverage_counter_ref): Ditto. Rename to rtl_coverage_counter_ref.
1781 (tree_coverage_counter_ref): New.
1782 * coverage.h (coverage_counter_ref): Remove declaration.
1783 (rtl_coverage_counter_ref): New declaration.
1784 (tree_coverage_counter_ref): New declaration.
1785 * opts.c (OPT_ftree_based_profiling): New.
1786 * profile.c: Include cfghooks.h, tree-flow.h.
1787 (profile_hooks): New.
1788 (profile_dump_file): New.
1789 (instrument_edges): Use hooks instead of RTL-specific code.
1790 (instrument_values): Ditto.
1791 (get_exec_counts): Ditto.
1792 (compute_branch_probabilities): Ditto.
1793 (compute_value_histograms): Ditto.
1794 (branch_prob): Ditto.
1795 (find_spanning_tree): Ditto.
1796 (end_branch_prob): Ditto.
1797 (gen_edge_profiler): Move to rtl-profile.c (rtl_gen_edge_profiler).
1798 (gen_interval_profiler): Ditto (rtl_gen_interval_profiler).
1799 (gen_pow2_profiler): Ditto (rtl_gen_pow2_profiler).
1800 (gen_one_value_profiler): Ditto (rtl_gen_one_value_profiler).
1801 (tree_register_profile_hooks): New.
1802 (rtl_register_profile_hooks): New.
1803 * rtl-profile.c: New file.
1804 * rtl.h (init_branch_prob): Move declaration to value-prof.h.
1805 (end_branch_prob): Ditto.
1806 (branch_prob): Ditto.
1807 * toplev.c (flag_tree_based_profiling): New.
1808 (f_options): Add -ftree-based-profiling.
1809 (compile_file): Register rtl-based CFG and profiling hooks.
1810 (rest_of_compilation): Do rtl-based profiling only when
1811 !flag_tree_based_profiling. Register rtl-based profiling hooks.
1812 (process_options): Sorry for -ftree-based-profiling plus
1813 -ftest-coverage or -fprofile-values.
1814 * toplev.h (flag_tree_based_profiling): New.
1815 * tree-cfg.c (tree_block_ends_with_call_p): New.
1816 (tree_block_ends_with_condjump_p): New.
1817 (need_fake_edge_p): New.
1818 (tree_flow_call_edges_add): New (largely from flow_call_edges_add
1820 (tree_cfg_hooks): Add tree_block_ends_with_call_p,
1821 tree_block_ends_with_condjump_p, tree_flow_call_edges_add.
1822 * tree-optimize.c (init_tree_optimization_passes):
1823 Add pass_tree_profile.
1824 * tree-pass.h: Ditto.
1825 * tree-profile.c: New file.
1826 * value-prof.c (value_prof_hooks): New.
1827 (find_values_to_profile): Rename to rtl_find_values_to_profile.
1828 Move rtl-specific bits in from branch_prob.
1829 (value_profile_transformations): Rename to
1830 rtl_value_profile_transformations.
1831 (struct value_prof_hooks): New.
1832 (rtl_value_prof_hooks): New.
1833 (rtl_register_value_prof_hooks): New.
1834 (tree_find_values_to_profile): New stub.
1835 (tree_value_profile_transformations): New stub.
1836 (tree_value_prof_hooks): New stub.
1837 (tree_register_value_prof_hooks): New stub.
1838 (find_values_to_profile): New.
1839 (value_profile_transformations): New.
1840 * value-prof.h: Add multiple inclusion guard.
1841 (struct histogram_value): Change rtx fields to void *.
1842 (rtl_register_value_prof_hooks): New declaration.
1843 (tree_register_value_prof_hooks): New declaration.
1844 (find_values_to_profile): New declaration.
1845 (free_profiled_values): New declaration.
1846 (value_profile_transformations): New declaration.
1847 (struct profile_hooks): New declaration.
1848 (init_branch_prob): Declaration moved from rtl.h.
1849 (branch_prob): Declaration moved from rtl.h.
1850 (end_branch_prob): Declaration mooved from rtl.h.
1851 (tree_register_profile_hooks): New declaration.
1852 (rtl_register_profile_hooks): New declaration.
1853 (tree_profile_hooks): New declaration.
1854 (rtl_profile_hooks): New declaration.
1855 * doc/invoke.texi: Document -ftree-based-profiling.
1857 2004-02-12 Jeff Law <law@redhat.com>
1859 * domwalk.c (walk_dominator_tree): Move statement walking from
1860 clients into here. Walk statements in forward or backward order
1861 as requested by the client. Walk either the dominator tree or
1862 the post-dominator tree as requested by the client.
1863 * domwalk.h (dom_walk_data): Add two fields to control direction of
1864 statement walk and dominator vs post-dominator tree walk. Add
1865 BSI argument to the per-statement callbacks.
1866 * tree-ssa-dom.c (optimize_stmt): Update prototype so that it can
1867 be directly used as a callback for the dominator tree walker.
1868 Update stmts_to_rescan here.
1869 (tree_ssa_dominator_optimize): Initialize new fields in the dominator
1870 walker structure. Use optimize_stmt instead of dom_opt_walk_stmts
1871 for statement callback.
1872 (dom_opt_walk_stmts): Kill. No longer used.
1873 * tree-ssa.c (mark_def_sites): Update prototype so that it can be
1874 called as the per-statement callback. No longer walk statements here.
1875 (mark_def_sites_initialize_block): New.
1876 (rewrite_stmt): Update prototype so that it can be called as the
1877 per-statement callback.
1878 (rewrite_walk_stmts): Kill. No longer used.
1879 (rewrite_into_ssa): Initialize new fields in the dominator walker
1880 structure. Use rewrite_stmt instead of rewrite_walk_stmts. Add
1881 mark_def_sites_initialize_block callback.
1883 2004-02-12 Steven Bosscher <stevenb@suse.de>
1885 * doc/cfg.texi: New file.
1886 * doc/ggcint.texi: Include it. Add a new chapter.
1888 2004-02-11 Jeff Law <law@redhat.com>
1890 * Makefile.in (OBJS-common): Add tree-ssa-forwprop.o
1891 (tree-ssa-forwprop.o): Add dependencies.
1892 * timevar.def (TV_TREE_FORWPROP): New timevar.
1893 * tree-optimize.c (init_tree_optimization_passes): Link in
1894 the forward propagation pass.
1895 * tree-pass.h (pass_forwprop): Declare.
1896 * tree-ssa-forwprop.c: New file with forward propagation pass.
1897 * doc/invoke.texi: Document dump for forward propagation pass.
1899 2004-02-11 Andrew MacLeod <amacleod@redhat.com>
1901 * tree-ssa.c (rewrite_out_of_ssa): Don't use coalesce list until new
1904 2004-02-11 Andrew MacLeod <amacleod@redhat.com>
1906 * tree-ssa-live.c (compare_pairs): New. Coalesce list cost function.
1907 (sort_coalesce_list): Use qsort() to sort list by cost.
1908 (coalesce_tpa_members): Use correct partition representatives. Add more
1909 debug information. Allow coalesce by list, root_var, or both.
1910 (tpa_dump): Show partition index.
1911 * tree-ssa-live.h (SSANORM_COALESCE_PARTITIONS): New flag.
1912 (SSANORM_USE_COALESCE_LIST): New flag.
1913 * tree-ssa.c (create_temp): Don't mark as used when created.
1914 (coalesce_ssa_name): Create coalesce list if requested. Add more
1916 (assign_vars): Add additional debug info.
1917 (remove_ssa_form): Perform TER after assign_vars().
1918 (rewrite_vars_out_of_ssa): Pass coalesce partitions flag to
1920 (rewrite_out_of_ssa): Add coalesce list flag to remove_ssa_form call.
1922 2004-02-10 Jeff Law <law@redhat.com>
1924 * Makefile.in (OBJS-common): Add tree-ssa-phiopt.o
1925 (tree-ssa-phiopt.o): Add dependencies.
1926 * timevar.def (TV_TREE_PHIOPT): New timevar.
1927 * tree-cfg.c (extract_true_false_edges_from_block): Moved here from
1929 (tree_verify_flow_info): Use extract_true_false_edges_from_block.
1930 * tree-flow.h (extract_true_false_edges_from_block): Declare.
1931 * tree-ssa-dom.c (extract_true_false_edges_from_block): Moved into
1933 (get_eq_expr_value): Improve type check.
1934 * tree-optimize.c (init_tree_optimization_passes): Link in
1936 * tree-pass.h (pass_phiopt): Declare.
1937 * tree-ssa-phiopt.c: New file with PHI node optimization pass.
1938 * doc/invoke.texi: Document dump for PHI node optimization.
1940 2004-02-10 Richard Henderson <rth@redhat.com>
1942 * tree-sra.c (lookup_scalar): Handle unnamed fields.
1944 2004-02-10 Diego Novillo <dnovillo@redhat.com>
1946 * Makefile.in (OBJS-common): Add tree-ssa-alias.o.
1947 (tree-ssa-alias.o): New rule.
1948 (tree-ssa-operands.o): Add dependency on $(TIMEVAR_H) and tree-pass.h
1949 (gt-tree-dfa.h): Remove.
1950 * timevar.def (TV_TREE_OPS): Rename from unused entry TV_TREE_DFA.
1951 * tree-ssa-alias.c: New file.
1952 * tree-dfa.c (struct alias_stats_d, alias_stats, dump_alias_stats,
1953 may_alias_p, add_may_alias, global_var, aliases_computed_p,
1954 compute_may_aliases): Move to tree-ssa-alias.c.
1955 (struct walk_state): Remove fields 'is_asm_expr' and 'num_calls'.
1957 (compute_alias_sets, create_memory_tags, may_access_global_mem_p,
1958 get_memory_tag_for, promote_call_clobbered_vars,
1959 find_addressable_vars): Remove.
1960 (call_clobbered_vars): Move to tree-ssa-alias.c and convert to
1962 (find_referenced_vars): Move logic to create .GLOBAL_VAR to
1964 (create_ssa_name_ann): New.
1965 (dump_variable): Rearrange.
1966 (dump_dfa_stats): Do not show the number of call clobbered
1968 (find_vars_r): Do not try to determine if an assignment my access
1970 (add_referenced_var): Remove hacks to establish global memory
1972 If the variable needs to live in memory mark it call-clobbered.
1973 * tree-flow-inline.h (ssa_name_ann): New.
1974 (get_ssa_name_ann): New.
1975 (set_may_alias_global_mem): Remove.
1976 (may_alias_global_mem_p): Remove.
1977 (set_may_point_to_global_mem): Remove.
1978 (may_point_to_global_mem_p): Remove.
1979 (is_call_clobbered): New
1980 (mark_call_clobbered): New
1981 (mark_non_addressable): New
1982 * tree-flow.h (enum tree_ann_type): Add SSA_NAME_ANN.
1983 (enum mem_tag_kind): Declare.
1984 (struct var_ann_d): Remove fields 'is_call_clobbered',
1985 'may_alias_global_mem' and 'may_point_to_global_mem'.
1986 Replace bitfield 'mem_tag' with enum bitfield 'mem_tag_kind'.
1987 Rename field 'mem_tag' to 'type_mem_tag'.
1988 (struct stmt_ann_d): Change type of field 'addresses_taken' to a
1989 bitmap. Update all users.
1990 (struct ssa_name_ann_d): Declare.
1991 (union tree_ann_d): Add field 'ssa_name'.
1992 (ssa_name_ann_t): New type.
1993 (struct bb_ann_d): Add field 'has_escape_site'.
1994 (num_call_clobbered_vars): Remove.
1995 (call_clobbered_var): Remove.
1996 (call_clobbered_vars): Change to bitmap.
1997 (dump_points_to_info): Declare.
1998 (debug_points_to_info): Declare.
1999 (walk_use_def_chains_fn): New type.
2000 (walk_use_def_chains): Declare.
2001 (is_call_clobbered): Declare.
2002 (mark_call_clobbered): Declare.
2003 * tree-simple.c (needs_to_live_in_memory): Move to tree.c.
2004 (is_gimple_non_addressable): Update comment.
2005 (is_gimple_call_clobbered): Remove.
2006 (get_call_expr_in): New.
2007 (get_base_var): Rename from get_base_symbol. Update all callers.
2008 Don't strip SSA_NAME wrappers.
2009 (get_base_decl): New.
2010 (get_base_address): New.
2011 * tree-simple.h (is_gimple_call_clobbered): Remove.
2012 (needs_to_live_in_memory): Remove.
2013 (get_base_decl): Declare.
2014 (get_base_var): Declare.
2015 (get_base_address): Declare.
2016 * tree-ssa-dce.c (need_to_preserve_store): Reduce to calling
2017 needs_to_live_in_memory.
2018 * tree-ssa-operands.c: Include tree-pass.h and timevar.h
2019 (get_stmt_operands): Push/pop TV_TREE_OPS time var.
2020 Call mark_call_clobbered for asms that store to memory.
2021 (get_expr_operands): When adding operands for INDIRECT_REF
2022 expressions, use flow-sensitive aliasing, if available.
2023 Assume that malloc-like function calls won't clobber.
2024 (add_call_clobber_ops):
2025 (add_call_read_ops):
2026 * tree-ssa.c (rewrite_into_ssa): If any variable in vars_to_rename
2027 is a pointer, invalidate all name memory tags.
2028 (create_temp): Call is_call_clobbered and mark_call_clobbered.
2029 (walk_use_def_chains_1): New.
2030 (walk_use_def_chains): New.
2032 * tree.c (needs_to_live_in_memory): New.
2033 * tree.h (DECL_NEEDS_TO_LIVE_IN_MEMORY_INTERNAL): Define.
2034 (struct tree_decl): Add bitfield 'needs_to_live_in_memory'.
2035 Update unused bits comment.
2036 (needs_to_live_in_memory): Declare.
2038 * tree-simple.h (get_call_expr_in): Declare.
2039 * tree-sra.c (scalarize_stmt): Call get_call_expr_in when handling
2041 * tree-ssa-ccp.c (likely_value): Likewise.
2043 * params.def (PARAM_MAX_CLOBBERED_VARS_GLOBAL_VAR): Remove.
2044 (PARAM_MAX_CALLS_GLOBAL_VAR): Remove.
2045 (PARAM_GLOBAL_VAR_THRESHOLD): Define.
2046 (PARAM_MAX_ALIAS_SET_SIZE): Define.
2048 * params.h (MAX_CALLS_FOR_GLOBAL_VAR): Remove.
2049 (MAX_CLOBBERED_VARS_FOR_GLOBAL_VAR): Remove.
2050 (GLOBAL_VAR_THRESHOLD): Define.
2051 (MAX_ALIAS_SET_SIZE): Define.
2053 2004-02-09 Richard Henderson <rth@redhat.com>
2055 * langhooks.h (lang_hooks_for_functions): Add missing_noreturn_ok_p.
2056 * langhooks-def.h, c-lang.c, objc/objc-lang.c
2057 (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): New.
2058 * c-objc-common.c (c_missing_noreturn_ok_p): Return bool.
2059 (c_objc_common_init): Don't set lang_missing_noreturn_ok_p.
2060 * c-tree.h (c_missing_noreturn_ok_p): Update decl.
2061 * flow.c (lang_missing_noreturn_ok_p): Remove.
2063 * flow.c (check_function_return_warnings): Move to tree-cfg.c.
2064 * toplev.c (rest_of_compilation): Don't call it.
2065 * tree-cfg.c (execute_warn_function_return): Move from flow.c,
2066 rename, update for tree vs rtl.
2067 (pass_warn_function_return): New.
2068 * tree-pass.h (pass_warn_function_return): Declare it.
2069 * tree-optimize.c (init_tree_optimization_passes): Run it.
2071 * function.h (struct function): Remove x_clobber_return_insn.
2072 * function.c (free_after_compilation): Don't set it.
2073 (expand_function_end): Likewise.
2075 2004-02-09 Richard Henderson <rth@redhat.com>
2078 2004-02-06 Richard Henderson <rth@redhat.com>
2079 * tree-ssa-dom.c (record_equivalences_from_phis): Use
2080 record_const_or_copy.
2081 (record_equivalences_from_stmt): Likewise. Replace
2082 block_avail_exprs_p and block_nonzero_vars_p args with bd.
2084 2004-02-09 Jeff Law <law@redhat.com>
2086 * tree-ssa-dom.c (get_eq_expr_value): Improve handling of boolean
2089 * domwalk.c (walk_dominator_tree): Completely lose PARENT argument.
2090 Callers updated. No longer pass PARENT to callbacks.
2091 * domwalk.h (struct dom_walk_data): Corresponding changes.
2092 * tree-ssa-dom.c: Likewise.
2093 * tree-ssa.c: Likewise.
2095 * domwalk.c (walk_dominator_tree): Change last argument to be the
2096 parent block in the dominator tree rather than the last statement
2097 in the parent block in the dominator tree. Similarly in all the
2099 * domwalk.h (struct dom_walk_data): Update callback prototypes.
2100 * tree-ssa-dom.c: Corresponding changes.
2101 * tree-ssa.c: Likewise.
2103 * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Break out
2104 of tree_ssa_dominator_optimize. If the out-of-ssa pass creates
2105 new variables, then invalidate some requested jump threads.
2107 2004-02-08 Richard Henderson <rth@redhat.com>
2109 * flow.c (regno_uninitialized): Remove.
2110 * output.h (regno_uninitialized): Remove.
2111 * function.c (setjmp_vars_warning): Rename from
2112 uninitialized_vars_warning, remove uninitialized vars warning.
2113 * toplev.c (rest_of_handle_life): Update to match.
2114 * tree.h (setjmp_vars_warning): Likewise.
2116 * tree-sra.c (lookup_scalar): Set DECL_NAME to something descriptive.
2118 * tree-ssa.c (warn_uninit): New.
2119 (warn_uninitialized_var, warn_uninitialized_phi): New.
2120 (execute_early_warn_uninitialized): New.
2121 (execute_late_warn_uninitialized): New.
2122 (gate_warn_uninitialized): New.
2123 (pass_early_warn_uninitialized): New.
2124 (pass_late_warn_uninitialized): New.
2125 * tree-pass.h (pass_early_warn_uninitialized): New.
2126 (pass_late_warn_uninitialized): New.
2127 * tree-optimize.c (init_tree_optimization_passes): Add them.
2129 2004-02-08 Richard Henderson <rth@redhat.com>
2131 * cppexp.c (append_digit): Rearrange unsignedp/overflow setting.
2132 (eval_token, num_binary_op, num_part_mul, num_div_op): Likewise.
2133 * ra-rewrite.c (rewrite_program2): Zero info.
2134 * reload.c (decompose): Zero val.
2135 * tree-ssa-ccp.c (visit_phi_node): Zero phi_val.const_val.
2137 2004-02-07 Jan Hubicka <jh@suse.cz>
2139 * tree-inline.c (save_body): Clone the parm decl correctly.
2141 * cgraph.c: Add introductionary comment.
2142 (cgraph_remove_node): Release DECL_SAVED_INSNS too.
2143 * cgraphunit.c: Likewise.
2144 (cgraph_finalize_function): Release DECL_SAVED_INSNS of external function.
2145 (decl_expand_function): Release DECL_SAVED_INSNS/body/tree.
2146 (cgraph_remove_unreachable_nodes): Likewise; guard cgraph verification.
2148 2004-02-06 Richard Henderson <rth@redhat.com>
2150 * common.opt (fdisable-tree-ssa): Remove.
2151 * flags.h (flag_disable_tree_ssa): Remove.
2152 * toplev.c (flag_disable_tree_ssa): Remove.
2153 (f_options): Don't set it.
2154 * opts.c (common_handle_option): Likewise.
2155 * doc/invoke.texi (fdisable-tree-ssa): Remove.
2157 2004-02-06 Richard Henderson <rth@redhat.com>
2159 * tree-ssa-dom.c (record_equivalences_from_phis): Use
2160 record_const_or_copy.
2161 (record_equivalences_from_stmt): Likewise. Replace
2162 block_avail_exprs_p and block_nonzero_vars_p args with bd.
2164 2004-02-06 Andrew Pinski <pinskia@physics.uc.edu>
2167 * tree-inline.c (declare_return_variable): Set the no warning bit
2168 on the variable created for the return value.
2170 2004-02-06 Richard Henderson <rth@redhat.com>
2172 * tree-pretty-print.c (dump_generic_node): Render NON_LVALUE_EXPR.
2174 * tree-ssa-dom.c (local_fold): New.
2175 (thread_across_edge, simplify_rhs_and_lookup_avail_expr,
2176 find_equivalent_equality_comparison): Use it.
2178 2004-02-06 Andrew Pinski <pinskia@physics.uc.edu>
2181 * c-common.c (c_decl_uninit_1): Remove.
2182 (c_decl_uninit): Remove.
2183 * c-common.h (c_decl_uninit): Remove prototype.
2184 * c-lang.c (LANG_HOOKS_DECL_UNINIT): Delete.
2185 * objc/objc-lang.c (LANG_HOOKS_DECL_UNINIT): Delete.
2186 * c-simplify.c (gimplify_decl_stmt): Set TREE_NO_WARNING
2187 on the decl where the initial is itself.
2188 * function.c (uninitialized_vars_warning): Remove old comment
2189 and check for DECL_INITIAL, replace with a check of TREE_NO_WARNING
2190 and do not call the langhook.
2191 * langhooks-def.h (LANG_HOOKS_DECL_UNINIT): Remove.
2192 (LANG_HOOKS_INITIALIZER): Remove usage of LANG_HOOKS_DECL_UNINIT.
2193 * langhooks.c (lhd_decl_uninit): Remove.
2194 * langhooks.h (lhd_decl_uninit): Remove prototype.
2196 2004-02-05 Richard Henderson <rth@redhat.com>
2198 * tree-ssa-dom.c (record_const_or_copy_1): New.
2199 (record_const_or_copy): New.
2200 (thread_across_edge): Use it.
2201 (dom_opt_finalize_block): Likewise. Tidy.
2202 (record_equality): Split out from ...
2203 (record_equivalences_from_incoming_edge): ... here.
2205 2004-02-05 Richard Henderson <rth@redhat.com>
2207 * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Allow
2208 mixing PLUS and MINUS when folding operations.
2210 2004-02-05 Andrew Macleod <amacleod@redhat.com>
2212 * tree-pretty-print.c (dump_bb_header): Allow TDF_SLIM printing.
2213 (dump_bb_end): Allow TDF_SLIM printing.
2214 (dump_generic_bb_buff): Add flags parameter to dump_bb_end.
2216 2004-02-05 Jan Hubicka <jh@suse.cz>
2218 * alias.c (find_base_term, get_addr): Do not dereference NULL
2219 pointer when all VALUE's locations has been invalidated.
2220 (rtx_equal_for_memref_p): Simplify checking of VALUEs.
2222 2004-02-04 Daniel Berlin <dberlin@dberlin.org>
2224 * tree-alias-ander.c (andersen_init): Reorder/Redo code so that we
2225 actually free the memory in intraprocedural mode.
2226 (andersen_cleanup): Ditto.
2228 2004-02-04 Richard Henderson <rth@redhat.com>
2230 * tree-ssa-ccp.c (get_value, visit_phi_node,
2231 visit_assignment, dump_lattice_value): Tidy.
2232 (evaluate_stmt): Don't do debug dump here.
2233 (def_to_undefined): Merge into set_lattice_value.
2234 (def_to_varying): Likewise, but retain as a wrapper.
2235 (set_lattice_value): Tidy. Emit correct debug info.
2236 (replace_uses_in): Remove strlen hacks.
2237 (execute_fold_all_builtins): Fix DECL_BUILT_IN comparison.
2238 Force folding of BUILT_IN_CONSTANT_P.
2240 2004-02-04 Richard Henderson <rth@redhat.com>
2242 * builtins.c (fold_builtin_expect): New.
2243 (fold_builtin_1): Call it.
2245 2004-02-04 Jeff Law <law@redhat.com>
2247 * jump.c (duplicate_loop_exit_test): Allow copying of the loop
2248 exit test even if we do not find the LOOP_END note.
2250 * domwalk.c: Update comments.
2252 2004-02-04 Brian Booth <bbooth@redhat.com>
2255 * tree-dfa.c (compute_alias_sets): set rename flag for variables
2256 aliased by GLOBAL_VAR.
2258 2004-02-04 Richard Henderson <rth@redhat.com>
2260 * tree-ssa-dom.c (simplify_switch_and_lookup_avail_expr): New.
2261 (eliminate_redundant_computations): Call it.
2263 2004-02-03 Richard Henderson <rth@redhat.com>
2266 * tree-cfg.c (cfg_remove_useless_stmts_bb): Correct handling of
2267 boolean variables in COND_EXPR_COND.
2269 2004-02-03 Richard Henderson <rth@redhat.com>
2272 * builtins.c (fold_builtin_1): Rename from fold_builtin.
2273 (fold_builtin): New.
2274 * c-simplify.c (gimplify_expr_stmt): Check TREE_NO_WARNING.
2275 * stmt.c (expand_expr_stmt_value): Likewise.
2276 * tree.h (struct tree_common): Add nowarning_flag.
2277 (TREE_NO_WARNING): New.
2278 (TREE_NO_UNUSED_WARNING): Remove.
2279 * c-typeck.c (build_unary_op): Use TREE_NO_WARNING instead.
2280 * stmt.c (warn_if_unused_value): Likewise.
2282 2004-02-03 Steven Bosscher <stevenb@suse.de>
2284 * tree-ssa-dce.c: Partial rewrite. The old DCE is now called
2285 `conservative'. The more aggressive algorithm uses control
2286 dependence and is called `aggressive' or cd-dce.
2287 * timevar.def (TV_TREE_DCE): Rename.
2288 (TV_TREE_CD_DCE, TV_CONTROL_DEPENDENCES): New timevars.
2289 * tree-pass.h: Declare extern pass_cd_dce.
2290 * tree-optimize.c (init_tree_optimization_passes): Replace
2291 the final DCE pass with a CD-DCE pass.
2293 2004-02-01 Jan Hubicka <jh@suse.cz>
2295 * cgraphunit.c (cgraph_mark_inline_edge): Fix insertion to
2298 2004-01-30 Frank Ch. Eigler <fche@redhat.com>
2300 * common.opt: Add support for -fmudflapth, -fmudflapir.
2301 * invoke.texi: Document them.
2303 * flags.h: Add new flags flag_mudflap_threads, _ignore_reads.
2304 * toplev.c: Initialize new flags. Remove redundant code from
2305 lang_independent_options[].
2306 * tree-mudflap.c (*): Support new flag_mudflap_threads encoding.
2307 (mf_xform_derefs_1): Support flag_mudflap_ignore_reads option.
2308 * c-mudflap.c (mflang_flush_calls): Mark static ctor TREE_USED.
2310 2004-01-30 Ian Lance Taylor <ian@wasabisystems.com>
2312 * gengtype-yacc.y (bitfieldlen): Add empty action.
2314 2004-01-30 Diego Novillo <dnovillo@redhat.com>
2316 * configure.ac: Move configuration for libbanshee and
2317 libgmp from configure.in.
2319 2004-01-30 Richard Henderson <rth@redhat.com>
2322 * gengtype-yacc.y (struct_fields): Accept unnamed bitfields.
2323 (bitfieldlen): Split from ...
2324 (bitfieldopt): ... here.
2325 * gimplify.c (mark_not_gimple): Remove.
2326 (gimplify_call_expr): Don't ignore BUILT_IN_MD.
2327 * tree-dfa.c (struct walk_state): Remove is_not_gimple.
2328 (find_referenced_vars): Don't look for TREE_NOT_GIMPLE.
2329 (find_vars_r, add_referenced_var): Likewise.
2330 * tree-ssa-operands.c (get_stmt_operands, get_expr_operands): Likewise.
2331 * tree-simple.h (mark_not_gimple): Remove.
2332 * tree.h (struct tree_common): Remove not_gimple_flag.
2333 (TREE_NOT_GIMPLE): Remove.
2335 2004-01-29 Jason Merrill <jason@redhat.com>
2338 * c-simplify.c (gimplify_for_stmt): Reorganize to fix cleanups.
2340 2004-01-29 Richard Henderson <rth@redhat.com>
2343 * tree-inline.c (initialize_inlined_parameters): Register the
2344 substitute reference also.
2346 2004-01-29 Richard Henderson <rth@redhat.com>
2348 * tree-inline.c (gimple_expand_calls_inline): Look inside
2351 * tree-pretty-print.c (dump_generic_node): If TDF_DETAILS, dump
2354 2004-01-29 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
2356 * cfg.c (unlink_block): Reset prev_bb and next_bb.
2358 2004-01-29 Jeff Law <law@redhat.com>
2359 Andrew MacLeod <amacleod@redhat.com>
2361 * tree-ssa-live.h (tpa_next_partition): Correctly handle compressed
2363 * tree-ssa.c (coalesce_ssa_name): New argument, flags. Callers
2364 updated. Test SSANORM_COMBINE_TEMPS in flags rather than
2365 flag_tree_combine_temps.
2366 (coalesce_vars): Either operand of a copy might not have a
2367 partition when rewriting a subset of the variables out of SSA form.
2368 (rewrite_vars_out_of_ssa): Honor -ftree-combine-temps by passing
2369 in SSANORM_COMBINE_TEMPS in flags argument to remove_sas_form..
2371 2004-01-29 Dale Johannesen <dalej@apple.com>
2373 * Makefile.in (OBJS-common): Move tree-nomudflap.o...
2374 (OBJS-archive): ...to here, and remove duplicate tree-optimize.o.
2376 2004-01-28 Richard Henderson <rth@redhat.com>
2379 * gimplify.c (gimplify_init_constructor): Invoke
2380 lhd_set_decl_assembler_name on the now-static variable.
2382 2004-01-28 Richard Henderson <rth@redhat.com>
2385 * expr.c (is_zeros_p): Remove. Change all callers to use
2387 (categorize_ctor_elements_1, categorize_ctor_elements): New.
2388 (count_type_elements): New.
2389 (mostly_zeros_p): Use them.
2390 * gimplify.c (tmp_var_id_num): Split out from create_tmp_var_raw.
2391 (create_tmp_var_name): Likewise.
2392 (gimplify_init_constructor): Drop constructors to readonly memory
2393 as indicated by categorize_ctor_elements and can_move_by_pieces.
2394 * tree.c (initializer_zerop): Handle VECTOR_CST. Don't check
2395 AGGREGATE_TYPE_P for CONSTRUCTOR.
2396 * tree.h (categorize_ctor_elements): Declare.
2397 (count_type_elements): Declare.
2398 * Makefile.in (gimplify.o): Update dependencies.
2399 (GTFILES): Add gimplify.c.
2401 2004-01-27 Frank Ch. Eigler <fche@redhat.com>
2403 * tree-mudflap.c (mx_register_decls): Support VLAs.
2404 (mf_xform_derefs_1): Disable checking shortcut for VLAs.
2405 * c-simplify.c (gimplify_decl_stmt): Add mudflap xref comment.
2406 * gimplify.c (gimplify_bind_expr): Ditto.
2408 2004-01-27 Daniel Berlin <dberlin@dberlin.org>
2410 * tree-ssa-pre.c: Add more comments describing SSAPRE and
2411 the various functions.
2412 (generate_expr_as_of_bb): Use PRED, a basic block argument, instead of
2413 j, the index of that bb.
2414 (generate_vops_as_of_bb): Ditto.
2415 (insert_occ_in_preorder_dt_order): Rename to
2416 create_and_insert_occ_in_preorder_dt_order.
2418 2004-01-27 Daniel Berlin <dberlin@dberlin.org>
2420 * tree-ssa-pre.c (rename_1): Add some more comments.
2422 2004-01-25 Andrew Pinski <pinskia@physics.uc.edu>
2425 * c-decl.c (finish_function): Do not pass
2426 the function on to optimizers if there was an error.
2428 2004-01-23 Richard Henderson <rth@redhat.com>
2431 * combine.c (SHIFT_COUNT_TRUNCATED): Provide default value.
2432 (simplify_comparison): Don't simplify (eq (zero_extract c 1 r) 0)
2433 if SHIFT_COUNT_TRUNCATED is set.
2435 2004-01-21 Richard Henderson <rth@redhat.com>
2438 * c-decl.c (c_finalize): New.
2439 (finish_function): Use it. Genericize and finalize only non-nested
2440 functions. Register nested functions with cgraph.
2441 * c-simplify.c: Include cgraph.h.
2442 (c_genericize): Genericize nested functions.
2443 * gimplify.c (gimplify_expr): Use DECL_SAVED_INSNS to access
2444 the struct function for the context.
2445 * Makefile.in (c-simplify.o): Update dependencies.
2447 2004-01-21 Steven Bosscher <stevenb@suse.de>
2450 * tree-cfg.c (simple_goto_p): Remove NONLOCAL_LABEL check.
2452 2004-01-21 Dale Johannesen <dalej@apple.com>
2454 * tree-dfa.c: Fix comment.
2456 2004-01-21 Richard Henderson <rth@redhat.com>
2459 * tree-ssa-operands.c (get_expr_operands): Handle (&x + c).
2461 * tree-ssa-ccp.c (maybe_fold_offset_to_component_ref): Handle
2462 flexible array members and lookalikes.
2464 2004-01-21 Dale Johannesen <dalej@apple.com>
2466 * tree-ssa-dom.c (cprop_into_stmt): Add convert call
2467 to prevent type mismatches.
2469 2004-01-21 Daniel Berlin <dberlin@dberlin.org>
2471 * tree-ssa-pre.c (load_modified_phi_result): PARM_DECL is okay
2472 to not have a defbb.
2473 (rename_1): Add a comment.
2475 2004-01-21 Jeff Law <law@redhat.com>
2477 * tree-ssa-dom.c (find_equivalent_equality_comparison): Treat
2478 CONVERT_EXPRs just like NOP_EXPRs.
2479 (record_equivalences_from_stmt): Similarly.
2480 (thread_across_edge): Fix formatting goof.
2482 * tree-ssa-dom.c (thread_across_edge): Remove bogus restriction
2483 which prevents threading around to the top of a loop.
2485 * tree-ssa-dom.c (thread_across_edge): Handle SWITCH_EXPRs in the
2486 target block in addition to COND_EXPRs.
2488 * tree-ssa-dom.c (thread_across_edge): Create equivalences for
2489 PHIs before looking at the statements in the destination
2492 2004-01-20 Roger Sayle <roger@eyesopen.com>
2494 * fold-const.c (fold_convert): Rename to fold_convert_const.
2495 (fold_convert_const): Change arguments to take a tree_code,
2496 a type and the operand/expression to be converted. Return
2497 NULL_TREE if no simplification is possible. Add support for
2498 FIX_CEIL_EXPR and FIX_FLOOR_EXPR in addition to FIX_TRUNC_EXPR.
2499 (fold): Handle FIX_CEIL_EXPR and FIX_FLOOR_EXPR.
2500 Adjust call to fold_convert to match new fold_convert_const.
2501 Avoid modifying the tree passed to fold in-place.
2502 (nondestructive_fold_unary_to_constant): Likewise, simplify
2503 call to fold_convert to match new fold_convert_const.
2505 2004-01-20 Daniel Berlin <dberlin@dberlin.org>
2507 * tree-alias-ander.c (andersen_op_assign): Update
2508 prototype. Make this handle &x in the operands using
2509 the addrargs parameter.
2510 (andersen_init): Turn off ip_partial until variables
2511 aliasing variables in other functions is resolved.
2512 (andersen_add_var): Use newly renamed alias_var_new_with_aterm.
2514 (andersen_add_var_same): Ditto.
2515 (andersen_function_call): Use ip_partial, not flag_unit_at_a_time.
2516 * tree-alias-common.c (get_values_from_constructor): Add bitmap
2517 and int * arguments. Used to mark operands that we are taking
2519 (get_alias_var_decl): We should never see FIELD_DECL's right now.
2520 (intra_function_call): Reverse ordering for slightly faster
2522 (find_op_of_decl): New function.
2523 (find_func_aliases): Use it.
2524 Comment x = foo.y case.
2525 Move get_alias_var_decl of arguments so we only call it if
2527 Handle address of arguments in operations.
2528 (create_fun_alias_var): tvar->var.
2529 Set context of fakeargs.
2530 Set context of fakedecls.
2531 Set DECL_PTA_ALIASVAR of RETURN_DECL's.
2532 (create_fun_alias_var_ptf): tvar->var.
2533 Set context of fakedecls.
2534 (create_alias_vars): Only create alias vars for globals
2535 with DECL_INITIAL's.
2536 * tree-alias-common.h (struct tree_alias_ops):
2537 Update op_assign arguments.
2538 (may_alias): Fix comment.
2539 (same_points_to_set): Ditto.
2540 (empty_points_to_set): Ditto.
2541 * tree-alias-type.h: Rename alias_tvar_new_with_aterm
2542 -> alias_var_new_with_aterm.
2543 * tree-alias-type.c: Ditto.
2545 2004-01-20 Richard Henderson <rth@redhat.com>
2547 * tree-sra.c (get_scalar_for_field): Validate field.
2548 (create_scalar_copies): Iterate over rhs fields too.
2550 2004-01-19 Dale Johannesen <dalej@apple.com>
2552 * params.def: Add PARAM_MAX_CALLS_GLOBAL_VAR and
2553 PARAM_MAX_CLOBBERED_VARS_GLOBAL_VAR.
2555 tree-dfa.c: Use them.
2556 doc/invoke.texi: Document them.
2558 2004-01-19 Jeff Law <law@redhat.com>
2560 * tree-ssa.c (insert_phi_nodes_for): Always use fully pruned
2563 * tree-flow.h: Update copyright dates.
2564 (register_new_def): Declare.
2565 * tree-ssa-dom.c: Update copyright dates.
2566 Add tracking of current definition of each program variable just
2567 like we do when rewriting into SSA form.
2568 (get_value_for, set_value_for): Handle either an SSA_NAME or
2570 (tree_ssa_dominator_optimize): Initialize and update CURRDEFS.
2571 If we thread through a block with real statements, the destination
2572 of those statements must be rewritten too.
2573 (thread_across_edge): Skip nop statements at the start of a
2575 (dom_opt_initialize_block_local_data): Clear block_defs
2577 (record_equivalences_from_phis): Accept walk_data structure.
2578 Call register_new_def appropriately.
2579 (optimize_stmt): Call register_new_defs_for_stmt.
2580 (dom_opt_finalize_block): Restore CURRDEFS appropriately.
2581 (register_new_definitions_for_stmt): New.
2582 * tree-ssa.c: Update copyright dates.
2583 (register_new_def): No longer static. Accept additional argument
2584 for the table to hold the new definition. Callers updated.
2586 * gimplify.c: Update copyright dates.
2587 * tree-cfg.c: Likewise.
2590 * tree-iterator.c, tree-iterator.c: Use GCC rather than GNU CC.
2591 * tree-ssa-pre.c, tree-ssa-live.h: Likewise.
2593 2004-01-19 Daniel Berlin <dberlin@dberlin.org>
2595 * timevar.def (TV_TREE_SPLIT_EDGES): New timevar.
2596 * tree-ssa-pre.c (split_critical_edges): Move from here
2597 (pass_pre): Add PROP_no_crit_edges as required.
2598 * tree-cfg.c (split_critical_edges): to here.
2599 (pass_split_crit_edges): New pass.
2600 * tree-optimize.c (tree_optimization_passes): Add NEXT_PASS
2602 * tree-pass.h: Add PROP_no_crit_edges.
2603 (pass_split_crit_edges): Declared.
2605 2004-01-19 Frank Ch. Eigler <fche@redhat.com>
2607 * tree-mudflap.c (mf_build_check_statement_for): Tolerate
2608 incoming locus NULL pointer.
2610 2004-01-18 Richard Henderson <rth@redhat.com>
2612 * builtins.c (simplify_builtin_strcpy): Export. Take strlen argument.
2613 (simplify_builtin_strncpy, simplify_builtin_strcmp): Similarly.
2614 (simplify_builtin_strncmp): Similarly.
2615 (simplify_builtin): Update to match.
2616 * expr.h (simplify_builtin_strcmp, simplify_builtin_strncmp,
2617 simplify_builtin_strcpy, simplify_builtin_strncpy): Declare.
2618 * tree-pass.h (pass_fold_builtins): New.
2619 * tree-optimize.c (init_tree_optimization_passes): Add it.
2620 * tree-ssa-ccp.c (ccp_fold_builtin): Handle BUILT_IN_STRCPY,
2621 BUILT_IN_STRNCPY, BUILT_IN_STRCMP, BUILT_IN_STRNCMP.
2622 (get_strlen): Don't cast to size_t.
2623 (execute_fold_all_builtins, pass_fold_builtins): New.
2625 2004-01-19 Jan Hubicka <jh@suse.cz>
2628 * cgraphunit.c (cgraph_finalize_compilation_unit): Fix memory leak.
2629 (cgraph_remove_unreachable_nodes): Do not mix analyzed and
2630 DECL_SAVED_TREE flags.
2632 2004-01-18 Richard Henderson <rth@redhat.com>
2634 * tree-sra.c (REALPART_INDEX, IMAGPART_INDEX): Remove.
2635 (sra_candidates, needs_copy_in): Use a bitmap. Update all users.
2636 (struct sra_elt, sra_elt_hash, sra_elt_eq): New.
2637 (sra_map_size): Remove.
2638 (sra_map): Use a htab_t.
2639 (lookup_scalar): Update to match.
2640 (get_scalar_for_field, get_scalar_for_complex_part): Likewise.
2641 (scalarize_structure_assignment): Use annotate_all_with_locus.
2642 (csc_build_component_ref): Remove index argument.
2643 (csc_build_complex_part): Take tree_code, not index.
2644 (create_scalar_copies): Don't collect indicies.
2645 (emit_scalar_copies): New.
2646 (scalarize_modify_expr, scalarize_tree_list): Use it.
2647 (scalarize_return_expr): Likewise.
2648 (scalarize_structures): Simplify needs_copy_in iteration.
2649 (scalarize_call_expr): Use annotate_all_with_locus.
2650 (dump_sra_map_trav): Split from ...
2651 (dump_sra_map): ... here. Update for hash table.
2652 (tree_sra): Update for new datastructures.
2654 2004-01-18 Richard Henderson <rth@redhat.com>
2656 * tree-cfg.c (dump_function_to_file): Move ";; Function" header ...
2657 * tree-optimize.c (execute_one_pass): ... here.
2659 2004-01-17 Daniel Berlin <dberlin@dberlin.org>
2661 * tree-alias-common.c: s@_typevar@_var@g, s@_TVAR@_VAR@g,
2663 * tree-alias-common.h: Ditto
2665 * tree-alias-ander.c: Ditto
2666 * tree-alias-type.c: Ditto
2667 * tree-alias-type.h: Ditto
2669 2004-01-17 Richard Henderson <rth@redhat.com>
2671 * tree-complex.c (gimplify_val): Copy TREE_BLOCK.
2673 * tree-complex.c (gimplify_val): New.
2674 (extract_component, do_binop, do_unop): Use it.
2676 2004-01-17 Richard Henderson <rth@redhat.com>
2678 * tree-complex.c (expand_complex_operations_1): Fix RETURN_EXPR
2679 thinko in last change.
2681 2004-01-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
2683 * cfghooks.c (split_block): Don't redirect edges.
2684 * cfgrtl.c (rtl_split_block): Do it here.
2685 * tree-cfg.c (tree_split_block): Ditto.
2687 2004-01-17 Richard Henderson <rth@redhat.com>
2689 * tree-cfg.c (verify_expr): Tidy. Check COND_EXPR for boolean
2692 2004-01-17 Jan Hubicka <jh@suse.cz>
2694 PR optimization/11761
2695 * Makefile.in: Remove tree-simple.c from GTYized files.
2696 * tree-dfa.c (find_addressable_vars): Parse nontrivial ADDR_EXPRs.
2697 (discover_nonconstant_array_refs_r): New static function.
2698 (discover_nonconstant_array_refs): New global function.
2699 * tree-flow.h (discover_nonconstant_array_refs): Declare.
2700 * tree-simple.c (types_checked, types_in_memory): Kill.
2701 (struct_needs_to_live_in_memory): Kill.
2702 (needs_to_live_in_memory): aggregates are safe.
2703 * tree-ssa.c (rewrite_out_of_ssa): Call the new function.
2705 2004-01-17 Richard Henderson <rth@redhat.com>
2708 * tree-complex.c (expand_complex_comparison): Handle COND_EXPR.
2709 (expand_complex_operations_1): Likewise.
2711 2004-01-17 Richard Henderson <rth@redhat.com>
2713 * tree-sra.c (scalarize_tree_list): Take bitmap argument to
2714 avoid emitting duplicates. Update all callers.
2716 2004-01-17 Richard Henderson <rth@redhat.com>
2719 * tree-complex.c (expand_complex_comparison): New.
2720 (expand_complex_operations_1): Handle EQ_EXPR and NE_EXPR.
2722 2004-01-16 Daniel Berlin <dberlin@dberlin.org>
2724 * tree-alias-common.c (get_alias_var): Handle BIT_FIELD_REF.
2725 (find_func_aliases): Ditto.
2726 Update for fact that basic component_refs are no longer
2728 (create_fun_alias_var): Set DECL_CONTEXT on our faked declarations.
2729 (pass_del_pta): PTA dumps info on delete, so it needs a name.
2731 2004-01-16 Steven Bosscher <stevenb@suse.de>
2733 * tree-optimize.c (init_tree_optimization_passes): Run DCE
2734 before the first dominator optimization pass.
2736 2004-01-15 Brian Booth <bbooth@redhat.com>
2737 Richard Henderson <rth@redhat.com>
2739 * tree-sra.c (REALPART_INDEX, IMAGPART_INDEX): New.
2740 (sra_map_size): New.
2742 (mark_all_vdefs): New.
2743 (is_sra_candidate_decl): New.
2744 (is_sra_candidate_ref): New.
2745 (lookup_scalar): Use sra_map_size, make_temp.
2746 (get_scalar_for_field): Rename from get_scalar_for.
2747 (get_scalar_for_complex_part): New.
2748 (can_be_scalarized_p): Handle COMPLEX_TYPE.
2749 (scalarize_component_ref): Handle REAL/IMAGPART_EXPR.
2750 (scalarize_structure_assignment): Tidy.
2751 (find_candidates_for_sra): Handle COMPLEX_TYPE, return bool.
2752 (csc_assign, csc_build_component_ref): Split out from ...
2753 (create_scalar_copies): ... here. Handle COMPLEX_TYPE.
2754 (csc_build_complex_part): New.
2755 (scalarize_modify_expr): Use is_sra_candidate_foo.
2756 (scalarize_tree_list): Likewise.
2757 (scalarize_return_expr): Likewise.
2758 (dump_sra_map): Split out from ...
2759 (tree_sra): ... here. Tidy.
2761 2004-01-15 Frank Ch. Eigler <fche@redhat.com>
2763 * tree-mudflap.c (mf_xform_derefs): Accept void return statements.
2765 2004-01-15 Andrew MacLeod <amacleod@redhat.com>
2766 Jeff Law <law@redhat.com>
2768 * tree-ssa-dom.c (remove_local_expressions_from_table): New function
2769 extracted from dom_opt_finalize_block.
2770 (restore_vars_to_originalvalue): Likewise.
2771 (extract_true_false_edges_from_block): Likewise.
2772 (thread_across_edge): Handle if (cond) too.
2773 (dom_opt_finalize_block): Use new functions. Handle if (cond).
2775 * tree-ssa-dom.c (thread_across_edge): Accept dom_walk argument.
2776 Record temporary equivalences created by PHIs and temporarily
2777 const/copy propagate into conditionals.
2778 (dom_opt_finalize_block): Thread across an edge to a dominated block
2779 if the dominated block has PHIs. Remove temporary equivalenecs
2780 created by PHIs in thread_across_edge. Update code to restore the
2781 various hash tables to use the actual varray rather than a local
2783 (simplify_rhs_and_lookup_avail_expr): Set the condition's code
2784 before settings its operands.
2786 * tree-ssa.c (create_temp): Use add_referenced_var rather than
2787 an incomplete inline of its behavior. Also make sure to
2788 set is_dereferenced_{load,store}, is_call_clobbered and is_stored.
2790 * tree-ssa-live.c (build_tree_conflict_graph): Correctly handle
2791 case where the result of a PHI is unused.
2793 2004-01-15 Diego Novillo <dnovillo@redhat.com>
2795 * cfghooks.c (predicted_by_p): Add missing return.
2797 2004-01-15 Richard Henderson <rth@redhat.com>
2799 * tree-ssa-dom.c (optimize_stmt): Dump new statement if
2802 2004-01-15 Kazu Hirata <kazu@cs.umass.edu>
2804 * tree-cfg.c: Fix comment typos.
2805 * tree-eh.c: Likewise.
2806 * tree-inline.c: Likewise.
2807 * tree-optimize.c: Likewise.
2808 * tree-ssa.c: Likewise.
2809 * tree-ssa-dom.c: Likewise.
2810 * tree-ssa-operands.c: Likewise.
2811 * tree-ssa-pre.c: Likewise.
2812 * tree-tailcall.c: Likewise.
2814 2004-01-14 Jan Hubicka <jh@suse.cz>
2816 * basic-block.h: Include predict.h
2817 (tree_predicted_by_p, rtl_predicted_by_p, rtl_predict_edge,
2818 predict_edge_def): Declare.
2819 * cfghooks.h (cfg_hooks): add predict_edge and predicted_by_p
2820 (predict_edge, predicted_by_p): Declare.
2821 * cfghooks.c (predict_edge, predicted_by_p): Declare.
2822 * cfgrtl (rtl_cfg_hooks, cfg_layout_rtl_cfg_hook): Add new hooks.
2823 * cse.c (struct cse_basic_block_data): Rename enum values to not
2824 conflict with profile.h; update all uses.
2825 * predict.c: Include tree-flow.h, ggc.h, tree-dump.h
2826 (predicted_by_p): Rename to ...
2827 (rtl_predicted_by_p): .. this one; make global
2828 (tree_predicted_by_p): New.
2829 (dump_prediction): Add FILE argument.
2830 (predict_edge): Rename to ...
2831 (rtl_predict_edge): .. this one.
2832 (tree_predict_edge): New.
2833 (combine_predictions_for_insn): Update calls of predict_edge.
2834 (predict_loops): Break out from ...
2835 (estimate_probability): ... here; update comments; move updating
2836 of unknown probabilities from ...
2837 (estimate_bb_frequencies): ... here.
2838 (combine_predictions_for_bb): New.
2839 (tree_predict_by_opcode): New.
2840 (tree_estimate_probability): New.
2841 * predict.def (PRED_TREE_POINTER, PRED_TREE_OPCODE_POSITIVE,
2842 PRED_TREE_OPCODE_NONEQUAL, PRED_TREE_FPOPCODE): New predictors.
2843 * predict.h: Add include guard.
2844 (predict_edge, predict_edge_def): Move prototypes to basic_block.h
2845 * tree-cfg.c (tree_cfg_hooks): Add prediction hooks.
2846 * tree-dump.c (dump_files): Add profile.
2847 * tree-flow.h (struct edge_prediction): New structure.
2848 (struct bb_ann_d): Add field predictions.
2849 (tree_estimate_probability): Declare.
2850 * tree-optimize.c (optimize_function_tree): Call tree_estimate_probability.
2851 * tree.h (tree_dump_index): Add TDI_profile.
2852 * tree-pass.h (pass_profile): Declare.
2854 2004-01-14 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
2856 * basic-block.h (find_basic_blocks, cleanup_cfg,
2857 delete_unreachable_blocks, merge_seq_blocks): Declare.
2858 * cfgcleanup.c (merge_seq_blocks): New.
2859 * output.h (find_basic_blocks, cleanup_cfg, delete_unreachable_blocks):
2860 Declarations moved to basic-block.h.
2861 * tree-cfg.c (tree_merge_blocks, tree_can_merge_blocks_p): New.
2862 (cleanup_tree_cfg): Call merge_seq_blocks.
2863 (tree_cfg_hooks): Add tree_can_merge_blocks_p and tree_merge_blocks.
2865 2004-01-14 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
2867 * tree-cfg.c (tree_make_forwarder_block): Fix.
2869 2004-01-14 Richard Henderson <rth@redhat.com>
2871 * tree-complex.c: New file.
2872 * Makefile.in (OBJS-common): Add it.
2873 * tree-pass.h (pass_lower_complex): New.
2874 * tree-optimize.c (init_tree_optimization_passes): Add it.
2876 2004-01-14 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
2878 * Makefile.in (tree-ssa-loop.o): Add cfgloop.h dependency.
2879 (cfghooks.o): Add TIMEVAR_H and toplev.h dependency.
2880 * basic-block.h (struct edge_def): Use ir_type instead testing of
2882 (tidy_fallthru_edge, tidy_fallthru_edges, dump_bb, verify_flow_info):
2883 Declaration removed.
2884 * cfg.c (verify_flow_info, dump_bb): Moved to cfghooks.c.
2885 * cfgcleanup.c (try_simplify_condjump): Changed due to change of
2887 * cfghooks.c: Include timevar.h and toplev.h.
2888 (cfg_hooks): Made static.
2889 (tree_register_cfg_hooks, ir_type): New.
2890 (verify_flow_info, dump_bb): Moved from cfg.c.
2891 (redirect_edge_and_branch, redirect_edge_and_branch_force,
2892 split_block, split_block_after_labels, move_block_after,
2893 delete_basic_block, split_edge, create_basic_block,
2894 create_empty_bb, can_merge_blocks_p, merge_blocks,
2895 make_forwarder_block, tidy_fallthru_edge, tidy_fallthru_edges): New.
2896 * cfghooks.h (struct cfg_hooks): Modified.
2897 (redirect_edge_and_branch, redirect_edge_and_branch_force, split_block,
2898 delete_basic_block, split_edge, create_basic_block, can_merge_blocks_p,
2899 merge_blocks, make_forwarder_block): Changed into functions.
2900 (loop_optimizer_init, loop_optimizer_finalize): Removed.
2901 (HEADER_BLOCK, LATCH_EDGE): Moved into cfgloop.c.
2902 (tidy_fallthru_edge, tidy_fallthru_edges, create_empty_bb,
2903 verify_flow_info, dump_bb, ir_type): Declare.
2904 (cfg_layout_rtl_cfg_hooks): Declare.
2905 * cfglayout.c (copy_bbs): Don't call add_to_dominance_info.
2906 * cfgloop.c (HEADER_BLOCK, LATCH_EDGE): Moved from cfghooks.h.
2907 (update_latch_info, mfb_keep_just, mfb_keep_nonlatch): New functions.
2908 (canonicalize_loop_headers): Use new semantics of make_forwarder_block.
2909 * cfgloop.h (rtl_loop_optimizer_init, rtl_loop_optimizer_finalize):
2911 (loop_optimizer_init, loop_optimizer_finalize): Declare.
2912 * cfgloopmanip.c (split_loop_bb): Don't update dominators.
2913 (remove_bbs): Don't call remove_bbs.
2914 (create_preheader): Use make_forwarder_block.
2915 (mfb_keep_just, mfb_update_loops): New static functions.
2916 * cfgrtl.c (cfg_layout_split_block, rtl_split_block,
2917 rtl_make_forwarder_block, rtl_create_basic_block,
2918 rtl_delete_block, rtl_split_block, rtl_merge_blocks,
2919 tidy_fallthru_edge, rtl_split_edge, cfg_layout_merge_blocks,
2920 cfg_layout_split_edge): Parts not specific to rtl moved to cfghooks.c
2921 (tidy_fallthru_edges): Moved to cfghooks.c.
2922 (rtl_move_block_after): New.
2923 (redirect_edge_with_latch_update, update_cfg_after_block_merging):
2925 (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Modified.
2926 * ifcvt.c (merge_if_block, find_cond_trap, find_if_case_1,
2927 find_if_case_2): Don't update dominators.
2928 * loop-init.c (rtl_loop_optimizer_init, rtl_loop_optimizer_finalize):
2929 Replaced by rtl_loop_optimizer_init and rtl_loop_optimizer_finalize.
2930 * loop-unswitch.c (unswitch_loop): Don't call add_to_dominance_info.
2931 * toplev.c (rest_of_handle_loop2): Enter cfglayout mode here.
2932 * tree-cfg.c (create_bb): Modified to suit create_basic_block hook.
2933 (tree_redirect_edge_and_branch_1): Merged into
2934 tree_redirect_edge_and_branch.
2935 (create_blocks_annotations): Removed.
2936 (tree_loop_optimizer_init, tree_loop_optimizer_finalize): Removed.
2937 (tree_make_forwarder_block, remove_bb, tree_split_edge,
2938 tree_redirect_edge_and_branch, tree_split_block,
2939 tree_move_block_after): Partially moved to cfghooks.c.
2940 (tree_duplicate_bb): New.
2941 (PENDING_STMT): Moved to tree-flow.h.
2942 (tree_register_cfg_hooks): Moved to cfghooks.c.
2943 (build_tree_cfg): Don't call create_blocks_annotations.
2944 (factor_computed_gotos, make_blocks): Use create_empty_bb.
2945 (cleanup_tree_cfg): Use delete_unreachable_blocks.
2946 (remove_unreachable_blocks, insert_bb_before): Removed.
2947 (remove_phi_nodes_and_edges_for_unreachable_block): Modified.
2948 (tree_find_edge_insert_loc, thread_jumps): Use cfg hooks.
2949 (bsi_commit_edge_inserts): Update_annotations argument removed.
2950 (tree_cfg_hooks): Modified.
2951 * tree-flow.h (PENDING_STMT): Moved from tree-cfg.c.
2952 (insert_bb_before, remove_unreachable_blocks,
2953 remove_phi_nodes_and_edges_for_unreachable_block, tree_split_edge):
2954 Declaration removed.
2955 (bsi_commit_edge_inserts): Declaration changed.
2956 (tree_duplicate_bb): Declare.
2957 * tree-sra.c (scalarize_structures): Changed due to
2958 bsi_commit_edge_inserts change.
2959 * tree-ssa-dom.c (tree_ssa_dominator_optimize): Use
2960 delete_unreachable_blocks.
2961 * tree-ssa-loop.c: Include cfgloop.h.
2962 * tree-ssa-pre.c (split_critical_edges, tree_perform_ssapre): Use cfg
2964 * tree-ssa.c (rewrite_trees, rewrite_vars_out_of_ssa): Changed due to
2965 bsi_commit_edge_inserts change.
2966 (ssa_redirect_edge): Record the phi arguments on the redirected edge.
2967 * tree-tailcall.c (eliminate_tail_call): Clean stored phi arguments.
2969 2004-01-13 Richard Henderson <rth@redhat.com>
2971 * gimplify.c (gimplify_lhs_complex_part_expr): Remove.
2972 (gimplify_modify_expr): Don't call it.
2974 * tree-alias-common.c (HAVE_BANSHEE): Make sure it's defined.
2975 (pass_build_pta): Set name.
2977 2004-01-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
2979 * tree-tailcall.c (eliminate_tail_call): Add phi nodes for the call
2981 (find_tail_calls): Ignore returns with virtual operands.
2983 2004-01-12 Richard Henderson <rth@redhat.com>
2985 * tree-pass.h: New file.
2986 * gimple-low.c: Include tree-pass.h.
2987 (lower_function_body): Make static, take no arguments. Set
2988 dont_emit_block_notes and call reset_block_changes here.
2989 (pass_lower_cf): New.
2990 * toplev.c (general_init): Call init_tree_optimization_passes.
2991 * toplev.h (init_tree_optimization_passes): Declare.
2992 * tree-alias-ander.c: Include tree-pass.h.
2993 (tree_dump_file, tree_dump_flags): Remove.
2994 (andersen_init): Don't dump_begin.
2995 (andersen_cleanup): Don't dump_end.
2996 * tree-alias-common.c: Include tree-pass.h, timevar.h.
2997 (currptadecl): Remove.
2998 (create_alias_vars): Make static, take no args. Tidy ifdefs.
2999 (delete_alias_vars): Likewise. Protect vs PTA_ANDERSEN.
3000 (pass_build_pta, pass_del_pta): New.
3001 * tree-alias-common.h (create_alias_vars): Delete decl.
3002 (delete_alias_vars): Likewise.
3003 * tree-cfg.c: Include tree-pass.h.
3004 (tree_dump_file, tree_dump_flags): Remove.
3005 (build_tree_cfg): Don't timevar, do init_flow. Ensure one bb.
3006 Don't dump the function here.
3007 (execute_build_cfg, pass_build_cfg): New.
3008 (remove_useless_stmts): Make static, take no arguments.
3009 (pass_remove_useless_stmts): New.
3010 (remove_bb): Don't open the dump file.
3011 * tree-dfa.c: Include tree-pass.h.
3012 (tree_dump_file, tree_dump_flags): Remove.
3013 (find_referenced_vars): Make static, take no args. Do init_tree_ssa.
3014 (compute_may_aliases): Similarly. Don't timevar or open dump file.
3015 Don't delete_alias_vars here.
3016 (pass_referenced_vars, pass_may_alias): New.
3017 * tree-dump.c (dump_files): Remove optimization dumps.
3018 (extra_dump_files, extra_dump_files_in_use): New.
3019 (extra_dump_files_alloced): New.
3020 (dump_register): New.
3021 (get_dump_file_info): New.
3022 (dump_begin, dump_enabled_p, dump_flag_name): Use it.
3023 (dump_enable_all): Handle extra_dump_files.
3024 (dump_switch_p_1): Split out from dump_switch_p.
3025 (dump_switch_p): Handle extra_dump_files.
3026 * tree-dump.h (dump_register): Declare.
3027 * tree-eh.c: Include tree-pass.h
3028 (lower_eh_constructs): Make static, take no args. Don't timevar,
3029 don't dump function.
3030 (pass_lower_eh): New.
3031 * tree-flow.h (remove_useless_stmts, find_referenced_vars,
3032 compute_may_aliases, lower_function_body, rewrite_out_of_ssa,
3033 tree_ssa_ccp, tree_ssa_dominator_optimize, tree_ssa_dce,
3034 tree_ssa_loop_opt, lower_eh_constructs, tree_sra): Remove.
3035 (rewrite_into_ssa): Update decl.
3036 * tree-mudflap.c: Include tree-pass.h.
3037 (mudflap_function_decls): Make static, take no args, don't process
3038 functions with mf_marked_p.
3039 (mudflap_function_ops): Likewise.
3040 (gate_mudflap, pass_mudflap_1, pass_mudflap_2): New.
3041 (mudflap_enqueue_decl): Don't open dump file.
3042 (mudflap_enqueue_constant): Likewise.
3043 * tree-nomudflap.c: Include tree-pass.h.
3044 (mudflap_c_function_decls, mudflap_c_function_ops): Remove.
3045 (pass_mudflap_1, pass_mudflap_2): New.
3046 * tree-optimize.c: Include tree-pass.h.
3047 (optimize_function_tree): Remove.
3048 (tree_dump_file, tree_dump_flags, vars_to_rename): New.
3050 (execute_gimple, pass_gimple): New.
3051 (execute_rebuild_bind, pass_rebuild_bind): New.
3052 (gate_all_optimizations, pass_all_optimizations): New.
3053 (execute_del_cfg, pass_del_cfg): New.
3054 (register_one_dump_file, register_dump_files): New.
3055 (dup_pass_1, init_tree_optimization_passes): New.
3056 (current_properties, last_verified): New.
3057 (execute_todo, execute_one_pass, execute_pass_list): New.
3058 (tree_rest_of_compilation): Remove -O0 passes.
3059 * tree-sra.c: Include tree-pass.h, flags.h.
3060 (tree_dump_file, tree_dump_flags, vars_to_rename): Remove.
3061 (tree_sra): Make static, take no args. Don't timevar or dump file.
3062 (gate_sra, pass_sra): New.
3063 * tree-ssa-ccp.c: Include tree-pass.h, flags.h.
3064 (tree_dump_file, tree_dump_flags): New.
3065 (tree_ssa_ccp): Make static, take no args. Don't timevar or dump file.
3066 (gate_ccp, pass_ccp): New.
3067 (substitute_and_fold): Take no args.
3068 * tree-ssa-dce.c: Include tree-pass.h, flags.h.
3069 (tree_dump_file, tree_dump_flags): New.
3070 (tree_ssa_dce): Make static, take no args. Don't open dump file.
3071 (gate_dce, pass_dce): New.
3072 * tree-ssa-dom.c: Include tree-pass.h, flags.h.
3073 (tree_dump_file, tree_dump_flags, vars_to_rename): Remove.
3074 (tree_ssa_dominator_optimize): Make static, take no args, don't
3075 timevar, don't dump file.
3076 (gate_dominator, pass_dominator): New.
3077 * tree-ssa-loop.c: Include tree-pass.h, flags.h.
3078 (tree_dump_file, tree_dump_flags): Remove.
3079 (tree_ssa_loop_opt): Make static, take no args, don't open dump file.
3080 (gate_loop, pass_loop): New.
3081 * tree-ssa-pre.c: Include tree-pass.h, flags.h.
3082 (tree_dump_file, tree_dump_flags): Remove.
3083 (execute_pre): Rename from tree_perform_ssapre, make static,
3084 take no args, don't timevar, don't open dump file, don't allocate
3086 (gate_pre, pass_pre): New.
3087 * tree-ssa.c: Include tree-pass.h.
3088 (tree_dump_file, tree_dump_flags, vars_to_rename): Remove.
3089 (rewrite_into_ssa): Take no arguments, don't open dump file.
3090 (rewrite_out_of_ssa): Make static, take no args, don't timevar,
3091 don't open dump file. Disable TER if mudflap.
3092 (pass_build_ssa, pass_del_ssa): New.
3093 * tree-tailcall.c: Include tree-pass.h, flags.h.
3094 (tree_dump_file, tree_dump_flags): Remove.
3095 (tree_optimize_tail_calls_1): Rename from tree_optimize_tail_calls.
3096 Make static, take only opt_tailcalls, don't dump file.
3097 (execute_tail_recursion, gate_tail_calls, execute_tail_calls): New.
3098 (pass_tail_recursion, pass_tail_calls): New.
3099 * tree.h (enum tree_dump_index): Remove optimization dumps.
3100 * Makefile.in (tree-alias-ander.o, tree-alias-common.o, tree-ssa.o,
3101 tree-ssa-dom.o, tree-ssa-pre.o, tree-cfg.o, tree-tailcall.o,
3102 tree-dfa.o, tree-eh.o, tree-ssa-loop.o, tree-optimize.o, gimple-low.o,
3103 tree-mudflap.o, tree-ssa-dce.o, tree-ssa-ccp.o, tree-sra.o: Update
3106 2004-01-12 Frank Ch. Eigler <fche@redhat.com>
3108 * tree-mudflap.c (mf_xform_derefs): Restore instrumentation of
3111 2004-01-11 Jan Hubicka <jh@suse.cz>
3113 * tree-cfg.c (remove_usless_stmts_cond): Fold statement.
3114 (remove_useless_stmts_1): Fold trees we know how to fold.
3116 2004-01-09 Richard Henderson <rth@redhat.com>
3118 * gimplify.c (gimplify_constructor): Merge into ...
3119 (gimplify_init_constructor): ... here. Handle COMPLEX_TYPE and
3121 (gimplify_lhs_complex_part_expr): New.
3122 (gimplify_modify_expr): Call it.
3123 * tree-simple.c (is_gimple_rhs): Accept COMPLEX_EXPR.
3124 * c-pretty-print.c (pp_c_initializer): Accept any type CONSTRUCTOR.
3125 (pp_c_initializer_list): Fix code expectations for VECTOR_TYPE and
3128 2004-01-09 Steven Bosscher <stevenb@suse.de>
3130 PR optimization/13599
3131 * tree-cfg.c (remove_useless_stmts_cond): Clear last-goto
3134 2004-01-09 Richard Henderson <rth@redhat.com>
3136 * gimplify.c (gimplify_asm_expr): Fix ordering of ASM_INPUTS.
3138 2004-01-09 Jan Hubicka <jh@suse.cz>
3140 * cgraph.h (cgraph_clone_inlined_nodes): Declare.
3141 * cgraphunit.c (cgrpah_clone_inlined_nodes): Make global.
3142 (cgraph_mark_inline_edge): Sanity check that size is positive.
3143 (cgraph_decide_inlining): Fix typo.
3144 * tree-optimize.c (tree_rest_of_compilation): Fix node duplication
3147 2004-01-09 Jan Hubicka <jh@suse.cz>
3149 * tree-inline.c (estimate_num_insns_1): Fix.
3151 2004-01-09 Richard Henderson <rth@redhat.com>
3153 * tree-alias-ander.c, tree-cfg.c, tree-dfa.c, tree-mudflap.c,
3154 tree-sra.c, tree-ssa-ccp.c, tree-ssa-dce.c, tree-ssa-dom.c,
3155 tree-ssa-loop.c, tree-ssa-pre.c, tree-ssa.c, tree-tailcall.c: Rename
3156 dump_file and dump_flags to tree_dump_file/flags.
3158 2004-01-08 Frank Ch. Eigler <fche@redhat.com>
3160 * tree-mudflap.c (mf_build_string): Properly mf_mark string.
3161 (mf_varname_tree): Remove redundant marking.
3162 * tree-optimize.c (tree_rest_of_compilation): Skip mudflap processing
3163 of mf_marked functions.
3164 * c-mudflap.c (mflang_flush_calls): mf_mark synthetic function.
3166 2004-01-07 Diego Novillo <dnovillo@redhat.com>
3168 * Makefile.in (OBJS-common): Remove tree-must-alias.o
3169 (tree-must-alias.o): Remove.
3170 * common.opt (ftree-must-alias): Remove.
3171 * flags.h (flag_tree_must_alias): Remove. Update all users.
3172 * timevar.def (TV_TREE_MUST_ALIAS): Remove.
3173 * toplev.c (f_options): Remove entry for -ftree-must-alias.
3174 * tree-alias-common.c (local_alias_vars): Add GTY marker.
3175 (local_alias_varnums): Likewise.
3176 * tree-dfa.c (aliases_computed_p): Declare.
3177 (dump_variable): Show variable UID and dereferenced bits.
3178 (compute_may_aliases): Add arguments 'vars_to_rename' and 'phase'.
3179 Do not call create_alias_vars.
3180 Call promote_call_clobbered_vars
3182 Set 'aliases_computed_p' to true before returning.
3183 (create_memory_tags): Call may_be_aliased.
3184 Mark new memory tags for renaming.
3185 (compute_alias_sets): Don't do debugging dumps.
3186 (find_variable_in): Move from tree-must-alias.c
3187 (remove_element_from): Likewise.
3188 (find_addressable_vars): Likewise
3189 (promote_call_clobbered_vars): New.
3190 (get_memory_tag_for): Mark the tag volatile if the pointed-to type
3192 * tree-dump.c (dump_files): Remove entry for tree-mustalias.
3193 Add entries for tree-ssa7, tree-dom3 and tree-dce3.
3194 * tree-flow-inline.h (may_be_aliased): New.
3195 * tree-flow.h (may_be_aliased): Declare.
3196 (aliases_computed_p): Declare.
3197 (tree_compute_must_alias): Remove.
3198 * tree-must-alias.c: Remove.
3199 * tree-optimize.c: Include tree-alias-common.h.
3200 (optimize_function_tree): Call create_alias_vars before going into
3202 Do not compute aliases until after the first DOM and DCE passes.
3203 Run DOM and DCE once more after computing may-aliases.
3204 * tree-ssa-dom.c (propagate_copy): Merge the dereferenced bit flags
3205 when copy propagating pointers.
3206 * tree-ssa-operands.c (get_stmt_operands): Assume that the
3207 statement has no volatile operands.
3208 (get_expr_operands): When processing an INDIRECT_REF expressions,
3209 mark the statement as having volatile operands if aliases have not
3211 (add_stmt_operand): If the variable may be aliased and aliasing has
3212 not been computed yet, mark the statement as having volatile
3214 * tree-ssa.c (init_tree_ssa): Set aliases_computed_p to false.
3215 (delete_tree_ssa): Likewise.
3216 * tree.h (tree_dump_index): Remove TDI_mustalias.
3217 Add TDI_dom_3, TDI_ssa_7 and TDI_dce_3.
3218 * doc/invoke.texi: Remove must-alias documentation.
3220 2004-01-07 Jeff Law <law@redhat.com>
3222 * tree-ssa-dce.c (find_useful_stmts): Do not consider PHIs for
3223 virtual operands inherently necessary.
3225 2004-01-07 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
3227 * tree-dfa.c (free_df_for_stmt, free_df): New functions.
3228 (compute_immediate_uses_for_stmt): Record uses in VDEFs.
3229 * tree-flow.h (free_df, kill_redundant_phi_nodes): Declare.
3230 * tree-optimize.c (optimize_function_tree): Call
3231 kill_redundant_phi_nodes.
3232 * tree-ssa-ccp.c (finalize): Call free_df.
3233 * tree-ssa.c (replace_immediate_uses, raise_value,
3234 kill_redundant_phi_nodes): New functions.
3236 2004-01-06 Jeff Law <law@redhat.com>
3238 * tree.h (FUNCTION_RECEIVES_NONLOCAL_GOTO): Kill.
3239 * tree-cfg.c (make_exit_edges, is_ctrl_altering_stmt): Use
3240 current_function_has_nonlocal_label instead of
3241 FUNCTION_RECEIVES_NONLOCAL_GOTO.
3242 * gimplify.c (gimplify_expr): Set has_nonlocal_label in the
3243 appropriate function's struct function rather than setting
3244 a bit in the FUNCTION_DECL.
3246 2004-01-06 Jan Hubicka <jh@suse.cz>
3248 * expr.c (string_constant): Recognize array_ref.
3250 2004-01-06 Richard Henderson <rth@redhat.com>
3252 * builtins.c (builtin_save_expr): New.
3253 (expand_builtin_mathfn, expand_builtin_mathfn_2,
3254 expand_builtin_strcmp, expand_builtin_strncmp,
3255 expand_builtin_strcat, fold_builtin_cabs): Use it.
3257 2004-01-06 Jan Hubicka <jh@suse.cz>
3259 * fold-const.c (fold): Do not rebuild comparison when nothing
3262 2004-01-05 Jan Hubicka <jh@suse.cz>
3264 * tree-ssa-ccp.c (ccp_fold_builtin): Return early for builtins
3267 2004-01-05 Steven Bosscher <steven@gcc.gnu.org>
3269 * tree-ssa-dce.c: Clean up whitespace.
3271 * tree-cfg.c (tree_verify_flow_info): Fix complaint about
3272 missing or wrong labels in the targets of a conditional branch.
3274 2004-01-05 Richard Henderson <rth@redhat.com>
3276 * tree-ssa-dom.c (record_equivalences_from_incoming_edge): Check
3277 for signed zeros before recording value.
3278 * Makefile.in (tree-ssa-dom.o): Depend on real.h.
3280 2004-01-05 Jeff Law <law@redhat.com>
3282 * tree-ssa-dom.c (cprop_into_stmt): Remove hack which prevented
3283 copy propagation into statements with virtual operands, but no
3286 * tree-ssa-dom.c (tree_ssa_dominator_optimize): Correctly handle
3287 the case where an edge we wish to redirect is split by the out of SSA
3290 2004-01-05 Richard Henderson <rth@redhat.com>
3292 * c-tree.h (struct lang_type): Add enum_min, enum_max.
3293 * c-decl.c (finish_enum): Set them. Set TYPE_MIN/MAX_VALUE to
3294 the limits of the compatible type, not to the enumerators.
3295 (check_bitfield_type_and_width): Use them.
3296 (finish_struct): Clear allocated struct lang_type.
3297 * gimplify.c (gimplify_switch_expr): Remove special handling of
3298 outer cast in a switch.
3299 * tree-ssa-dom.c (record_equivalences_from_incoming_edge): Likewise.
3301 2004-01-05 Daniel Berlin <dberlin@dberlin.org>
3303 * tree-ssa-pre.c (added_phis): Removed.
3304 Remove gt-tree-ssa-pre.h.
3305 (process_left_occs_and_kills): ASM_EXPR's block load pre.
3307 * Makefile.in (GTFILES): Don't process tree-ssa-pre.c.
3308 gt-tree-ssa-pre.h isn't a gtfile anymore.
3310 2004-01-05 Andrew Pinski <pinskia@physics.uc.edu>
3312 * config.gcc (powerpc-*-darwin*): Make libbanshee rebuild
3315 2004-01-05 Richard Henderson <rth@redhat.com>
3317 * gimplify.c (gimplify_expr): Move check for error_mark inside
3320 2004-01-04 Jan Hubicka <jh@suse.cz>
3322 * Makefile.in (cgraph.o, cgraphunit.o): Add intl.h dependency.
3323 * cgraph.c (create_edge, dump_cgraph): Update to use inline_failed
3324 * cgraph.h (cgraph_edge): Replace inline_call by inline_failed
3325 (cgraph_inline_p): Add extra argument reason.
3326 * cgraphunit.c: Minor formating fixes.
3327 cgraph_first_inlined_callee): New functions.
3328 (record_call_1): Record builtins too.
3329 (cgraph_analyze_function): Update inline_failed messages.
3330 (cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_inlined_into,
3331 cgraph_inlined_callees, cgraph_estimate_growth): Update to use inline_failed.
3332 (cgraph_check_inline_limits): Likewise; Add argument reason.
3333 (cgraph_set_inline_failed): New static function.
3334 (cgraph_decide_inlining_of_small_function, cgraph_decide_inlining): Set
3336 (cgraph_inline_p): Add new argument reason.
3337 * tree-inline.c (expand_call_inline): Update warning.
3339 2004-01-04 Andreas Jaeger <aj@suse.de>
3341 * common.opt: Re-order some options in ASCII collating orders.
3343 2004-01-03 Richard Henderson <rth@redhat.com>
3345 * toplev.c (rest_of_compilation): Fixup merge error wrt
3346 check_function_return_warnings.
3348 * tree.h (FUNCTION_RECEIVES_NONLOCAL_GOTO): Use unsigned_flag.
3350 2004-01-02 Jan Hubicka <jh@suse.cz>
3352 * c-decl.c (duplicate_decls): Output DIE of extern inline function
3353 only when it can be inlined.
3354 * c-objc-common.c (c_disregard_inline_limits): When not inlining
3355 extern inline functions do not disregard.
3356 * cgraphunit.c (cgraph_analyze_function): When not inlining do not set
3358 (cgraph_decide_inlining): Limit work done when not inlining.
3359 (cgrpah_decide_inlining_incrementally): Likewise.
3360 * tree-optimize.c (tree_rest_of_compilation): Do not call
3361 optimize_inline_calls
3362 when there is nothing to inline.
3364 2004-01-01 Richard Henderson <rth@redhat.com>
3366 * c-common.c (c_expand_expr): Don't handle STMT_EXPR.
3367 * c-objc-common.c (c_objc_common_finish_file): Use expand_expr.
3368 * c-semantics.c (lang_expand_stmt, lang_expand_decl_stmt,
3369 expand_cond, genrtl_do_pushlevel, genrtl_goto_stmt, genrtl_expr_stmt,
3370 genrtl_expr_stmt_value, genrtl_decl_stmt, genrtl_if_stmt,
3371 genrtl_while_stmt, genrtl_do_stmt_1, genrtl_do_stmt,
3372 genrtl_return_stmt, genrtl_for_stmt, genrtl_break_stmt,
3373 genrtl_continue_stmt, genrtl_scope_stmt, genrtl_switch_stmt,
3374 genrtl_case_label, genrtl_compound_stmt, genrtl_asm_stmt,
3375 genrtl_cleanup_stmt, expand_stmt, find_reachable_label,
3376 find_reachable_label_1, expand_unreachable_if_stmt,
3377 expand_unreachable_stmt): Remove.
3378 * c-common.h: Update.
3380 2003-12-31 Richard Henderson <rth@redhat.com>
3382 * c-mudflap.c (mflang_register_call): Remove.
3383 (mflang_flush_calls): Use start_function/finish_function.
3384 * tree-mudflap.c (mf_init_extern_trees): Tidy.
3385 (mf_decl_cache_locals): Fix chaining for empty body.
3386 (deferred_static_decl_labels): Remove.
3387 (deferred_static_decls_init): Remove.
3388 (mudflap_register_call): New.
3389 (mudflap_enqueue_decl): Use it. Remove label argument.
3390 (mudflap_enqueue_constant): Likewise.
3391 (mudflap_finish_file): Update to match.
3392 * tree-mudflap.h (mudflap_enqueue_decl): Remove label argument.
3393 (mudflap_enqueue_constant): Likewise.
3394 (mflang_register_call): Remove.
3395 * tree-nomudflap.c (mudflap_enqueue_decl): Remove label argument.
3396 (mudflap_enqueue_constant): Likewise.
3397 * tree-optimize.c (tree_ssa_finish): Don't create NULL bodies.
3398 * varasm.c (make_decl_rtl): Update mudflap_enqueue_decl call.
3399 (output_constant_def_contents): Similarly for mudflap_enqueue_constant.
3401 2003-12-26 Sebastian Pop <s.pop@laposte.net>
3403 * tree-cfg.c (print_loop, print_pred_bbs, print_succ_bbs,
3404 debug_loop_ir, print_loop_ir): New.
3405 * tree-flow.h (debug_loop_ir, print_loop_ir): Declare.
3407 2003-12-23 Jeff Law <law@redhat.com>
3409 * tree-cfg.c (tree_find_edge_insert_loc): Do not use the target
3410 block as an insertion location if the target block has PHI nodes.
3412 2003-12-23 Jan Hubicka <jh@suse.cz>
3414 * cgraphunit.c (cgraph_mark_inline): Accept argument edge; return
3415 next edge not redirected.
3416 (cgraph_recursive_inlining_p): Simplify.
3417 (cgraph_decide_inlining*): Update calls of cgraph_mark_inline.
3419 2003-12-22 Toon Moene <toon@moene.indiv.nluug.nl>
3421 * tree-alias-common.c (find_func_aliases): Do not call
3422 intra_function_call for languages assuring no aliasing between
3423 arguments (by themselves) and global memory.
3425 2003-12-21 Jan Hubicka <jh@suse.cz>
3427 * tree-ssa-ccp.c (fold_stmt): Return when there is no RHS
3428 (get_rhs): Return for RETURN_EXPR with no operand.
3430 2003-12-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
3432 * tree-cfg.c (tree_make_forwarder_block): Use split_block.
3433 (tree_split_block): New.
3434 (tree_cfg_hooks): Add tree_split_block.
3435 (tree_loop_optimizer_init): Enable force_single_succ_latches.
3436 * cfgloopmanip.c (loop_split_edge_with): Don't update dominators.
3437 * cfgrtl.c (rtl_split_edge, cfg_layout_split_edge): Update dominators.
3439 2003-12-19 Daniel Berlin <dberlin@dberlin.org>
3441 * tree-dfa.c (alias_stats_d): New structure.
3442 (alias_stats): New variable.
3443 (create_memory_tags): Zero out alias_stats.
3444 (dump_alias_stats): New function.
3445 (compute_alias_sets): Call it if TDF_STATS is set.
3446 (may_alias_p): Collect the various statistics.
3448 2003-12-19 Diego Novillo <dnovillo@redhat.com>
3450 * gimple-low.c (expand_var_p): Always expand volatiles.
3451 * tree-dfa.c (find_referenced_vars): Move up in the file.
3452 (create_memory_tags): New local function.
3453 (compute_may_aliases): Call it.
3454 (add_referenced_var): Move code to create memory tags and create
3455 aliasing arrays to create_memory_tags.
3456 (get_memory_tag_for): Don't mark memory tags volatile. Mark them
3458 * tree-flow.h (var_ann_d): Add bitfields is_dereferenced_store and
3459 is_dereferenced_load.
3460 (add_call_clobbered_var): Remove.
3461 * tree-ssa-operands.c (check_optype_freelist): Mark arguments
3463 (add_optype_freelist): Likewise.
3464 (add_stmt_operand): Don't add operands for volatile variables.
3466 2003-12-19 Kazu Hirata <kazu@cs.umass.edu>
3468 * dominance.c: Fix comment typos.
3469 * et-forest.c: Likewise.
3470 * et-forest.h: Likewise.
3471 * tree-cfg.c: Likewise.
3472 * tree-eh.c: Likewise.
3473 * tree-mudflap.c: Likewise.
3474 * tree-optimize.c: Likewise.
3475 * tree-pretty-print.c: Likewise.
3476 * tree-ssa-ccp.c: Likewise.
3477 * tree-ssa-dom.c: Likewise.
3478 * tree-ssa.c: Likewise.
3479 * tree-tailcall.c: Likewise.
3480 * tree.def: Likewise.
3483 2003-12-18 Jason Merrill <jason@redhat.com>
3486 * c-simplify.c (stmt_expr_last_stmt): Split out from...
3487 (gimplify_stmt_expr): Here.
3488 * c-common.h: Declare it.
3490 2003-12-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
3492 * et-forest.h (et_forest_create, et_forest_delete,
3493 et_forest_add_node, et_forest_add_edge, et_forest_remove_node,
3494 et_forest_remove_edge, et_forest_parent,
3495 et_forest_common_ancestor, et_forest_node_value,
3496 et_forest_enumerate_sons): Declarations removed.
3497 (struct et_node): New.
3498 (et_new_tree, et_free_tree, et_set_father, et_split, et_nca,
3500 * et-forest.c (struct et_forest_occurrence, struct et_forest,
3501 struct et_forest_node): Removed.
3502 (et_forest_create, et_forest_delete,
3503 et_forest_add_node, et_forest_add_edge, et_forest_remove_node,
3504 et_forest_remove_edge, et_forest_parent,
3505 et_forest_common_ancestor, et_forest_node_value,
3506 et_forest_enumerate_sons, splay, remove_all_occurrences,
3507 find_leftmost_node, find_rightmost_node, calculate_value): Removed.
3508 (struct et_occ): New.
3509 (et_nodes, et_occurences): New.
3510 (set_depth, set_depth_add, set_prev, set_next, et_recomp_min,
3511 et_check_occ_sanity, et_check_sanity, et_check_tree_sanity,
3512 record_path_before_1, record_path_before, check_path_after_1,
3513 check_path_after, et_splay, et_new_occ, et_new_tree,
3514 et_free_tree, et_set_father, et_split, et_nca, et_below): New.
3515 * basic-block.h (struct basic_block_def): New field dom.
3516 (struct dominance_info): Type removed.
3517 (calculate_dominance_info, free_dominance_info,
3518 nearest_common_dominator, set_immediate_dominator,
3519 get_immediate_dominator, dominated_by_p, get_dominated_by,
3520 add_to_dominance_info, delete_from_dominance_info,
3521 recount_dominator, redirect_immediate_dominators,
3522 iterate_fix_dominators, verify_dominators): Declarations
3524 (enum dom_state): New.
3525 (dom_computed): New variable.
3526 (first_dom_son, next_dom_son): Declare.
3527 * dominance.c (struct dominance_info): Removed.
3528 (BB_NODE, SET_BB_NODE): Removed.
3529 (calculate_dominance_info, free_dominance_info,
3530 nearest_common_dominator, set_immediate_dominator,
3531 get_immediate_dominator, dominated_by_p, get_dominated_by,
3532 add_to_dominance_info, delete_from_dominance_info,
3533 recount_dominator, redirect_immediate_dominators,
3534 iterate_fix_dominators, verify_dominators,
3535 debug_dominance_info): Work over new datastructure. Access
3536 dominance datastructures through CFG.
3537 (assign_dfs_numbers, compute_dom_fast_query, first_dom_son,
3539 * tree-cfg.c (pdom_info): Variable removed.
3540 (create_bb): Add the block to the dominance information.
3541 (cleanup_tree_cfg): Let updating of the dominance on the
3543 (remove_bb): Don't handle pdom.
3544 (cleanup_control_expr_graph, tree_make_forwarder_block,
3545 thread_jumps): Invalidate the dominators.
3546 (tree_split_edge): Update the dominators.
3547 (compute_dominance_frontiers_1, compute_dominance_frontiers,
3548 tree_verify_flow_info, tree_loop_optimizer_init): Use the new
3549 interface to dominators.
3550 * domwalk.c (walk_dominator_tree): Do not use dom_children.
3551 * tree-flow-inline.h (add_dom_child, remove_dom_child,
3552 clear_dom_children, dom_children): Removed.
3553 * tree-flow.h (struct bb_ann_d): Dom_children field removed.
3554 (add_dom_child, dom_children, build_dominator_tree): Declaration
3556 (compute_dominance_frontiers): Declaration changed.
3557 * tree-optimize.c (optimize_function_tree): Free dominance
3558 information in the end.
3559 * tree-ssa-dom.c (tree_ssa_dominator_optimize,
3560 dom_opt_finalize_block): Do not use dom_children.
3561 * tree-ssa-pre.c (fast_a_dominates_b, build_dfs_id_array_1,
3562 build_dfs_id_array): Removed.
3563 (pre_idom, dfs_id, dfs_id_last): Variables removed.
3564 (build_dfn_array): Do not use dom_children.
3565 (eref_compare, load_modified_phi_result, rename_1, reaching_def,
3566 finalize_1, collect_expressions, tree_perform_ssapre): Use the
3567 new interface to the dominance information.
3568 * tree-ssa.c (struct mark_def_sites_global_data): Idom field
3570 (set_livein_block, verify_use, verify_phi_args,
3571 rewrite_into_ssa, mark_def_sites, verify_ssa): Use the new
3572 interface to the dominance information.
3573 (build_dominator_tree): Removed.
3574 * tree-tailcall.c (tree_optimize_tail_calls): Invalidate
3575 dominance information.
3576 * bt-load.c (dom): Variable removed.
3577 (augment_live_range, combine_btr_defs, migrate_btr_def,
3578 migrate_btr_defs, branch_target_load_optimize): Updated for the
3579 new interface for dominance information.
3580 * cfglayout.c (copy_bbs): Removed loops argument. Updated for
3581 the new interface for dominance information.
3582 * cfglayout.h (copy_bbs): Declaration changed.
3583 * cfgloop.c (flow_loop_pre_header_find, flow_loops_cfg_dump,
3584 flow_loop_scan, canonicalize_loop_headers, flow_loops_find): Updated
3585 for the new interface for dominance information.
3586 (flow_loop_scan): Loops argument removed.
3587 (flow_loops_free): Don't release dominators.
3588 * cfgloop.h (struct cfg): Dom field removed.
3589 (flow_loop_scan, loop_split_edge_with, simple_loop_p,
3590 just_once_each_iteration_p, split_loop_bb): Declaration changed.
3591 * cfgloopanal.c (simple_loop_exit_p, simple_increment,
3592 just_once_each_iteration_p, simple_loop_p): Remove loops argument.
3593 Updated for the new interface for dominance information.
3594 * cfgloopmanip.c (remove_bbs, find_path, create_preheader,
3595 split_loop_bb, loopify, duplicate_loop_to_header_edge,
3596 force_single_succ_latches, loop_split_edge_with): Ditto.
3597 (create_loop_notes): Free the dominators.
3598 * gcse.c (dominators): Variable removed.
3599 (free_code_hoist_mem, compute_code_hoist_data, hoist_code):
3600 Updated for the new interface for dominance information.
3601 * ifcvt.c (post_dominators): Variable removed.
3602 (mark_loop_exit_edges, merge_if_block, find_if_header,
3603 find_cond_trap, find_if_case_1, find_if_case_2, if_convert):
3604 Updated for the new interface for dominance information.
3605 * loop-init.c (rtl_loop_optimizer_init,
3606 rtl_loop_optimizer_finalize): Ditto.
3607 * loop-unroll.c (decide_peel_simple, decide_peel_once_rolling,
3608 decide_peel_completely, decide_unroll_stupid,
3609 decide_unroll_constant_iterations,
3610 decide_unroll_runtime_iterations): Loops argument removed.
3611 Updated for the new interface for dominance information.
3612 (unroll_and_peel_loops, peel_loops_completely,
3613 unroll_loop_runtime_iterations): Updated for the new interface for
3614 dominance information.
3615 * loop-unswitch.c (may_unswitch_on_p, unswitch_loops,
3616 unswitch_single_loop, unswitch_loop): Updated for the new
3617 interface for dominance information.
3618 * predict.c (process_note_predictions, process_note_prediction,
3619 estimate_probability, note_prediction_to_br_prob): Ditto.
3620 * sched-rgn.c (find_rgns, init_regions): Ditto.
3621 * toplev.c (rest_of_handle_branch_prob): Free the dominators.
3623 2003-12-18 Jeff Law <law@redhat.com>
3625 * tree-ssa-dom.c (edges_to_redirect, redirection_targets): Merged
3626 into a single varray "redirection_edges".
3627 (tree_ssa_dominator_optimize): Twiddle initialization, finalization
3628 and accessors to redirection information based on combining varrays.
3629 Get the threading destination from the saved edge rather than from a
3630 saved block. Mark variables appearing in PHIs at the jump thread
3631 destination to be taken out of SSA form.
3632 (thread_across_edge): Save the edge into the destination block
3633 rather than the destination block itself. Twiddle based on
3634 combining varrays of jump threading information.
3635 * tree-flow.h (tree_block_forwards_to): Returns an edge rather than
3637 * tree-cfg.c (tree_block_forwards_to): Return the edge leading to
3638 the target block rather than the target block itself.
3640 2003-12-18 Daniel Berlin <dberlin@dberlin.org>
3642 * tree-dfa.c (get_memory_tag_for): Don't put things with different
3643 points-to sets in the same memory tag.
3645 2003-12-18 Jan Hubicka <jh@suse.cz>
3647 * c-common.c (handle_nonnull_attribute, check_function_nonnull):
3649 * c-format.c (handle_format_attribute): Initialize format_num.
3650 * rtlanal.c (get_related_value): Initialize get_jump_table_offset
3652 2003-12-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
3654 * stmt.c (expand_start_loop, expand_loop_continue_here,
3655 expand_end_loop): Don't create loop notes.
3657 2003-12-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
3658 Jeff Law <law@redhat.com>
3660 * tree-cfg.c (tree_node_shared_p): Explicitly allow sharing of
3662 * tree-simple.c (is_gimple_rhs): Allow CST nodes.
3663 (is_gimple_min_invariant): Reject constants with TREE_OVERFLOW set.
3664 * tree-ssa-ccp (visit_assignment): Test is_gimple_min_invariant
3665 after munging bitfields.
3666 * tree-ssa-dom.c (record_equivalences_from_stmt): Similarly.
3668 2003-12-17 Jan Hubicka <jh@suse.cz>
3670 Based on patch by Dale Johannesen
3671 * expr.c (MOVE_RATIO, CLEAR_RATIO): Move to ...
3672 * expr.h (MOVE_RATIO, CLEAR_RATIO): ... here
3674 2003-12-17 Jan Hubicka <jh@suse.cz>
3676 * Makefile.in (sibcall.o): Kill.
3677 (tree-tailcall.o): Add except.h dependency
3679 (purge_reg_equiv_notes, purge_mem_unchanging_flag): Move to ...
3680 * calls.c (purge_reg_equiv_notes, purge_mem_unchanging_flag) ... here.
3681 (expand_call): Do not produce placeholders; do not deal with tail
3682 recursion; set tail_call_emit.
3683 (fixup_tail_calls): New.
3684 * expr.h (fixup_tail_calls): Declare.
3685 * toplev.c (rest_of_handle_sibling_calls): Kill.
3686 (rest_of_compialtion): Do not use rest_of_handle_sibling_calls;
3687 call fixup_tail_calls.
3688 * tree-dump.c (dump_files): Add tail2
3689 * tree-flow.h (tree_optimize_tail_calls): Update prototype.
3690 * tree-optimize.c (optimize_function_tree): Do tail optimization twice.
3691 * tree-tailcall.c: Inlucde except.h
3692 (suitable_for_tail_call_opt_p): New.
3693 (optimize_tail_call): Add opt_tailcalls argument; optimize tailcalls.
3694 (tree_optimize_tail_calls): Add opt_tailcalls/pass arguments.
3695 * tree.h (CALL_EXPR_TAILCALL): New.
3696 (tree_dump_index): Add tail2
3697 * function.h (struct function): Add tail_call_emit field.
3699 2003-12-17 Jan Hubicka <jh@suse.cz>
3701 * tree-inline.c (estimate_num_insns_1): Check that all nodes are
3702 known; add missing nodes; fix MODIFY_EXPR
3704 2003-12-16 Jason Merrill <jason@redhat.com>
3707 * stor-layout.c (layout_type): Just return if type is
3709 * c-decl.c (grokdeclarator): Immediately layout an
3710 ARRAY_TYPE used in a pointer-to-array declarator.
3712 2003-12-16 Diego Novillo <dnovillo@redhat.com>
3714 * tree-dfa.c (may_alias_p): If VAR and PTR are pointers with the
3715 same alias set, return false.
3716 (get_memory_tag_for): Group based on alias set classes, not on
3717 conflicting alias sets.
3718 * tree-must-alias.c (promote_var): Don't bring aliases over when
3719 all the may-aliases of a non-promotable variable are promoted.
3721 2003-12-16 Andrew MacLeod <amacleod@redhat.com>
3723 * tree-flow-inline.h (free_vuse, free_vdefs): Moved to
3725 (get_def_ops, get_use_ops, get_vdef_ops, get_vuse_ops): Use the new
3726 more direct structure pointer.
3727 (get_use_op_ptr, get_def_op_ptr): Cast is no longer necessary.
3728 * tree-flow.h (struct stmt_ann_d): Replace operands and voperands
3729 pointers with pointers directly to the operand types.
3730 * tree-ssa-dom.c (cprop_into_stmt): Use new stmt based interface to
3731 free virtual operands. Check virtual bases of both VUSE and VDEF.
3732 * tree-ssa-operands.c (struct voperands_d): Declare here, used only
3733 for previous_vops during stmt operand construction.
3734 (struct vecmanage_d, vecmanage_add_segmen, vecmanage_add_special,
3735 vecmanage_init, vecmanage_tree_ptr_init, vecmanage_fini, check_free,
3736 vecmanage_new_vector, vecmanage_new_tree_ptr_vector,
3737 vecmanage_free_vector): Remove.
3738 (allocate_ssa_op_vec, free_ssa_op_vec, allocate_ssa_virtual_op_vec,
3739 allocate_operands_t, allocate_voperands_t): Remove.
3740 (finalize_new_ssa_operands, inalize_new_ssa_virtual_operand): Remove.
3741 (struct freelist_d): New. List of free operand structures.
3742 (check_optype_freelist): New. Choose memory from freelist, if available.
3743 (add_optype_freelist): New. Add structure to freelist, if appropriate.
3744 (allocate_def_optype): New. Allocate a def operand list from GC.
3745 (allocate_use_optype): New. Allocate a useoperand list from GC.
3746 (allocate_vdef_optype): New. Allocate a vdef operand list from GC.
3747 (allocate_vuse_optype): New. Allocate a vuse operand list from GC.
3748 (free_uses, free_defs, free_vuses, free_vdefs): Use GC and the freelist.
3749 (remove_vuses, remove_vdefs): New. External interface to remove virtual
3751 (init_ssa_operands, fini_ssa_operands): Ensure the free list is empty.
3752 (finalize_ssa_defs, finalize_ssa_use, finalize_ssa_vdefs,
3753 finalize_ssa_vuses): Use new direct pointers from the stmt annotation.
3754 (append_vdef, append_vuse): No need to hack prev_vops pointer now.
3755 (get_stmt_operands): use new freeing interface, keep previous vops in
3756 their own local structure for now, passing its address around.
3757 * tree-ssa-operands.h (struct def_optype_d, struct use_optype_d,
3758 struct vdef_optype_d, struct vuse_optype_d): Implement as a single
3759 dynamically allocated structure.
3760 (struct operands_d, struct operands_d): Remove.
3761 * tree-ssa-pre.c (subst_phis): Remove virtual operands using new funcs.
3763 2003-12-16 Jan Hubicka <jh@suse.cz>
3765 * tree-cfg.c (verify_addr_expr): Rename to ....
3766 (verify_expr): ... this one; check that no SSA names are on
3768 (verify_stmt, verify_stmts): Update calls of verify_addr_expr.
3770 Revert until initializers are made language independent:
3771 * cgraphunit.c (record_call_1): Do not call analyze_expr hook
3772 * langhooks-def.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Kill.
3773 (LANG_HOOKS_CALLGRAPH_INITIALIZER): Update.
3774 * longhooks.h (lang_hooks_for_callgraph): Kill analyze_expr.
3776 2003-12-16 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
3778 * tree-pretty-print.c (dump_bb_header): Show block number when
3780 (pp_cfg_jump): Show labels in addition to block numbers.
3781 (dump_generic_bb_buff): Always call dump_bb_header.
3783 2003-12-16 Jan Hubicka <jh@suse.cz>
3785 * cgraphunit.c (cgraph_remove_unreachable_nodes): Fix typo;
3786 improve comments; cleanup linked list mantenance.
3788 2003-12-15 Diego Novillo <dnovillo@redhat.com>
3790 * tree-sra.c (can_be_scalarized_p): Reject volatile variables.
3792 * sibcall.c (skip_copy_to_return_value): Initialize 'hardret' and
3795 2003-12-16 Jan Hubicka <jh@suse.cz>
3797 * cgraph.c (cgraph_remove_node): Ignore DECL_EXTERNAL clones.
3798 * cgraphunit.c (verify_cgraph_node): Do not insist on unemmited extern
3799 inline functions to be valid.
3800 (cgraph_finalize_compilation_unit): Fix ordering.
3801 (cgraph_mark_functions_to_output): Do not insist on DECL_EXTERNAL
3802 nodes to be reclaimed.
3803 (cgraph_remove_unreachable_nodes): New function.
3804 (cgraph_decide_inlining): use it.
3806 2003-12-15 Andrew MacLeod <amacleod@redhat.com>
3808 * Makefile.in (TREE_FLOW_H): Add dependence on tree-ssa-operands.h
3809 (OBJS-common): Add tree-ssa-operands.o
3810 (tree-ssa-operands.o): Add dependencies.
3811 (GTFILES): Add tree-ssa-operands.[ch].
3812 * tree-dfa.c (get_stmt_operands, get_expr_operands, add_stmt_operand,
3813 note_addressable, add_def, add_use, add_vde, add_vuse,
3814 add_call_clobber_ops, add_call_read_ops): Moved to tree-ssa-operands.c.
3815 (compute_immediate_uses_for_stmt): Use new optypes interface.
3816 (cleanup_operand_arrays): Delete.
3817 (collect_dfa_stats_r): Use new optypes interface.
3818 (get_call_flags): Moved to tree-ssa-operands.c.
3819 (vdefs_disappeared_p, mark_new_vars_to_rename): Use optypes interface.
3820 * tree-flow-inline.h (def_ops, use_ops, vdef_ops, vuse_ops): Use new
3822 (free_vuses): New. Clear and release vuses.
3823 (free_vdefs): New. Clear and release vdefs.
3824 (get_use_ops_ptr): New. Get address of a use op.
3825 (get_def_ops_ptr): New. Get address of a use op.
3826 (get_vdef_result_ptr): New. Get address of a use op.
3827 (get_vdef_op_ptr): New. Get address of a use op.
3828 (get_vuse_op_ptr): New. Get address of a use op.
3829 (start_ssa_stmt_operands): New. Entry point to start processing stmt
3831 * tree-flow.h (struct operands_d, struct voperands_d): Move to
3833 (struct stmt_ann_d): Add GTY markers to operands.
3834 * tree-pretty-print.c (dump_vops): Use optypes interface.
3835 * tree-sra.c (create_scalar_copies): Use optypes interface.
3836 (scalarize_structures, scalarize_modify_exp): Use optypes interface.
3837 * tree-ssa-ccp.c (visit_stmt, ccp_fold, initialize, replace_uses_in,
3838 likely_value, set_rhs): Use optypes interface.
3839 * tree-ssa-dce.c (find_useful_stmts, stmt_useful_p, process_worklist):
3840 Use optypes interface.
3841 * tree-ssa-dom.c (thread_across_edge, thread_jumps_walk_stmts): Use
3843 (cprop_into_stmt): Rewrite using new interface.
3844 (eliminate_redundant_computations, record_equivalences_from_stmt,
3845 optimize_stmt, avail_expr_hash, avail_expr_eq): Use optypes interface.
3846 * tree-ssa-live.c (create_ssa_var_map, calculate_live_on_entry,
3847 build_tree_conflict_graph,register_ssa_partitions_for_vars): Use
3849 * tree-ssa-pre.c (names_match_p, maybe_find_rhs_use_for_var,
3850 expr_phi_insertion, same_e_version_real_occ_real_occ, opnum_of_phi,
3851 generate_expr_as_of_bb, generate_vops_as_of_bb, subst_phis,
3852 load_modified_real_occ_real_occ, same_e_version_phi_result, can_insert,
3853 get_default_def, reaching_def, process_left_occs_and_kills,
3854 collect_expressions): Use optypes interface.
3855 * tree-ssa.c (mark_def_sites, check_replaceable, find_replaceable_in_bb,
3856 dump_replaceable_exprs, rewrite_trees, verify_ssa, rewrite_stmt): Use
3858 (init_tree_ssa): Initialize new operand data structures.
3859 (delete_tree_ssa): Free new operand structures.
3860 * tree.h (VDEF_RESULT, VDEF_OP, NUM_VDEFS): Move to tree-ssa-operands.h.
3862 * tree-ssa-operands.h: New file.
3863 (struct def_optype_d): New. Structure for stmt defs.
3864 (struct use_optype_d): New. Structure for stmt uses.
3865 (struct vdef_optype_d): New. Structure for stmt vdefs.
3866 (struct vuse_optype_d): New. Structure for stmt vuses.
3867 (USE_OPS, STMT_USE_OPS, NUM_USES, USE_OP_PTR, USE_OP): Macros to
3869 (DEF_OPS, STMT_DEF_OPS, NUM_DEFS, DEF_OP_PTR, DEF_OP): Macros to
3871 (VDEF_OPS, STMT_VDEF_OPS, NUM_VDEFS, VDEF_RESULT_PTR, VDEF_RESULT,
3872 VDEF_OP_PTR, VDEF_OP): Macros to access stmt vdefs.
3873 (VUSE_OPS, STMT_VUSE_OPS, NUM_VUSES, VUSE_OP_PTR, VUSE_OP): Macros to
3875 (struct operands_d, struct voperands_d): moved from tree-dfa.c.
3876 * tree-ssa-operands.c: New file.
3877 (build_defs, build_uses, build_vdefs, build_vuses): New static varrays.
3878 (struct vecmanage_d): New. Struct to manage non-GC vectors.
3879 (vecmanage_add_segment): New. Add a new segment to a vector manager.
3880 (vecmanage_add_special): New. Add a large vector to the special list.
3881 (vecmanage_init): Initialize a vector manager.
3882 (vecmanage_tree_ptr_init): New. Initialize a vector manager for tree *.
3883 (vecmanage_fini): New. Release vector manager memory.
3884 (check_free): New. Look for free memory in the vector maanger.
3885 (vecmanage_new_vector): New. Allocate a vector.
3886 (vecmanage_new_tree_ptr_vector): New. Allocate a vector of 'tree *'.
3887 (vecmanage_free_vector): New. Free a vector.
3888 (free_ssa_op_vec): New. Free an ssa operand's memory.
3889 (allocate_ssa_op_vec): New. Allocate a vector for use/defs.
3890 (allocate_ssa_virtual_op_vec): New. Allocate a vector for vuse/vdefs.
3891 (allocate_operands_t): New. Allocate an operand structure.
3892 (allocate_voperands_t): New. Allocate a virtual operand structure.
3893 (free_uses): New. Clear and release uses.
3894 (free_defs): New. Clear and release defs.
3895 (init_ssa_operands): New. Initialize ssa operand management.
3896 (fini_ssa_operands): New. Cleanup ssa operand management.
3897 (finalize_new_ssa_operands): New. Commit current operands.
3898 (finalize_new_ssa_virtual_operands): New. Commit current virtual ops.
3899 (finalize_ssa_defs): New. Commit and verify stmt definitions.
3900 (finalize_ssa_uses): New. Commit and verify stmt uses.
3901 (finalize_ssa_vdefs): New. Commit and verify stmt virtual definitions.
3902 (finalize_ssa_vuses): New. Commit and verify stmt virtual uses.
3903 (finalize_ssa_stmt_operands): New. Commit all stmt operands.
3904 (verify_start_operands): New. Verify build mechanism is ready for a new
3906 (append_def): Renamed from add_def, and moved from tree-dfa.c.
3907 (append_use): Renamed from add_def, and moved from tree-dfa.c.
3908 (append_vdef): Renamed from add_def, and moved from tree-dfa.c.
3909 (append_vuse): Renamed from add_def, and moved from tree-dfa.c.
3910 (add_vuse): New. Entry point to add a vuse to a stmt.
3911 (get_call_flags): Moved from tree-dfa.c
3912 (get_stmt_operands, get_expr_operands, add_stmt_operand): Moved from
3913 tree-dfa.c, and use new optype interface.
3914 (note_addressabe, add_call_clobber_ops, add_call_read_ops): Moved from
3917 2003-12-15 Diego Novillo <dnovillo@redhat.com>
3919 * tree-optimize.c (optimize_function_tree): Call BITMAP_XFREE.
3921 2003-12-15 Diego Novillo <dnovillo@redhat.com>
3923 PR optimization/12747
3925 * tree-cfg.c (verify_addr_expr): Simplify predicates.
3926 * tree-must-alias.c (addresses_needed): Declare as file local.
3927 (can_be_promoted): New.
3928 (tree_compute_must_alias): Call it.
3929 Remove promoted variables from call_clobbered_vars.
3930 (find_addressable_vars): Update comment.
3931 Remove argument. Update callers.
3932 (promote_var): Always clear TREE_ADDRESSABLE.
3933 Don't remove promoted variables from call_clobbered_vars.
3934 If the promoted variable is in the may-alias set of a
3935 non-promotable variable, copy its alias set into the alias set of
3936 the non-promotable variable.
3937 (find_variable_in): Update comment.
3938 * tree-sra.c (can_be_scalarized_p): Reject structures with
3939 __complex__ fields in them.
3941 2003-12-15 Diego Novillo <dnovillo@redhat.com>
3942 Jason Merrill <jason@redhat.com>
3944 PR optimization/12747
3946 * Makefile.in (tree-simple.o): Add dependency on bitmap.h and
3948 (GTFILES): Add tree-simple.c.
3949 * tree-simple.c: Include ggc.h and bitmap.h.
3950 (is_gimple_non_addressable_1): Remove. Update all callers.
3951 (types_checked): New local variable.
3952 (types_in_memory): New local variable.
3953 (struct_needs_to_live_in_memory): New.
3954 (needs_to_live_in_memory): New.
3955 (is_gimple_reg): Call it.
3956 (is_gimple_non_addressable): Call it.
3957 (is_gimple_call_clobbered): Call it.
3958 * tree-simple.h (needs_to_live_in_memory): Declare.
3960 2003-12-14 Andreas Jaeger <aj@suse.de>
3962 * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Handle
3965 2003-12-14 Jan Hubicka <jh@suse.cz>
3967 * cgraphunit.c (cgraph_expand_function): Release function body when no
3969 (lookup_recursive_calls): New function.
3970 (cgraph_decide_recursive_inlining): Likewise.
3971 (cgraph_decide_inlining_of_small_functions): Do recursive inlining.
3972 * tree-inline.c: Include function.h
3973 (copy_body): Choose saved body for recursive inlining.
3974 (initialize_inlined_parameters): Likewise.
3975 (expand_call_inline): Do not verify nodes when recursivly inlining,
3976 insert ret_label into decl map.
3977 * params.def (PARAM_MAX_INLINE_INSNS_RECURSIVE,
3978 PARAM_MAX_INLINE_INSNS_RECURSIVE_AUTO,
3979 PARAM_MAX_INLINE_RECURSIVE_DEPTH,
3980 PARAM_MAX_INLINE_RECURSIVE_DEPTH_AUTO): New argument.
3981 * invoke.texi (max-inline-insns-recursive, max-inline-recursive-depth):
3983 * Makefile.in (tree-inline.o): Include function.h.
3985 2003-12-14 Jan Hubicka <jh@suse.cz>
3987 * cgraphunit.c (record_call_1): Do not call analyze_expr hook
3988 * langhooks-def.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Kill.
3989 (LANG_HOOKS_CALLGRAPH_INITIALIZER): Update.
3990 * longhooks.h (lang_hooks_for_callgraph): Kill analyze_expr.
3992 2003-12-13 Jan Hubicka <jh@suse.cz>
3994 * timevar.def (TV_TREE_STMT_VERIFY, TV_CFG_VERIFY, TV_CGRAPH_VERIFY):
3996 * tree-cfg.c (verify_stmts): Push/pop timevar.
3997 * cfg.c: Include timevar.h
3998 (verify_flow_info): Push/pop timevar.
3999 * Makefile.in (cfg.o): Add dependnecy on TIMEVARS
4001 * cgraph.c (cgraph_create_edge): Sanity check for duplicates;
4003 (cgraph_remove_node): Decrease cgraph_n_nodes; do not clear
4004 DECL_SAVED_TREE when dumping.
4005 (cgraph_dump_node): Break out from ...; print more information.
4006 (cgraph_dump): ... here.
4007 * cgraph.h (cgraph_node): Add aux field.
4008 (dump_cgraph_node, verify_cgraph, verify_cgraph_node): Declare.
4009 (cgraph_mark_inline_edge): Declare
4010 * cgraphunit.c (error_found): New static variable.
4011 (verify_cgraph_node_1): New static function.
4012 (verify_cgraph_node, verify_cgraph): New global function.
4013 (cgraph_expand_function): More sanity checks.
4014 (cgraph_clone_inline_nodes): Destructivly clone DECL_EXTERNAL nodes.
4015 (cgraph_mark_inline_edge): Make global.
4016 (cgraph_decide_inlining): Remove extern inline functions never inlined.
4017 (cgraph_decide_inlining_incrementally): Verify that function body is
4019 (expand_all_functions): Verify that all nodes are reachable.
4020 (cgraph_optimize): Verify cgraph and memory management.
4021 * tree-inline.c (copy_body_r): All edges must be present.
4022 (expand_call_inline): Sanity check newly created edges and nodes
4024 (optimize_inline_calls): Sanity check that we've inlined everything.
4025 * tree-optimize.c (tree_rest_of_compilation): Clone functions inlined
4028 2003-12-13 Jan Hubicka <jh@suse.cz>
4030 * tree-flow.h (tree_ssa_useless_type_conversion_1): Declare.
4031 * tree-flow.c (tree_ssa_useless_type_conversion_1): Break out from
4032 from...; allow complex types whose subtypes match.
4033 (tree_ssa_useless_type_conversion): ... here.
4035 2003-12-12 Jeff Law <law@redhat.com>
4037 * tree-ssa-dom.c (optimize_stmt): Don't call cleanup_control_expr
4038 here. Instead just note that we need to cleanup the cfg (which
4041 * timevar.def (TV_TREE_SSA_THREAD_JUMPS): Kill.
4042 * tree-dump.c (dump_files): Kill .thread dump.
4043 * tree.h (TDI_thread_jumps): Kill.
4044 * tree-flow.h (tree_ssa_dominator_thread_jumps): Kill prototype.
4045 * tree-optimize.c (optimize_function_tree): Kill call to
4046 tree_ssa_dominator_thread_jumps.
4047 * tree-ssa-dom.c (thread_through_phis): Kill. We no longer need
4048 to restrict threading through PHIs.
4049 (tree_ssa_dominator_thread_jumps): Kill.
4050 (tree_ssa_domiantor_optimize_1): Fold back into
4051 tree_ssa_dominator_optimize.
4052 (tree_ssa_dominator_optimize): Mark back edges in the flow graph.
4053 Kill code which conditionalized the walk_tree callbacks based
4054 on thread_through_phis. When threading jumps, reorganize code
4055 so that we can take the affected variables out of SSA form.
4056 Mark new variables created by out-of-ssa code as needing to be
4058 (thread_across_edge): Always allow threading through phis.
4059 (thread_jumps_walk_stmts): Kill.
4061 * tree-ssa.c (create_temp): When we create a new temporary, make
4062 sure to put it into referenced_vars, give it an ID number and
4064 (eliminate_build): If we encounter a PHI argument which is an
4065 SSA_VAR we are not rewriting out of SSA form, then just treat
4067 (rewrite_vars_out_of_ssa): New function.
4068 * tree-flow.h (rewrite_vars_out_of_ssa): Prototype.
4069 * tree-ssa-live.c (register_ssa_partitions_for_vars): New function.
4070 * tree-ssa-live.h (register_ssa_partitions_for_vars): Prototype.
4072 2003-12-12 Jan Hubicka <jh@suse.cz>
4074 * tree-inline.c (remap_decl): Avoid invalid sharing.
4075 * cp-tree.h (optimize_function): Kill.
4076 * optimize.c (optimize_function): Kill.
4077 * semantics.c (expand_body): Do not call optimize_function.
4079 2003-12-12 Jan Hubicka <jh@suse.cz>
4081 * cgraphunit.c (cgraph_optimize): Do not decide inlining when not
4084 2003-12-11 Jan Hubicka <jh@suse.cz>
4086 * tree-inline.c (initialize_inlined_parameters): Disable
4087 constant propagation for non-gimple-min-invariant when
4088 preserving gimple form.
4090 2003-12-11 Jeff Law <law@redhat.com>
4092 * tree-ssa-ccp.c (widen_bitfield): Clear out unwanted high bits
4093 even if the field's type is unsigned.
4094 * tree-ssa-dom.c (record_equivalences_from_stmt): When creating
4095 equivalences from stores, be more careful about non-constant
4096 stores to bitfields.
4098 2003-12-11 Diego Novillo <dnovillo@redhat.com>
4100 * opts.c (decode_options): Do not enable the tree loop optimizer by
4102 * tree-ssa-loop.c (tree_ssa_loop_opt): Remove ENABLE_CHECKING
4105 2003-12-10 Richard Henderson <rth@redhat.com>
4107 * builtins.c (expand_builtin_profile_func): New.
4108 (expand_builtin): Use it.
4109 * builtins.def (BUILT_IN_PROFILE_FUNC_ENTER): New.
4110 (BUILT_IN_PROFILE_FUNC_EXIT): New.
4111 * function.c (expand_function_start, expand_function_end): Don't
4112 do function instrumentation here.
4113 * gimplify.c (gimplify_function_tree): Do it here.
4115 * c-opts.c (c_common_post_options): Don't ever use rtl inlining.
4117 2003-12-10 Diego Novillo <dnovillo@redhat.com>
4119 * ifcvt.c (dead_or_predicable): Initialize local variable
4121 * tree-cfg.c (verify_stmt): Fix typo.
4122 * tree-ssa-dom.c (propagate_value): New local function.
4123 (cprop_into_stmt): Call it.
4124 (cprop_into_phis): Call it.
4125 (eliminate_redundant_computations): Call it.
4127 2003-12-10 Dale Johannesen <dalej@apple.com>
4129 * tree-dfa.c (compute_alias_sets): Don't try to make
4130 GLOBAL_VAR alias itself.
4132 2003-12-08 Steven Bosscher <stevenb@suse.de>
4134 * tree-must-alias.c (tree_compute_must_alias): Use
4135 num_call_clobbered_vars and call_clobbered_var() instead of
4136 poking in the call_clobbered_vars varray directly.
4138 2003-12-11 Jan Hubicka <jh@suse.cz>
4140 * cgraph.c (cgraph_function_possibly_inlined_p): Fix syntax error on
4143 2003-12-10 Diego Novillo <dnovillo@redhat.com>
4147 2003-12-07 Richard Henderson <rth@redhat.com>
4149 * c-common.c (c_address_looks_like_offsetof): New.
4150 * c-common.h (c_address_looks_like_offsetof): Declare.
4151 * c-typeck.c (build_unary_op) <ADDR_EXPR>: Use it. Don't lower
4152 address references not destined for offsetof.
4153 (c_expand_return): Only look inside ARRAY_REF and COMPONENT_REF
4154 when looking for returning address of local variable.
4155 * expr.c (expand_expr_1): Don't dereference size
4156 of unbounded arrays.
4157 * gimplify.c (gimplify_addr_expr): Only fold
4158 address of variable size array elements.
4159 * tree-simple.c (is_gimple_min_invariant): Also check
4160 is_gimple_variable before disallowing offset address for type.
4161 * tree-ssa-ccp.c (maybe_fold_offset_to_aggregate_ref): New.
4162 (maybe_fold_offset_to_component_ref): Use it.
4163 (maybe_fold_stmt_indirect, maybe_fold_stmt_plus): Likewise.
4164 (maybe_fold_offset_to_array_ref): Likewise.
4165 Don't fail for division remainder non-zero.
4166 * varasm.c (initializer_constant_valid_p) <ADDR_EXPR>: Use
4167 handled_component_p and look inside references.
4168 <MINUS_EXPR>: Always look past widening casts.
4170 2003-12-09 Jan Hubicka <jh@suse.cz>
4172 * cgraph.c (cgraph_inline_hash): New global variable.
4173 (cgraph_create_node): Break out of ....
4174 (cgraph_node): ... this one.
4175 (cgraph_redirect_edge_callee): New function.
4176 (cgraph_remove_node): Aggressively elliminate dead nodes;
4177 remove node out of clone list.
4178 (dump_cgraph): Dump inlined_to field; dump uid numbers.
4179 (cgraph_clone_edge): Return edge created.
4180 (cgraph_clone_node): New.
4181 (cgraph_function_possibly_inlined_p): Re-implement using hashtable.
4182 * cgraph.h: Include hashtab.h
4183 (struct cgraph_global_info): Kill inline_once, will be output and
4184 cloned_times fields. Add inlined_to field.
4185 (cgraph_node): Add next_clone.
4186 (cgraph_inline_hash): Declare.
4187 (cgraph_clone_edge): Update prototype.
4188 (cgraph_clone_node, cgraph_redirect_callee): Declare.
4189 * cgraphunit.c (cgraph_optimize_function): Kill.
4190 (cgraph_assemble_function): Kill next_needed to avoid GGC corruption.
4191 (cgraph_analyze_function): Do not intialize cloned_times and
4193 (cgraph_finalize_compilation_unit): Clear next_needed.
4194 (cgraph_optimize_function): Kill.
4195 (cgraph_expand_function): Do not use cgraph_optimize_function.
4196 (cgraph_estimate_growth, cgraph_mark_inline,
4197 cgraph_check_inline_limits, cgraph_recursive_inlining_p,
4198 cgraph_preserve_function_body_p): Update for explicit clones.
4199 (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into,
4200 cgraph_inlined_callees, struct cgraph_inline_context,
4201 cgraph_create_inline_context, cgraph_free_inline_context,
4202 cgraph_inline_context_set_caller, cgraph_inline_context_clear_caller,
4203 cgraph_inline_context_set_callee, cgraph_inline_context_clear_callee,
4204 update_callee_keys): Kill.
4205 (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge): New.
4206 (cgraph_decide_inlining_of_small_functions, (cgraph_decide_inlining,
4207 cgraph_decide_inlining_incrementally): Simplify.
4208 * tree-inline.c (typedef struct_inline_data): New field saving_p.
4209 (copy_body_r): Update all clones.
4210 (expand_call_inline): Remove inlined cgraph node.
4211 (save_body): Inicialize id.node and id.saving_p.
4212 * tree-optimize.c (tree_rest_of_compilation): Maintain clone up-to-date
4213 in no-unit-at-a-time mode.
4215 2003-12-08 Steven Bosscher <stevenb@suse.de>
4217 * tree-optimize.c (optimize_function_tree): Move verify_ssa calls
4220 2003-12-08 Daniel Berlin <dberlin@dberlin.org>
4222 * tree-alias-ander.c (andersen_same_points_to_set): Fix memory leak.
4224 2003-12-08 Jeff Law <law@redhat.com>
4226 * tree-ssa-live.c (register_ssa_partition): Kill legacy code which
4227 recursively called register_ssa_partition on PHI arguments when
4228 SSA_VAR was defined by a PHI_NODE.
4230 2003-12-08 Jan Hubicka <jh@suse.cz>
4232 * tree-dump.c (dump_files): Fix ordering of tail call pass.
4233 * tree.h (tree_dump_index): Likewise.
4235 2003-12-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
4237 * Makefile.in (tree-cfg.o): Add gt-tree-cfg.h dependency.
4238 (GTFILES): Add tree-cfg.c.
4239 * tree-cfg.c: Include gt-tree-cfg.h.
4240 (factored_computed_goto_label, factored_computed_goto):
4243 2003-12-08 Steven Bosscher <stevenb@suse.de>
4244 Jan Hubicka <jh@suse.de>
4246 * gengtype-lex.l (IWOrD): Add HOST_WIDEST_INT
4247 * Makefile.in (function.o, reg-stack.o): Add missing dependency on
4249 (GTFILES): Add basic-block.h and hwint.h.
4250 * basic-block.h (struct edge_def): Add GTY markers, make garbage
4251 collectable. Make `insns' field GC safe depending on the setting
4253 (struct basic_block_def): Add GTY markers, make garbage collectable.
4254 (tree_bb_root, tree_phi_root): Kill extern decls.
4255 (ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Change from macro to variable
4256 (entry_exit_blocks): Kill.
4257 * cfg.c: Include ggc.h
4258 (bb_pool, edge_pool, entry_exit_blocks): Kill.
4259 (ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Define.
4260 (init_flow): Do not create ppols; allocate entry/exit block.
4261 (free_edge, alloc_block, expunge_block, unchecked_make_edge): Use GGC.
4262 (compact_blocks): Don't update tree_bb_root and tree_phi_root.
4263 * cfgrtl.c (rtl_merge_blocks): Clear head pointer.
4264 * regs.h: Protect against multiple inclusion.
4265 * tree-cfg.c (obstack_tree_ann_obstack, first_block_tree_and_obj,
4266 tree_bb_root): Kill.
4267 (build_tree_cfg, create_bb, remove_bb, delete_tree_cfg): Don't
4268 touch tree_bb_root and tree_phi_root.
4269 (create_block_annotations): Do not initialize obstack.
4270 (free_block_annotations): Do not free obstack.
4271 (create_block_annotation): Use GGC.
4272 * tree-dfa.c (tree_phi_root): Kill.
4273 * tree-flow.h (bb_ann, bb_ann_d): Declare. Add `phi_nodes' field.
4274 * tree-phinodes.c (create_phi_node, add_phi_arg, remove_phi_node,
4275 remove_all_phi_nodes_for): Use `phi_nodes' field in the bb
4276 annotation instead of tree_phi_root.
4277 * tree-flow-inline.h (phi_nodes, set_phi_nodes): Likewise.
4278 (add_dom_child, clear_dom_children): Use GGC.
4279 * tree-ssa-pre.c (code_motion): Use `phi_nodes' field in the bb
4280 annotation instead of tree_phi_root.
4281 * varray.h (union varray_data): Make basic_block_def and edge_def
4282 varrays garbage collectable.
4284 2003-12-07 Richard Henderson <rth@redhat.com>
4286 * c-common.c (c_address_looks_like_offsetof): New.
4287 * c-common.h (c_address_looks_like_offsetof): Declare.
4288 * c-typeck.c (build_unary_op) <ADDR_EXPR>: Use it. Don't lower
4289 address references not destined for offsetof.
4290 (c_expand_return): Only look inside ARRAY_REF and COMPONENT_REF
4291 when looking for returning address of local variable.
4292 * expr.c (expand_expr_1): Don't dereference size of unbounded arrays.
4293 * gimplify.c (gimplify_addr_expr): Only fold address of variable size
4295 * tree-simple.c (is_gimple_min_invariant): Also check
4296 is_gimple_variable before disallowing offset address for type.
4297 * tree-ssa-ccp.c (maybe_fold_offset_to_aggregate_ref): New.
4298 (maybe_fold_offset_to_component_ref): Use it.
4299 (maybe_fold_stmt_indirect, maybe_fold_stmt_plus): Likewise.
4300 (maybe_fold_offset_to_array_ref): Likewise. Don't fail for division
4302 * varasm.c (initializer_constant_valid_p) <ADDR_EXPR>: Use
4303 handled_component_p and look inside references.
4304 <MINUS_EXPR>: Always look past widening casts.
4306 2003-12-07 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
4308 * tree-cfg.c (compute_dominance_frontiers): Don't assume that
4309 the first block has index 0.
4311 2003-12-07 Jan Hubicka <jh@suse.cz>
4313 * cgraph.c (create_edge): Rename to ...
4314 (cgraph_create_edge): ... this one; accept call_expr as operand.
4315 (cgraph_edge): New function
4316 (cgraph_remove_edge): Use edge as argument
4317 (cgraph_record_call, cgraph_remove_call): Kill.
4318 (clone_cgraphedge): New function.
4319 * cgraph.h (cgraph_edge): Add call_expr argument; add chain_next.
4320 (cgraph_record_call, cgraph_remove_call): Kill prototype.
4321 (cgraph_remove_call, cgraph_inline_p): Update prototype.
4322 (cgraph_clone_edge): Declare.
4323 * cgraphunit.c (cgraph_finalize_function): Update use of
4325 (record_call_1): Use cgraph_create_edge; record builtins too.
4326 (cgraph_create_edges): Accept node instead of decl.
4327 (cgraph_analyze_function): Update use cgraph_create_edges.
4328 (cgraph_inline_p): Accept edge.
4329 * tree-inline.c (inline_data): Replace decl and current_decl
4330 by node and current_node.
4331 (copy_body_r): Clone edges.
4332 (expand_call_inline): Do not create inlined edges.
4333 (optimize_inline_call): Set id->current_node, id->node.
4334 * tree-optimize.c (tree_rest_of_compilation): Update cgraph edges after
4337 2003-12-07 Diego Novillo <dnovillo@redhat.com>
4339 * tree-ssa-loop.c (dump_file, dump_flags): Only declare with
4341 (tree_ssa_loop_opt): Mark arguments with ATTRIBUTE_UNUSED.
4343 2003-12-07 Richard Henderson <rth@redhat.com>
4345 * function.h (struct function): Add last_label_uid.
4346 * tree-cfg.c (set_bb_for_stmt): Use it.
4347 (delete_tree_cfg): Clear label_to_block_map.
4349 * gimple-low.c (lower_stmt_body): Export.
4350 (lower_stmt): Allow data to be null.
4351 * gimplify.c (declare_tmp_vars): Make static.
4352 (push_gimplify_context): Export.
4353 (pop_gimplify_context): Export. Put the temps somewhere.
4354 (gimplify_body): Don't declare_tmp_vars here.
4355 * tree-flow.h, tree-simple.h: Update for new decls.
4357 * tree-mudflap.c (mf_build_string): New.
4358 (mudflap_c_function_decls): Push and pop gimplify context, don't
4359 gimplify here. Dump pass 1.
4360 (mudflap_c_function_ops): Similarly.
4361 (mf_decl_cache_locals): Gimplify eveything as we go along.
4362 (mf_build_check_statement_for): Likewise.
4363 (mf_mostly_copy_tree_r): Remove.
4364 (mf_varname_tree): Use mf_build_string.
4365 (mf_file_function_line_tree): Rewrite.
4366 (mf_offset_expr_of_array_ref): Remove.
4367 (mx_xfn_indirect_ref): Remove.
4368 (mf_xform_derefs_1): New.
4369 (mf_xform_derefs): Rewrite to expect gimple.
4370 (mx_register_decls): Use build_function_call_expr.
4371 (mudflap_enqueue_constant): Use mf_build_string.
4372 * tree-optimize.c (tree_rest_of_compilation): Reorder mudflap bits.
4373 * tree-dump.c (dump_files): Split mudflap to parts 1 and 2.
4374 * tree.h (enum tree_dump_index): Likewise.
4376 2003-12-06 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
4378 * tree-ssa-loop.c: New.
4379 * Makefile.in (tree-ssa-loop.o): New.
4380 * common.opt (ftree-loop-optimize): Add.
4381 * flags.h (flag_tree_loop): Declare.
4382 * opts.c (decode_options): Enable flag_tree_loop at -O1.
4383 (common_handle_option): Handle OPT_ftree_loop_optimize.
4384 * timevar.def (TV_TREE_LOOP): New.
4385 * toplev.c (flag_tree_loop): New.
4386 (f_options): Add -ftree-loop-optimize.
4387 * tree-cfg.c (build_tree_cfg): Remove disabled loop optimizer
4389 (tree_make_forwarder_block): Update phi nodes.
4390 (tree_loop_optimizer_init): Don't call force_single_succ_latches.
4391 (tree_try_redirect_by_replacing_jump): Comment fix.
4392 * tree-dump.c (dump_files): Add .loop dump.
4393 * tree-flow.h (tree_ssa_loop_opt, set_phi_nodes): Declare.
4394 * tree-optimize.c (optimize_function_tree): Call tree_ssa_loop_opt.
4395 * tree.h (enum tree_dump_index): Add TDI_loop.
4396 * tree-flow-inline.h (set_phi_nodes): New.
4397 * doc/invoke.texi (-fdump-tree-loop, -ftree-loop-optimize): Document.
4399 2003-12-05 Jeff Law <law@redhat.com>
4401 * tree-dfa.c (mark_new_vars_to_rename): Change VARS_TO_RENAME to be
4402 a "bitmap" instead of an "sbitmap". Callers updated.
4403 * tree-must-alias.c (promote_var): Likewise.
4404 (tree_compute_must_alias): Likewise.
4405 * tree-phinodes.c (remove_all_phi_nodes_for): Likewise.
4406 * tree-ssa-dom.c (tree_ssa_dominator_thread_jumps): Likewise.
4407 (tree_ssa_dominator_optimize): Likewise.
4408 (tree_ssa_dominator_optimize_1): Likewise.
4409 * tree-ssa-pre.c (pre_expression): Likewise.
4410 (tree_perform_ssapre): Likewise.
4411 * tree-ssa.c (rewrite_into_ssa): Likewise.
4412 (insert_phi_nodes): If VARS_TO_RENAME is zero, then examine
4413 each node to determine if we need to insert a PHI.
4414 (prepare_operand_for_rename): If VARS_TO_RENAME is zero, then
4415 assume the operand needs renaming.
4416 * tree-ssa-ccp.c (substitute_and_fold): Change VARS_TO_RENAME to
4417 be a "bitmap" instead of an "sbitmap". Callers updated.
4418 (tree_ssa_ccp): Likewise. Also make sure timevar_pop encloses
4420 (scalarize_modify_expr): Likewise.
4421 * tree-sra.c (create_scalar_copies): Change VARS_TO_RENAME to
4422 be a "bitmap" instead of an "sbitmap". Callers updated.
4423 (tree_sra): Likewise.
4424 * tree-optimize.c (optimize_function_tree): Make VARS_TO_RENAME
4425 be a "bitmap" instead of an "sbitmap".
4426 * tree-flow.h: Update various prototypes.
4428 2003-12-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
4430 * tree-cfg.c (remove_useless_stmts_goto, remove_useless_stmts): Move
4431 handling of factored_computed_goto ...
4432 (disband_implicit_edges): ... here.
4434 2003-12-05 Jan Hubicka <jh@suse.cz>
4436 * tree-eh.c (tree_could_trap_p): Fix warning.
4437 * expr.c (expand_expr): Fix warning on uninitialized last.
4439 2003-12-04 Jeff Law <law@redhat.com>
4441 * tree-ssa.c (rewrite_trees): Do not unconditionally overwrite
4442 variables set by statements. Let replace_variable do any
4445 2003-12-04 Richard Henderson <rth@redhat.com>
4447 * c-parse.in (primary): Use annotate_with_locus instead of
4448 STMT_LINENO for STMT_EXPR.
4449 * c-simplify.c (gimplify_stmt_expr): Likewise.
4451 2003-12-04 Jan Hubicka <jh@suse.cz>
4453 * tree-dump.c (dump_files): Reorder tailcall and mustalias
4454 * tree.h (tree_dump_index): Likewise.
4455 * tree-optimize.c (optimize_function_tree): Do tail call after mustalias.
4457 2003-12-04 Diego Novillo <dnovillo@redhat.com>
4459 * tree-dfa.c (opf_none, opf_is_def, opf_no_vops): Change to #define.
4461 2003-12-04 Canqun Yang <canqun@nudt.edu.cn>
4463 * stor-layout.c (update_alignment_for_field): Export.
4464 * tree.h (update_alignment_for_field): Declare.
4466 2003-12-03 Andrew Haley <aph@redhat.com>
4468 * tree-eh.c (tree_could_trap_p): Add division instructions.
4469 * expr.c (expand_expr): Check the EH region of an expression and
4470 mark all the insns that result from its expansion with the
4471 appropriate REG_EH_REGION.
4473 2003-12-03 Jan Hubicka <jh@suse.cz>
4475 * tree-cfg.c (verify_addr_expr, verify_stmt, tree_node_shared_p,
4476 verify_stmts): New functions.
4477 (verify_flow_info): Remove PHI checking code.
4478 * tree-flow.h (verify_stmt, verify_stmts): Declare.
4479 * tree-inline.h (walk_tree, walk_tree_without_duplicates): Move
4481 * tree.h (walk_tree, walk_tree_without_duplicates): ... here.
4483 2003-12-03 Jan Hubicka <jh@suse.cz>
4484 Diego Novillo <dnovillo@redhat.com>
4486 * tree-ssa.c (verify_def, verify_use, verify_phi_args): New static
4488 (verify_ssa): New global function.
4489 * tree-flow.h (verify_ssa): Declare.
4490 * tree-optimize.c (optimize_function_tree): Call it.
4492 2003-12-03 Diego Novillo <dnovillo@redhat.com>
4494 * timevar.def (TV_TREE_SSA_VERIFY): New timer.
4495 * tree-sra.c (create_scalar_copies): Always mark the previous
4496 variables on the LHS for renaming.
4497 Do not emit unnecessary assignments from VA_ARG_EXPRs.
4498 (scalarize_modify_expr): Similarly, when scalarizing the LHS of a
4499 COMPONENT_REF assignment.
4500 * tree-must-alias.c (tree_compute_must_alias): Do not promote
4501 variables with hidden uses.
4502 * tree-ssa-ccp.c (set_rhs): When replacing the whole statement, reset
4503 SSA_NAME_DEF_STMT for all the SSA_NAMEs in vdef and def
4506 2003-12-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
4507 Diego Novillo <dnovillo@redhat.com>
4509 * tree-dfa.c (opf_no_vops): New.
4510 (add_stmt_operand): Don't create virtual operands when opf_no_vops
4512 (get_expr_operands): Set opf_no_vops flag before diving into the
4513 operand of an ADDR_EXPR node.
4515 2003-12-03 Richard Henderson <rth@redhat.com>
4517 * tree-simple.c (is_gimple_min_invariant): Disallow offset of
4518 address of a scalar.
4520 * c-parse.in (primary): Set STMT_LINENO on STMT_EXPR.
4521 * c-simplify.c (gimplify_stmt_expr): Be prepared for last_stmt
4524 2003-12-03 Daniel Berlin <dberlin@dberlin.org>
4527 * tree-ssa-pre.c (code_motion): Do phi nodes last, and rearrange
4528 how we decide what temporary to choose so that we get it right.
4530 2003-12-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
4532 * tree-dfa.c (get_expr_operands): Don't record VUSEs for invariant
4535 2003-12-03 Brian Booth <bbooth@redhat.com>
4537 * tree-pretty-print.c (dump_phi_nodes): Removed superfluous ampersand.
4539 2003-12-03 Jeff Law <law@redhat.com>
4541 * ggc-page.c: Resync with mainline sources. Remove tree-ssa
4542 specific hack which disabled special GC pagesizes for 2 operand
4545 * tree-ssa.c (mark_def_sites): Call prepare_operand_for_rename
4546 on the VDEF_RESULT as well, providing a dummy uid argument.
4548 * tree-phinodes.c: Include rtl.h for ceil_log2.
4549 (ideal_phi_node_len): New function.
4550 (resize_phi_node): Make static.
4551 (make_phi_node): Use ideal_phi_node_len.
4552 (add_phi_arg): Likewise.
4553 * tree.h (resize_phi_node): Remove prototype.
4554 * Makefile.in (tree-phinodes.o): Depend on $(RTL_H).
4556 2003-12-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
4558 * tree-cfg.c: (make_edges): Eliminate fallthru to exit.
4559 (make_ctrl_stmt_edges): Nonlocal goto handling moved to
4560 make_goto_expr_edges.
4561 (make_goto_expr_edges): Remove simple gotos.
4562 (cfg_remove_useless_stmts_bb): Goto removal cancelled.
4563 (cleanup_cond_expr_graph, cleanup_switch_expr_graph):
4565 (cleanup_control_expr_graph): New.
4566 (cleanup_control_flow): Use it.
4567 (disband_implicit_edges): New.
4568 (tree_find_edge_insert_loc): Never insert before a control statement.
4569 (tree_split_edge, thread_jumps, tree_try_redirect_by_replacing_jump,
4570 tree_redirect_edge_and_branch): Work over no-gotos form.
4571 (tree_verify_flow_info): Check no-gotos form invariants.
4572 * tree-pretty-print.c (pp_cfg_jump, dump_implicit_edges): New.
4573 (dump_generic_bb_buff): Call dump_implicit_edges.
4574 * tree-flow.h (cleanup_cond_expr_graph, cleanup_switch_expr_graph):
4575 Declaration removed.
4576 (cleanup_control_expr_graph, delete_tree_ssa, disband_implicit_edges):
4578 * tree-optimize.c (tree_ssa_finish): New.
4579 (optimize_function_tree): Call it.
4580 * tree-ssa-dom.c (thread_jumps_walk_stmts, optimize_stmt): Use
4581 cleanup_control_expr_graph.
4582 * tree-ssa.c (delete_tree_ssa): Export, work even if there are no
4584 (rewrite_out_of_ssa): Don't call it.
4586 2003-12-03 Jan Hubicka <jh@suse.cz>
4588 * tree-ssa.dom.c (tree_ssa_domionator_thread_jumps): Mark back edges.
4589 (thread_across_edge): Do not thread across loop headers.
4591 * Makefile.in (tree-optimize.o): Depend on cgraph.h
4592 * cgraph.h (cgraph_preserve_function_body_p): Declare.
4593 * cgraphunit.c (cgraph_preserve_function_body_p): New function.
4594 * tree-optimize.c: Include cgraph.h
4595 (clear_decl_rtl): Kill.
4596 (tree_rest_of_compilation): Use cgraph_preserve_function_body_p;
4597 do not clear DECL_RTL; do final ggc in the pushed context for nested
4600 2003-12-02 Jeff Law <law@redhat.com>
4602 * tree-ssa-dom.c (optimize_stmt): Accept and pass down dominator
4603 walker structure instead of individual varrays. Callers updated.
4604 (eliminate_redundant_computations): Likewise.
4605 (simplify_rhs_and_lookup_avail_expr): Likewise. Cache and update
4606 a dummy COND_EXPR when querying the hash tables when transforming
4607 DIV/MOD into RSHIFT/BIT_AND or ABS_EXPR into NEG_EXPR.
4608 (dom_opt_walk_stmts): Don't reload the block data pointer each
4609 iteration of the loop. Load it once outside the loop.
4611 * tree-dfa.c (cleanup_operand_arrays): Avoid creating a new
4612 varray for the vuse operands.
4614 * tree-ssa-dom.c (extract_range_from_cond): Use int_const_binop to
4615 avoid creating useless tree nodes.
4617 * tree-phinodes.c (add_phi_arg): If we receive a new node from
4618 resize_phi_node, then release the old node and update the PHI
4621 2003-12-02 Brian Booth <bbooth@redhat.com>
4623 * tree-pretty-print.c (dump_phi_nodes): Added code to always show phi
4624 nodes of regular gimple scalars.
4625 (dump_generic_bb_buff): Removed condition upon which to show phi nodes.
4627 2003-12-02 Jan Hubicka <jh@suse.cz>
4629 * tree-optimize.c (optimize_function_tree): Invoke ggc_collect in
4630 between optimization passes.
4632 2003-12-02 Daniel Berlin <dberlin@dberlin.org>
4634 * tree-sra.c (can_be_scalarized_p): Print details about why something
4635 could not be scalarized to the dump file.
4637 2003-12-01 Jeff Law <law@redhat.com>
4639 * Makefile.in (OBJS-common): Add tree-phinodes.o.
4640 (tree-phinodes.o): Add dependencies.
4641 (GTFILES): Add tree-phinodes.c.
4642 * tree-phinodes.c: New file.
4643 * tree-dfa.c (create_phi_node): Moved to tree-phinodes.o.
4644 (add_phi_arg, remove_phi_arg, remove_phi_arg_num): Similarly.
4645 (remove_phi_node, remove_all_phi_nodes_for): Similarly.
4646 * tree-ssa.c (init_tree_ssa): Initialize PHI node management.
4647 (delete_tree_ssa): Finalize PHI node management.
4648 * tree.c (dump_tree_statistics): Dump PHI node stats.
4649 (make_phi_node, resize_phi_node): Moved to tree-phinodes.o.
4650 * tree.h (init_phinodes): Prototype.
4651 (fini_phinodes, release_phi_node): Likewise.
4652 (phinodes_print_statistics): Likewise.
4654 2003-12-01 Richard Henderson <rth@redhat.com>
4656 * tree-dfa.c (get_expr_operands): Don't handle PLUS_EXPR inside
4658 * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Use int_const_binop.
4659 (maybe_fold_offset_to_component_ref): Likewise.
4660 (maybe_fold_stmt_indirect): Likewise.
4661 (maybe_fold_stmt_plus): Expand ARRAY_REF when seen with addend.
4662 * fold-const.c (int_const_binop): Export.
4663 * tree.h (int_const_binop): Declare.
4665 2003-12-01 Jan Hubicka <jh@suse.cz>
4667 * basic-block.h (tree_phi_root): New variable.
4668 * cfg.c: Include tree-flow.h.
4669 (compact_blocks): Compact tree_phi_root
4670 * tree-cfg.c (build_tree_cfg): Initialize tree_phi_root.
4671 (create_bb, remove_bb, delete_tree_cfg): Update tree_phi_root.
4672 * tree-dfa.c (tree_phi_root): Declare.
4673 (create_phi_node, add_phi_arg, remove_phi_node,
4674 remove_all_phi_nodes_for): Always use accessor functions for
4675 getting, varray for setting phis.
4676 * tree-ssa-pre.c (code_motion): Likewsie.
4677 * tree-flow-inline.h (phi_nodes): Use varray.
4678 * tree-flow.h (bb_ann_d): Remove phi_nodes.
4680 * tree-ssanames.c (free_ssanames): Do not use deleteable GTY flag.
4682 2003-11-30 Jan Hubicka <jh@suse.cz>
4684 * tree-optimize.c (tree_rest_of_compilation): Move ggc_collect call to
4685 the end of function; keep clearing of DECL_SAVED_TREE to the cgraph
4688 2003-11-30 Jan Hubicka <jh@suse.cz>
4690 * cgraphunit.c (cgraph_inline_context): New structure.
4691 (cgrpah_mark_inline, cgraph_check_inline_limits): Use context
4692 instead of passing all arguments by hand.
4693 (cgraph_create_inline_context, cgraph_free_inline_context,
4694 cgraph_inline_context_set_caller, cgraph_inline_context_clear_caller,
4695 cgraph_inline_context_set_callee, cgrpah_inline_context_clear_callee,
4696 cgraph_recursive_inlining_p): New static function.
4697 (cgraph_decide_inline*): Reorganize to use context.
4699 2003-11-30 Paul Brook <paul@nowt.org>
4701 * Makefile.in (GTFILES): Remove stray '\'.
4703 2003-11-30 Daniel Berlin <dberlin@dberlin.org>
4705 * c-config-lang.in: Move tree-alias-* from here
4706 * Makefile.in (GTFILES): To here.
4707 * tree-alias-ander.c: Include bitmap.h
4708 (andersen_function_call): Updated to take address of variables
4709 in an ADDR_EXPR in a CALL_EXPR.
4710 * tree-alias-common.h (struct tree_alias_ops): Update arguments to
4712 * tree-alias-type.h (struct alias_typevar_common): Add varnum.
4713 * tree-alias-common.c: Include bitmap.h, and function.h.
4714 s/global_var/pta_global_var/g.
4715 (addrargs): New static variable.
4716 (pta_global_var): Ditto.
4717 (find_func_decls): Remove.
4718 (find_func_aliases): Take one argument, update all callers.
4719 Handle (cast) [addr-expr] [var].
4720 Handle COMPONENT_REF of an INDIRECT_REF.
4721 Pass info about ADDR_EXPR arguments to function_call function.
4722 (deal_with_call_aliasing): New function.
4723 (call_may_return): New function.
4724 (get_alias_var_decl): Call find_func_aliases on the DECL_INITIAL
4726 Use ALIAS_TVAR_VARNUM, instead of VARRAY_ACTIVE_SIZE (alias_vars) - 1.
4727 (get_alias_var): Handle REALPART_EXPR and IMAGPART_EXPR.
4728 Return NULL in default case.
4729 (intra_function_call): Remove wrong code.
4730 (create_fun_alias_var): Use simple_assign, not addr_assign.
4731 Set up ALIAS_TVAR_VARNUM when creating an alias var.
4732 (create_fun_alis_var_ptf): Ditto on ALIAS_TVAR_VARNUM.
4733 (create_alias_var): Ditto.
4734 (create_alias_vars): Build pta_global_var here.
4735 Walk unexpanded_var_list.
4736 Walk the statements in basic blocks.
4737 (delete_alias_vars): Correct ip_partial case.
4739 (init_alias_vars): Create addrargs.
4741 2003-11-29 Jan Hubicka <jh@suse.cz>
4743 * Makefile.in (tree-ssanames.o): Depend on gt-tree-ssanames.h.
4744 (tree-eh.o): Depend on gt-tree-eh.h.
4745 (gr-tree-ssanames.h, gt-tree-eh.h): New targets.
4746 (GTFILES): Add tree-ssanames.c, tree-eh.c
4747 * tree-eh.c: Include ggc.h and gt-tree-eh.h
4748 (lower_eh_constructs): Allecate throw_stmt_table in ggc.
4749 * tree-ssanames.c: Include ggc.h and gt-tree-ssanames.h
4751 * function.h (struct function): Add saved_tree/saved_args.
4752 * toplev.c (rest_of_compilation): Move code to clear cfun and
4753 DECL_SAVED_INSNS and call to ggc_collect to ...
4754 * tree-optimize.c (tree_rest_of_compilation): ... this function. Use
4755 cfun to save/restore function body.
4757 2003-11-28 Richard Henderson <rth@redhat.com>
4759 * gimplify.c (create_tmp_var_raw): Split out from create_tmp_var.
4760 (create_tmp_var): Use it.
4761 (create_tmp_alias_var): Remove.
4762 * tree-alias-common.c, tree-dfa.c: Use create_tmp_var_raw instead.
4763 * tree-simple.h: Update decls.
4765 2003-11-28 Richard Henderson <rth@redhat.com>
4767 * gimple-low.c (lower_function_body): Call lower_bind_expr
4768 to handle the outermost BIND_EXPR.
4770 2003-11-28 Jan Hubicka <jh@suse.cz>
4772 * tree-ssa.c (remove_annotations_r): Kill.
4773 (delete_tree_ssa): Remove annotations using statement walk;
4774 kill argument fndecl.
4775 (rewrite_out_of_ssa): Update call.
4777 2003-11-27 Andrew MacLeod <amacleod@redhat.com>
4779 * tree-ssa-live.c (register_ssa_partition): Abort if a virtual SSA
4780 version is registered.
4781 (create_ssa_var_map): Always process PHI nodes.
4782 * tree-ssa.c (Eliminate_virtual_phis): Rename from
4783 eliminate_extraneous_phis, and look specifically for virtuals.
4784 (rewrite_out_of_ssa): Eliminate virtual PHI nodes before building
4787 2003-11-27 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
4789 * tree-ssa-ccp.c (get_strlen): Mark the visited variables.
4790 (ccp_fold_builtin): Changed due to changed calling convention of
4793 2003-11-26 Diego Novillo <dnovillo@redhat.com>
4797 2003-11-25 Jeff law <law@redhat.com>
4799 * Makefile.in (OBJS-common): Add tree-phinodes.o.
4800 (tree-phinodes.o): Add dependencies.
4801 * tree-phinodes.c: New file.
4802 * tree-dfa.c (create_phi_node): Moved to tree-phinodes.o.
4803 (add_phi_arg, remove_phi_arg, remove_phi_arg_num): Similarly.
4804 (remove_phi_node, remove_all_phi_nodes_for): Similarly.
4805 * tree-ssa.c (init_tree_ssa): Initialize PHI node management.
4806 (delete_tree_ssa): Finalize PHI node management.
4807 * tree.c (dump_tree_statistics): Dump PHI node stats.
4808 (make_phi_node, resize_phi_node): Moved to tree-phinodes.o.
4809 * tree.h (init_phinodes): Prototype.
4810 (fini_phinodes, release_phi_node): Likewise.
4811 (phinodes_print_statistics): Likewise.
4813 2003-11-25 Jan Hubicka <jh@suse.cz>
4815 * tree-mustalias.c (promote_var): Do not clear
4816 may_point_to_global_mem.
4818 2003-11-25 Jeff law <law@redhat.com>
4820 * domwalk.c (walk_dominator_tree): Indicate to the block local
4821 data initializer if the block local data is new or recycled.
4822 * domwalk.h (struct dom_walk_data): Corresponding changes.
4823 * tree-ssa-dom.c (dom_opt_initialize_block_local_data): Accept and use
4824 "recycled" argument. For recycled structures, only clear varrays
4825 that have been initialized. For new blocks, do not initialize
4827 (dom_opt_finalize_block): When threading across edges, if the
4828 true/false varrays have not been initialized, then the limit is zero.
4829 Only clear block local varrays that have been initialized.
4830 (record_equivalences_from_incoming_edge): If necessary, initialize
4831 block local const_and_copies.
4832 (dom_opt_walk_stmts): If necessary, initialize block local
4834 (record_var_is_nonzero): If necessary, initialize block local
4836 (record_cond_is_true): If necessary, initialize block local
4838 (record_cond_is_false): If necessary, initialize block local
4840 (lookup_avail_expr): If necessary, initialize block local
4842 (record_range): If necessary, initialize block local vrp_varaibles.
4844 * tree-ssa.c (rewrite_initialize_block_local_data): Accept and use
4845 "recycled" argument. For recycled structures, only clear varrays
4846 that have been initialized. For new blocks, do not initialize
4848 (rewrite_finalize_block): Only clear block local varrays that have
4850 (register_new_def): If necessary, initialize block local defs.
4852 * tree-ssa-dom.c (get_eq_expr_value): Return a struct rather than
4854 (record_equivalences_from_incoming_edge): Corresponding changes.
4855 (find_equivalent_equality_comparison): Use tree_int_cst_XXX rather
4856 then building and folding nodes.
4857 (simplify_cond_and_lookup_avail_expr): Likewise.
4859 * Makefile.in (OBJS-common): Add tree-phinodes.o.
4860 (tree-phinodes.o): Add dependencies.
4861 * tree-phinodes.c: New file.
4862 * tree-dfa.c (create_phi_node): Moved to tree-phinodes.o.
4863 (add_phi_arg, remove_phi_arg, remove_phi_arg_num): Similarly.
4864 (remove_phi_node, remove_all_phi_nodes_for): Similarly.
4865 * tree-ssa.c (init_tree_ssa): Initialize PHI node management.
4866 (delete_tree_ssa): Finalize PHI node management.
4867 * tree.c (dump_tree_statistics): Dump PHI node stats.
4868 (make_phi_node, resize_phi_node): Moved to tree-phinodes.o.
4869 * tree.h (init_phinodes): Prototype.
4870 (fini_phinodes, release_phi_node): Likewise.
4871 (phinodes_print_statistics): Likewise.
4873 2003-11-25 Jan Hubicka <jh@suse.cz>
4875 * tree-inline.c (save_body): New body
4876 * tree-inline.h (save_body): Declare.
4877 * tree-optimize.c (tree_rest_of_compilation): Save function tree
4880 2003-11-24 Richard Henderson <rth@redhat.com>
4882 * gimplify.c (canonicalize_addr_expr): New.
4883 (gimplify_conversion): Use it. Canonicalize after nop cast removal.
4884 * tree-simple.c (is_gimple_min_invariant): Remove STRING_CST cast
4887 2003-11-24 Jeff Law <law@redhat.com>
4889 * flow.c (count_or_remove_death_notes_bb): New. Extracted from
4890 count_or_remove_death_notes.
4891 (count_or_remove_death_notes): Use EXECUTE_IF_SET_IN_SBITMAP.
4893 2003-11-24 Richard Henderson <rth@redhat.com>
4896 * gimplify.c (cpt_same_type): Allow different ARRAY_TYPEs with
4899 2003-11-24 Daniel Berlin <dberlin@dberlin.org>
4902 * tree-ssa-pre.c (append_eref_to_block): Delete.
4903 (insert_euse_in_preorder_dt_order_1): Ditto.
4904 (insert_one_operand): Take an extra argument, because
4905 avdefs may need to be changed.
4906 (clear_all_eref_arrays): Use FOR_ALL_BB.
4907 (insert_occ_in_preorder_dt_order): Stop appending to bb eref arrays.
4909 (insert_euse_in_preorder_dt_order): Rewrite to just build a new varray
4910 with only the EPHI's and EUSE's, and then sort it.
4911 (pre_expression): Don't use bb based erefs array when printing
4913 (split_critical_edges): Just use FOR_ALL_BB.
4914 (tree_perform_ssapre): Pre-split entry block successor edge if the
4915 successor block has multiple preds.
4917 * tree-flow.h (struct bb_ann_d): Remove erefs varray.
4919 2003-11-24 Daniel Berlin <dberlin@dberlin.org>
4921 * tree-cfg.c (cleanup_tree_cfg): FOR_EACH_BB -> FOR_ALL_BB when
4922 clearing dom children, because the entry block has dom_children
4924 * tree-ssa.c (build_dominator_tree): Ditto.
4926 2003-11-24 Diego Novillo <dnovillo@redhat.com>
4928 * tree-cfg.c (compute_dominance_frontiers_1,
4929 compute_dominance_frontiers): Move from ssa.c.
4930 * tree-flow.h (compute_dominance_frontiers): Declare.
4931 * Makefile.in (tree-ssa.o, tree-ssa-live.o, tree-ssa-pre.o,
4932 tree-optimize.o): Don't depend on ssa.h.
4933 * tree-ssa.c: Don't include ssa.h.
4934 * tree-ssa-live.c: Likewise.
4935 * tree-ssa-pre.c: Likewise.
4936 * tree-optimize.c: Likewise.
4938 2003-11-24 Jan Hubicka <jh@suse.cz>
4940 * fold-const.c (fold): Do not return early when
4941 optimizing COMPONENT_REF and constant.
4943 2003-11-24 Richard Henderson <rth@redhat.com>
4945 * objc/objc-act.c (build_protocol_expr): Use convert instead of
4948 2003-11-23 Andrew MacLeod <amacleod@redhat.com>
4950 * tree-ssa-live.h (SSANORM_PERFORM_TER, SSANORM_COMBINE_TEMPS,
4951 SSANORM_REMOVE_ALL_PHIS): New flag macros.
4952 * tree-ssa.c (replace_variable): Return true if var was rewritten.
4953 (eliminate_extraneous_phis): Dump var map to file if checking triggers
4955 (rewrite_trees): Set modified_stmt if stmt was changed.
4956 (remove_ssa_form): Move more of rewrite_out_of_ssa to make it serve
4957 all the same functions based on new flags in tree-ssa-live.h.
4958 (rewrite_out_of_ssa): Call remove_ssa_form.
4960 2003-11-23 Jan Hubicka <jh@suse.cz>
4962 * tree-cfg.c (tree_verify_flow_info): Check that ENTRY/EXIT block
4963 has no instructions associated with it.
4965 2003-11-22 Jeff Law <law@redhat.com>
4967 * tree-ssa-names.c (release_ssa_name): Use SSA_NAME_IN_FREE_LIST
4968 instead of checking SSA_NAME_DEF_STMT being null.
4969 * tree.h (SSA_NAME_DEF_STMT): Use chain field rather than the
4971 (SSA_NAME_OCCURS_IN_ABNORMAL_PHI): Use existing flag from tree_common.
4972 (SSA_NAME_IN_FREE_LIST): Define.
4973 (struct tree_ssa_name): Kill DEF_STMT and OCCURS_IN_ABNORMAL_PHI fields.
4975 2003-11-22 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
4977 * tree-pretty-print.c (dump_generic_node): Remove superfluous ';'.
4979 2003-11-22 Diego Novillo <dnovillo@redhat.com>
4981 * Makefile.in (simple-break-elim.o): Remove.
4982 (simple-goto-elim.o): Remove.
4983 (tree-dchain.o): Remove.
4984 * simple-break-elim.c: Remove.
4985 * simple-goto-elim.c: Remove.
4986 * tree-dchain.c: Remove.
4987 * tree-dchain.h: Remove.
4989 2003-11-22 Daniel Berlin <dberlin@dberlin.org>
4991 * tree-ssa-pre.c (build_dfs_id_array_1): > should be >=
4992 (build_dfn_array): Ditto.
4994 2003-11-21 Diego Novillo <dnovillo@redhat.com>
4996 * Makefile.in (tree-dfa.o): Add dependency on $(TREE_DUMP_H)
4997 * tree-dfa.c: Include tree-dump.h
4998 (compute_alias_sets): Call dump_function_to_file.
4999 (may_access_global_mem_p): Check if the base address of _REF nodes
5000 may point to global memory.
5002 * cfgcleanup.c (try_crossjump_to_edge): Initialize newpos1 and
5005 2003-11-21 Jeff Law <law@redhat.com>
5009 2003-11-21 Jan Hubicka <jh@suse.cz>
5011 * tree-dfa.c (get_expr_operands): Fix handling of CALL_EXPR.
5012 * tree-must-alias.c (tree_compute_must_alias): promote pointers.
5013 (find_addressable_vars): Deal with complex constant
5014 expressions; do not clear may_point_to_global_mem.
5016 2003-11-21 Jeff Law <law@redhat.com>
5018 * Makefile.in (domwalk.o): Depend on $(GGC_H).
5019 * domwalk.c: Include ggc.h.
5020 (walk_dominator_tree): Manage allocation/deallocation and
5021 pushing/popping of the toplevel block data pointer here.
5022 Use callback to initialize the block local data.
5023 (init_walk_dominator_tree): New function.
5024 (fini_walk_dominator_tree): Likewise.
5025 * domwalk.h (struct dom_walk_data): Add callback to initialize
5026 block local data. Add field for sizeof block local data.
5027 Add "private" field free_block_data.
5028 (init_dominator_tree, fini_dominator_tree): Prototype.
5029 * tree-ssa-dom.c (dom_opt_initialize_local_data): New function.
5030 (tree_ssa_dominator_optimize_1): Initialize new fields in the
5031 dominator walker structure. Initialize and finalize the dominator
5032 walker. Slightly reorder code to make it more readable..
5033 (dom_opt_initialize_block): No longer deal with allocation and
5034 initialization of block local data.
5035 (dom_opt_finalize_block): Similarly for deallocation of block
5037 * tree-ssa.c (rewrite_block_data): New structure.
5038 (rewrite_initialize_block_local_data): New function.
5039 (rewrite_initialize_block): No longer deal with allocation and
5040 initialization of block local data.
5041 (rewrite_into_ssa): Initialize new fields in the dominator walker
5042 structure. Initialize and finalize the dominator walker.
5043 (rewrite_initialize_block): No longer deal with allocation and
5044 initialization of block local data.
5045 (rewrite_optimize_stmts): Deal with changes in the dominator
5047 (rewrite_finalize_block): No longer with deallocation of block
5050 * tree-dfa.c (add_vdef, cleanup_voperand_arrays): Use NUM_VDEFS.
5051 (mark_new_vars_to_rename, collect_dfa_status_r): Likewise.
5052 * tree-pretty-print.c (dump_vops): Likewise.
5053 * tree-sra.c (create_scalar_copies): Likewise.
5054 * tree-ssa-dce.c (stmt_useful_p, process_worklist): Likewise.
5055 * tree-ssa-live.c (create_ssa_var_map): Likewise.
5056 (calculate_live_on_entry): Likewise.
5057 * tree-ssa-pre.c (process_left_occs_and_kills): Likewise.
5058 * tree-ssa.c (mark_def_sites, rewrite_stmt): Likewise.
5059 * tree.h (NUM_VDEFS): Define.
5060 * tree-ssa-ccp.c (visit_stmt): Use NUM_VDEFS. Fix thinko in last
5062 (initialize): Use NUM_VDEFS.
5064 * tree-dfa.c (add_vdef): Revamp to handle new method for
5066 (cleanup_operand_arrays): Similarly.
5067 * tree-sra.c (create_scalar_copies): Similarly.
5068 * tree-ssa-ccp.c (visit_stmt, initialize): Similarly.
5069 * tree-ssa-dce.c (stmt_useful_p, process_worklist): Similarly.
5070 * tree-ssa-dom.c (cprop_into_stmt): Similarly.
5071 (record_equivalences_from_stmt): Similarly.
5072 * tree-ssa-live.c (create_ssa_var_map): Similarly.
5073 (calculate_live_on_entry): Similarly.
5074 * tree-ssa.c (mark_def_sites, rewrite_stmt): Similarly.
5075 * tree-ssa-pre.c (process_left_occr_and_kills): Similarly.
5076 * tree-inline.c (estimate_num_insns_1): Kill VDEF_EXPR.
5077 * tree-pretty-print.c (dump_generic_node) Kill VDEF_EXPR.
5078 (dump_vops): Dump VDEFs here.
5079 * tree.c (build_vdef_expr): Kill.
5080 * tree.h (build_vdef_expr): Kill prototype.
5081 (VDEF_RESULT, VDEF_OP): Revamp to handle new method for recording
5083 * tree.def (VDEF_EXPR): Kill.
5085 * tree-cfg.c (cfg_remove_useless_stmts): Set both VAR and VAL to
5086 NULL anytime one of them is determined to be invalid.
5088 2003-11-21 Andrew MacLeod <amacleod@redhat.com>
5090 * tree-ssa-live.c (compact_var_map): Fix typo. Clear correct field.
5091 (calculate_live_on_entry): Remove unneeded stmt.
5092 * tree-ssa-live.h (version_to_var): New. Return variable associated
5093 with a specific SSA version.
5094 * tree-ssa.c (eliminate_build): Add check that ignored results don't
5095 have important arguments. Allow ignored results.
5096 (coalesce_abnormal_edges): Allow non-relevant results to be ignored.
5097 (eliminate_extraneous_phis): Allow non-relevant results. Check that
5098 no important arguments are being missed.
5099 (coalesce_vars): Non-partition variables are allowed now, just ignored.
5100 (rewrite_trees): New. Split out from rewrite_out_of_ssa. Perform tree
5102 (remove_ssa_form): New. Allow rewriting of just specified variables.
5103 (rewrite_out_of_ssa): Use rewrite_trees and reorganize slightly to
5104 accommodate typechecking in eliminate_extraneous_phis.
5106 2003-11-21 Jan Hubicka <jh@suse.cz>
5108 * tree-dfa.c (get_expr_operands): Fix handling of CALL_EXPR.
5109 * tree-must-alias.c (tree_compute_must_alias): promote pointers.
5110 (find_addressable_vars): Deal with complex constant expressions;
5111 do not clear may_point_to_global_mem.
5113 2003-11-21 Jan Hubicka <jh@suse.cz>
5115 * parser.c (cp_parser_postfix_expression): Initialize 's' to
5118 2003-11-20 Richard Henderson <rth@redhat.com>
5120 * Makefile.in (bitmap.o-warn, caller-save.o-warn, combine.o-warn,
5121 cgraphunit.o-warn, c-semantics.o-warn, emit-rtl.o-warn, expr.o-warn,
5122 fold-const.o-warn, genattrtab.o-warn, regmove.o-warn, tree.o-warn,
5123 varasm.o-warn, f/expr.o-warn, profile.o-warn): Remove.
5124 * bitmap.c (bitmap_first_set_bit): Abort if no non-zero word found.
5125 (bitmap_last_set_bit): Likewise.
5126 * combine.c (get_pos_from_mask): Always set *plen.
5128 2003-11-20 Richard Henderson <rth@redhat.com>
5130 * tree-dfa.c (get_expr_operands): Remove handling of PLUS_EXPR
5131 inside INDIRECT_REF.
5133 2003-11-20 Diego Novillo <dnovillo@redhat.com>
5135 * tree-nomudflap.c (nogo): Fix prototype.
5137 2003-11-20 Richard Henderson <rth@redhat.com>
5139 * except.c (output_function_exception_table): Strip nops.
5140 * gimplify.c (gimplify_addr_expr): Kill missing cast workaround.
5141 (cpt_same_type, check_pointer_types_r): New.
5142 (gimplify_body): Call it.
5143 * tree-inline.c (insert_decl_map): New.
5144 (remap_decl, remap_type, remap_block, copy_body_r,
5145 initialize_inlined_parameters, declare_return_variable,
5146 remap_save_expr, mark_local_for_remap_r): Use it.
5148 2003-11-20 Frank Ch. Eigler <fche@redhat.com>
5151 * c-pragma.c (handle_pragma_redefine_extname): Define always.
5152 (init_pragma): Activate #pragma redefine_extname for mudflap.
5154 * tree-inline.c (copy_tree_r): Propagate mf_marked-ness.
5155 * tree-mudflap.c (mudflap_c_function): Break into new
5156 _decls and _ops functions.
5157 (mudflap_c_function_decls): Avoid unnecessary tree copying.
5158 (mudflap_c_function_ops): Ditto. Gimplify explicitly only for
5160 * tree-nomudflap.c: Add new stub functions. Simplify error
5161 message emission throughout.
5162 * tree-mudflap.h: Corresponding changes.
5163 * tree-optimize.c (tree_rest_of_compilation): Call the _decl
5164 instrumentation before gimplification and ssa optimizations;
5165 call the _ops instrumentation after ssa optimizations.
5167 2003-11-20 Diego Novillo <dnovillo@redhat.com>
5169 Initial fix for PR optimization/12747
5171 * Makefile.in (OBJS): Add tree-sra.o
5172 * common.opt (ftree-sra): Add.
5173 * flags.h (flag_tree_sra): Declare.
5174 * gimplify.c (gimplify_addr_expr): Set TREE_INVARIANT
5175 when producing and address expression for a DECL node.
5176 * opts.c (decode_options): Enable SRA at -O1.
5177 (common_handle_option): Handle -ftree-sra.
5178 * timevar.def (TV_TREE_SRA): New timer.
5179 * toplev.c (flag_tree_sra): Define.
5180 * tree-cfg.c (stmt_ends_bb_p): Declare extern.
5181 (bsi_replace): Add boolean argument to specify whether to
5182 preserve EH region information. Update all callers.
5183 (bsi_commit_edge_inserts): Also check the edge from ENTRY_BLOCK_PTR
5186 (bsi_commit_edge_inserts_1): ... here.
5187 * tree-dump.c: Add dump for SRA pass.
5188 * tree.h (enum tree_dump_index): Modify accordingly.
5189 (STRIP_USELESS_TYPE_CONVERSION): Define. Update all callers to
5190 tree_ssa_useless_type_conversion.
5191 * tree-eh.c (add_stmt_to_eh_region): New function.
5192 * tree-flow.h (stmt_ends_bb_p): Declare.
5193 (add_stmt_to_eh_region): Declare.
5194 (tree_sra): Declare.
5195 (enum bsi_iterator_update): Mirror entries in
5196 enum tsi_iterator_update.
5197 * tree-optimize.c (optimize_function_tree): Call SRA pass
5199 * tree-sra.c: New file.
5200 * doc/invoke.texi: Document -ftree-sra and -fdump-tree-sra.
5202 2003-11-20 Andrew Macleod <amacleod@redhat.com>
5204 * tree-ssa.c (check_replaceable): Return false if the LHS is a
5207 2003-11-20 Diego Novillo <dnovillo@redhat.com>
5209 * tree-ssa-ccp.c (set_rhs): Replace with an empty statement when
5210 the replacement has no side effects.
5212 2003-11-20 Jeff Law <law@redhat.com>
5214 * Makefile.in (OBJS-common): Kill tree-ssa-copyprop.o.
5215 (tree-ssa-copyprop.o): Kill dependencies clause.
5216 * common.opt (tree-copyprop): Kill option.
5217 * flags.h (flag_tree_copyprop): Kill.
5218 * opts.c (decode_options): Don't set flag_tree_copyprop.
5219 (common_handle_option): Kill handling of -ftree-copyprop.
5220 * timevar.def (TV_TREE_COPYPROP): Kill.
5221 * toplev.c (flag_tree_copyprop): Kill.
5222 (lang_independent_options): Kill -ftree-copyprop.
5223 * tree-dump.c (dump_files): Kill .copyprop dump.
5224 * tree-flow.h (tree_ssa_copyprop): Kill prototype.
5225 (propagate_copy): Move prototype.
5226 * tree-optimize.c (optimize_function_tree): Kill -ftree-copyprop stuff.
5227 * tree.h (tree_dump_index): Kill TDI_copyprop.
5228 * tree-ssa-copyprop.c: Kill.
5229 * tree-ssa-dom.c (propagate_copy): Moved here from tree-ssa-copyprop.c.
5231 * tree-ssanames.c (free_ssanames): No longer a varray.
5232 (init_ssanames, make_ssa_name, release_ssa_name): Corresponding changes.
5234 2003-11-20 Steven Bosscher <stevenb@suse.de>
5236 * tree-ssanames.c (ssanames_print_statistics): Use ISO function
5237 declaration. Print unsigned ints, not usinged longs.
5239 2003-11-18 Daniel Berlin <dberlin@dberlin.org>
5241 * tree-ssa-pre.c (rename_1): This should be static.
5242 (append_eref_to_block): Don't gc allocate.
5243 (clear_all_eref_arrays): Free the array rather than
5245 (rename_1): Ditto on both counts.
5246 (free_expr_info): Free the arrays.
5247 (collect_expressions): Don't gc allocate the arrays.
5249 2003-11-18 Daniel Berlin <dberlin@dberlin.org>
5251 * tree-ssa-pre.c (insert_one_operand): Handle self-referential
5254 2003-11-19 Jeff Law <law@redhat.com>
5256 * tree-ssa-dom.c (true_exprs, false_exprs): New hash tables.
5257 (nonzero_vars): New varray.
5258 (dom_walk_block_data): Add true_exprs, false_exprs and nonzero_vars.
5259 (get_value_for, set_value_for): Accept additional argument indicating
5260 which table to use. Callers updated.
5261 (tree_ssa_dominator_optimize_1): Initialize and wipe our new hash
5262 tables and varray appropriately.
5263 (dom_opt_initialize_block): Initialize new block local varrays for
5264 true expressions, false expressions and nonzero vars. Update call
5265 to record_equivalences_from_incoming_edge.
5266 (dom_opt_finalize_block): Put equivalences from taken edges
5267 into the true_exprs and false_exprs hash tables. Restore global
5268 state for true_exprs, false_exprs and nonzero_vars too.
5269 (record_equivalences_from_incoming_edge): Accept dom_walk structure
5270 instead of a gazillion varrays. Pass down block local
5271 true_exprs, false_exprs and nonzero_vars varrays to various children.
5272 (optimize_stmt): Accept block local nonzero_vars argument. Pass
5273 new varrays down to record_equivalences_from_stmt.
5274 (thread_jumps_walk_stmt): Pass new varrays down to
5275 record_equivalences_from_stmt.
5276 (dom_opt_walk_stmt): Pass new varrays down to optimize_stmt.
5277 (dump_dominator_optimizer_statistics): Dump new hash tables.
5278 (record_cond_is_true, record_cond_is_false): Record info into
5279 the true/false hash tables/varrays instead of the main expression
5280 varrays. Don't create useless tree nodes.
5281 (record_var_is_nonzero): New function.
5282 (record_equivalences_from_stmt): Don't generate useless tree nodes.
5283 (lookup_avail_expr): Consult nonzero_vars and the true/false
5284 expression tables as well.
5285 (get_eq_expr_value): Record local true/false expressions in the
5286 local true/false varrays rather than the main local expression
5288 (true_false_expr_hash, true_false_expr_eq): New functions.
5290 * Makefile.in (OBJS-sommon): Add tree-ssanames.o.
5291 (tree-ssanames.o): Add dependencies.
5292 * tree-dfa.c (remove_phi_node): Release SSA_NAME expression when
5293 we remove the PHI node.
5294 (remove_all_phi_nodes_for): Similarly.
5295 * tree-ssa.c (prepare_operand_for_rename): Similarly when we
5296 strip away an SSA_NAME expression from an operand.
5297 (init_tree_ssa): Call the SSA_NAME initializer.
5298 (delete_tree_ssa): Call the SSA_NAME finalizer.
5299 * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Clear the
5300 const_and_copies and vrp_data virtual arrays.
5301 * tree-ssanames.c: New file for management of SSA_NAME expressions.
5302 * tree.h: Prototypes for functions exported by tree-ssanames.c.
5303 * tree-flow.h, tree-ssa-ccp.c, tree-ssa-dce.c: Use highest_ssa_version
5304 rather than next_ssa_version.
5305 * tree-ssa-dom.c, tree-ssa-live.c, tree-ssa.c: Similarly.
5306 * tree.c (dump_tree_statistics): Call into tree-ssaname statistics
5308 (make_ssa_name): Kill. Now in tree-ssanames.c
5310 2003-11-18 Richard Henderson <rth@redhat.com>
5312 * tree.c (recompute_tree_invarant_for_addr_expr): Split out from ...
5314 * tree.h: Declare it.
5315 * gimplify.c (gimplify_addr_expr): Use it.
5316 * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Split out
5317 from fold_indirect_refs_r.
5318 (maybe_fold_stmt_indirect): Likewise.
5319 (maybe_fold_offset_to_component_ref): New.
5320 (maybe_fold_stmt_plus): New.
5321 (fold_stmt_r): Rename from fold_indirect_refs_r.
5322 (fold_stmt): Strip more useless type conversions.
5324 2003-11-18 Richard Henderson <rth@redhat.com>
5326 * tree-cfg.c (dump_function_to_file): Mind when cfun is null.
5328 2003-11-18 Diego Novillo <dnovillo@redhat.com>
5332 2003-11-18 Jan Hubicka <jh@suse.cz>
5334 * tree-cfg.c (cfg_remove_useless_stmts_bb): Avoid crash.
5335 * tree-dfa.c (get_expr_operands): Fix handling of CALL_EXPR.
5337 2003-11-18 Jan Hubicka <jh@suse.cz>
5339 * Makefile.in (sibcall.o): Kill.
5340 (tree-tailcall.o): Add except.h dependency
5342 (purge_reg_equiv_notes, purge_mem_unchanging_flag): Move to ...
5343 * calls.c (purge_reg_equiv_notes,
5344 purge_mem_unchanging_flag) ... here.
5345 (expand_call): Do not produce placeholders; do
5346 not deal with tail recursion; update
5347 equivalencies after sibcall production.
5348 * toplev.c (rest_of_handle_sibling_calls): Kill.
5349 (rest_of_compialtion): Do not use rest_of_handle_sibling_calls.
5350 * tree-dump.c (dump_files): Add tail2
5351 * tree-flow.h (tree_optimize_tail_calls): Update prototype.
5352 * tree-optimize.c (optimize_function_tree): Do
5353 tail optimization twice.
5354 * tree-tailcall.c: Inlucde except.h
5355 (suitable_for_tail_call_opt_p): New.
5356 (optimize_tail_call): Add opt_tailcalls argument;
5358 (tree_optimize_tail_calls): Add opt_tailcalls/pass arguments.
5359 * tree.h (CALL_EXPR_TAILCALL): New.
5360 (tree_dump_index): Add tail2
5362 2003-11-18 Jan Hubicka <jh@suse.cz>
5364 * tree-cfg.c (cfg_remove_useless_stmts_bb): Avoid crash.
5365 * tree-dfa.c (get_expr_operands): Fix handling of CALL_EXPR.
5367 2003-11-18 Diego Novillo <dnovillo@redhat.com>
5369 * tree-optimize.c (optimize_function_tree): Disable tail
5372 2003-11-18 Jan Hubicka <jh@suse.cz>
5374 * Makefile.in (sibcall.o): Kill.
5375 (tree-tailcall.o): Add except.h dependency
5377 (purge_reg_equiv_notes, purge_mem_unchanging_flag): Move to ...
5378 * calls.c (purge_reg_equiv_notes, purge_mem_unchanging_flag) ... here.
5379 (expand_call): Do not produce placeholders; do not deal with tail
5380 recursion; update equivalencies after sibcall production.
5381 * toplev.c (rest_of_handle_sibling_calls): Kill.
5382 (rest_of_compialtion): Do not use rest_of_handle_sibling_calls.
5383 * tree-dump.c (dump_files): Add tail2
5384 * tree-flow.h (tree_optimize_tail_calls): Update prototype.
5385 * tree-optimize.c (optimize_function_tree): Do tail optimization twice.
5386 * tree-tailcall.c: Inlucde except.h
5387 (suitable_for_tail_call_opt_p): New.
5388 (optimize_tail_call): Add opt_tailcalls argument; optimize tailcalls.
5389 (tree_optimize_tail_calls): Add opt_tailcalls/pass arguments.
5390 * tree.h (CALL_EXPR_TAILCALL): New.
5391 (tree_dump_index): Add tail2
5393 2003-11-18 Jeff Law <law@redhat.com>
5395 * tree-ssa-dom.c (thread_across_edge): Lose block_avail_exprs argument.
5396 Callers updated. Pass NULL for block_avail_exprs in call to
5397 lookup_avail_expr. Record both the condition and the inverted
5398 condition when threading across an edge.
5400 2003-11-18 Richard Henderson <rth@redhat.com>
5402 * tree-ssa.c (tree_ssa_useless_type_conversion): Use TYPE_MAIN_VARIANT
5403 when compariing pointer types too.
5405 2003-11-18 Jan Hubicka <jh@suse.cz>
5407 * tree-dump.c (dump_files): Reorder tail calls.
5408 * tree-optimize.c (optimize_function_tree): Likewise
5409 * tree-tailcall.c (optimize_tail_call, eliminate_tail_call): Remove
5410 variable tmpvars; update SSA.
5411 (suitable_for_tail_opt_p): Do not give up because of static variables.
5412 (find_tail_calls): Track return values in SSA graph.
5413 * tree.c (make-phi_node): Do not create new SSA name when operand
5415 * tree.h (enum tree_dump_index): Reorder tail call.
5417 2003-11-17 Diego Novillo <dnovillo@redhat.com>
5419 * gimplify.c (gimplify_call_expr): Change gimple_test_f argument to
5421 (mark_decls_volatile_r): New local function.
5422 (gimplify_expr): Make gimple_test_f return bool type.
5423 Call mark_decls_volatile_r when gimplifying VA_ARG_EXPR.
5424 * tree-dfa.c (struct walk_state): Remove field is_va_arg_expr.
5426 (opf_force_vop): Remove. Update all users.
5427 (add_stmt_operand): Re-structure to add real operands only for
5428 GIMPLE register variables.
5429 (find_vars_r): Don't handle VA_ARG_EXPR nodes.
5430 (add_referenced_var): Also assign a UID to variables with hidden
5432 Call is_gimple_call_clobbered to determine if a variable is call
5434 (get_memory_tag_for): Mark memory tags volatile and static.
5435 * tree-flow.h (struct var_ann_d): Remove field is_in_va_arg_expr.
5437 * tree-simple.c (is_gimple_*): Change return type to bool. Update
5439 (is_gimple_reg_type): Return true only for non aggregate types.
5440 (is_gimple_non_addressable_1): New local function.
5441 (is_gimple_reg): Call it.
5442 (is_gimple_non_addressable): New function.
5443 (is_gimple_call_clobbered): New function.
5444 * tree-simple.h (is_gimple_*): Change return type to bool.
5446 2003-11-17 Jason Merrill <jason@redhat.com>
5449 * gimplify.c (gimple_add_tmp_var): Also make sure
5450 seen_in_bind_expr isn't set.
5451 (mostly_copy_tree_r): Don't copy a TARGET_EXPR.
5452 (gimplify_target_expr): Only expand a TARGET_EXPR the first time
5455 2003-11-17 Richard Henderson <rth@redhat.com>
5457 * tree-pretty-print.c (dump_generic_node): Use %u not %x for
5460 2003-11-16 Richard Henderson <rth@redhat.com>
5462 * c-common.c (c_add_case_label): Use create_artificial_label.
5463 * tree-simple.h (create_artificial_label): Move decl ...
5466 2003-11-16 Richard Henderson <rth@redhat.com>
5469 * gimple-low.c (lower_stmt_body): Take a tree, not a tree*.
5470 (lower_stmt): Handle EH nodes.
5471 (lower_bind_expr): Remove fixme.
5472 (block_may_fallthru): Move from tree-eh.c. Handle COND_EXPR,
5473 BIND_EXPR, and TRY_FINALLY_EXPR.
5474 (lower_cond_expr): Use it.
5475 * tree-eh.c (collect_finally_tree): Ignore COND_EXPR and BIND_EXPR.
5476 (replace_goto_queue_cond_clause): New.
5477 (replace_goto_queue_1): Use it. Split out statement_list handling.
5478 (replace_goto_queue_stmt_list): New.
5479 (-block_may_fallthru): Move to gimple-low.c.
5480 (lower_eh_constructs_1): Ignore BIND_EXPR.
5481 * tree-flow.h (block_may_fallthru): Declare.
5483 * tree-dump.c (dump_files): Exchange .eh and .lower passes.
5484 * tree-optimize.c (tree_rest_of_compilation): Likewise.
5485 * tree.h (enum tree_dump_index): Likewise.
5487 2003-11-16 Jason Merrill <jason@redhat.com>
5489 * gimplify.c (mostly_copy_tree_r): Don't walk into a BLOCK.
5491 * tree-inline.c (walk_tree): Don't walk into the BIND_EXPR_VARS
5493 * c-common.c (c_walk_subtrees): Don't walk into the decl of a
5496 PR optimization/11269
5497 * dwarf2out.c (gen_subprogram_die): Generate a DIE for a named
5499 (loc_descriptor_from_tree): Treat RESULT_DECL like VAR_DECL.
5500 (add_location_or_const_value_attribute): Likewise.
5501 (add_bound_info): Likewise.
5502 (gen_decl_die): Likewise.
5504 2003-11-16 Jason Merrill <jason@redhat.com>
5506 * c-pretty-print.c (debug_c_tree): Restore removed fn.
5507 * diagnostic.h: Declare it.
5509 * tree-pretty-print.c (dump_generic_node): Use DECL_UID when
5510 dumping anonymous decls.
5512 2003-11-16 Richard Henderson <rth@redhat.com>
5514 * tree-cfg.c (last_and_only_stmt): New.
5515 * tree-flow.h (last_and_only_stmt): Declare.
5516 * tree-ssa-dom.c (thread_across_edge): Use it.
5518 * tree-cfg.c (tree_block_forwards_to): Don't check for empty stmts.
5519 (tree_forwarder_block_p): Likewise.
5520 * tree-dfa.c (get_stmt_operands): Likewise.
5521 * tree-ssa-ccp.c (set_rhs): Likewise.
5522 * tree-ssa-dom.c (optimize_stmt): Likewise.
5523 * tree-ssa.c (rewrite_stmt): Likewise.
5525 2003-11-16 Richard Henderson <rth@redhat.com>
5527 * tree.h (LABEL_DECL_UID): Rename from LABEL_DECL_INDEX.
5528 * tree-flow.h (bsi_remove): Declare.
5529 * tree-flow-inline.h (bsi_remove): Move ...
5530 * tree-cfg.c (set_bb_for_stmt): Don't re-set LABEL_DECL_UID.
5531 Verify that a label isn't already in a block before adding it.
5532 (bsi_remove): Move from tree-flow-inline.h, clear bb.
5533 * tree-pretty-print.c (dump_generic_node): Use LABEL_DECL_UID if set.
5535 2003-11-15 Richard Henderson <rth@redhat.com>
5537 * function.c (clear_block_marks): Rename from reorder_blocks_0, export.
5538 * function.h (clear_block_marks): Declare.
5539 * gimple-low.c (lower_function_body): Use it.
5540 (lower_bind_expr): Ensure we don't link blocks into the tree twice.
5541 * gimplify.c (gimplify_body): Keep old bind_expr at top level if
5544 2003-11-14 Richard Henderson <rth@redhat.com>
5546 * tree-ssa-pre.c (split_critical_edges): Reimplement. Call
5547 tree_split_edge directly.
5549 2003-11-14 Jason Merrill <jason@redhat.com>
5551 * tree-eh.c (do_return_redirection): Assign directly to the
5552 RESULT_DECL of a function which returns in memory.
5554 2003-11-14 Daniel Berlin <dberlin@dberlin.org>
5556 * tree-ssa-pre.c (pre_stats): Add ephis_current member.
5557 (create_ephi_node): Use xmalloc, not ggc_alloc_tree.
5558 (clear_all_eref_arrays): Free the ephis here.
5559 (expr_phi_insertion): Don't append the ephis to the erefs array.
5560 (insert_occ_in_preorder_dt_order): Move building/freeing of dfn
5561 array so that it only occurs once per function..
5562 (rename_1): Ditto on the dfs_id array.
5563 (ephi_use_pool): New alloc pool.
5564 (add_ephi_use): Pool allocate these things, rather than
5566 (insert_euse_in_preorder_dt_order_1): Use ephi_at_block to put the
5568 (pre_expression): Don't PRE when we only have 1 occurrence.
5569 (expr_lexically_eq): Make inline.
5570 (names_match_p): Move closer to first use.
5571 (tree_perform_ssapre): Alloc and free the ephi_use_pool.
5572 Make stat printing per-expression.
5573 Add checking that we freed all ephis.
5575 2003-11-14 Andrew MacLeod <amacleod@redhat.com>
5577 * common.opt (ftree-ter): Document new option.
5578 * flags.h (flag_tree_ter): Add new flag.
5579 * fold-const.c (invert_truthvalue): Don't ignore cast to BOOLEAN_TYPE.
5580 * opts.c (decode_options): Option -ftree-ter defaults to on.
5581 (common_handle_option): Add processing for flag_tree_ter.
5582 * toplev.c (flag_tree_ter): Initialize to 0.
5583 (lang_independent_options f_): Add -ftree-ter flag.
5584 * tree-ssa-live.c (init_var_map): Initialize ref_count to 0.
5585 (delete_var_map): Free ref count if allocated.
5586 (register_ssa_partition): Add "is_use" parameter for reference counting.
5587 (create_ssa_var_map): Add flag and code for calculating ref counts.
5588 * tree-ssa-live.h (struct _var_map): Add ref_count field.
5589 (SSA_VAR_MAP_REF_COUNT): Define flag.
5590 (version_ref_count): Function to retreive ref_count.
5591 * tree-ssa.c (replace_variable): If an expression vector is passed in,
5592 use replacement expression instead of mapped variable when available.
5593 (struct value_expr_d): New structure for value lists.
5594 (struct temp_expr_table_d): Structure used to build an expression
5596 (new_temp_expr_table): New. Create a new TER (Temporary Expression
5598 (free_temp_expr_table): New. Free a TER table.
5599 (new_value_expr): New. Allocate a value list element.
5600 (free_value_expr): New. Free a value list element.
5601 (find_value_in_list): New. Find a value in a list.
5602 (add_value_to_list): New. Add a value to a list if not already present.
5603 (remove_value_from_list): New. Remove a value from a list.
5604 (add_dependance): New. Add a dependency to an expression.
5605 (check_replaceable): New. Check if a stmt is a candidate for TER. Add
5606 to active list and create dependancies if so.
5607 (finish_expr): New. Remove an expression from TER consideration.
5608 (mark_replaceable): New. Finish a TER expression as a valid replacement.
5609 (kill_expr): New. Finish dependent TER expressions as not replaceable.
5610 (kill_virtual_exprs): New. Finish any TER expressions dependent on a
5611 virtual operand as not replaceable.
5612 (find_replaceable_in_bb): New. Process a basic block for TER expression.
5613 (find_replaceable_exprs): New. Entry point for TER expression finder.
5614 (dump_replaceable_exprs): New. output list of replaceable expressions.
5615 (rewrite_out_of_ssa): Build TER table if requested, and use it.
5617 2003-11-14 Andreas Jaeger <aj@suse.de>
5619 * c-semantics.c (find_reachable_label): Use C90 function
5622 2003-11-14 Jason Merrill <jason@redhat.com>
5625 * tree-cfg.c (call_expr_flags): Move to calls.c.
5626 * tree-flow.h: Move prototype to tree.h.
5629 * c-simplify.c (gimplify_c_loop): Wrap the increment in a
5632 * tree-dfa.c (get_stmt_operands) <ASM_EXPR>: A memory clobber
5633 clobbers all call-clobbered variables. Clobber clobber.
5635 * gimplify.c (canonicalize_component_ref): Remove redundant call
5636 to recalculate_side_effects.
5638 2003-11-14 Richard Henderson <rth@redhat.com>
5641 * tree-eh.c (struct leh_tf_state): Add outer.
5642 (lower_try_finally, lower_cleanup): Set it.
5643 (lower_try_finally_fallthru_label): New.
5644 (honor_protect_cleanup_actions): Use it.
5645 (lower_try_finally_copy, lower_try_finally_switch): Likewise.
5647 * tree-eh.c (collect_finally_tree): Complete manual tailrecurse
5650 2003-11-14 Richard Henderson <rth@redhat.com>
5652 * gimplify.c (voidify_wrapper_expr): Don't clobber TREE_TYPE of
5653 statements in a STATEMENT_LIST. Be prepared for an empty list.
5655 2003-11-14 Steven Bosscher <stevenb@suse.de>
5657 * jump.c (never_reached_warning): Remove function.
5658 * rtl.h (never_reached_warning): Don't declare it.
5659 * cfgrtl.c (never_reached_warning): Don't call it.
5660 * cse.c (never_reached_warning): Ditto.
5662 2003-11-13 Jeff Law <law@redhat.com>
5664 * tree-cfg.c (bsi_replace): Restore accidentally removed code.
5666 * tree-cfg.c (cfg_remove_useless_stmts_bb): Also detect useless
5667 var->var copies created by the out-of-ssa translation.
5669 2003-11-13 Steven Bosscher <stevenb@suse.de>
5672 * tree-inline.c (walk_tree): Handle PLACEHOLDER_EXPR.
5674 2003-11-13 Richard Henderson <rth@redhat.com>
5676 * tree-cfg.c (cfg_remove_useless_stmts_bb): Initialize stmt.
5678 2003-11-13 Jan Hubicka <jh@suse.cz>
5680 * calls.c (special_function_p): Do not check for ECF_MALLOC.
5681 (flags_from_decl_or_type): Use special_function_p.
5682 (expand_call): Remove call to special_function_p.
5683 * tree-cfg.c (notice_special_calls, clear_special_calls): New functions.
5684 (remove_useless_stmts): Use clear_special_calls.
5685 (remove_useless_stmts_1): Use notice_special_calls.
5686 * tree-flow.h (notice_special_calls, clear_special_calls): New functions.
5687 * tree-ssa-dce.c (remove_dead_stmts): Use clear_special_calls and
5688 notice_special_calls..
5690 * gimplify.c (gimplify_expr): Check labels.
5692 * tree-cfg.c (tree_verify_flow_info): Check labels.
5694 * tree-cfg.c (make_exit_edges): Do not create edges for const
5696 (update_call_expr_flags): Fix.
5698 2003-11-12 Diego Novillo <dnovillo@redhat.com>
5700 (declare_inlined_vars): New local function.
5701 (initialize_inlined_parameters): Call it.
5702 (expand_call_inline): Call it.
5704 2003-11-13 Steven Bosscher <stevenb@suse.de>
5706 PR optimization/12640
5707 * tree-ssa-ccp.c (get_strlen): Don't follow the UD chain
5708 of a PHI argument if the DEF stmt for the argument is
5711 2003-11-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
5712 Jeff Law <law@redhat.com>
5714 * tree-cfg.c (cfg_remove_useless_stmts): New function.
5715 (cfg_remove_useless_stmts_bb): Likewise.
5716 * tree-flow.h (cfg_remove_useless_stmts): Prototype.
5717 * tree-ssa.c (rewrite_out_of_ssa): Use cfg_remove_useless_stmts
5718 instead of remove_useless_stmts.
5720 2003-11-12 Richard Henderson <rth@redhat.com>
5722 * Makefile.in (OBJS-common): Add tree-iterator.o.
5723 (expr.o): Depend on tree-iterator.h.
5724 (GTFILES): Add tree-iterator.c.
5725 * basic-block.h (struct basic_block_def): Replace head_tree_p
5726 and end_tree_p with stmt_list.
5727 (tree_bb_root): New.
5728 (create_bb): Don't declare.
5729 * c-common.c (c_warn_unused_result): Handle STATEMENT_LIST.
5730 * c-simplify.c (c_gimplify_stmt): Don't rationalize_compound_expr.
5731 * cfg.c (entry_exit_blocks): Adjust for member changes.
5732 (compact_blocks): Manage tree_bb_root.
5733 * expr.c (expand_expr_1): Handle STATEMENT_LIST.
5734 * gimple-low.c: Update for tree_stmt_iterator changes.
5735 (lower_cond_expr): Use expr_only. Notice empty conditionals.
5736 * gimplify.c (append_to_statement_list_1): Create and
5737 manage statement_list nodes.
5738 (foreach_stmt): Remove.
5739 (wfl_locus): Remove.
5740 (annotate_all_with_locus_1): Merge into...
5741 (annotate_all_with_locus): ... here. Iterate over the
5742 statement list directly.
5743 (voidify_wrapper_expr): Handle STATEMENT_LIST.
5744 (gimplify_return_expr): Likewise.
5745 (gimplify_loop_expr): Likewise.
5746 (shortcut_cond_r, shortcut_cond_expr): Likewise.
5747 (gimplify_cleanup_point_expr): Likewise.
5748 (gimple_build_eh_filter): Create statement list bodies.
5749 (gimplify_bind_expr): Likewise.
5750 (gimplify_switch_expr): Likewise.
5751 (gimplify_cond_expr): Likewise.
5752 (gimplify_compound_expr): Handle void expressions as well.
5753 (gimplify_statement_list): New.
5754 (gimple_push_cleanup): Gimplify the WITH_CLEANUP_EXPR operand.
5755 (gimplify_stmt): Ensure non-null result.
5756 (gimplify_to_stmt_list): New.
5757 (gimplify_expr): Use gimplify_compound_expr, gimplify_statement_list,
5758 gimplify_to_stmt_list as appropriate.
5759 (gimplify_body): Fix creation of outer BIND_EXPR.
5760 * tree-cfg.c (tree_bb_root): New.
5761 (build_tree_cfg): Initialize it. Update for make_blocks changes.
5762 (factor_computed_gotos): Use create_bb directly.
5763 (make_blocks): Rewrite to use statement lists.
5764 (append_stmt_to_bb, prepend_stmt_to_bb): Remove.
5765 (create_bb): Make static. Add stmt_list argument. Don't allow
5766 null after argument. Set tree_bb_root.
5767 (make_edges): ENTRY block successor is FALLTHRU.
5768 (remove_useless_stmts_warn_notreached): Handle STATEMENT_LIST.
5769 (struct rus_data): Add last_goto.
5770 (remove_useless_stmts_cond): Clear it. Zap empty conditionals.
5771 Use expr_only for simple statment elimination.
5772 (remove_useless_stmts_tf): Clear last_goto. Use TREE_SIDE_EFFECTS
5773 instead of IS_EMPTY_STMT. Use append_to_statement_list instead of
5774 munging to COMPOUND_EXPR.
5775 (remove_useless_stmts_tc): Clear last_goto. Use TREE_SIDE_EFFECTS.
5776 (remove_useless_stmts_goto): Set last_goto.
5777 (remove_useless_stmts_label): New. Kill goto-next-label.
5778 (remove_useless_stmts_1): Reorg to handle STATEMENT_LIST.
5779 (remove_bb): Simplify block removal.
5780 (remove_bsi_from_block): Kill.
5781 (tree_block_forwards_to): Tidy bsi loops. Do not create
5783 (tree_cfg2dot): Update for bb->stmt_list.
5784 (delete_tree_cfg): Clear tree_bb_root.
5785 (set_bb_for_stmt): Handle STATEMENT_LISTs.
5786 (bsi_insert_before, bsi_insert_after): Re-implement on TSIs.
5787 (bsi_move_after, bsi_move_before, bsi_move_to_bb_end): Likewise.
5788 (bsi_replace): Likewise.
5789 (tree_find_edge_insert_loc): New, split from ...
5790 (bsi_insert_on_edge_immediate): ... here.
5791 (bsi_commit_edge_inserts): Use it. Add all stmts at once.
5792 (bsi_insert_on_edge): Use statement lists.
5793 (tree_split_edge): Position new block correctly. Deal with
5794 fallthrough to EXIT.
5795 (tree_verify_flow_info): Do not check block order vs statement chain.
5796 (tree_make_forwarder_block): Update create_bb call, fix edge flags.
5797 (thread_jumps): Call tree_redirect_edge_and_branch directly.
5798 (tree_block_label): Don't return a NONLOCAL_LABEL.
5799 (tree_redirect_edge_and_branch_1): Rename from s/_1//. Take an
5800 argument to use ssa_redirect_edge or redirect_edge_succ. Use
5801 tree_split_edge instead of bsi_insert_on_edge_immediate.
5802 (tree_redirect_edge_and_branch): New.
5803 (remove_stmt, first_exec_stmt, bsi_init, bsi_next_in_bb): Kill.
5804 (bsi_start, bsi_last, bsi_prev, bsi_from_tsi): Kill.
5805 (bsi_update_from_tsi, bsi_link_after): Kill.
5806 * tree-eh.c (collect_finally_tree): Handle STATEMENT_LIST.
5807 (replace_goto_queue_1): Likewise.
5808 (replace_goto_queue): Don't use walk_tree.
5809 (do_return_redirection): Create statement lists.
5810 (do_goto_redirection): Likewise.
5811 (block_may_fallthru_last): Fold into...
5812 (block_may_fallthru): ... here.
5813 (frob_into_branch_around): Use append_to_statement_list.
5814 (honor_protect_cleanup_actions): Likewise.
5815 (lower_try_finally_nofallthru): Likewise.
5816 (lower_try_finally_onedest): Likewise.
5817 (lower_try_finally_copy): Likewise.
5818 (lower_try_finally_switch): Likewise.
5819 (lower_try_finally): Likewise.
5820 (lower_catch): Likewise.
5821 (lower_eh_filter): Likewise.
5822 (lower_eh_constructs_1): Handle STATEMENT_LIST.
5823 * tree-flow-inline.h (BSI_NUM_ELEMENTS, bsi_list_p): Remove.
5824 (new_bsi_list, empty_bsi_stack, FOR_EACH_BSI_IN_REVERSE): Remove.
5825 (FOR_EACH_STMT_IN_REVERSE): Remove.
5826 (bsi_start, bsi_last, bsi_end_p): Re-implement based on TSIs.
5827 (bsi_next, bsi_prev, bsi_stmt, bsi_stmt_ptr, bsi_remove): Likewise.
5828 * tree-flow.h (block_stmt_iterator): Likewise.
5829 * tree-inline.c (copy_statement_list): New.
5830 (copy_body_r): Use it, and append_to_statement_list.
5831 (initialize_inlined_parameters): Use append_to_statement_list.
5832 (expand_call_inline): Likewise.
5833 (gimple_expand_calls_inline): New.
5834 (expand_calls_inline): Use it.
5835 (walk_tree, unsave_r): Handle STATEMENT_LIST.
5836 (add_stmt_to_compound): Remove.
5837 * tree-iterator.c: New file.
5838 * tree-iterator.h: Re-implement based on STATEMENT_LIST.
5839 * tree-mudflap.c (mf_decl_cache_locals): Don't
5840 rationalize_compound_expr.
5841 * tree-optimize.c (optimize_function_tree): Make static.
5842 Rechain statements from blocks before deleting the cfg.
5843 * tree-pretty-print.c (dump_generic_node): Handle STATEMENT_LIST,
5844 update for change in tree_stmt_iterator wrt COMPOUND_EXPR.
5845 (dump_generic_node): Dump lowered COND_EXPR on a single line.
5846 * tree-simple.c (is_gimple_stmt): Handle STATEMENT_LIST.
5847 * tree-simple.h (foreach_stmt_fn, foreach_stmt): Remove.
5848 (gimplify_to_stmt_list): Declare.
5849 (alloc_stmt_list, free_stmt_list): Declare.
5850 * tree-ssa-dce.c (should_remove_dead_stmt): Rename from
5851 remove_dead_stmt; return bool if statement should be removed.
5852 (remove_dead_stmts): Update to match.
5853 * tree-ssa-live.c (build_tree_conflict_graph): Don't use
5854 FOR_EACH_STMT_IN_REVERSE.
5855 * tree-ssa-pre.c (reaching_def): Tidy BSI usage.
5856 (insert_one_operand, collect_expressions): Likewise.
5857 * tree.c (tree_size): Handle STATEMENT_LIST.
5858 (copy_node): Abort on STATEMENT_LIST.
5859 (expr_first, expr_last): Move to tree-iterator.c.
5860 (expr_length): Remove.
5861 (tree_node_structure): Handle STATEMENT_LIST.
5862 (tsi_link_before, tsi_link_after, tsi_delink): Move to tree-iterator.c.
5863 (tsi_link_chain_before, tsi_link_chain_after): Merge into non-chain.
5864 (tsi_new_stmt_list, tsi_stmt_list_head, body_is_empty): Kill.
5865 * tree.def (STATEMENT_LIST): New.
5866 * tree.h (STATEMENT_LIST_HEAD, STATEMENT_LIST_TAIL): New.
5867 (struct tree_statement_list_node): New.
5868 (struct tree_statement_list): New.
5869 (enum tree_node_structure_enum): Add TS_STATEMENT_LIST.
5870 (union tree_node): Add stmt_list.
5871 (expr_length): Remove.
5873 (add_to_compound_expr, body_is_empty): Remove.
5874 (optimize_function_tree): Remove.
5876 2003-11-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
5878 * tree-flow.h (remove_useless_vars): Declare.
5879 (expand_var_p): Declaration removed.
5880 * tree-ssa.c (rewrite_out_of_ssa): Call remove_useless_vars.
5881 * tree-cfg.c (dump_function_to_file): Update dumping of variables.
5882 * gimple-low.c (expand_var_p): Made static.
5883 (remove_useless_vars): New.
5884 (expand_used_vars): Expand all variables in the
5885 cfun->unexpanded_var_list.
5887 2003-11-11 Richard Henderson <rth@redhat.com>
5889 * c-common.c (c_gimplify_stmt): Fix botched removal of
5890 rationalize_compound_expr calls.
5892 * c-semantics.c (build_stmt): Set TREE_SIDE_EFFECTS.
5893 * c-simplify.c (c_gimplify_stmt): Return a gimplify_status;
5894 mind the status from subroutines to avoid re-gimplification.
5895 (c_build_bind_expr): Do not call gimplify_stmt.
5896 (gimplify_c_loop): Don't create a loop_expr; fully gimplify.
5897 (gimplify_block, gimplify_cleanup, gimplify_expr_stmt,
5898 gimplify_for_stmt, gimplify_while_stmt, gimplify_do_stmt,
5899 gimplify_if_stmt, gimplify_switch_stmt, gimplify_return_stmt,
5900 gimplify_decl_stmt, gimplify_compound_literal_expr,
5901 gimplify_stmt_expr): Return a gimplify_status. In most cases,
5902 don't do local gimplification of sub-structures.
5903 (gimplify_decl_stmt): Use append_to_compound_expr when we care
5904 about the result value.
5905 (gimplify_stmt_expr): Use append_to_statement_list_force and
5906 re-gimplify so that voidify_wrapper_expr can work.
5907 (finish_bc_block): Don't append to a non-list.
5908 (c_gimplify_expr): Pass back the gimplify_status of subroutines.
5909 * c-common.h (c_gimplify_stmt): Update decl.
5910 * gimplify.c (append_to_statement_list_1): Make sure list_p is
5911 never null after call.
5912 (append_to_compound_expr): New.
5913 * tree-simple.h (append_to_compound_expr): Declare.
5915 2003-11-11 Richard Henderson <rth@redhat.com>
5917 * gimplify.c (gimplify_addr_expr): Clear, not copy, TREE_SIDE_EFFECTS.
5919 2003-11-11 Richard Henderson <rth@redhat.com>
5922 * c-simplify.c (gimplify_if_stmt): Remove short circuit.
5923 * tree-cfg.c (struct rus_data): Add has_label.
5924 (remove_useless_stmts_warn_notreached): New.
5925 (remove_useless_stmts_cond): Warn for deleted conditionals.
5926 (remove_useless_stmts_tc): Warn for deleted catches.
5927 (remove_useless_stmts_1): Set has_label.
5929 2003-11-11 Jan Hubicka <jh@suse.cz>
5931 * gimplify.c (gimplify_call_expr): Unset side effects for
5933 * tree-cfg.c (update-call_expr_flags): New function.
5934 (remove_useless_stmts_and_vars_1): Use it.
5935 (is_ctrl_altering_stmt): Pure/const calls never alter the CFG.
5936 * tree-ssa-dce.c (stmt_useful_p): Check side effects flag
5939 2003-11-11 Jan Hubicka <jh@suse.cz>
5941 * tree-cfg.c (has_label_p): New function.
5942 (tree_verify_flow_info): New checks.
5943 * tree-optimize.c (optimize_function_tree): Call verify_flow_info
5946 2003-11-11 Richard Henderson <rth@redhat.com>
5948 * tree-cfg.c (struct rus_data): Rename from rusv_data.
5949 Remove remove_unused_vars.
5950 (remove_useless_stmts*): Rename from remove_useless_stmts_and_vars*.
5951 (remove_useless_stmts_bind): Do not remove dead variables.
5952 (remove_useless_stmts): Kill remove_unused_vars argument.
5953 * tree-flow.h (remove_useless_stmts): Update.
5954 * tree-optimize.c (tree_rest_of_compilation): Update call.
5955 * tree-ssa.c (rewrite_out_of_ssa): Likewise.
5957 2003-11-11 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
5958 Diego Novillo <dnovillo@redhat.com>
5960 * basic-block.h (brief_dump_cfg): Declare.
5961 * cfg.c (dump_cfg_bb_info, brief_dump_cfg): New.
5962 * diagnostic.h (dump_generic_node): Declaration changed.
5963 (print_generic_stmt_indented): Declare.
5964 * gimple-low.c (expand_var_p): New.
5965 (expand_used_vars): Use it.
5966 * tree-cfg.c (struct cfg_stats_d): Remove num_failed_bind_expr_merges
5968 (remove_bb): Only dump whole block with TDF_DETAILS.
5969 (tree_dump_bb): Use dump_generic_bb.
5970 (dump_tree_cfg): Use brief_dump_cfg and dump_function_to_file.
5971 (dump_cfg_function_to_file): Merged into dump_function_to_file,
5973 (dump_cfg_stats): Do not dump cfg_stats.num_failed_bind_expr_merges.
5974 (dump_function_to_file): Moved from tree-dump.c, merged with
5975 dump_cfg_function_to_file.
5976 * tree-dump.c (dump_function_to_file): Removed.
5977 * tree-flow.h (dump_cfg_function_to_file): Declaration removed.
5978 (dump_generic_bb, expand_var_p): Declare.
5979 * tree-must-alias.c (tree_compute_must_alias): Replace
5980 dump_cfg_function_to_file by dump_function_to_file.
5981 * tree-ssa-ccp.c (tree_ssa_ccp): Ditto.
5982 * tree-ssa-copyprop.c (tree_ssa_copyprop): Ditto.
5983 * tree-ssa-dce.c (tree_ssa_dce): Ditto.
5984 * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Ditto.
5985 * tree-ssa-pre.c (tree_perform_ssapre): Ditto.
5986 * tree-ssa.c (rewrite_into_ssa, rewrite_out_of_ssa): Ditto.
5987 * tree-tailcall.c (tree_optimize_tail_calls): Ditto.
5988 * tree-pretty-print.c (print_declaration, print_generic_decl): Don't
5989 use flags argument, change spacing.
5990 (dump_block_info): Removed.
5991 (dump_generic_bb_buff, dump_generic_bb, print_generic_stmt_indented,
5992 dump_bb_header, dump_bb_end, dump_phi_nodes): New functions.
5993 (dump_vops): Change spacing, don't dump phi nodes.
5994 (do_niy, print_generic_stmt, print_generic_expr, print_declaration,
5995 print_struct_decl, print_call_name): Add argument to
5996 the dump_generic_node calls.
5998 (dump_generic_node): Print semicolons at end of statements correctly.
5999 Don't print bb related stuff.
6000 (maybe_init_pretty_print): Don't initialize last_bb.
6001 * tree-ssa.c (rewrite_out_of_ssa): Do not allow virtual operands to
6002 be shown in the .optimized dump.
6004 2003-11-11 Daniel Berlin <dberlin@dberlin.org>
6006 PR optimization/12936
6007 * tree-ssa-pre.c (expr_phi_insertion): Remove unused code that was
6008 causing ICE's for VA_ARG_EXPR.
6010 2003-11-10 Richard Henderson <rth@redhat.com>
6012 * gimple-low.c (lower_function_body): Lower bind_expr in place.
6013 (lower_stmt): Only incr for stmts we're skipping.
6014 (lower_cond_expr): Detect empty if.
6016 2003-11-10 Steven Bosscher <stevenb@suse.de>
6018 * toplev.c (rest_of_decl_compilation): Use the location of the
6019 declaration for error messages.
6021 2003-11-10 Richard Henderson <rth@redhat.com>
6023 * gimplify.c (add_stmt_to_compound, add_tree): Remove.
6024 (append_to_statement_list_1, append_to_statement_list): New.
6025 (append_to_statement_list_force): New.
6026 (gimplify_loop_expr): Take pre_p.
6027 (gimplify_expr): Provide it.
6028 * tree-simple.h: Update.
6030 * c-simplify.c: Replace add_tree with append_to_statement_list.
6031 * gimplify.c, tree-mudflap.c: Likewise.
6033 2003-11-10 Richard Henderson <rth@redhat.com>
6035 * c-common.c (c_warn_unused_result): Restructure to use iterator
6036 on COMPOUND_EXPR only.
6038 2003-11-09 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6040 * tree-cfg.c (tree_verify_flow_info): Fix checking of order of basic
6043 2003-11-09 Richard Henderson <rth@redhat.com>
6045 * basic-block.h (struct edge_def): Turn insns into a union.
6046 * cfgrtl.c (insert_insn_on_edge): Update to match.
6047 (commit_one_edge_insertion, commit_edge_insertions): Likewise.
6048 (commit_edge_insertions_watch_calls): Likewise.
6049 * gcse.c (reg_killed_on_edge, bypass_block): Likewise.
6050 * profile.c (instrument_edges): Likewise.
6051 * rtlanal.c (hoist_insn_to_edge): Likewise.
6052 * tree-cfg.c (PENDING_STMT): Likewise.
6053 (SET_PENDING_STMT): Remove.
6054 (bsi_commit_edge_inserts): Update to match.
6056 2003-11-08 Jan Hubicka <jh@suse.cz>
6058 * fold.c (nondestructive_fold_binary_to_constant): Fix typo.
6059 * fold-const.c (fold_relational_const): Check for side effects.
6061 2003-11-07 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6063 * basic-block.h (create_bb): Declaration changed.
6064 * tree-cfg.c (create_bb): Enable creating a block on specified place.
6065 (make_blocks, tree_split_edge, tree_make_forwarder_block): Use it.
6066 (tree_verify_flow_info): Check bbs are in the correct order.
6068 * tree-cfg.c (find_unreachable_blocks): Remove now incorrect comments.
6070 * tree-ssa.c (rewrite_out_of_ssa): Don't remove annotations from
6071 statements before the final dump.
6073 2003-11-07 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6075 * tree-tailcall.c (struct tailcall): New.
6076 (bb_optimize_tail_calls, find_tail_call_p): Removed.
6077 (eliminate_tail_call): Get the tailcall from the struct tailcall.
6078 (optimize_tail_call, find_tail_calls): New.
6079 (tree_optimize_tail_calls): Use them.
6081 2003-11-07 Jan Hubicka <jh@suse.cz>
6083 * gimple-low.c (simple_goto_p): Move to...
6084 * tree-cfg.c: (simple_goto_p): ... here;
6085 (nonlocal_goto_p): New.
6086 (is_computed_goto): Rename to ...
6087 (computed_goto_p): ... this; make global.
6088 (factor_computed_gotos, make_blocks): Update calls.
6089 (make_ctrl_stmt_edges): Add edge for nonlocal labels; use new functions.
6090 * tree-flow.h (is_coputed_goto): Kill.
6091 (nonlocal_goto_p, simple_goto_p, computed_goto_p): Declare.
6092 * tree-ssa-ccp (visit_stmt): Update.
6094 2003-11-07 Jan Hubicka <jh@suse.cz>
6096 * fold-const.c (tree_expr_nonzero_p): Fix typo.
6098 * fold-const.c (tree_expr_nonzero_p): New function.
6099 (fold_relational_const): Use it.
6100 (nondestructive_fold_binary_to_constant): Allow casts in address
6103 2003-11-06 Jan Hubicka <jh@suse.cz>
6105 * tree-cfg.c (tree_block_label): Cleanup.
6107 2003-11-06 Daniel Berlin <dberlin@dberlin.org>
6109 * tree-ssa-pre.c (fast_a_dominates_b): New function.
6110 (build_dfs_id_array_1): Ditto.
6111 (build_dfs_id_array): Ditto.
6112 (load_modified_phi_result): Use fast_a_dominates_b.
6114 Also use build_dfs_id_array, and remove some duplicate ephi_at_block
6116 (insert_occ_in_preorder_dt_order): Remove some duplicate ephi_at_block
6118 (pre_expression): Ditto.
6119 Also free dfs_id arrays here.
6120 (collect_expressions): Remove duplicate bsi_stmt calls.
6122 2003-11-06 Daniel Berlin <dberlin@dberlin.org>
6124 * tree-ssa-pre.c (count_stmts_in_bb): Removed.
6125 (set_var_phis): Only call bb_for_stmt once.
6126 (insert_one_operand): Remove endtree, endtreep, a lot of special handling
6127 no longer needed. Remove insert_done.
6128 (collect_expressions): Enable INDIRECT_REF and SSA_NAME handling.
6130 2003-11-06 Steven Bosscher <stevenb@suse.de>
6132 * tree-cfg.c (STRIP_CONTAINERS): Remove.
6134 2003-11-06 Jan Hubicka <jh@suse.cz>
6136 * tree-cfg.c (cleanup_cond_expr_graph): Clean edge flags.
6138 2003-11-06 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6140 * tree-dump.c (dump_options): Remove TDF_LINENO from all setting.
6142 2003-11-06 Jan Hubicka <jh@suse.cz>
6144 * builtins.c (expand_builtin_strstr, expand_builtin_strchr,
6145 expand_builtin_strrchr, expand_builtin_strpbrk,
6146 simplify_builtin_strstr, simplify_builtin_strrchr,
6147 simplify_builtin_strpbrk): Add missing casts.
6149 2003-11-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6151 * diagnostic.h (print_generic_decl): Declare.
6152 * tree-cfg.c (dump_cfg_function_to_file): Dump variables in
6153 unexpanded_var_list.
6154 * tree-pretty-print.c (print_generic_decl): New function.
6156 2003-11-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6158 * Makefile.in (gimplify.o): Add function.h dependency.
6159 * c-call-graph.c (construct_call_graph): Modify build_tree_cfg call.
6160 * gimple-low.c (record_vars): Export.
6161 (lower_function_body): Remove the topmost BIND_EXPR.
6162 * gimplify.c: Include function.h.
6163 (gimple_add_tmp_var): Record temporaries in the
6164 cfun->unexpanded_vars_list if available.
6165 * tree-cfg.c (build_tree_cfg): Work without the topmost BIND_EXPR.
6166 (dump_cfg_function_to_file): New.
6167 (dump_tree_cfg): Use dump_cfg_function_to_file.
6168 * tree-dump.c (dump_function_to_file): Work without the topmost
6170 * tree-flow.h (build_tree_cfg): Declaration changed.
6171 (dump_cfg_function_to_file, record_vars): Declare.
6172 * tree-optimize.c (optimize_function_tree, tree_rest_of_compilation):
6173 Work without the topmost BIND_EXPR.
6174 * tree-must-alias.c (tree_compute_must_alias): Use
6175 dump_cfg_function_to_file.
6176 * tree-ssa-ccp.c (tree_ssa_ccp): Ditto.
6177 * tree-ssa-copyprop.c (tree_ssa_copyprop): Ditto.
6178 * tree-ssa-dce.c (tree_ssa_dce): Ditto.
6179 * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Ditto.
6180 * tree-ssa-pre.c (tree_perform_ssapre): Ditto.
6181 * tree-ssa.c (rewrite_into_ssa, rewrite_out_of_ssa): Ditto.
6182 * tree-tailcall.c (tree_optimize_tail_calls): Ditto.
6183 * tree.h (optimize_function_tree): Declaration changed.
6185 2003-11-03 Daniel Berlin <dberlin@dberlin.org>
6187 * tree-ssa-pre.c (handle_bb_creation): Removed.
6188 (redo_dominators): Removed.
6189 (insert_one_operand): Remove code to handle bb creation, since all
6190 critical edges are now pre-split.
6191 (finalize_2): Remove redo_dominators related code.
6192 (pre_expression): Return 1 if we exited early because nothing happened.
6193 (split_critical_edges): Do fake variable assignments instead, because
6194 it works. return true if we actually split an edge.
6195 (tree_perform_ssapre): Remove redo_dominators code.
6197 2003-11-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6199 * function.h (struct function): New field unexpanded_var_list.
6200 * gimple-low.c (unexpanded_var_list): Removed.
6201 (record_vars, expand_used_vars): Use cfun->unexpanded_var_list.
6202 * tree-flow.h (unexpanded_var_list): Declaration removed.
6204 * gimplify.c (should_carry_locus_p): New.
6205 (annotate_all_with_locus_1): Use it. Do not annotate empty
6208 2003-11-03 Jan Hubicka <jh@suse.cz>
6210 * tree-cfg.c (tree_try_redirect_by_replacing_jump): Do not use
6213 2003-11-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6215 * tree-pretty-print.c (dump_block_info): Add flags parameter.
6216 Only show line number when asked to.
6217 (dump_generic_node): Pass flags to dump_block_info.
6219 2003-11-03 Jan Hubicka <jh@suse.cz>
6221 * cfghooks.h (redirect_edge_and_branch hook): Make it return edge.
6222 * cfgrtl.c (cfg_layout_redirect_edge_and_branch,
6223 rtl_redirect_edge_and_branch, try_redirect_by_replacing_jump):
6224 Update to new interface.
6225 * tree-cfg.c (tree_cfg_hooks): Move to end of file; set
6226 redirect_edge_and_branch and redirect_edge_and_branch_force.
6227 (thread_jumps): Use redirect_edge_and_branch.
6228 (tree_block_label): new; break out of thread_edge.
6229 (tree_try_redirect_by_replacing_jump): New.
6230 (thread_edge): Rename to tree_redirect_edge_and_branch; deal sanely
6231 with unusual edges; preserve profile.
6232 (tree_redirect_edge_and_branch_force): New.
6233 * tree-flow.h (ssa_redirect_edge): Declare.
6234 * tree-ssa.dom.c (tree_ssa_dominator_optimize): Use redirect_edge_and_branch.
6235 * tree-ssa.c (ssa_redirect_edge): New.
6237 2003-11-03 Jeff Law <law@redhat.com>
6239 * domwalk.h (struct dom_walk_data): New field "global_data".
6240 * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): Initialize new
6241 "global_data" field.
6242 * tree-flow.h (enum need_phi_state): New enumeration.
6243 (var_ann_d): Add bitfield for need_phi_state.
6244 * tree-ssa.c (mark_def_sites_global_data): New structure to hold
6245 global data for mark_def_sites dominator walk.
6246 (mark_def_sites): Revamp to be called via the dominator walker.
6247 (set_def_block): Update need_phi_state for the variable as needed.
6248 (set_livein_block): Similarly.
6249 (rewrite_into_ssa): Use dominator walker to call mark_def_sites.
6250 Delay freeing dominance info. Kill "globals" bitmap.
6251 (insert_phi_nodes): No longer need "globals" bitmap. Use
6252 need_phi_state in variable's annotation to determine if a PHI
6255 * tree-ssa-dom.c (dom_opt_finalize_block): Try to thread across the
6256 edges leaving COND_EXPR nodes which are leafs in the dominator
6258 (record_equivalences_from_incoming_edge): Do not set EQ_EXPR_VALUE
6259 unless the block's single predecessor contains parent_block_last_stmt.
6261 2003-11-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6263 * tree-dump.c (dump_options): Add TDF_LINENO.
6264 * tree-pretty-print.c (dump_generic_node): Print line number for
6265 statements if asked to.
6266 * tree.h (TDF_LINENO): New.
6267 * doc/invoke.texi (lineno): Document.
6269 2003-11-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6271 * expr.c (expand_vars, expand_var): Split of ...
6272 (expand_expr_1): ... here.
6273 * expr.h (expand_var): Declare.
6274 * gimple-low.c (lower_function_body, lower_stmt, lower_bind_expr):
6275 Eliminate BIND_EXPRs.
6276 (expand_used_vars): New.
6277 * tree-alias-common.c (create_alias_vars): Walk variables in blocks.
6278 * tree-cfg.c (make_bind_expr_blocks): Removed.
6279 (make_blocks, build_tree_cfg, factor_computed_gotos): Don't handle
6281 (assign_vars_to_scope, successor_block, NEXT_BLOCK_LINK): Removed.
6282 (make_edges, make_exit_edges): Don't use successor_block.
6283 (remove_useless_stmts_and_vars_goto): Don't expect NEXT_BLOCK_LINK
6285 (bsi_init, bsi_next_in_bb, bsi_from_tsi): Don't handle BIND_EXPRs.
6286 (replace_stmt): Don't create BIND_EXPRs.
6287 * tree-flow.h (struct var_ann_d): Removed field scope.
6288 (struct stmt_ann_d): Removed fields scope and scope_level.
6289 (propagate_copy): Declaration changed.
6290 (fixup_var_scope): Removed.
6291 * tree-must-alias.c (tree_compute_must_alias): Consider DECL_NONLOCAL
6292 vars call clobbered.
6293 * tree-optimize.c (tree_rest_of_compilation): Call expand_used_vars.
6294 * tree-ssa-copyprop.c (move_var_to_scope, fixup_var_scope): Removed.
6295 (copyprop_stmt): Call to propagate_copy changed.
6296 (propagate_copy): Don't update scope.
6297 * tree-ssa-dom.c (cprop_into_stmt): Call to propagate_copy changed.
6298 (eliminate_redundant_computations): Don't call fixup_var_scope.
6299 * tree-ssa.c (insert_copy_on_edge): Don't update scope.
6301 2003-11-02 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6303 * tree-inline.c (walk_tree): Tail recursion optimized for
6305 * tree-eh.c (collect_finally_tree): Ditto.
6307 2003-11-02 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6309 * tree-optimize.c (optimize_function_tree): Removed duplicate call of
6310 lower_function_body. Moved call of reset_block_changes ...
6311 (tree_rest_of_compilation) ... here. Reset the scope to top before
6312 expanding function end.
6314 2003-11-01 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6316 * basic-block.h (BB_CONTROL_STRUCTURE): Removed.
6317 * tree-cfg.c (struct cfg_stats_d): Field num_merged_cases removed.
6318 (make_blocks, make_bind_expr_blocks, append_stmt_to_bb, bsi_link_after,
6319 build_tree_cfg, factor_computed_gotos, prepend_stmt_to_bb,
6320 remove_stmt, replace_stmt): Don't set parent.
6321 (set_parent_stmt, add_stmt_to_bb, find_contained_blocks,
6322 blocks_unreachable_p, remove_blocks, remove_unreachable_block,
6323 move_outgoing_edges, merge_tree_blocks, remap_stmts): Removed.
6324 (REMOVE_ALL_STMTS, REMOVE_NO_STMTS, REMOVE_NON_CONTROL_STRUCTS,
6325 REMOVE_CONTROL_STRUCTS): Removed.
6326 (remove_bb): Code to handle control structures removed.
6327 (tree_block_forwards_to): Don't stop due to CASE_LABEL_EXPRs.
6328 (tree_dump_bb): Don't print parent. Print only BIND_EXPRs in slim
6330 (dump_tree_cfg): Don't count merged case labels.
6331 (is_ctrl_structure): Removed.
6332 (stmt_starts_bb_p): Don't handle CASE_LABEL_EXPRs.
6333 (tree_verify_flow_info): Don't check BB_CONTROL_STRUCTURE.
6334 * tree-flow-inline.h (parent_block, parent_stmt): Removed.
6335 * tree-flow.h (struct stmt_ann_d): Remove parent_stmt field.
6336 (parent_stmt, parent_block, is_ctrl_structure): Declarations removed.
6337 * tree-pretty-print.c (dump_generic_node): Don't handle lowered
6338 COND_EXPRs specially.
6339 * tree-ssa-ccp.c (visit_stmt): Don't check is_ctrl_structure.
6341 2003-10-31 Jeff Law <law@redhat.com>
6343 * tree-ssa-dom.c (record_equivalences_from_stmt): Restore lost code
6344 to create equivalences from BIT_IOR_EXPR.
6346 * tree-ssa-dom.c (thread_jumps_walk_stmts): Go ahead and optimize
6347 a COND_EXPR with a compile-time constant condition.
6349 2003-10-31 Diego Novillo <dnovillo@redhat.com>
6351 * tree-optimize.c (optimize_function_tree): Fix comment
6352 describing SSA pass after DOM2.
6354 2003-10-31 Diego Novillo <dnovillo@redhat.com>
6356 Fix PR optimization/12825
6357 * tree-optimize.c (optimize_function_tree): Run SSA renamer after
6360 2003-10-30 Richard Henderson <rth@redhat.com>
6362 * c-common.c (match_case_to_enum_1, match_case_to_enum): New.
6363 (c_do_switch_warnings): New.
6364 * c-common.h (c_do_switch_warnings): Declare.
6365 * c-typeck.c (c_finish_case): Call it.
6366 * stmt.c (all_cases_count, BITARRAY_TEST, BITARRAY_SET,
6367 mark_seen_cases, check_for_full_enumeration_handling): Remove.
6368 (expand_end_case_type): Don't do warn_switch handling.
6369 * expr.h, tree.h: Remove dead decls.
6371 * c-simplify.c (gimplify_switch_stmt): Force switch body non-null.
6373 2003-10-30 Richard Henderson <rth@redhat.com>
6375 * tree-cfg.c (thread_jumps): Allow SWITCH_EXPR.
6376 (thread_edge): Handle it. Tidy surrounding code.
6378 2003-10-30 Richard Henderson <rth@redhat.com>
6380 * domwalk.c (walk_dominator_tree): Pass any final is_ctrl_stmt
6381 down the recursive walk.
6383 2003-10-30 Jeff Law <law@redhat.com>
6385 * tree-ssa-dom.c (thread_across_edge): Renamed from
6386 thread_through_successor. Revamp to thread the destination of an edge
6387 rather than the successors of a block.
6388 (dom_opt_finalize_block): Corresponding changes. Do not bother calling
6389 thread_across_edge unless we are at a leaf in the dominator tree.
6391 * tree-cfg.c (thread_jumps): Now returns a bool. Move some tests into
6392 tree_forwarder_block_p. Improve comments.
6393 (cleanup_control_flow): Now returns a bool indicating if anything was
6395 (thread_unconditional_jumps): Kill.
6396 (cleanup_tree_cfg): Repeat cascading cleanups until nothing changes.
6397 (tree_forwarder_block_p): Check forwardable bit in the block's
6398 annotation to avoid useless work. Mark blocks as not forwardable as
6399 appropriate. Verify destination is not the exit block here. Do not
6400 consider successors of the entry block as forwarders. Ignore empty
6401 statements when walking through the block's statements. Verify target
6402 block is not the start of a case label and that we can safely insert
6403 a label at the target block.
6405 2003-10-29 Richard Henderson <rth@redhat.com>
6407 * c-common.c (c_warn_unused_result): Remove lowered containers.
6408 * c-semantics.c (genrtl_case_label): Update add_case_node call.
6409 * c-simplify.c (gimplify_switch_stmt): Build SWITCH_EXPR and
6410 gimplify it simultaneously with the body.
6411 * expr.c (expand_expr_1): Handle SWITCH_BODY clear and
6412 SWITCH_LABELS set. Update add_case_node calls.
6413 * gimple-low.c (lower_stmt): Don't do anything for SWITCH_EXPR.
6414 (lower_switch_expr, lower_case_label_expr): Remove.
6415 * gimplify.c (gimplify_switch_expr): Zap SWITCH_BODY after
6416 gimplification. Force default entry for SWITCH_LABELS.
6417 (gimplify_case_label_expr): Rename from gimple_add_case_label.
6418 Assert switch in scope; lower to LABEL_EXPR.
6419 * stmt.c (pushcase, pushcase_range) Update add_case_node calls.
6420 (add_case_node): Add dont_expand_label argument.
6421 (same_case_target_p): Don't search rtl.
6422 * tree-cfg.c (enum find_location_action): Remove.
6423 (make_switch_expr_blocks): Remove.
6424 (make_blocks): Update.
6425 (make_case_label_edges): Remove.
6426 (make_edges): Update.
6427 (find_contained_blocks): Remove lowered containers.
6428 (make_switch_expr_edges): New.
6429 (make_ctrl_stmt_edges): Call it.
6430 (make_cond_expr_edges): Use label_to_block.
6431 (remove_useless_stmts_and_vars_1): Don't go into SWITCH_BODY.
6432 (remove_unreachable_block): Remove SWITCH_EXPR special case.
6433 (cleanup_cond_expr_graph): Tidy.
6434 (cleanup_switch_expr_graph): Rewrite.
6435 (disconnect_unreachable_case_labels): Remove.
6436 (find_taken_edge_cond_expr): Use integer_zerop/integer_nonzerop.
6437 (find_taken_edge_switch_expr): Rewrite.
6438 (value_matches_some_label): Remove.
6439 (find_case_label_for_value): New.
6440 (is_ctrl_structure): Remove lowered containers.
6441 (is_ctrl_stmt): Add SWITCH_EXPR.
6442 (switch_parent): Remove.
6443 (handle_switch_fallthru): Remove.
6444 (handle_switch_split): Remove.
6445 (find_insert_location): Merge into ...
6446 (bsi_insert_on_edge_immediate): ... here. Simplify.
6447 (tree_split_edge): Don't set EDGE_FALLTHRU.
6448 * tree-eh.c (collect_finally_tree): Remove lowered containers.
6449 (replace_goto_queue_1, block_may_fallthru_last): Likewise.
6450 (lower_eh_constructs_1): Likewise.
6451 (verify_norecord_switch_expr): New.
6452 (lower_try_finally_switch): Generate lowered switches.
6453 * tree-inline.c (expand_calls_inline): Don't search null SWITCH_BODY.
6454 * tree-pretty-print.c (dump_generic_node): Do something sensible
6455 with lowered switch_expr.
6456 * tree-ssa-dom.c (record_equivalences_from_incoming_edge): Update
6457 for lowered switch_expr.
6458 * tree.def (SWITCH_EXPR): Update docs.
6459 * tree.h (add_case_node): Update decl.
6461 2003-10-29 Daniel Berlin <dberlin@dberlin.org>
6463 * tree-ssa-pre.c (n_phi_preds): New variable.
6464 (generate_vops_as_of_bb): New function
6465 (generate_expr_as_of_bb): Remove unused first argument. Update all
6467 (subst_phis): Add boundary check for the phi_pred_cache array.
6468 (same_e_version_phi_result): Once modified, no point in continuing
6470 (finalize_2): ESSA Minimization can crash if we ended up with new
6473 2003-10-29 Richard Henderson <rth@redhat.com>
6475 * tree-eh.c (do_return_redirection): Don't move copy to RESULT_DECL
6476 outside the RETURN_EXPR. Introduce a new temporary as needed.
6478 2003-10-26 Richard Henderson <rth@redhat.com>
6480 * gimplify.c (keep_function_tree_in_gimple_form): Remove.
6481 (gimplify_function_tree): Return void. Remove hack for
6482 language not supporting gimple.
6483 * tree.h: Update decls.
6484 * langhooks-def.h (LANG_HOOKS_GIMPLE_BEFORE_INLINING): New.
6485 * langhooks.h (struct lang_hooks): Add gimple_before_inlining.
6486 * tree-inline.c (copy_body_r): Check that instead of
6487 keep_function_tree_in_gimple_form.
6488 (initialize_inlined_parameters): Likewise.
6489 (expand_call_inline, expand_calls_inline): Likewise.
6491 * explow.c (probe_stack_range): Never emit loop notes.
6492 * expr.c (emit_block_move_via_loop): Likewise.
6493 * toplev.c (rest_of_compilation): Always synthesize loop notes.
6495 2003-10-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6497 * Makefile.in (gimple-low.o): Add function.h dependency.
6498 * gimple-low.c (struct lower_data): New field block.
6499 (lower_function_body, lower_stmt, lower_bind_expr): Record
6500 the block at statements.
6501 * cfglayout.c (insn_locators_initialize): Use new info about
6503 * expr.c (expand_expr): Record block changes.
6504 * function.c (blocks_nreverse): Export.
6505 (uninitialized_vars_warning): Use DECL_RTL_SET_P to test for presence
6507 (reset_block_changes, record_block_change, finalize_block_changes,
6508 check_block_change, free_block_changes): New functions.
6509 * function.h (struct function): New bitfield dont_emit_block_notes.
6510 New field ib_boundaries_block.
6511 (blocks_nreverse, reset_block_changes, record_block_change,
6512 finalize_block_changes, check_block_change, free_block_changes):
6514 * sibcall.c (optimize_sibling_and_tail_recursive_call): Don't call
6515 reorder_blocks when dont_emit_block_notes.
6516 * stmt.c (expand_start_bindings_and_block, expand_end_bindings):
6517 Don't emit block notes when dont_emit_block_notes.
6518 * toplev.c (rest_of_compilation): Don't call reorder_blocks when
6519 dont_emit_block_notes.
6520 * tree.c (build1): Initialize TREE_BLOCK field.
6521 * tree-flow.h (lower_function_body): Declare.
6522 * tree-optimize.c: Include function.h.
6523 (optimize_function_tree): Call lower_function_body.
6524 * tree.h (struct tree_exp): Add block field.
6525 (TREE_BLOCK): New macro.
6527 2003-10-26 Richard Henderson <rth@redhat.com>
6529 * tree.h (tree_dump_index): Add TDI_lower.
6530 * tree-dump.c (dump_files): Add .lower entry.
6531 * tree-optimize.c (optimize_function_tree): Move lower_function_body,
6532 (tree_rest_of_compilation): here. Tidy .useless dump.
6534 2003-10-25 Jan Hubicka <jh@suse.cz>
6536 * c-common.c (c_estimate_num_insns_1): Kill.
6537 (c_estimate_num_insns): Kill.
6538 * c-common.h (c_estimate_num_insns): Kill.
6539 * c-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill.
6540 * cp-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill.
6541 * objc-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill.
6542 * java/lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill.
6543 (java_estimate_num_insns_1, java_estimate_num_insns): Kill.
6544 * cgraphunit (cgraph_analyze_function): Use estimate_num_insns.
6545 * tree-eh.c (decide_copy_try_finally): Likewise.
6546 * tree-inline.c (limits_allow_inilining, optimize_inline_calls): Likewise.
6547 (estimate_num_insns_1, estimate_num_insns): New functions.
6548 * langhooks-def.h (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Kill.
6549 * langhooks.h (estimate_num_inssn): Kill.
6550 * tree-inline.h (estimate_num_insns): Declare.
6552 2003-10-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6554 * gimple-low.c: New.
6555 * Makefile.in (gimple-low.o): Add.
6556 * domwalk.c (walk_dominator_tree): Consider COND_EXPR a control
6558 * tree-cfg.c (make_cond_expr_blocks, linearize_control_structures,
6559 linearize_cond_expr): Removed.
6560 (thread_jumps, tree_forwarder_block_p): New.
6561 (merge_tree_blocks): Unused now.
6562 (phi_alternatives_equal): Modified for use in jump threading.
6563 (enum find_location_action): Remove EDGE_INSERT_LOCATION_NEW_ELSE.
6564 (make_blocks): Don't call make_cond_expr_blocks.
6565 (set_parent_stmt): Ensure we don't set COND_EXPR as a parent
6567 (find_contained_blocks): Remove COND_EXPR alternative.
6568 (make_cond_expr_edges): Handle lowered gotos.
6569 (cleanup_tree_cfg): Don't call linearize_control_structures,
6570 call thread_jumps and verify_flow_info and rerun cleanup_control_flow.
6571 (remove_unreachable_block): Remove handling of structured COND_EXPRs.
6572 (remove_bb): Fix warning for removed goto exprs.
6573 (cleanup_control_flow, cleanup_cond_expr_graph,
6574 cleanup_switch_expr_graph, find_taken_edge_cond_expr,
6575 bsi_insert_before, find_insert_location, bsi_insert_on_edge_immediate):
6576 Handle lowered COND_EXPRs.
6577 (is_ctrl_structure): Remove COND_EXPR.
6578 (is_ctrl_stmt): Add COND_EXPR.
6579 (tree_verify_flow_info): Check validity of COND_EXPRs.
6580 (thread_edge): Moved from tree-ssa-dom.c.
6581 * tree-flow.h (cleanup_cond_expr_graph, cleanup_switch_expr_graph):
6582 Declaration changed.
6583 (thread_edge, lower_function_body): Declare.
6584 * tree-optimize.c (optimize_function_tree): Call lower_function_body.
6585 * tree-pretty-print.c (dump_generic_node): Dump lowered cond_exprs in
6587 * tree-ssa-copyprop.c (fixup_var_scope): Handle non-SSA_NAMEs.
6588 * tree-ssa-dce.c (stmt_useful_p, process_worklist): Cleaned up when
6589 COND_EXPRs are lowered.
6590 * tree-ssa-dom.c (thread_edge): Moved to tree-cfg.c.
6591 (tree_ssa_dominator_optimize_1): Dumps and setting of vars_to_rename
6592 moved from thread_edge.
6593 (optimize_stmt): Pass block iterator to cleanup_cond_expr_graph and
6594 cleanup_switch_expr_graph.
6595 * tree-ssa.c (insert_copy_on_edge): Fixup scope for emitted variables.
6597 * dominance.c (BB_NODE): Use VARRAY_GENERIC_PTR_NOGC.
6598 (calculate_dominance_info): Use VARRAY_GENERIC_PTR_NOGC_INIT.
6599 * varray.c (element): Add GENERIC_PTR_NOGC entry.
6600 * varray.h (enum varray_data_enum): Add VARRAY_DATA_GENERIC_NOGC.
6601 (union varray_data_tag): Add generic_nogc.
6602 (VARRAY_GENERIC_PTR_NOGC_INIT, VARRAY_GENERIC_PTR_NOGC,
6603 VARRAY_PUSH_GENERIC_PTR_NOGC, VARRAY_TOP_GENERIC_PTR_NOGC): New.
6605 2003-10-25 Jan Hubicka <jh@suse.cz>
6607 * cppcharset.c (one_utf8_to_utf32): Initialize 's' to silence warning.
6609 2003-10-25 Jan Hubicka <jh@suse.cz>
6611 * fold-const.c (nondestructive_fold_binary_to_constant): Realize that
6612 (plus (address) (const_int)) is a constant.
6614 2003-10-25 Jan Hubicka <jh@suse.cz>
6616 * opts.c (decode_options): Uncomment unit-at-a-time setting
6617 * params.def: Syncrhonize with manline.
6618 * tree-inline.c (initialize_inlined_parameters): Set variable as
6621 2003-10-24 Steven Bosscher <steven@gcc.gnu.org>
6623 * gimplify.c (create_artificial_label): New function.
6624 (build_and_jump): Use it.
6625 * c-simplify.c (c_gimplify_stmt): Likewise.
6626 (gimplify_condition): Likewise.
6627 * tree-cfg.c (factor_computed_gotos, tree_block_forwards_to,
6628 handle_switch_fallthru, handle_switch_split): Likewise.
6629 * tree-ssa-dom.c (thread_edge): Likewise.
6630 * tree-ssa-pre.c (split_critical_edges): Likewise.
6631 * tree-tailcall.c (eliminate_tail_call): Likewise.
6632 * tree-eh.c (frob_into_branch_around,
6633 honor_protect_cleanup_actions, lower_try_finally_nofallthru,
6634 lower_try_finally_onedest, lower_try_finally_copy,
6635 lower_try_finally_switch, lower_catch, lower_eh_filter,
6636 lower_cleanup): Likewise.
6637 (make_label): Remove.
6638 * tree-simple.h (create_artificial_label): Add prototype.
6639 * tree-inline.c (expand_call_inline): Make return label for
6640 inlined function artificial.
6642 2003-10-23 Jeff Law <law@redhat.com>
6644 * timevar.def (TV_TREE_SSA_THREAD_JUMPS): New timevar.
6645 * tree-dump.c (dump_files): Add dump file for jump threading.
6646 * tree.h (TDI_thread_jumps): New enum member.
6647 * tree-cfg.c (tree_block_forwards_to): No longer static.
6648 * tree-flow.h (tree_block_forwards_to): Prototype.
6649 (tree_ssa_dominator_thread_jumps): Likewise.
6650 * tree-optimize.c (optimize_function_tree): Call jump threader.
6651 * tree-ssa-dom.c (tree_ssa_dominator_optimize_1): New function.
6652 Common code for redundancy elimination and jump threading on
6653 the dominator tree. Slightly different callback initialization
6654 for redundancy elimination and jump threading. Initialize
6655 block forwardable attribute.
6656 (tree_ssa_dominator_optimize): Call tree_ssa_dominator_optimize_1.
6657 (tree_ssa_dominator_thread_jumps): New function.
6658 (thread_edge): Mark results of PHI nodes as needing rewriting if
6659 we have threaded through a block with PHI nodes.
6660 (thread_through_successor): If thread_through_phis is nonzero,
6661 then allow jump threading through blocks with PHI nodes. If the
6662 target block is a forwarder block, then forward the jump.
6663 (thread_jumps_walk_stmts): Statement walker for dominator thread
6666 * tree-ssa-dom.c (record_equivalence_from_incoming_edge): Fix
6669 2003-10-23 Richard Henderson <rth@redhat.com>
6671 * gimplify.c (gimplify_*): Return gimplify_status.
6672 (gimple_add_tmp_var): Set seen_in_bind_expr.
6673 (gimplify_bind_expr): Likewise. Kill if 0 code.
6674 (gimplify_return_expr): Cope with error marks.
6675 (gimple_push_cleanup): Do nothing if errors seen.
6676 (gimplify_expr): Cope with error marks. Use gimplify_status to
6677 decide when to exit the main loop. Zap statements with errors.
6678 (gimplify_body): Return void.
6679 (keep_function_tree_in_gimple_form): Don't exit on errors.
6680 (gimplify_function_tree): Return bool. Don't exit on errors.
6681 * langhooks.c (lhd_gimplify_expr): Return GS_UNHANDLED.
6682 * langhooks.h (struct lang_hooks): Update docs for gimplify_expr.
6683 * tree-optimize.c (optimize_function_tree): Don't exit on errors.
6684 Move delete_tree_cfg call outside optimization clause.
6685 (tree_rest_of_compilation): Don't exit on errors.
6686 * tree-simple.h (enum gimplify_status): New.
6687 (gimplify_expr, gimplify_stmt, gimplify_body): Update.
6688 * tree-ssa.c (rewrite_out_of_ssa): Move delete_tree_cfg call to
6689 optimize_function_tree.
6690 * tree.h (struct tree_decl): Add seen_in_bind_expr.
6691 (gimplify_function_tree): Update.
6692 * c-common.c (c_add_case_label): Unify three error exit paths.
6693 Create a normal label, not a case label to suppress unreachable
6695 * c-simplify.c (c_build_bind_expr): Don't create an empty bind
6696 body. Pass entire bind_expr to gimplify_stmt.
6697 (gimplify_block): Don't abort on mismatches if errors seen.
6698 (gimplify_expr_stmt): Cope with error marks.
6699 (gimplify_decl_stmt): Likewise.
6700 (c_gimplify_expr): Return gimplify_status.
6702 2003-10-22 Daniel Berlin <dberlin@dberlin.org>
6704 * tree-pretty-print.c (dump_generic_node): Kill off ELEFT_NODE.
6705 Print out status of new EUSE_LVAL flag.
6707 * tree-ssa-pre.c: #include alloc-pool.h
6708 (append_eref_to_block): Inline.
6709 (names_match_p): Ditto.
6710 (pre_expression): Take sbitmap of variables to rename so we can
6711 mark our new variable if necessary.
6712 (insert_occ_in_preorder): Completely redo to be an O(n log n)
6713 algorithm worst case, instead O(n^2) all the time.
6714 (build_dfn_array): New function.
6715 (eref_compare): Ditto.
6716 (preorder_count): Remove no-longer used variable.
6717 (pre_stats): Add new stats about memory use.
6718 (struct expr_info): add loadpre_cand member.
6719 (euse_node_pool): New alloc-pool
6720 (eref_node_pool): Ditto
6721 (create_expr_ref): Use them.
6722 (expr_phi_insertion): Insert on PHI's of VUSES for loadpre cands.
6723 Not all expressions have uses (left occurrences don't).
6724 (load_modified_real_occ_real_occ): Return false, not abort.
6725 (process_delayed_rename): Remove useless fibheap, do proper LVAL
6727 (insert_euse_in_preorder_dt_order_1): No more ELEFT_NODE's.
6728 (finalize_1): Ditto.
6730 (really_available_def): New function.
6731 (finalize_2): Use really_available_def, not EUSE_SAVE, during EPHI
6733 (names_match_p): Handle INDIRECT_REF properly.
6734 (call_modifies_slot): Removed.
6735 (add_call_to_ei): Removed.
6736 (process_left_occs_and_kills): Fix.
6737 (pre_expression): Zero out counts.
6738 (collect_expressions): Split out from tree_perform_ssapre. Do this
6740 (tree_perform_ssapre): Create and free alloc-pools.
6741 Rename new variables that need to be renamed.
6743 * tree.c (tree_size): Remove ELEFT_NODE.
6744 (tree_node_size): Ditto.
6745 (is_essa_node): Ditto.
6747 * tree.def (ELEFT_NODE): Gone.
6749 * tree.h (EREF_NODE_CHECK): No more ELEFT_NODE.
6750 (struct tree_eref_common): Add ID flag.
6751 (struct tree_euse_node): Add lval flag.
6752 (EREF_ID): New macro.
6753 (EUSE_LVAL): New macro.
6755 2003-10-22 Daniel Berlin <dberlin@dberlin.org>
6757 * tree-flow-inline.h (add_dom_child): XMALLOC, not GGC_ALLOC,
6759 (clear_dom_children): XFREE the bitmap.
6761 2003-10-22 Andrew MacLeod <amacleod@redhat.com>
6763 * tree-ssa-live.c (new_tree_live_info, (delete_tree_live_info,
6764 live_worklist, set_if_valid, add_livein_if_notdef,
6765 calculate_live_on_entry, calculate_live_on_exit,
6766 add_conflicts_if_valid, dump_live_info): Use bitmap instead of sbitmap.
6767 (build_tree_conflict_graph): Use bitmap, Change mechanism for
6768 adding conflicts between live-on-entry partitions.
6769 * tree-ssa-live.h (struct tree_live_info_d): Switch to bitmaps.
6770 (partition_is_global, live_entry_blocks, live_on_exit,
6771 live_merge_and_clear, make_live_on_entry): Switch to bitmaps.
6772 * tree-ssa.c (struct _elim_graph): Remove bitmaps, use varrays.
6773 (new_elim_graph, clear_elim_graph, delete_elim_graph): Switch from
6774 old bitmap implementation.
6775 (elim_graph_size): New. Number of elements in elimination graph.
6776 (elim_graph_add_node): New. Add an element to the elim-graph.
6777 (elim_graph_add_edge): New. Add an edge to the elim-graph.
6778 (elim_graph_remove_succ_edge): New. Remove an edge for which a node
6780 (FOR_EACH_ELIM_GRAPH_SUCC): Find all successor nodes.
6781 (FOR_EACH_ELIM_GRAPH_PRED): Find all predeccesor nodes.
6782 (eliminate_name, eliminate_build, elim_forward,
6783 elim_unvisited_predecessor, elim_backward, elim_create, eliminate_phi):
6784 Use new elim-graph routines.
6785 (rewrite_out_of_ssa): Enable single-definition compaction when not
6786 combining temporaries.
6788 2003-10-21 Richard Henderson <rth@redhat.com>
6790 * gimplify.c: Sort functions into use order, and all gimplification
6791 functions to the end.
6793 2003-10-22 Jeff Law <law@redhat.com>
6795 * tree-cfg.c (thread_unconditional_jumps): New function.
6796 (tree_block_forwards_to): Likewise.
6797 (cleanup_tree_cfg): Call thread_unconditional_jumps.
6798 * tree-flow.h (bb_ann_t): Add forwardable status bit.
6800 * tree-dump.c (dump_files): Add entry for TDI_none.
6801 (dump_begin): Do nothing for TDI_none.
6802 (dump_enable_all, dump_switch_p): Start our scan at TDI_none + 1.
6803 * tree.h (tree_dump_index): Add.
6804 * tree-ssa-dom.c (tree_ssa_dominator_optimize): If we have altered the
6805 CFG and we have variables to [re]rename, go ahead and rename them before
6806 starting the next iteration of the dominator optimizer.
6808 2003-10-21 Jason Merrill <jason@redhat.com>
6810 * gimplify.c (gimplify_modify_expr): Require a regvar on either
6811 the lhs or rhs if we're dealing with a renameable type.
6812 (canonicalize_component_ref): New fn.
6813 (gimplify_compound_lval): Use it.
6814 (gimplify_conversion): Use it.
6815 (gimplify_expr): Lose redundant STRIP_MAIN_TYPE_NOPS.
6816 Discard conversions in void context.
6818 2003-10-21 Daniel Berlin <dberlin@dberlin.org>
6820 * tree-ssa-pre.c (pre_expression): Free and allocate the
6821 ephi_pindex_htab and phi_pred_cache in this function only.
6822 (phi_pred_cache): New array to store cached phi preds, to avoid
6823 recomputation and unnecessary copying.
6824 (subst_phis): Use it.
6825 (added_phis): array of added phis that is marked for GC.
6827 * Makefile.in: Add tree-ssa-pre.c to the gtype files, and
6828 gt-tree-ssa-pre.h to the list of generated files.
6830 2003-10-21 Jason Merrill <jason@redhat.com>
6832 PR optimization/12661
6833 * tree-dfa.c (get_expr_operands): Handle TRUTH_NOT_EXPR.
6834 * tree-simple.c (is_gimple_rhs): Allow TRUTH_NOT_EXPR.
6835 * gimplify.c (gimplify_expr) <TRUTH_NOT_EXPR>: Don't rewrite to an
6838 2003-10-21 Jan Hubicka <jh@suse.cz>
6840 * haifa-sched.c (choose_ready): Initialize index.
6841 * tree-tailcall.c (bb_optimize_tail_calls): Initialize has_return.
6842 * f/lex.c (ffelex_cfelex_): Initialize d.
6844 2003-10-20 Diego Novillo <dnovillo@redhat.com>
6846 Fix PR optimization/12688
6847 * tree-dfa.c (get_stmt_operands): Don't return early when dealing
6848 with an empty statement.
6849 * tree-ssa-ccp.c (set_rhs): If the expression has no side effects,
6850 replace the statement with an empty statement.
6852 2003-10-20 Andrew MacLeod <amacleod@redhat.com>
6854 * tree-ssa-dce.c (processed): Change to an sbitmap.
6855 (mark_necessary): Test bits in 'processed'.
6856 (tree_ssa_dce): Initialize/free processed as an sbitmap.
6858 2003-10-20 Diego Novillo <dnovillo@redhat.com>
6860 * tree-cfg.c (bsi_prev): Also copy the context from the previous
6863 2003-10-18 Richard Henderson <rth@redhat.com>
6865 * builtins.c (simplify_builtin): Handle BUILT_IN_CONSTANT_P.
6867 2003-10-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
6869 * tree-tailcall.c: New.
6870 * Makefile.in (tree-tailcall.o): Add.
6871 * function.c (assign_parms): Setting of current_function_stdarg
6873 (allocate_struct_function): ... here.
6874 * tree-dump.c (dump_files): Add .tail dump.
6875 * tree-flow.h (tree_optimize_tail_calls): Declare.
6876 * tree-optimize.c (optimize_function_tree): Call
6877 tree_optimize_tail_calls.
6878 * tree.h (enum tree_dump_index): Add TDI_tail.
6880 2003-10-18 Jan Hubicka <jh@suse.cz>
6882 * tree-ssa-copyprop.c (move_var_to_scope): Do not clear abstract
6883 origin for static variables.
6885 2003-10-18 Jan Hubicka <jh@suse.cz>
6887 * integrate.c (copy_decl_for_inlinig): Fix copying of copies.
6889 2003-10-18 Jan Hubicka <jh@suse.cz>
6891 * cgraphunit.c (cgraph_analyze_function): Fix call of estimate_num_insns.
6893 2003-10-17 Kazu Hirata <kazu@cs.umass.edu>
6895 * ChangeLog.tree-ssa: Fix typos.
6896 * tree-alias-common.c: Fix comment typos.
6897 * tree-cfg.c: Likewise.
6898 * tree-dfa.c: Likewise.
6899 * tree-eh.c: Likewise.
6900 * tree-flow.h: Likewise.
6901 * tree-iterator.h: Likewise.
6902 * tree-mudflap.c: Likewise.
6903 * tree-ssa-ccp.c: Likewise.
6904 * tree-ssa-dce.c: Likewise.
6905 * tree-ssa-dom.c: Likewise.
6906 * tree-ssa-live.c: Likewise.
6907 * tree-ssa-live.h: Likewise.
6908 * tree-ssa-pre.c: Likewise.
6909 * tree-ssa.c: Likewise.
6911 2003-10-17 Andrew MacLeod <amacleod@redhat.com>
6913 * tree-ssa-dce.c (processed): New Global vector.
6914 (mark_necessary): Check if SSA_NAME has already been processed first.
6915 (find_useful_stmts, process_worklist): Change call to mark_necessary().
6916 (tree_ssa_dce): Initialize and free processed vector.
6917 * tree-cfg.c (handle_switch_fallthru): A new basic block can result
6918 from splitting edges of nested switch stmts.
6919 (handle_switch_split): If a new block is created, restart the loop for
6920 inserting GOTO's to handle the new block.
6922 2003-10-17 Jan Hubicka <jh@suse.cz>
6924 * tree-cfg.c (remove_useless_stmts_and_vars_bind): Fix handling of
6927 2003-10-16 Richard Henderson <rth@redhat.com>
6929 * common.opt (fdisable-gimple): Remove.
6930 * flags.h (flag_disable_gimple): Remove.
6931 * toplev.c (flag_disable_gimple): Remove.
6932 (process_options): Don't check it.
6933 (lang_independent_options): Don't set it.
6934 * opts.c (common_handle_option): Likewise.
6935 * gimplify.c (keep_function_tree_in_gimple_form): Don't check it.
6936 * c-semantics.c (expand_stmt_toplev): Likewise.
6937 * tree-optimize.c (tree_rest_of_compilation): Likewise.
6938 * doc/invoke.texi: Don't document it.
6940 2003-10-16 Roger Sayle <roger@eyesopen.com>
6942 * fold-const.c: Merge from mainline.
6943 * tree.c (associate_tree_code, commutative_tree_code): Use a
6944 switch statement instead of a sequence of comparisons.
6946 2003-10-16 Richard Henderson <rth@redhat.com>
6948 * gimplify.c (maybe_protect_cleanup): Remove.
6949 * tree-simple.h (maybe_protect_cleanup): Remove.
6950 * c-simplify.c (gimplify_cleanup): Don't call it.
6952 2003-10-16 Jeff Law <law@redhat.com>
6954 * tree-cfg.c (found_computed_goto): New global for computed goto
6955 factoring/unfactoring.
6956 (factored_computed_goto_label, factored_computed_goto): Likewise.
6957 (factor_computed_gotos): New function.
6958 (build_tree_cfg): Use it.
6959 (make_blocks): Record whether or not we find a computed goto.
6960 (remove_useless_stmts_and_vars): Un-factor computed gotos.
6961 (remove_useless_stmts_and_vars): Reset factored_computed_goto_label
6962 and factored_computed_goto.
6964 * tree-ssa-dom.c (get_value_for, set_value_for): Move to the start
6965 of the file. Delete pointless sanity checking.
6967 * tree-ssa.c (currdefs): Now a varray instead of a hash table.
6968 (get_value_for, set_value_for): Corresponding changes. Move to
6969 the start of the file and delete pointless sanity checking.
6970 (rewrite_into_ssa, dump_tree_ssa_stats): Corresponding changes.
6971 (var_value_hash, var_value_eq): Kill.
6973 * tree-ssa.c (rewrite_add_phi_arguments): Once we encounter a
6974 rewritten PHI break the inner loop.
6976 * tree-ssa.c (insert_phi_nodes_for): Use EXECUTE_IF_AND_COMPL_IN_BITMAP.
6978 * tree-dfa.c (create_phi_node): Clear PHI_REWRITTEN on all new PHIs
6979 (remove_all_phi_nodes_for): Set PHI_REWRITTEN on any PHIs which are
6981 * tree-ssa.c (rewrite_add_phi_arguments): Check the PHI node itself
6982 to see if it has already been rewritten.
6983 * tree.h (PHI_REWRITTEN): New accessor macro.
6984 (struct phi_node): New field rewritten.
6986 * tree-flow.h (struct bb_ann_d): New field num_preds.
6987 * tree-dfa.c (create_phi_node): Get the number of predecessors from
6988 the block's annotation.
6989 * tree-ssa.c (rewrite_into_ssa): Compute number of preds for each
6990 block and store it into the block's annotation.
6991 (insert_phi_nodes_for): Get the number of preds for each block
6992 from the block's annotation.
6994 * tree-ssa.c: Remove parallel lifetime analysis code from April 2003.
6995 (def_blocks_d): Remove PHI_INSERTION_POINTS field.
6996 (compute_global_livein): Accept livein/def bitmaps to use for
6997 life analyis rather than a varray of variables. Callers updated.
6998 Rewritten to compute life information for one variable at a
6999 time instead of several variables at once.
7000 (insert_phis_for_deferred_variables): Remove.
7001 (insert_phi_nodes_for): Lose varray argument. Callers updated.
7002 No longer mess with deferring PHI insertions for variables.
7003 (insert_phi_nodes): No longer need to deal with deferred variables.
7004 Kill everything related to them.
7006 2003-10-15 Jeff Law <law@redhat.com>
7008 * domwalk.c, domwalk.h: New files.
7009 * Makefile.in (OBJS-common): Add domwalk.c.
7010 (tree-ssa-dom.o): Add dependency on $(BASIC_BLOCK_H) and domwalk.h.
7011 (tree-ssa.o): Add dependency on domwalk.h.
7012 (domwalk.o): Add dependencies.
7013 * tree-ssa-dom.c: Include domwalk.h.
7014 (cfg_altered, vars_to_rename): Now globals.
7015 (dom_walk_block_data): New structure for block data used by dominator
7017 (optimize_block, record_equivalences_from_block_entry): Kill.
7018 (optimize_stmt): Lose "cfg_altered" argument. Update callers.
7019 Initialize may_have_exposed_new_symbols.
7020 (get_value_for, set_value_for): Lose "table" argument. Update
7021 callers. Use const_and_copies table directly.
7022 (lookup_avail_expr): Lose "const_and_copies" argument. Callers
7024 (get_eq_expr_value): Similarly. Also accept a pointer to the
7025 vrp_variables. Callers updated.
7026 (update_rhs_and_lookup_avail_expr): Similarly.
7027 (record_cond_is_true, record_cond_is_false): Similarly.
7028 (simplify_rhs_and_lookup_avail_expr): Similarly.
7029 (simplify_cond_and_lookup_avail_expr): Similarly.
7030 (record_equivalences_from_phis): Similarly.
7031 (record_equivalences_from_incoming_edge): Similarly. Also accept
7032 a pointer to the block const_and_copies table and vrp_variables.
7034 (eliminate_redundant_computations): Similarly
7035 (record_equivalences_from_stmt, thread_through_successor): Similarly.
7036 (dom_opt_initialize_block): New function. Perform block local
7037 initialization for the dominator optimizer.
7038 (dom_opt_finalize_block): Renamed from finalize_block. Get
7039 block local varrays from walk_data. Pop entry off block local
7040 data stack when complete.
7041 (dom_opt_walk_stmts): New function.
7042 (cprop_into_phis): Get block local varrays from walk_data.
7043 (record_range): Get vrp varray by reference than by value.
7044 (tree_ssa_dominator_optimize): Store incoming "vars" variable into
7045 global "vars_to_rename". Initialize walk_data. Use
7046 walk_dominator_tree.
7047 (cprop_into_stmt): Initialize may_have_exposed_new_symbols.
7048 * tree-ssa.c: Include domwalk.h
7049 (rewrite_finalize_block, rewrite_initialize_block): New functions
7050 extracted from rewrite_block.
7051 (rewrite_walk_stmts, rewrite_add_phi_arguments): Similarly.
7052 (rewrite_block): Kill.
7053 (rewrite_into_ssa): Initialize walk_data. Use walk_dominator_tree.
7055 2003-10-14 Richard Henderson <rth@redhat.com>
7057 * gimplify.c (gimplify_expr): Return bool. Bail gracefully if
7059 (gimplify_asm_expr): Take pointer-to-expr. Allow gimplify_expr
7060 to fail for lvalues, and issue appropriate error messages. Zap
7061 the entire asm statement on failure.
7062 * tree-simple.h (enum fallback_t): Add fb_mayfail.
7064 2003-10-14 Richard Henderson <rth@redhat.com>
7066 * c-tree.h (C_LANG_TREE_NODE_CHAIN_NEXT): New.
7067 (union lang_tree_node): Use it for chain_next annotation.
7069 2003-10-14 Richard Henderson <rth@redhat.com>
7071 * c-common.c: Include tree-iterator.h.
7072 (c_expand_expr): Kill warn_unused_result checks.
7073 (c_warn_unused_result): New.
7074 * c-common.h (STMT_EXPR_WARN_UNUSED_RESULT): Remove.
7075 (c_warn_unused_result): Declare.
7076 * c-decl.c (finish_function): Always gimplify. Call
7077 c_warn_unused_result.
7078 * calls.c (expand_call): Kill warn_unused_result checks.
7079 * Makefile.in (c-common.o): Update.
7081 2003-10-15 Steven Bosscher <steven@gcc.gnu.org>
7083 * cfghooks.c (dump_bb): Take extra `int indent' argument.
7084 * cfg.c (dump_bb): Take extra argument to match cfg hook.
7085 Write out all information about bb that is shared between the tree
7086 and rtl representations.
7087 * basic-block.c (dump_bb): Adjust prototype.
7088 * cfgrtl.c (rtl_dump_bb): Update prototype to match cfg hook.
7090 * flow.c (verify_wide_reg, verify_local_live_at_start):
7091 Fixup dump_bb calls.
7092 * tree-cfg.c (dump_tree_bb): Rename to tree_dump_bb. Remove unused
7093 `prefix' argument. Put in tree_cfg_hooks as cfg hook for dump_bb.
7094 (remove_bb, debug_tree_bb, dump_tree_cfg): Call dump_bb.
7095 * tree-ssa (dump_tree_ssa): Likewise.
7096 * tree-flow.h (dump_tree_bb): Replace with new tree_dump_bb
7098 * tree-pretty-print (dump_block_info): Match case of BLOCK, SUCC,
7101 2003-10-14 Daniel Berlin <dberlin@dberlin.org>
7103 * tree-alias-ander.c (throwaway_global): Delete.
7104 (andersen_same_ponts_to_set): We handle all globals individually
7106 * tree-alias-common.c: Remove doxygen markers.
7107 (get_alias_var_decl): Always create an alias var for globals now.
7108 Assign the global alias vars to GLOBAL_VAR, too.
7109 (intra_function_call): Fix logic, do a bit of pre-filtering to
7110 avoid useless global aliasing.
7111 (get_values_from_constructor): It's the same for field based and
7113 (create_alias_vars): Remove special global var handling.
7114 (same_points_to_set): Ditto.
7115 (ptr_may_alias_var): Ditto.
7117 2003-10-14 Jeff Law <law@redhat.com>
7119 * tree-ssa-dom.c (cprop_into_phis): Avoid doing useless work if the
7120 edge we care about is abnormal.
7121 * tree-ssa-copyprop (cprop_phi): Avoid doing useless work if the
7122 destination of the PHI node occurs in an abnormal PHI.
7124 * tree-ssa-dom.c (record_equivalences_from_stmt): Renamed from
7125 record_equivalances. Caller updated.
7126 (record_equivalences_from_phis): New function extracted from
7128 (record_equivalences_from_incoming_edge): Likewise.
7129 (record_equivalances_from_block_entry): Likewise.
7130 (cprop_into_phis): Likewise.
7131 (optimize_stmt): Lots of code moved into new functions. Call
7132 record_equivlances_from_block_entry.
7134 * tree-ssa-dom.c (optimize_block): Simplify interface slightly.
7135 Use finalize_block. Extract edge_flags from our block's
7136 incoming edge as necessary. Simplify recursive call.
7137 (thread_through_successor): Extracted from optimize_block.
7138 (finalize_block): Similarly.
7140 * tree-ssa-dom.c (eliminate_redundant_computations): New function
7141 extracted from optimize_stmt.
7142 (record_equivalences): Similarly.
7143 (optimize_stmt): Use eliminate_redundant_computations and
7144 record_equivalences. If fold_stmt changes stmt, then make sure
7145 to get a new annotation as well.
7147 * tree-cfg.c (cleanup_control_flow): Pass last statement down to
7148 cleanup_cond_expr_graph and cleanup_switch_expr_graph.
7149 (cleanup_cond_expr_graph): Accept statement from caller and
7150 use it. Return nonzero if the predicate was constant. No longer
7152 (cleanup_switch_expr_graph): Similarly.
7153 (disconnect_unreachable_case_labels): Similarly, except that it
7155 * tree-flow.h (cleanup_cond_expr_graph): Prototype.
7156 (cleanup_switch_expr_graph): Similarly.
7157 * tree-ssa-dom.c (optimize_stmt): Also optimize the condition
7158 in a SWITCH_EXPR. Use COND_EXPR_COND and SWITCH_COND to get
7159 conditions instead of relying upon known operand positions.
7160 Use cleanup_cond_expr_graph and cleanup_switch_expr_graph rather
7161 than open coding equivalents.
7162 (lookup_avail_expr): Handle SWITCH_EXPRs. Use COND_EXPR_COND and
7163 SWITCH_COND to get conditions instead of relying upon known
7165 (avail_expr_hash, avail_expr_eq): Similarly.
7167 2003-10-14 Richard Henderson <rth@redhat.com>
7169 * gimplify.c (gimplify_body): Save and restore input_location;
7170 initialize input_location to DECL_SOURCE_LOCATION.
7171 (gimplify_expr): Always save and restore input_location.
7173 2003-10-14 Richard Henderson <rth@redhat.com>
7175 * expr.c (expand_expr): Break out EXPR_LOCUS code from ...
7176 (expand_expr_1): ... here, renamed from expand_expr.
7178 2003-10-13 Richard Henderson <rth@redhat.com>
7180 * c-simplify.c (c_gimplify_stmt): Upreate on location_t and not
7181 fine and line individually.
7182 (gimplify_c_loop, gimplify_switch_stmt): Likewise.
7183 * gimplify.c (wfl_locus): Merge wfl_filename+wfl_lineno.
7184 (annotate_all_with_locus_1): Rename from annotate_stmt_with_file_line.
7185 (annotate_all_with_locus): Replace annotate_all_with_file_line;
7187 * tree-simple.h: Update.
7188 * tree.c, tree.h (annotate_with_locus): New.
7190 2003-10-13 Steven Bosscher <steven@gcc.gnu.org>
7192 * tree-flow-inline.h (def_ops): Take a stmt_ann_t as argument
7194 (use_ops): Likewise.
7195 (vdef_ops): Likewise.
7196 (vuse_ops): Likewise.
7197 * tree-flow.h: Update prototypes.
7198 * tree-cfg.c (remove_stmt): Load the statement annotation.
7200 * tree-dfa.c (compute_immediate_uses_for_stmt,
7201 mark_new_vars_to_rename): Likewise.
7202 * tree-pretty-print.c (dump_vops): Likewise.
7203 * tree-ssa-ccp.c (tree_ssa_ccp): Likewise. Also remove now
7204 superfluous stmt_ann() calls.
7205 (visit_stmt, cpp_fold, add_var_to_ssa_edges_worklist,
7206 initialize, replace_uses_in, likely_value): Likewise.
7207 * tree-ssa-copyprop.c (copyprop_stmt): Likewise.
7208 * tree-ssa-dce.c (stmt_useful_p, process_worklist): Likewise.
7209 * tree-ssa-dom.c (cprop_into_stmt, optimize_stmt,
7210 avail_expr_hash, avail_expr_eq):
7212 * tree-ssa-live.c (create_ssa_var_map, calculate_live_on_entry,
7213 build_tree_conflict_graph): Likewise.
7214 * tree-ssa-pre.c (maybe_find_rhs_use_for_var,
7215 expr_phi_insertion, same_e_version_real_occ_real_occ,
7216 generate_expr_as_of_bb, bool load_modified_real_occ_real_occ,
7217 bool same_e_version_phi_result, get_default_def,reaching_def,
7218 tree_perform_ssapre): Likewise.
7219 * tree-ssa.c (mark_def_sites, rewrite_out_of_ssa, rewrite_stmt):
7222 2003-10-12 Richard Henderson <rth@redhat.com>
7224 * gimplify.c (gimplify_array_ref_to_plus): Be prepared for
7225 null TYPE_DOMAIN or TYPE_MIN_VALUE for the array.
7226 * tree-ssa-ccp.c (fold_indirect_refs_r): Likewise.
7228 2003-10-12 Richard Henderson <rth@redhat.com>
7230 * tree.h (struct tree_common): Rename unused_1 to invariant_flag.
7231 (TREE_INVARIANT): New.
7232 * builtins.c (build_string_literal): Set TREE_INVARIANT.
7233 * c-common.c (fix_string_type): Likewise.
7234 * c-typeck.c (build_external_ref): Likewise.
7235 (build_c_cast, pop_init_level): Likewise.
7236 * fold-const.c (fold_convert, fold): Likewise.
7237 * tree.c (make_node, build_constructor): Likewise.
7238 (build, build1): Likewise.
7239 (staticp): Pass unknown component references to the language.
7240 (save_expr): Check TREE_INVARIANT instead of TREE_CONSTANT.
7241 (skip_simple_arithmetic): Likewise.
7242 (stabilize_reference_1): Likewise.
7243 * print-tree.c (print_node): Print TREE_INVARIANT.
7245 * c-common.c (pointer_int_sum): Rely on build to set TREE_CONSTANT.
7246 (finish_label_address_expr): Likewise.
7247 * c-typeck.c (default_function_array_conversion): Likewise.
7248 (parser_build_binary_op, pointer_diff): Likewise.
7249 (build_unary_op, build_binary_op): Likewise.
7250 * fold-const.c (non_lvalue): Likewise.
7252 * tree-pretty-print.c (dump_generic_node): Handle VIEW_CONVERT_EXPR.
7254 2003-10-12 Richard Henderson <rth@redhat.com>
7255 Diego Novillo <dnovillo@redhat.com>
7257 * gimplify.c (gimplify_array_ref_to_plus): Subtract the array
7258 domain minimum index.
7259 (gimplify_addr_expr): Expand ARRAY_REFs. Cope with Fortran
7260 missing cast wierdnesses.
7261 * tree-dfa.c (get_expr_operands): Handle (&v + c); abort on
7262 other address invariants that should have been folded.
7263 (vdefs_disappeared_p): New.
7264 (mark_new_vars_to_rename): Use it. Move from ...
7265 * tree-ssa-dom.c: ... here.
7266 * tree-flow-inline.h (is_unchanging_value): Remove; use
7267 is_gimple_min_invariant everywhere instead.
7268 (phi_ssa_name_p): New.
7269 * tree-must-alias.c (find_addressable_vars): Process PHIs.
7270 * tree-simple.c (is_gimple_min_invariant): Rename from
7271 is_gimple_const; allow non-static variable addresses; update callers.
7272 (is_gimple_val): Remove ADDR_EXPR checks.
7273 * tree-simple.h: Update.
7274 * tree-ssa-ccp.c (replace_uses_in): Add replaced_address argument.
7275 (substitute_and_fold): Use that to mark_new_vars_to_rename.
7276 (fold_indirect_refs_r): New.
7277 (fold_stmt): Use it.
7278 * tree-ssa-copyprop.c (copyprop_stmt): Call fold_stmt.
7279 * tree-ssa-dce.c (NECESSARY): Use asm_written_flag.
7280 (mark_necessary): Reject DECLs.
7281 * tree-ssa-live.c (register_ssa_partition): Use phi_ssa_name_p.
7282 * tree-ssa-pre.c (generate_expr_as_of_bb): Call fold_stmt if we
7283 replaced with constants.
7284 * tree-ssa.c (insert_copy_on_edge): Unwrap ADDR_EXPRs to set_is_used.
7285 (eliminate_build, coalesce_abnormal_edges, coalesce_vars): Use
7288 2003-10-09 Frank Ch. Eigler <fche@redhat.com>
7291 * gimplify.c (gimplify_save_expr): Tolerate void-typed saved
7294 2003-10-09 Diego Novillo <dnovillo@redhat.com>
7296 * tree-dfa.c (add_call_clobber_ops): If a variable is read-only,
7297 add a VUSE operand instead of VDEF.
7299 2003-10-08 Jason Merrill <jason@redhat.com>
7301 PR optimization/12525
7302 * tree-dfa.c (note_addressable): New fn, split out from...
7303 (add_stmt_operands): Here.
7304 (get_stmt_operands) <ASM_EXPR>: Call it for mem ops.
7305 * gimplify.c (gimplify_asm_expr): Call parse_input_constraint
7306 directly. It's only a mem op if allows_mem is set.
7308 2003-10-08 Diego Novillo <dnovillo@redhat.com>
7311 * tree-dfa.c (add_stmt_operand): Test against current_function_decl
7312 when checking for global variables.
7313 (may_access_global_mem_p): Likewise.
7314 (add_referenced_var): Likewise.
7315 Consider DECL_NONLOCAL variables call clobbered and used.
7316 (find_hidden_use_vars): Do not test for DECL_NONLOCAL variables.
7317 * tree-optimize.c (tree_rest_of_compilation): Test against
7318 current_function_decl when checking for global variables.
7319 * tree-ssa-ccp.c (get_default_value): Likewise.
7320 * tree-ssa-dce.c (need_to_preserve_store): Likewise.
7322 2003-10-07 Jason Merrill <jason@redhat.com>
7324 PR optimization/12525
7325 * gimplify.c (gimplify_asm_expr): If the constraint doesn't allow
7326 a register, call mark_addressable. Split an in/out operand that
7327 does allow a register into separate input and output operands.
7329 2003-10-06 Richard Henderson <rth@redhat.com>
7331 * fold-const.c (fold): Fold (T1)((T2)X op Y) into (T1)X op Y,
7332 for suitable values of T1 & T2.
7334 2003-10-06 Andrew Macleod <amacleod@redhat.com>
7336 * tree-dfa.c (compute_immediate_uses): Add optional callback.
7337 (compute_immediate_uses_for_phi): Remove unused parameter. Add optional
7338 callback to determine if usage info should be calculated for variable.
7339 (compute_immediate_uses_for_stmt): Add optional callback to determine
7340 if usage info should be calculated for variable.
7341 * tree-flow.h (compute_immediate_uses): Update prototype.
7342 * tree-ssa-ccp.c (need_imm_uses_for): New. Callback function passed to
7343 compute_immediate_uses.
7344 (initialize): Calculate defaults initially, then build reduced
7345 immediate use information.
7346 (get_default_value): Non empty stmt's which are not a PHI_NODE or
7347 a MODIFY_EXPR default to VARYING.
7349 2003-10-06 Andrew Macleod <amacleod@redhat.com>
7351 * tree-cfg.c (tree_split_edge): Mark edge as FALLTHRU when splitting.
7353 2003-10-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
7355 * tree-ssa.c (rewrite_block): Test vars_to_rename instead of
7357 * tree-dfa.c (remove_phi_arg_num): Don't update
7360 2003-10-01 Richard Henderson <rth@redhat.com>
7362 * c-decl.c (set_decl_nonlocal): New.
7363 (store_parm_decls): Use it via walk_tree.
7365 2003-10-01 Jeff Law <law@redhat.com>
7367 * tree-ssa-dom.c (cprop_into_stmt): New function extracted from
7369 (optimize_stmt): Use cprop_into_stmt.
7371 2003-09-30 Richard Henderson <rth@redhat.com>
7373 * function.h (struct function): Add function_end_locus.
7374 * c-decl.c (finish_function): Set it.
7375 * tree-optimize.c (tree_rest_of_compilation): Set input_location
7376 to function_end_locus before expand_function_end.
7378 * tree-optimize.c (optimize_function_tree): Move calls to
7379 remove_useless_stmts_and_vars and lower_eh_constructs ...
7380 (tree_rest_of_compilation): ... here.
7382 * c-simplify.c (gimplify_expr_stmt): Don't warn for any statement
7383 with void result type.
7385 2003-09-30 Jeff Law <law@redhat.com>
7387 * tree-ssa-dom.c (simplify_cond_and_lookup_avail_expr): Fix thinko
7388 in test for swapping ranges.
7390 * tree-ssa-dom.c (record_range): New function.
7391 (extract_range_from_cond): Likewise.
7392 (tree_ssa_dominator_optimize): Initialize the vrp_data varray.
7393 (optimize_block): Initialize the vrp_variables varray. Wipe
7394 appropriate entries from the VRP varrays when done processing a block.
7395 (get_eq_expr_value): Accept new argument "bb". Call record_range
7396 appropriately. Refactor code to avoid useless work.
7397 (simplify_cond_and_lookup_avail_expr): Use value range records to
7398 simplify conditions.
7399 (simplify_rhs_and_lookup_avail_expr): When simplifying ABS_EXPR,
7400 DIV_EXPR and MOD_EXPR, use simplify_cond_and_lookup_avail_expr
7401 to determine the range of the given variable.
7403 * tree-ssa-dom.c (find_equivalent_equality_comparison): Do not
7404 look through a typecast which narrows a value.
7406 2003-09-30 Paul Brook <paul@nowt.org>
7408 * Makefile.in: Add rules for check-gfortran.
7410 2003-09-29 Richard Henderson <rth@redhat.com>
7412 * gimplify.c (gimplify_cond_expr): Fix both arms dead return value.
7414 2003-09-29 Jeff Law <law@redhat.com>
7416 * tree-ssa-dom.c (simplify_cond_and_lookup_avail_expr): New function.
7417 (find_equivalent_equality_comparison): Likewise.
7418 (optimize_block): Remove code to build a == c equivalence after
7419 seeing a == b and b == c. Remove code to walk backwards
7420 though typecasts to record equivalences and move relevant parts
7421 into find_equivalent_equality_comparison.
7422 (optimize_stmt): Call simplify_cond_and_lookup_avail_expr.
7424 2003-09-28 Richard Henderson <rth@redhat.com>
7426 * gimplify.c (gimplify_call_expr): Annotate all call_exprs.
7427 * tree-inline.c (expand_call_inline): Set input_location based
7428 on EXPR_LOCUS; save and restore input_location around that.
7429 (walk_tree): Do not set input_location.
7431 2003-09-27 Graham Stott <graham.stott@btinternet.com>
7433 * expr.c (expand_expr)[CATCH_EXPR]: Fix bogus return value.
7435 2003-09-26 Andrew MacLeod <amacloeod@redhat.com>
7437 * tree-ssa-dom.c (struct var_value_d): Remove.
7438 (const_and_copies): Change to a varray_type.
7439 (tree_ssa_dominator_optimize): Initialize const_and_copies as a varray.
7440 (optimize_block): Simply set the value in const_and_copies.
7441 (dump_dominator_optimization_stats): No hash stats for const_and_copies.
7442 (record_cond_is_true, record_cond_is_false,
7443 simplify_rhs_and_lookup_avail_expr, update_rhs_and_lookup_avail_expr):
7444 Parameter const_and_copies is now a varray_type.
7445 (var_value_hash, var_value_eq): Remove.
7446 (get_value_for, set_value_for): Access varray elements.
7447 (get_eq_expr_value): Parameter const_and_copies is now a varray_type.
7449 * tree-cfg.c (handle_switch_split): Update container of previous stmt.
7451 2003-09-25 Daniel Berlin <dberlin@dberlin.org>
7453 * tree-ssa-pre.c (split_critical_edges): New function, temporarily
7454 disabled until some edge splitting/insertion problems are fixed.
7455 (opnum_of_ephi): Take an edge argument, constify. Use hash table lookup.
7457 (ephi_pindex_eq): New function.
7458 (ephi_pindex_hash): New function.
7459 (ephi_pindex_htab): New variable.
7460 (add_ephi_pred): Update hash table.
7461 (expr_phi_insertion): Don't free the bitmap returned by compute_idfs
7463 (idfs_cache): New variable.
7464 (compute_idfs): Rewrite to use cache as much as possible, and not
7465 recompute when we can avoid it.
7467 2003-09-25 Daniel Berlin <dberlin@dberlin.org>
7469 * tree-alias-ander.c: Fixup comment spacing.
7470 (andersen_op_assign): Handle >2 operands case.
7472 2003-09-24 Steven Bosscher <steven@gcc.gnu.org>
7474 * tree-dfa.c (compute_immediate_uses_for): Split up in two
7475 separate functions, one for PHIs and one for normal statements.
7476 (compute_immediate_uses_for_phi): New.
7477 (compute_immediate_uses_for_stmt): New.
7479 2003-09-25 Jeff Law <law@redhat.com>
7481 * tree-ssa-dom.c (optimize_block): When EQ_EXPR_VALUE has the
7482 form DEST = SRC where both DEST and SRC are SSA_NAMEs also
7483 record SRC = DEST into the const and copies table.
7485 * tree-ssa-dom.c (optimize_block): Change tests which checked
7486 for SSA_VAR_P to only allow SSA_NAMEs.
7487 (get_value_for, set_value_for): Likewise.
7488 (lookup_avail_expr, get_eq_expr_value): Likewise.
7490 2003-09-25 Andrew MacLeod <amacleod@redhat.com>
7492 * tree-ssa-dce.c (pdom_info, needed_stmts): Remove.
7493 (NECESSARY): Define.
7494 (necessary_p): Check bit instead of hash table lookup.
7495 (clear_necessary): New. Clear necessary bit.
7496 (mark_necessary): Use bit instead of hash table. No control lookup.
7497 (mark_tree_necessary): Remove.
7498 (find_useful_stmts): Clear necessary bit before checking it.
7499 (stmt_useful_p): Remove GOTO_EXPR case. Check arms of COND_EXPR for
7500 GOTO. All other control flow stmts are necessary.
7501 (process_worklist): Dont look for control parents.
7502 (remove_dead_stmts): No dominattor info is necessary.
7503 (remove_dead_stmt): Don't need BB any more. Remove COND_EXPR by changing
7504 the condition to 'if (0)'. Abort on other control flow.
7505 (tree_ssa_dce): No longer need the hash table.
7506 (remove_conditional): Remove.
7508 2003-09-25 Andreas Schwab <schwab@suse.de>
7510 * tree-flow.h: Declare next_ssa_version.
7511 * tree-ssa-ccp.c: Remove conflicting declaration.
7512 * tree-ssa-live.c: Likewise.
7513 * tree.c (make_ssa_name): Likewise.
7515 2003-09-24 Jason Merrill <jason@redhat.com>
7517 * tree.h (DECL_SOURCE_LOCATION): Resurrect.
7518 (DECL_SOURCE_FILE, DECL_SOURCE_LINE): Likewise.
7519 (EXPR_LOCUS): Renamed from TREE_LOCUS. Null for non-exprs.
7520 (SET_EXPR_LOCUS): New macro.
7521 (EXPR_FILENAME): Renamed from TREE_FILENAME.
7522 (EXPR_LINENO): Renamed from TREE_LINENO.
7523 (struct tree_common): Remove locus field.
7524 (struct tree_decl): Re-add locus field.
7525 (struct tree_expr): Add locus field.
7526 * c-aux-info.c, c-decl.c, coverage.c, c-parse.in, dbxout.c,
7527 diagnostic.c, dwarf2out.c, expr.c, function.c, gimplify.c,
7528 integrate.c, print-tree.c, stmt.c, tree.c, tree-cfg.c,
7529 tree-dump.c, tree-flow-inline.h, config/alpha/alpha.c,
7530 config/mips/mips.c: Adjust.
7532 2003-09-24 Andrew MacLeod <amacleod@redhat.com>
7534 * tree-ssa-ccp.c (enum latticevalue): Add UNINITIALIZED.
7535 (const_values, struct value_map_d): Remove hash table structures.
7536 (value_vector): New array of values.
7537 (get_value): Use value_vector instead of hash table. Mark inline.
7538 (visit_phi_node): Ignore arguments if the PHI result is already VARYING.
7539 (initialize): Initialize value vector instead of hash table.
7540 (finalize): Free value vector instead of hash table.
7541 (add_var_to_ssa_edges_worklist): Don't add to worklist if
7542 DONT_SIMULATE_AGAIN flag is set.
7543 (value_map_hash, value_map_eq): Delete.
7545 2003-09-24 Jeff Law <law@redhat.com>
7547 * tree-ssa-dom.c (optimize_block): Create infrastructure for
7548 tracking const_and_copies equivalences which disappear when
7549 we leave the current block. Use it for equivalences created
7550 by EQ_EXPR_VALUE. Follow use-def chains for EQ_EXPR_VALUE
7551 equivalences and see if certain NOP_EXPRs can be ignored
7552 to create a block-local equivalence for const_and_copies.
7553 (optimize_stmt): Do not get confused by a cast of the return
7554 value from alloca or the address of a non-weak decl.
7556 * fold-const.c (fold_read_from_constant_string): New function.
7557 * tree.h (fold_read_from_constant_string): Prototype.
7558 * expr.c (expand_expr, case INDIRECT_REF): Use it.
7559 (expand_expr, case ARRAY_REF): Likewise. Put checking code
7560 inside an ENABLE_CHECKING.
7561 * tree-ssa-ccp.c (fold_stmt): Use fold_read_from_constant_string.
7562 * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise.
7564 2003-09-23 Jeff Law <law@redhat.com>
7566 * tree-ssa-dom.c (optimize_block): Ignore "useless" type
7567 conversions in SWITCH_COND when creating equivalenecs at
7570 2003-09-22 Jeff Law <law@redhat.com>
7572 * tree-ssa-dom.c (optimize_stmt): Addresses of non-weak symbols
7573 as well as dynamically allocated stack space are always nonzero.
7575 * tree-cfg.c (handle_switch_split): Properly mark the fallthru
7576 edge from SRC to DEST with EDGE_FALLTHRU.
7578 2003-09-22 Daniel Berlin <dberlin@dberlin.org>
7580 * tree-flow.h (struct bb_ann_d): Add erefs array.
7581 * tree-ssa-pre.c (handle_bb_creation): Remove ei parameter.
7583 (struct expr_info): Remove erefs array.
7584 (append_eref_to_block): New function.
7585 (clear_all_eref_arrays): Ditto.
7586 (expr_phi_insertion): Use append_eref_to_block.
7587 (insert_occ_in_preorder_dt_order_1): Ditto.
7588 (subst_phis): Only copy expression, not the containing EUSE/EPHI.
7589 Update all callers to reflect this.
7590 (compute_will_be_avail): Update for per-block eref array.
7591 (handle_bb_creation): Ditto.
7592 (pre_expression): Ditto.
7593 (tree_perform_ssapre): Clear eref arrays when done with expression.
7595 2003-09-22 Diego Novillo <dnovillo@redhat.com>
7597 * tree-cfg.c (dump_tree_bb): Remove superlfuous newlines.
7599 2003-09-21 Diego Novillo <dnovillo@redhat.com>
7601 * tree-dfa.c (compute_alias_sets): Use TDI_alias instead of
7603 * tree-dump.c (dump_files): Add enties for TDI_alias, TDI_ssa1,
7604 TDI_dom1, TDI_ssa2, TDI_dce1, TDI_ssa3, TDI_dom2, TDI_ssa4,
7605 TDI_ssa5 and TDI_dce2.
7606 Remove entries for TDI_ssa, TDI_dom and TDI_dce.
7607 * tree.h (enum tree_dump_index): Similarly.
7608 (TDF_ALIAS): Remove.
7609 (TDF_VOPS): Change value.
7610 * doc/invoke.texi (-fdump-tree-alias): Document.
7611 * tree-flow.h (tree_warn_uninitialized): Remove unused variable.
7612 (rewrite_into_ssa): Add enum tree_dump_index argument. Update all
7614 (rewrite_out_of_ssa): Likewise.
7615 (tree_perform_ssa_pre): Likewise.
7616 (tree_ssa_dominator_optimize): Likewise.
7617 (tree_ssa_dce): Likewise.
7618 (tree_ssa_copyprop): Likewise.
7619 (tree_ssa_ccp): Likewise.
7620 Add sbitmap argument.
7621 (tree_compute_must_alias): Likewise.
7622 (mark_new_vars_to_rename): Declare.
7623 * tree-must-alias.c (tree_compute_must_alias): Do not call
7625 Remove local vars_to_rename. Use new argument instead.
7626 * tree-optimize.c (optimize_function_tree): Re-write optimization
7627 ordering to support passes that need the SSA form updated.
7628 Call tree_ssa_dominator_optimize.
7629 Re-arrange optimization ordering.
7630 * tree-ssa-ccp.c (substitute_and_fold): Take new argument
7632 Call mark_new_vars_to_rename.
7633 (visit_phi_node): Move variable 'val' into the right scope.
7634 (initialize): Move call dump_begin ...
7635 (tree_ssa_ccp): ... here.
7636 * tree-ssa-dom.c (mark_new_vars_to_rename): Declare extern.
7637 Make sure that variables in virtual operands aren't marked
7639 * tree-ssa.c (rewrite_into_ssa): Do not call
7640 tree_ssa_dominator_optimize.
7642 2003-09-21 Diego Novillo <dnovillo@redhat.com>
7644 * tree-ssa-dce.c (dom_info): Remove unused variable.
7645 * tree-ssa-dom.c (tree_ssa_dominator_optimize): If the CFG has been
7646 altered, call cleanup_tree_cfg.
7647 Call cleanup_tree_cfg before returning.
7648 * tree-ssa-pre.c (tree_perform_ssapre): Call get_stmt_operands
7649 before processing the statement.
7650 * tree-ssa-dom.c (thread_edge): Remove attribute EDGE_FALLTHRU from
7653 2003-09-21 Jeff Law <law@redhat.com>
7655 * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Break out of
7656 optimize_stmt. Follow the def-use chains back for certain expressions
7657 to see if we can simplify the RHS of the current expression based
7658 on earlier expressions.
7660 * tree-ssa-dom.c (optimize_block): Rework code to propagate values
7661 into PHI nodes to be more efficient.
7663 2003-09-20 Andrew MacLeod <amacleod@redhat.com>
7665 * tree-flow.h (struct dataflow_d): Remove reaching fields, add 2 element
7667 * tree-flow-inline.h (immediate_uses): Rename to get_immediate_uses,
7668 return a dataflow object.
7669 (reaching_defs): Remove until needed.
7670 (num_immediate_uses): New. Return number of immediate uses.
7671 (immediate_use): New. Return a specified immediate use.
7672 * tree-dfa.c (add_immediate_use): Use new fields.
7673 (dump_immediate_uses_for): Use new interface.
7674 (create_phi_node): Chain to start of list.
7675 * tree-ssa-ccp.c (add_var_to_ssa_edges_worklist): Use new interface.
7676 * tree-ssa.c (compute_global_livein): Loop interchange.
7678 2003-09-18 Jeff Law <law@redhat.com>
7680 * tree-ssa-dom.c (optimize_stmt): Allow optimizing the RHS of a
7681 MODIFY_EXPR even if we can't record any equivalences created by
7682 the MODIFY_EXPR. Move code to simplify ABS_EXPR, TRUNC_DIV_EXPR
7683 and TRUNC_MOD_EXPR to an earlier position.
7685 2003-09-19 Andrew MacLeod <amacleod@redhat.com>
7687 * tree-ssa-ccp.c (cfg_edges): Rename to cfg_blocks.
7688 (cfg_blocks_num, cfg_blocks_head, cfg_blocks_tail): New. Queue markers.
7689 (bb_in_list): New. Vector indicating if a BB is in the cfg_blocks list.
7690 (tree_ssa_ccp): Use new routines.
7691 (add_control_edge): Add to cfg_blocks list.
7692 (initialize): Initialize new variables.
7693 (finalize): Free allocations.
7694 (cfg_blocks_empty): New. Is cfg_blocks queue list.
7695 (cfg_blocks_add): New. Add a basic block to cfg_blocks list.
7696 (cfg_blocks_pop): New. Get a basic_block from the list.
7698 2003-09-18 Richard Henderson <rth@redhat.com>
7700 * tree-cfg.c (struct rusv_data): Add may_throw, may_branch.
7701 (remove_useless_stmts_and_vars_1): Set them.
7702 (remove_useless_stmts_and_vars_goto): Likewise.
7703 (remove_useless_stmts_and_vars_tf): Transform to compound_expr
7704 if only fallthrough.
7705 (remove_useless_stmts_and_vars_tc): Kill region if nothrow.
7706 Detect catch regions that don't propagate exceptions.
7707 (remove_useless_stmts_and_vars): Zero entire data struct.
7709 2003-09-18 Richard Henderson <rth@redhat.com>
7711 * tree-eh.c (lower_try_finally_dup_block): New.
7712 (honor_protect_cleanup_actions, lower_try_finally_copy): Use it.
7714 2003-09-18 Richard Henderson <rth@redhat.com>
7716 * tree-cfg (remove_useless_stmts_and_vars_cond,
7717 remove_useless_stmts_and_vars_tf,
7718 remove_useless_stmts_and_vars_tc,
7719 remove_useless_stmts_and_vars_bind,
7720 remove_useless_stmts_and_vars_goto): Break out of ...
7721 (remove_useless_stmts_and_vars_1): ... here. Rename to _1;
7722 take and use struct rusv_data.
7723 (remove_useless_stmts_and_vars): New. Loop until no change.
7724 * tree-flow.h (remove_useless_stmts_and_vars): Update decl.
7725 * tree-ssa.c (rewrite_out_of_ssa): Don't loop here.
7727 2003-09-18 Richard Henderson <rth@redhat.com>
7729 * tree-pretty-print.c (dump_generic_node): Don't double indent asms.
7731 2003-09-18 Richard Henderson <rth@redhat.com>
7733 * tree-eh.c: Include langhooks.h, remove errors.h.
7734 (decide_copy_try_finally): Use estimate_num_insns to choose
7735 between copy and switch implementations.
7737 * c-common.c (c_estimate_num_insns): Take an expr, not a decl.
7738 * tree-inline.c (limits_allow_inlining): Pass it the body of the decl.
7740 2003-09-18 Jeff Law <law@redhat.com>
7742 * tree-ssa-dom.c (lookup_avail_expr): New argument which indicates
7743 if the expression should be entered into the hash table. All
7745 (update_rhs_and_lookup_avail_expr): New function factored out
7748 * tree.h (commutative_tree_code, associative_tree_code): Declare
7749 * tree.c (commutative_tree_code, associative_tree_code): New
7751 (iterative_hash_expr): Use commutative_tree_code.
7752 * fold-const.c (operand_equal_p): Use commutative_tree_code
7753 rather than inlining the communitivy check.
7754 (fold, nondestructive_fold_binary_to_constant): Similarly.
7756 2003-09-18 Diego Novillo <dnovillo@redhat.com>
7758 * Makefile.in (tree-eh.o): Add dependency on errors.h
7759 * tree-eh.c: Include errors.h
7761 2003-09-17 Richard Henderson <rth@redhat.com>
7763 * tree-cfg.c (remove_useless_stmts_and_vars): Revert last change.
7764 * tree-flow.h, tree-ssa.c: Likewise.
7766 2003-09-17 Richard Henderson <rth@redhat.com>
7768 * tree-eh.c (decide_copy_try_finally): Remove forgotten debug code.
7770 2003-09-17 Daniel Berlin <dberlin@dberlin.org>
7772 * tree-ssa-pre.c (pick_ssa_name): New function.
7773 (code_motion): Use it.
7775 2003-09-17 Richard Henderson <rth@redhat.com>
7777 * tree-eh.c: New file.
7778 * Makefile.in (OBJS-common): Add it.
7780 * calls.c (emit_call_1): New argument for full call expr.
7781 Check with lookup_stmt_eh_region to set REG_EH_REGION.
7782 (expand_call): Likewise for tail-calls.
7783 * except.c (struct eh_region): Add tree_label.
7784 (gen_eh_region, gen_eh_region_cleanup, gen_eh_region_try,
7785 gen_eh_region_catch, gen_eh_region_allowed,
7786 gen_eh_region_must_not_throw, get_eh_region_number,
7787 get_eh_region_may_contain_throw, get_eh_region_tree_label,
7788 set_eh_region_tree_label, expand_resx_expr): New.
7789 (expand_eh_region_start, expand_start_catch): Use them.
7790 (expand_end_catch): Tidy.
7791 (note_eh_region_may_contain_throw): Take region argument.
7792 (note_current_region_may_contain_throw): New.
7793 (get_exception_filter): Export.
7794 (collect_eh_region_array): Export.
7795 (remove_unreachable_regions): Check ERT_TRY based on reachability
7796 of catches, not reachability of continue_label. Never remove
7797 ERT_MUST_NOT_THROW regions.
7798 (collect_rtl_labels_from_trees): New.
7799 (convert_from_eh_region_ranges): Use it.
7800 (connect_post_landing_pads): Handle dying cleanups.
7801 (struct reachable_info): Add callback data.
7802 (add_reachable_handler): Invoke the callback.
7803 (foreach_reachable_handler): New.
7804 (reachable_handlers): Use it.
7805 (arh_to_landing_pad, arh_to_label): New.
7806 (can_throw_internal_1): Split out from can_throw_internal.
7807 (can_throw_external_1): Similarly.
7809 * expr.c (expand_expr): Handle RESX_EXPR, FILTER_EXPR.
7810 * gimplify.c (gimplify_modify_expr): Use tree_could_trap_p.
7811 * stmt.c (using_eh_for_cleanups_p): Export.
7812 (expand_return): Allow any typed rhs.
7813 * timevar.def (TV_TREE_EH): New.
7814 * tree-cfg.c (eh_stack): Kill.
7815 (build_tree_cfg): Don't set it. Kill code to handle EH.
7816 (could_trap_p): Move to tree-eh.c as tree_could_trap_p.
7817 (get_eh_region_type, make_try_expr_blocks, make_catch_expr_blocks,
7818 make_eh_filter_expr_blocks, try_finallys): Kill.
7819 (make_edges): Kill code to handle EH.
7820 (make_ctrl_stmt_edges): Kill TRY_FINALLY_EXPR, CATCH_EXPR,
7821 EH_FILTER_EXPR. Handle RESX_EXPR.
7822 (make_call_expr_edges): Kill.
7823 (make_exit_edges): Use make_eh_edges.
7824 (label_to_block): New.
7825 (make_goto_expr_edges): Use it.
7826 (is_ctrl_stmt): Add RESX_EXPR.
7827 (is_ctrl_altering_stmt): Restructure. Use tree_can_throw_internal.
7828 (last_exec_block, compute_reachable_eh): Kill.
7829 * tree-dfa.c (get_stmt_operands): Add RESX_EXPR.
7830 (get_expr_operands): Add FILTER_EXPR.
7831 * tree-dump.c (dump_files): Add tree-eh.
7832 * tree-flow.h (struct stmt_ann_d): Kill reachable_exception_handlers.
7833 (label_to_block, lower_eh_constructs, make_eh_edges,
7834 tree_could_trap_p, tree_could_throw_p, tree_can_throw_internal,
7835 tree_can_throw_external): Declare.
7836 * tree-optimize.c (optimize_function_tree): Call lower_eh_constructs.
7837 (tree_rest_of_compilation): Save tree for inlining.
7838 * tree-pretty-print.c (dump_generic_node): Handle FILTER_EXPR,
7840 * tree-simple.c (is_gimple_stmt): Add RESX_EXPR.
7841 (is_gimple_val): Add FILTER_EXPR.
7842 * tree-ssa-dce.c (stmt_useful_p): Restructure. Add lhs of
7843 EXC_PTR_EXPR or FILTER_EXPR.
7844 * tree.def (FILTER_EXPR, RESX_EXPR): New.
7845 * tree.h (enum tree_dump_index): Add TDI_eh.
7847 2003-09-17 Richard Henderson <rth@redhat.com>
7849 * tree.c (tsi_link_before): Remove unnecessary parens.
7850 (tsi_link_chain_before, tsi_delink): Likewise.
7851 (tsi_link_after): Accept the case if the iterator points
7852 to a NULL node; treat it as an empty list.
7853 (tsi_link_chain_after): Likewise. Update iterator properly
7856 2003-09-17 Richard Henderson <rth@redhat.com>
7858 * tree-inline.c (debug_find_tree_1, debug_find_tree): New.
7860 2003-09-17 Richard Henderson <rth@redhat.com>
7862 * tree-cfg.c (struct rusv_data): New.
7863 (remove_useless_stmts_and_vars_1): Rename from
7864 remove_useless_stmts_and_vars. Use rusv_data. Handle goto-next
7865 via remembering the last goto seen, and zapping it when appropriate.
7866 (remove_useless_stmts_and_vars): New. Loop until done.
7867 * tree-flow.h (remove_useless_stmts_and_vars): Update decl.
7868 * tree-optimize.c (optimize_function_tree): Don't cache fnbody.
7869 Dump data after remove_useless_stmts_and_vars.
7870 * tree-ssa.c (rewrite_out_of_ssa): Kill loop around
7871 remove_useless_stmts_and_vars.
7872 * tree-dump.c (dump_files): Add .useless.
7873 * tree.h (enum tree_dump_index): Add TDI_useless.
7875 2003-09-17 Diego Novillo <dnovillo@redhat.com>
7877 * pretty-print.c (pp_write_text_to_stream): Export.
7878 * pretty-print.h (pp_write_text_to_stream): Declare.
7879 * tree-pretty-print.c (print_generic_stmt): Flush to file.
7880 (dump_generic_node): Call pp_write_text_to_stream.
7881 (maybe_init_pretty_print): Take file argument; associate the
7882 stream with the buffer.
7884 2003-09-17 Jeff Law <law@redhat.com>
7886 * tree-ssa-ccp.c (ccp_fold): If the return value has the wrong
7887 type, try to convert it to the proper type rather than failing.
7889 * tree-ssa-dom.c (optimize_stmt): Note that the statement is
7890 modified, even if we just change the virtual operands. If
7891 the statement was modified by const/copy propagation, then
7892 set may_have_exposed_new_symbols.
7894 2003-09-17 Diego Novillo <dnovillo@redhat.com>
7896 * tree-dfa.c (find_vars_r): Do not consider 'void *' pointers as
7897 dereferenced when scanning function call arguments.
7898 * tree-flow-inline.h (may_propagate_copy): Block propagation of
7899 pointers when they have different memory tags.
7900 * tree-ssa-copyprop.c (propagate_copy): When copy propagating
7901 pointers, abort if the two pointers don't have identical memory
7904 2003-09-16 Jeff Law <law@redhat.com>
7906 * tree-ssa-ccp.c (visit_stmt): Do not set DONT_SIMULATE_AGAIN
7907 just because a statement as virtual definitions.
7908 (likely_value): A CALL_EXPR is assumed to return a VARYING
7909 result, regardless of its operands.
7911 2003-09-15 Jason Merrill <jason@redhat.com>
7913 * tree-simple.c (is_gimple_val): Allow addresses of all decls.
7914 (is_gimple_const): Allow addresses of all non-weak statics.
7915 * tree-ssa-ccp.c (fold_stmt): Return bool.
7916 * tree-flow.h: Adjust prototype.
7917 * tree-ssa-dom.c (optimize_stmt): If folding changed stuff, we
7918 need to recalculate the vops.
7920 2003-09-13 Diego Novillo <dnovillo@redhat.com>
7922 Fix PR optimization/12268
7923 * tree-dfa.c (add_referenced_var): Call-clobbered pointers may
7924 point to global memory.
7926 2003-09-13 Jason Merrill <jason@redhat.com>
7928 * c-common.c (c_apply_type_quals_to_decl): Unset TREE_READONLY for
7929 types with constructors.
7930 Remove superfluous references to TREE_TYPE (decl).
7932 2003-09-13 Diego Novillo <dnovillo@redhat.com>
7934 * opts.c (decode_options): Enable must-alias optimization by default.
7935 * tree-dfa.c (get_expr_operands): Always call add_stmt_operand when
7936 dealing with ADDR_EXPR nodes.
7937 (add_stmt_operand): If the variable has an alias set
7938 of size zero, abort.
7939 Call get_base_symbol() to retrieve the variable from an ADDR_EXPR
7941 (compute_alias_sets): Deep copy the aliases array when triggering
7942 the alias grouping heuristic.
7943 Don't group aliases if -ftree-must-alias is given.
7944 * tree-must-alias.c (tree_compute_must_alias): Call
7945 dump_referenced_vars when doing detailed dumps.
7946 Rename promoted_vars to vars_to_rename. Update all users.
7947 (find_addressable_vars): Always mark statements modified.
7948 (promote_var): Also mark aliases of promoted variable to be
7950 Call find_variable_in and remove_element_from to update varrays for
7951 call-clobbered variables and alias sets.
7952 (find_variable_in): New local function.
7953 (remove_element_from): New local function.
7954 * varray.c (varray_copy): New function.
7955 * varray.h (varray_copy): Declare.
7957 2003-09-13 Diego Novillo <dnovillo@redhat.com>
7959 * tree-flow-inline.h (is_optimizable_addr_expr): Remove. Update
7961 * tree-ssa-dom.c (optimize_stmt): Do not propagate SSA names from
7962 redundant expressions across abnormal edges.
7964 2003-09-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
7966 * tree-cfg.c (remove_unreachable_blocks): Clean up.
7967 (debug_tree_bb_n): New.
7968 (is_ctrl_structure): Remove LOOP_EXPR.
7969 * tree-flow.h (debug_tree_bb_n): Declare.
7971 2003-09-12 Andrew Macleod <amacleod@redhat.com>
7973 * tree-ssa-live.c (calculate_live_on_entry): Use default_def to add
7974 addition checks to live on entry calculations.
7975 * tree-ssa.c (print_exprs_edge): New debug output function.
7976 (coalesce_abnormal_edges): Add basic block information to output.
7977 (coalesce_ssa_name): Use default_def instead of trying to compute live
7980 2003-09-12 Diego Novillo <dnovillo@redhat.com>
7982 * tree-optimize.c (tree_rest_of_compilation): Set TREE_ASM_WRITTEN
7983 for functions that have errors.
7985 2003-09-12 Diego Novillo <dnovillo@redhat.com>
7987 * tree-ssa-pre.c (graph_dump_file, graph_dump_flags): Remove
7990 2003-09-11 Daniel Berlin <dberlin@dberlin.org>
7992 * tree-ssa-pre.c (reset_down_safe): Make test less conservative.
7993 (cba_search_start_from): Start from abnormal edge arguments, too.
7994 (cba_search_continue_from_to): Ditto here.
7996 2003-09-11 Daniel Berlin <dberlin@dberlin.org>
7998 * tree-ssa-pre.c: s/#if ENABLE_CHECKING/#ifdef ENABLE_CHECKING/g.
7999 Add more comments to DFS searching functions.
8000 (cba_search_reach_from_to): Remove empty function.
8001 (code_motion): Remove #if 0'd code.
8002 (pre_expression): Ditto.
8003 * tree.h (tree_dump_index): Remove TDI_predot.
8004 * tree-dump.c (dump_files): Ditto.
8006 2003-09-11 Jason Merrill <jason@redhat.com>
8008 Make EDGE_FALLTHRU meaningful for tree-cfg.
8009 * tree-cfg.c (make_edges): Set EDGE_FALLTHRU on fallthrough edge.
8010 (make_exit_edges): Likewise.
8011 (make_ctrl_stmt_edges): Don't set EDGE_FALLTHRU on edges into a
8013 (handle_switch_fallthru): Clear EDGE_FALLTHRU after inserting a goto.
8014 (find_insert_location): Only insert after a CALL_EXPR or MODIFY_EXPR.
8015 (bsi_insert_on_edge_immediate): Count outgoing abnormal edges.
8016 Insert before all control stmts.
8017 (bsi_link_after): Handle a block with nops after the last stmt.
8019 Rename some things to clarify difference between "control structures"
8020 (i.e. COND_EXPR) and "control statements" (also GOTO_EXPR).
8021 * basic-block.h (BB_CONTROL_STRUCTURE): Rename from BB_CONTROL_EXPR.
8022 * tree-cfg.c (REMOVE_NON_CONTROL_STRUCTS): Rename from
8023 REMOVE_NON_CONTROL_STMTS.
8024 (REMOVE_CONTROL_STRUCTS): Rename from REMOVE_CONTROL_STMTS.
8025 (make_ctrl_stmt_edges): Move GOTO_EXPR/RETURN_EXPR handling here...
8026 (make_exit_edges): ...from here.
8027 (is_ctrl_altering_stmt): Don't accept GOTO_EXPR/RETURN_EXPR.
8028 (is_ctrl_structure): Renamed from old is_ctrl_stmt.
8029 (is_ctrl_stmt): New fn.
8030 (bsi_move_to_bb_end): Use it.
8031 (stmt_starts_bb_p): Use is_ctrl_stmt and is_ctrl_altering_stmt.
8032 * tree-flow.h: Add prototype.
8033 * tree-ssa-ccp.c, tree-ssa-dom.c: Update for name changes.
8035 2003-09-10 Daniel Berlin <dberlin@dberlin.org>
8037 * tree-ssa-pre.c (ephi_has_bottom): Remove dead function.
8038 (ephi_has_unsafe_arg): New function.
8039 (compute_down_safety): Use it.
8040 (reset_down_safe): Continue search on abnormal edges, too.
8042 2003-09-10 Jason Merrill <jason@redhat.com>
8044 * gimplify.c (gimplify_asm_expr): Add post_p parm.
8045 (get_initialized_tmp_var): Add post_p parm.
8046 (internal_get_tmp_var): Likewise.
8047 (gimplify_expr, get_formal_tmp_var): Pass it.
8048 * c-simplify.c (gimplify_decl_stmt): Pass it.
8049 * tree-simple.h: Adjust prototype.
8051 * tree-cfg.c (make_call_expr_edges): Break out from...
8052 (make_exit_edges): ...here. Check TREE_NOTHROW.
8053 (is_ctrl_altering_stmt): Check TREE_NOTHROW.
8055 2003-09-10 Paul Brook <paul@nowt.org>
8057 * gimplify.c (gimplify_compound_lval): Treat REALPART_EXPR and
8058 IMAGPART_EXPR the same as COMPONENT_REF.
8059 * tree-simple.c (is_gimple_addr_expr_arg): Ditto.
8060 (is_gimple_lvalue): Remove REALPART_EXPR and IMAGPART_EXPR.
8062 2003-09-10 Diego Novillo <dnovillo@redhat.com>
8064 * c-pretty-print.c (decl_name_str): New local function.
8065 (pp_c_direct_declarator): Call it.
8066 (pp_c_primary_expression): Call it.
8067 (pp_c_id_expression): Call it.
8068 (pp_c_statement): Call it.
8070 2003-09-10 Diego Novillo <dnovillo@redhat.com>
8072 * tree-pretty-print.c (dump_generic_node): Change string used to
8073 display _DECL nodes with no DECL_NAME.
8075 2003-09-10 Diego Novillo <dnovillo@redhat.com>
8077 * tree-dfa.c (add_referenced_var): Handle cases when argument
8079 (add_referenced_tmp_var): New function.
8080 * tree-flow.h (add_referenced_tmp_var): Declare it.
8081 * tree-ssa-pre.c (pre_expression): Call it.
8082 * tree-ssa-live.c (create_ssa_var_map): Add checking for variables
8083 being in real and virtual operands.
8085 2003-09-01 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8086 Jeff Law <law@redhat.com>
8088 * tree-flow.h (remove_unreachable_blocks): Declare.
8089 * tree-cfg.c (remove_unreachable_blocks): Export. Return true
8090 if blocks were removed.
8091 * tree-ssa-dom.c (optimize_block, optimize_stmt): Record whether
8092 the cfg has changed. Schedule jump threading. If a block
8093 has more than one pred, then do not record equivalences created
8094 by a controlling COND_EXPR.
8095 (edges_to_redirect, redirection_targets): New variables.
8096 (thread_edge): Split out of optimize_block.
8097 (tree_ssa_dominator_optimize); Remove unreachable blocks and
8098 recompute dominator tree when the cfg changes.
8100 2003-09-07 Steven Bosscher <steven@gcc.gnu.org>
8102 * c-tree.h: Don't declare c_genericize, it's already
8103 declared in c-common.h.
8105 2003-09-07 Steven Bosscher <steven@gcc.gnu.org>
8107 Fix PR optimization/12198
8108 * tree-cfg.c (value_matches_some_label): Handle integer
8111 2003-09-06 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8113 * tree-iterator.h (tsi_iterator_update): Added TSI_CHAIN_START,
8114 TSI_CHAIN_END, TSI_CONTINUE_LINKING and comments.
8115 (tsi_link_chain_before, tsi_link_chain_after): Declare.
8116 * tree.c (tsi_link_chain_before, tsi_link_chain_after): New.
8117 (tsi_link_before, tsi_link_after): Handle new TSI_...
8120 2003-09-06 Diego Novillo <dnovillo@redhat.com>
8122 * varray.c (element): Add entry for 'tree *'.
8123 * varray.h (enum varray_data_enum): Add VARRAY_DATA_TREE_PTR.
8124 (union varray_data_tag): Add entry for 'tree *'.
8125 (VARRAY_TREE_PTR_INIT): Define.
8126 (VARRAY_TREE_PTR): Define.
8127 (VARRAY_PUSH_TREE_PTR): Define.
8128 (VARRAY_TOP_TREE_PTR): Define.
8129 * tree-cfg.c: Replace uses of VARRAY_GENERIC_PTR with
8130 VARRAY_TREE_PTR when accessing operand arrays.
8131 * tree-ssa-ccp.c: Likewise.
8132 * tree-ssa-copyprop.c: Likewise.
8133 * tree-ssa-dce.c: Likewise.
8134 * tree-ssa-dom.c: Likewise.
8135 * tree-ssa-live.c: Likewise.
8136 * tree-ssa-pre.c: Likewise.
8137 * tree-dfa.c: Likewise.
8138 * tree-ssa.c: Likewise.
8139 * tree-flow.h (struct operands_d): Remove 'skip' GC markers from
8141 (struct dataflow_d): Likewise.
8143 2003-09-05 Diego Novillo <dnovillo@redhat.com>
8145 * tree-dfa.c (find_referenced_vars): Re-enable .GLOBAL_VAR
8148 2003-09-05 Daniel Berlin <dberlin@dberlin.org>
8150 * tree.h (tree_eref_common): Make stmt a tree, not a tree *.
8151 * tree-ssa-pre.c: Transform all tree *'s to tree.
8153 2003-09-05 Paul Brook <paul@nowt.org>
8155 * tree.h (enum tree_index): Delete TI_SIGNED_SIZE_TYPE here.
8156 (signed_size_type_node): No longer a member of global_trees.
8157 * c-common.h (enum c_tree_index): New member CTI_SIGNED_SIZE_TYPE.
8158 (signed_size_type_node): Moved, now a member of c_global_trees.
8160 2003-09-05 Diego Novillo <dnovillo@redhat.com>
8162 * tree-dfa.c (find_referenced_vars): Temporarily disable
8163 .GLOBAL_VAR optimization.
8165 2003-09-04 Daniel Berlin <dberlin@dberlin.org>
8167 * tree-alias-common.c: Add overview.
8168 * tree-alias-ander.c: Add overview and more specific comments on what
8171 2003-09-04 Diego Novillo <dnovillo@redhat.com>
8173 * tree-optimize.c (tree_rest_of_compilation): Return if errorcount
8174 or sorrycount are non-zero.
8176 2003-09-04 Diego Novillo <dnovillo@redhat.com>
8178 * tree-cfg.c (cleanup_tree_cfg): Traverse basic blocks
8180 (remove_useless_stmts_and_vars): Likewise.
8181 * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
8182 * tree-ssa.c (rewrite_into_ssa): Likewise.
8183 * tree-dfa.c (remove_all_phi_nodes_for): Make sure that the new
8184 list of PHI nodes is NULL-terminated.
8185 Add sanity checks to make sure all the PHI nodes for variables to
8188 2003-09-04 Diego Novillo <dnovillo@redhat.com>
8190 * tree-dfa.c (struct walk_state): Add field 'num_calls'.
8191 (add_call_clobber_ops): New local function.
8192 (add_call_read_ops): New local function.
8193 (get_expr_operands): Call them.
8194 (add_stmt_operand): Call-clobbered variables are always added to
8196 (find_referenced_vars): If the number of call-clobbered variables
8197 and number of call sites is larger than a certain threshold, group
8198 all call-clobbered variables under .GLOBAL_VAR.
8199 (find_vars_r): Count the number of call sites.
8200 Don't add .GLOBAL_VAR to the list of referenced variables.
8201 (add_referenced_var): If the addressable variable is an array,
8202 register alias set of the type of the elements, not the type of the
8204 * tree-ssa-dom.c (mark_new_vars_to_rename): Rename from
8205 find_new_vars_to_rename. Update all users.
8206 Before scanning the statement for new operands, mark the existing
8207 virtual operands to be renamed again.
8208 (optimize_stmt): Also check for newly exposed variables when doing
8209 redundancy elimination.
8210 * tree-ssa.c (rewrite_into_ssa): Don't abort when rename_count is
8211 greater than 2. Simply stop trying at 3.
8212 (prepare_operand_for_rename): New function.
8213 (mark_def_sites): Call it.
8214 (rewrite_stmt): Don't check if the operand is an SSA_NAME before
8215 calling rewrite_operand.
8216 (rewrite_operand): Don't abort if the operand was already an
8217 SSA_NAME. Ignore it.
8219 2003-09-03 Richard Henderson <rth@redhat.com>
8221 * tree-optimize.c (set_save_expr_context, clear_decl_rtl,
8222 tree_rest_of_compilation): Merge from mainline new file.
8223 * Makefile.in (tree-optimize.o): Update.
8224 * c-semantics.c (expand_stmt_toplev): New.
8225 * c-common.h (expand_stmt_toplev): Declare.
8226 * c-lang.c, objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Use it.
8228 2003-09-03 Richard Henderson <rth@redhat.com>
8230 * gimplify.c (gimplify_switch_expr): Leave the outermost cast
8231 as part of the switch condition.
8233 2003-09-02 Diego Novillo <dnovillo@redhat.com>
8235 * Makefile.in (tree.o): Add dependency on $(BASIC_BLOCK_H) and
8237 * tree.c: Include basic-block.h and tree-flow.h
8238 (tsi_link_after): Adjust basic block tree pointers when inserting a
8241 2003-09-02 Richard Henderson <rth@redhat.com>
8243 * c-decl.c (finish_function): Fix misapplied patch. Don't
8244 free_after_parsing or free_after_compilation. For real this time.
8246 2003-09-01 Daniel Berlin <dberlin@dberlin.org>
8248 * tree-ssa-pre.c (finalize_1): Remove unnecessary call to
8249 insert_euse_in_preorder_dt_order.
8250 (code_motion): Ditto.
8251 (pre_expression): Ditto.
8253 2003-09-01 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8254 Jeff Law <law@redhat.com>
8256 * basic-block.h (BB_LOOP_CONTROL_EXPR): Remove.
8257 * c-simplify.c (gimplify_c_loop): Create loops in a better shape.
8258 * cfgloop.h (create_loop_notes): Declare.
8259 * cfgloopmanip.c (create_loop_notes): New.
8260 * explow.c (probe_stack_range): Don't produce loop notes when we
8262 * expr.c (emit_block_move_via_loop): Ditto.
8263 * gimplify.c (build_and_jump): Export.
8264 (gimplify_loop_expr): Don't produce LOOP_EXPRs.
8265 * toplev.c (rest_of_compilation): Recreate loop notes if needed.
8266 * tree-cfg.c (make_loop_expr_edges, make_loop_expr_blocks): Removed.
8267 (find_contained_blocks, make_ctrl_stmt_edges,
8268 remove_useless_stmts_and_vars, stmt_ends_bb_p, bsi_insert_before,
8269 find_insert_location, bsi_insert_on_edge_immediate,
8270 merge_tree_blocks): Remove handling of LOOP_EXPRs.
8271 (remove_stmt): Remove handling of BB_LOOP_CONTROL_EXPR.
8272 (find_taken_edge): Remove comment on LOOP_EXPRs.
8273 (dump_tree_bb): Don't dump loop-related information.
8274 (is_loop_stmt, is_latch_block_for): Removed.
8275 (find_insert_location): Handle TRY_CATCH and TRY_FINALLY.
8276 * tree-flow.h (is_loop_stmt, loop_body, set_loop_body,
8277 is_latch_block_for): Removed.
8278 * tree-dfa.c (get_stmt_operands): Don't handle LOOP_EXPRs.
8279 * tree-simple.c (is_gimple_stmt): Remove handling of LOOP_EXPRs.
8280 * tree-simple.h: Remove LOOP_EXPRs from gimple grammar comment.
8281 (build_and_jump): Declare.
8282 * tree-ssa.c (remove_annotations_r): Don't handle LOOP_EXPRs.
8284 2003-08-29 Daniel Berlin <dberlin@dberlin.org>
8286 * opts.c (decode_options): Turn on SSAPRE by default.
8288 2003-08-29 Jason Merrill <jason@redhat.com>
8290 * builtins.c (simplify_builtin): Make sure that the replacement
8291 has the same type as the original expression.
8292 (simplify_builtin_strpbrk): Fix type of COMPOUND_EXPR.
8293 (simplify_builtin_strncpy, simplify_builtin_memcmp): Likewise.
8294 (simplify_builtin_strncmp, simplify_builtin_strncat): Likewise.
8295 (simplify_builtin_strspn, simplify_builtin_strcspn): Likewise.
8296 (simplify_builtin_fputs, simplify_builtin_sprintf): Likewise.
8298 2003-08-28 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8300 * builtins.c (expand_builtin): Expand BUILT_IN_STACK_SAVE and
8301 BUILT_IN_STACK_RESTORE.
8302 * builtins.def (BUILT_IN_STACK_SAVE, BUILT_IN_STACK_RESTORE): New.
8303 * gimplify.c (build_stack_save_restore): New functions.
8304 (struct gimplify_ctx): New field save_stack.
8305 (gimplify_bind_expr, gimplify_call_expr): Arrange save of stack on
8306 BIND_EXPR entry and restore on exits.
8307 * stmt.c (expand_stack_alloc): Saving of stack removed.
8308 (expand_stack_save, expand_stack_restore): New.
8309 * tree.h (expand_stack_save, expand_stack_restore): Declare.
8311 2003-08-28 Diego Novillo <dnovillo@redhat.com>
8313 * tree-dfa.c (add_vdef): Check for duplicate voperands first.
8314 Handle SSA_NAME in voperands.
8315 (add_vuse): Likewise.
8317 2003-08-27 Diego Novillo <dnovillo@redhat.com>
8319 * tree-flow.h (var_ann_d): Convert is_in_va_arg_expr into a
8322 2003-08-27 Daniel Berlin <dberlin@dberlin.org>
8324 * tree-ssa-pre.c: Update comments to reflect reality.
8325 (insert_one_operand): Remove #if'0d code.
8327 2003-08-27 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8329 * gcov.c (typedef struct arc_info): New field cs_count.
8330 (accumulate_line_counts): Find cycles correctly.
8332 2003-08-27 Daniel Berlin <dberlin@dberlin.org>
8334 * tree-ssa-pre.c (compute_du_info): Move #if ENABLE_CHECKING up one
8337 2003-08-27 Daniel Berlin <dberlin@dberlin.org>
8339 * tree.h (struct ephi_arg_d): New structure.
8340 (struct eref_common): Remove non-used members, move some members
8342 (struct ephi_node): Ditto.
8344 * tree-optimize.c (optimize_function_tree): Move PRE before DCE.
8346 * tree.c (tree_size): use sizeof (struct ephi_arg_d) for ephi's.
8348 * tree-pretty-print.c (dump_generic_node): Re-teach to pretty
8349 print euses/ephis/etc given new structures, members, and
8352 * tree-ssa-pre.c (fixup_domchildren): Removed.
8354 (calculate_preorder): Ditto.
8355 (defs_match_p): Ditto.
8356 (defs_y_dom_x): Ditto.
8357 (compute_can_be_avail): Ditto.
8358 (reset_can_be_avail): Ditto.
8359 (reset_later): Ditto.
8360 (compute_later): Ditto.
8362 (set_replacement): Ditto.
8363 (remove_ephi): Ditto.
8364 (set_expruse_def): Ditto.
8365 (occ_compare): Ditto.
8366 (defs_hash_expr): Ditto.
8367 (compute_dt_preorder): Ditto
8368 (search_dt_preorder): Ditto.
8369 (ephi_operand_for_pred): Ditto.
8370 (injured_ephi_operand): Ditto.
8371 (compute_stops): New function.
8372 (occ_identical_to): Ditto.
8373 (require_phi): Ditto.
8374 (do_ephi_df_search_1): Ditto.
8375 (do_ephi_df_search): Ditto.
8376 (any_operand_injured): Ditto.
8377 (compute_du_info): Ditto.
8378 (add_ephi_use): Ditto.
8379 (insert_one_operand): Ditto.
8380 (add_ephi_pred): Ditto.
8381 (created_phi_preds): New bitmap.
8382 (dfn) Removed static variable.
8383 (idom_of_ephi): Ditto.
8384 (avdefs): Move into expr_info).
8385 (struct ephi_use_entry): New structure for EPHI uses.
8386 (struct ephi_df_search): New structure for depth first searchs.
8387 (cant_be_avail_search): Implementation of structure for
8388 cant_be_avail search.
8389 (stops_search): Ditto for stops.
8390 (replacing_search): Ditto for replacing_search.
8391 (do_proper_save): Arguments changed, callers updated.
8392 (create_ephi_node): Use sizeof (struct ephi_arg_d).
8393 (ephi_has_bottom): Rewrite for updated ephi-pred handling.
8394 (ephi_will_be_avail): Rewrite in terms of CANT_BE_AVAIL and STOPS.
8395 (expr_phi_insertion): Remove dead code.
8396 Update for new flags.
8397 (insert_occ_in_preorder_dt_order_1): Only insert one ephi-pred per
8399 Fix exit occurence handling.
8400 (rename_1): Remove occs stuff.
8401 Update for new ephi-pred handling.
8402 (reset_down_safe): Update for new ephi-pred handling.
8403 (compute_down_safe): Ditto.
8404 (can_insert): Ditto.
8405 (insert_one_operand): Split out from finalize_1.
8406 (finalize_1): Update for new ephi-pred handling.
8407 Only insert non-pointless, will-be-avail phis, rather than *all*
8409 (get_temp): New function. Hand us the right temporary for a given
8411 (code_motion): Use EREF_TEMP again, now that we can do it
8414 2003-08-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8416 * builtins.c (expand_builtin): Handle STACK_ALLOC.
8417 * builtins.def (BUILT_IN_STACK_ALLOC): New.
8418 * c-simplify.c (gimplify_decl_stmt, c_gimplify_stmt,
8419 gimplify_compound_literal_expr): Arrange explicit stack allocation.
8420 * expr.c (expand_expr): Handle deferred variables.
8421 * stmt.c (expand_stack_alloc): New.
8422 * tree-simple.c (is_gimple_val): Prevent ADDR_EXPRs of vla's from
8424 * tree.h (expand_stack_alloc): Declare.
8426 2003-08-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8428 * tree-ssa.c (build_dominator_tree): Use FOR_EACH_BB.
8430 2003-08-26 Jason Merrill <jason@redhat.com>
8432 * tree-simple.c (is_gimple_val): Also disallow memory vars.
8434 2003-08-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8436 * integrate.c (copy_decl_for_inlining): Reset DECL_TOO_LATE.
8438 2003-08-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8440 * tree-ssa-dom.c (optimize_block): Handle empty source block.
8442 * tree-ssa-dom.c (optimize_block): Handle case when dominance
8443 tree children have also other sucessors. Add dump to jump
8446 2003-08-25 Jason Merrill <jason@redhat.com>
8448 * c-simplify.c (mark_labels_r): New fn.
8449 (gimplify_decl_stmt): Use it to mark labels in static initializers.
8450 * tree-simple.c (is_gimple_initializer): Remove.
8451 (is_gimple_reg_type): New fn.
8452 (is_gimple_reg): Use it. Handle SSA_NAMEs properly.
8453 * tree-simple.h: Adjust.
8454 * gimplify.c (gimplify_expr) <CONSTRUCTOR>: Do nothing here.
8456 * gimplify.c (create_tmp_var): Set DECL_IGNORED_P.
8458 * tree-inline.c (initialize_inlined_parameters): Improve error
8461 * gimplify.c (gimplify_boolean_expr): Just replace with a COND_EXPR.
8463 2003-08-25 Diego Novillo <dnovillo@redhat.com>
8465 * tree-dfa.c (get_expr_operands): Don't create shared operands when
8466 folding *&VAR expressions.
8468 2003-08-24 Diego Novillo <dnovillo@redhat.com>
8470 * tree-flow.h (struct var_ann_d): Add field default_def.
8471 (widen_bitfield): Declare.
8472 (set_default_def): Declare.
8473 (default_def): Declare.
8474 * tree-flow-inline.h (set_default_def): New inline function.
8475 (default_def): New inline function.
8476 * tree-dfa.c (dump_variable): Display default_def, if set.
8477 * tree-simple.c (is_gimple_reg): Check for DECL_P before checking
8479 * tree-ssa-dom.c (add_expr_propagated_p): Remove. Update all
8481 (find_new_vars_to_rename): New local function.
8482 (tree_ssa_dominator_optimize): Add new argument vars_to_rename.
8483 Change return type to void. Update all users.
8484 (optimize_block): Add new argument vars_to_rename. Update all
8486 If the call to optimize_stmt returns true, add the statement to the
8487 list of statements to re-scan for operands.
8488 After optimizing the block and its dominator children, call
8489 find_new_vars_to_rename for every statement that may have had new
8491 (optimize_stmt): Change return type to bool. Return true if the
8492 statement may have had new symbols exposed by optimization.
8493 Add a sanity check for the value returned by lookup_avail_expr.
8494 Create equivalences for more memory stores, not just the ones done
8495 via INDIRECT_REF expressions.
8496 Call widen_bitfield when optimizing stores to bitfields.
8497 (lookup_avail_expr): Reformat comment.
8498 * tree-ssa.c (rewrite_into_ssa): Remove local variable
8499 addr_expr_propagated_p.
8500 Clear out vars_to_rename before running dominator optimizations.
8501 (check_for_new_variables): Remove.
8502 (rewrite_stmt): Always register new definitions and virtual
8504 (register_new_def): Update comment.
8505 (get_reaching_def): Update the default_def field for the variable
8506 if it didn't have a reaching definition.
8507 * tree-ssa-ccp.c (widen_bitfield): Declare it extern.
8509 2003-08-23 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8511 * tree-cfg.c (bsi_next_in_bb): Work correctly when the block ends
8512 with start of BIND_EXPR.
8514 2003-08-23 Daniel Berlin <dberlin@dberlin.org>
8516 * tree-alias-ander.c (andersen_op_assign): Fix to join the operands,
8517 the assign to the lhs.
8519 2003-08-23 Daniel Berlin <dberlin@dberlin.org>
8521 * tree-alias-common.c (get_alias_var): Remove REFERENCE_EXPR.
8522 (find_func_aliases): Fix some not quite right predicates, add ARRAY_REF
8525 2003-08-22 Jeff Law <law@redhat.com>
8527 * tree-dfa.c (compute_alias_sets): A memory tag used for stores can
8528 not conflict with objects marked TREE_READONLY.
8530 * tree-ssa-ccp.c (fold_stmt): Optimize reads from constant strings.
8532 2003-08-22 Jason Merrill <jason@redhat.com>
8534 * tree-simple.c: Total overhaul to only check forms and remove
8535 unnecessary predicates.
8536 (is_gimple_const): Accept function addresses here.
8537 Don't accept LABEL_DECL or RESULT_DECL.
8538 (is_gimple_val): Accept EXC_PTR_EXPR here.
8539 (is_gimple_lvalue): Rename from is_gimple_modify_expr_lhs.
8540 Accept BIT_FIELD_REF, REALPART_EXPR and IMAGPART_EXPR here.
8541 (is_gimple_addr_expr_arg): Replace with former is_gimple_varname.
8542 (is_gimple_constructor_elt): Just check for CONSTRUCTOR.
8543 (is_gimple_initializer): Just hand off to is_gimple_rhs.
8544 (is_gimple_rhs): Recognize most expressions here.
8545 (is_gimple_variable): New fn.
8546 (is_gimple_id): Use it. Now static.
8547 (is_gimple_reg): New fn.
8548 (is_gimple_cast): Replace with former is_gimple_cast_op.
8549 (is_gimple_constructor, is_gimple_expr): Remove.
8550 (is_gimple_modify_expr, is_gimple_relop): Remove.
8551 (is_gimple_binary_expr, is_gimple_unary_expr): Remove.
8552 (is_gimple_call_expr, is_gimple_arglist): Remove.
8553 (is_gimple_compound_lval, is_gimple_arrayref): Remove.
8554 (is_gimple_compref, is_gimple_exprseq): Remove.
8555 (is_gimplifiable_builtin): Remove.
8556 * tree-simple.h: Adjust.
8557 * gimplify.c (gimplify_conversion): Break out from gimplify_expr.
8558 (gimplify_expr): Use is_gimple_reg predicate to force a temp.
8559 <COMPONENT_REF>: Use gimplify_compound_lval.
8560 <REALPART_EXPR, IMAGPART_EXPR>: Likewise.
8561 <INDIRECT_REF>: Use is_gimple_reg predicate.
8562 <MIN_EXPR, MAX_EXPR>: Use new gimplify_minimax_expr.
8563 <TREE_LIST>: Reject.
8564 (gimplify_tree_list, gimplify_component_ref): Remove.
8565 (gimplify_compound_lval): Include REALPART_EXPR and IMAGPART_EXPR.
8566 (gimplify_component_ref): Remove.
8567 (gimplify_call_expr): Handle non-gimplifiable builtins and walking
8568 the argument list here.
8569 (gimplify_tree_list): Remove.
8570 (gimplify_addr_expr): Use fb_either.
8571 * tree-simple.h: Adjust.
8572 * tree-alias-common.c (find_func_aliases): Update use of predicates.
8574 2003-08-21 Andrew Pinski <pinskia@physics.uc.edu>
8576 * tree-ssa.c (tree_ssa_useless_type_conversion): Check also the
8577 precision of the type to make sure they are really useless type
8580 2003-08-21 Diego Novillo <dnovillo@redhat.com>
8582 * tree-dump.c (dequeue_and_dump): Handle 'r' and 's' code classes.
8584 2003-08-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8586 * c-pretty-print.c (print_c_tree): Create new pp object.
8588 2003-08-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8590 * tree-ssa-dom.c (tree_ssa_dominator_optimize): Don't free hash tables
8591 before statistics are made from them.
8592 * tree-ssa.c (rewrite_into_ssa): Ditto.
8594 2003-08-21 Jason Merrill <jason@redhat.com>
8596 * tree-inline.c (copy_body_r): Don't convert when stripping &*.
8597 Fix thinko in stripping *&.
8599 2003-08-21 Diego Novillo <dnovillo@redhat.com>
8600 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8602 * tree-cfg.c (stmt_starts_bb_p): Nonlocal and computed GOTO targets
8603 always start a new block.
8605 2003-08-20 Jason Merrill <jason@redhat.com>
8607 * tree-pretty-print.c (dump_generic_node): Just print "<retval>"
8608 for the RESULT_DECL.
8610 * c-simplify.c (make_type_writable, mostly_copy_tree_r): Remove.
8611 (deep_copy_list, deep_copy_node): Remove.
8613 * expr.c (expand_expr): Don't check for 'r' or 's' if we're
8614 checking IS_EXPR_CODE_CLASS.
8615 * tree-dfa.c (may_access_global_mem_p): Likewise.
8616 * tree-browser.c (browse_tree): Likewise.
8617 * tree-ssa-pre.c (defs_hash_expr): Likewise.
8618 * gimplify.c (gimplify_expr): Likewise.
8619 (internal_get_tmp_var): Only copy TREE_LOCUS from an expr.
8620 (mostly_copy_tree_r): Ignore decls here.
8622 2003-08-20 Diego Novillo <dnovillo@redhat.com>
8624 * c-pretty-print.c: Discard. Replace with same file from
8625 mainline. Update all users.
8626 (print_c_tree): New function.
8627 * c-pretty-print.h (print_c_tree): Declare.
8628 * tree-pretty-print.c: Update to use new pp_* primitives.
8629 * c-simplify.c: Include c-pretty-print.h.
8630 * Makefile.in (c-simplify.o): Add dependency on $(C_PRETTY_PRINT_H).
8632 2003-08-20 Roger Sayle <roger@eyesopen.com>
8634 * c-common.h (enum c_tree_index): Delete CTI_SIGNED_SIZE_TYPE.
8635 (signed_size_type_node): No longer a member of c_global_trees.
8636 * tree.h (enum tree_index): New member TI_SIGNED_SIZE_TYPE here.
8637 (signed_size_type_node): Moved, now a member of global_trees.
8639 2003-08-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8641 * tree-ssa-dom.c (optimize_block): Thread jump into empty
8644 * tree-cfg.c (linearize_cond_expr): Don't merge blocks if the
8645 later has other predecessors.
8647 2003-08-19 Jason Merrill <jason@redhat.com>
8649 * c-typeck.c (build_array_ref): Also build ARRAY_REFs from
8650 INDIRECT_REFs of ARRAY_TYPE.
8652 * tree-ssa.c (tree_ssa_useless_type_conversion): Also strip
8653 conversions between pointer and reference types.
8655 * tree-dfa.c (get_stmt_operands): Just mark non-GIMPLE statements
8657 (find_referenced_vars): So we don't need to mark them here.
8659 * tree-inline.c (inline_data): Add retvar field.
8660 (declare_return_variable): Set it.
8661 (remap_decls): Use it.
8662 (expand_call_inline): Tweak.
8664 2003-08-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8666 * cfg.c (dump_edge_info): Add name for EDGE_LOOP_EXIT flag.
8668 2003-08-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8670 * tree-flow.h (struct var_ann_d): New field scope.
8671 (struct stmt_ann_d): New field scope.
8672 (propagate_copy): Declaration changed.
8673 (fixup_var_scope): Declare.
8674 * tree-cfg.c (make_blocks, make_cond_expr_blocks,
8675 make_catch_expr_blocks, make_eh_filter_expr_blocks,
8676 make_try_expr_blocks, make_loop_expr_blocks, make_switch_expr_blocks,
8677 make_bind_expr_blocks, build_tree_cfg): Assign variables and statements
8679 (assign_vars_to_scope): New.
8680 * tree-ssa-copyprop.c (move_var_to_scope): New.
8681 (copyprop_stmt): Pass scope of statement to propagate_copy.
8682 (propagate_copy): Assign variable to the right bind_expr.
8683 (fixup_var_scope): New.
8684 * tree-ssa-dom.c (optimize_stmt): Pass scope of statement to
8687 2003-08-19 Daniel Berlin <dberlin@dberlin.org>
8689 * tree-cfg (bsi_move_after): New function.
8690 (bsi_move_before): New function.
8691 (bsi_move_to_bb_end): New function.
8692 * tree-flow.h: Prototype new functions.
8694 2003-08-18 Daniel Berlin <dberlin@dberlin.org>
8696 * tree-alias-ander.c: Remove doxygen markers.
8697 (eq_to_var): remove.
8699 (throwaway_global): Add.
8700 (andersen_same_points_to_set): Handle ignoring global var aliasing the
8702 (andersen_may_alias): Use list_member to avoid stupid hack.
8703 * tree-alias-common.c: Remove hacks for disabling global var aliasing.
8705 2003-08-17 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8707 * tree.c (resize_phi_node): Initialize new entries.
8709 2003-08-17 Jeff Law <law@redhat.com>
8711 * tree-pretty-print.c (last_bb): Actually record the basic block,
8713 (maybe_init_pretty_print): Corresponding changes.
8714 (dump_generic_node, dump_vops): Test the actual block pointers, not
8717 * tree-ssa-dom.c (optimize_block): Use equivalences from the
8718 dominator tree walk to thread through conditional jumps at leafs in
8721 * tree-cfg.c (blocks_unreachable_p, remove_blocks): Use a bitmap
8722 rather than a varray.
8723 (REMOVE_ALL_STMTS, REMOVE_NO_STMTS): New defines for remove_bb.
8724 (REMOVE_NON_CONTROL_STMTS, REMOVE_CONTROL_STMTS): Likewise.
8725 (remove_unreachable_block): Use find_contained_blocks rather
8726 than find_subblocks. If we have a COND_EXPR or SWITCH_EXPR which
8727 is unreachable, but which has reachable children clear out the
8728 condition and request all non-control statements be removed
8730 (remove_bb): Allow better control over what (if any) statements
8731 are removed. All callers updated.
8732 (find_subblocks): Remove.
8733 (find_contained_blocks): Handle statements with no associated
8736 2003-08-15 Andrew Pinski <pinskia@physics.uc.edu>
8738 * objc/objc-lang.c (LANG_HOOKS_GIMPLIFY_EXPR): Define
8739 as the c gimplifier.
8741 2003-08-15 Jeff Law <law@redhat.com>
8743 * tree-cfg.c (cleanup_tree_cfg): Wipe out the dominator tree
8744 if the number of basic blocks changes as a result of cfg cleanups.
8745 * tree-flow.h (build_dominator_tree): Prototype.
8746 * tree-ssa-dom.c (tree_ssa_dominator_optimize): Build the dominator
8747 tree if it is not already available.
8748 * tree-ssa.c (build_dominator_tree): New function.
8749 (rewrite_into_ssa): Use it.
8751 * gimplify.c (gimplify_expr, cases NOP_EXPR, CONVERT_EXPR): If a
8752 COMPONENT_REF is wrapped with a NOP_EXPR, then force the type of
8753 the COMPONENT_REF to match the accessed field. Strip away
8754 unnecessary type conversions and handle the case where all type
8755 conversions were removed.
8756 (case ARRAY_REF, COMPONENT_REF): Indicate to gimplify_array_ref
8757 and gimplify_component_ref if we want an lvalue or not.
8758 (gimplify_array_ref, gimplify_component_ref): Pass new argument
8759 WANT_LVALUE through to gimplify_compound_lval.
8760 (gimplify_compound_lval): If we do not want an lvalue and the
8761 toplevel COMPONENT_REF's type does not match its field's type,
8762 then wrap the COMPONENT_REF in a NOP_EXPR and force the
8763 COMPONENT_REF's type to match its field's type.
8764 (gimplify_modify_expr): If the RHS is a CALL_EXPR and the LHS
8765 is not a gimple temporary, then force the RHS through a gimple
8766 temporary, even if the call can not throw.
8767 (create_tmp_var): Make sure not to lose the type's attributes
8768 for the new variable.
8769 * tree-ssa.c (tree_ssa_useless_type_conversion): New function.
8770 * tree-flow.h (tree_ssa_useless_type_conversion): Prototype.
8771 * tree-ssa-dom.c (optimize_stmt): Use tree_ssa_useless_type_conversion.
8773 * tree-cfg.c (remove_useless_stmts_and_vars): Catch more
8774 useless statements created during the out-of-ssa pass.
8776 2003-08-14 Jeff Law <law@redhat.com>
8778 * tree-ssa-dom.c (optimize_block): Record equivalences created by
8781 * tree-ssa-dom.c (optimize_stmt): Allow optimizing the RHS of
8782 a RETURN_EXPR which contains an optimizable MODIFY_EXPR.
8783 (lookup_avail_expr): Corresponding changes.
8784 (avail_expr_hash, avail_expr_eq): Likewise.
8786 * tree-ssa-dom.c (optimize_stmt): Fix typo which prevented
8787 stores with more than one VDEF from creating useful equivalences.
8789 * tree-dfa.c (get_expr_operands): Do not special case *0;
8791 * fold-const.c (fold, case INDIRECT_REF): Revert last change.
8793 2003-08-14 Diego Novillo <dnovillo@redhat.com>
8795 * tree-cfg.c (bsi_insert_on_edge_immediate): Only update the
8796 container for the head tree of the next block if the new statement
8797 needs to be linked to it.
8799 2003-08-13 Jeff Law <law@redhat.com>
8801 * fold-const.c (fold, case INDIRECT_REF): Optimize reads from
8804 * tree-cfg.c (remove_useless_stmts_and_vars): For a COND_EXPR
8805 where the condition is a variable and the ELSE clause merely
8806 sets that variable to zero, remove the ELSE clause.
8808 * tree-ssa-dom.c (optimize_stmt): Do not check the type of the
8809 value returned by lookup_avail_expr.
8811 2003-08-13 Daniel Berlin <dberlin@dberlin.org>
8813 * tree-cfg.c (remove_stmt): Add new argument saying whether to remove
8814 annotations and invalidate defs. Update all callers
8815 (remove_bsi_from_block): Moved from bsi_remove, argument added.
8816 (bsi_remove): Made into wrapper for remove_bsi_from_block.
8818 2003-08-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8820 * tree-ssa-dom.c (optimize_stmt): Call get_stmt_operands.
8822 2003-08-12 Jeff Law <law@redhat.com>
8824 * tree-ssa-dom.c (optimize_stmt): Record equivalences created
8827 2003-08-12 Diego Novillo <dnovillo@redhat.com>
8829 * tree-cfg.c (find_insert_location): Handle other control
8830 statements that may be at the end of the block.
8832 2003-08-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
8834 * Makefile.in (tree-pretty-print.o): Add tree-iterator.h dependency.
8835 * tree-pretty-print.c: Include tree-iterator.h.
8836 (dump_generic_node): Avoid recursing into COMPOUND_EXPRs.
8838 2003-08-12 Jeff Law <law@redhat.com>
8840 * tree-ssa-dom.c (optimize_stmt): Optimize ABS_EXPR when we know
8841 the sign of the source operand.
8843 * tree-ssa-dom.c (optimize_stmt): Rewrite TRUNC_DIV_EXPR and
8844 TRUNC_MOD_EXPR even if the LHS is not an SSA variable. Do not
8845 enter the new expression in the hash tables if !may_optimize_p.
8846 Also try GE_EXPR to see if this transformation is safe.
8848 * tree-ssa-dom.c (optimize_stmt): Fix typo in last change which
8849 prevented recording equivalences created by IOR_EXPR.
8851 * tree-ssa-dom.c (optimize_stmt): Record that the destination of
8852 a MODIFY_EXPR nonzero if the RHS contains an IOR with a nonzero
8853 constant. Turn DIV/MOD by a power of 2 into SHIFT/AND if we know
8854 dividend is positive.
8856 2003-08-11 Jeff Law <law@redhat.com>
8858 * fold-const.c (fold, cases NE_EXPR and EQ_EXPR): Fold equality
8859 comparisons of non-weak symbol addresses against zero.
8861 * tree-ssa-ccp.c (fold_stmt): Strip unnecessary NOP_EXPRs from
8864 * gimplify.c (gimplify_expr, case INDIRECT_REF): Copy the base
8865 object into a temporary if it's in static memory or is addressable.
8867 2003-08-11 Steven Bosscher <steven@gcc.gnu.org>
8869 * tree-alias-common.h (struct tree_alias_ops): Add a semicolon, fix
8872 2003-08-10 Daniel Berlin <dberlin@dberlin.org>
8874 * tree-dfa.c (compute_may_aliases): Move points-to initialization from
8876 (find_referenced_vars): To here.
8877 (get_memory_tag_for): Use new same_points_to_set function.
8879 * tree-alias-common.h (struct tree_alias_ops): Remove doxygen markers.
8880 Add same_points_to_set function to struct.
8881 (same_points_to_set): New function.
8883 * tree-alias-common.c (we_created_global_var): A bit of magic to ignore
8884 global var aliasing when we didn't create global var. This will go
8886 (same_points_to_set): New function.
8888 * tree-alias-andersen.c (struct andersen_alias_ops): Add
8889 andersen_same_points_to_set.
8890 (andersen_same_points_to_set): New function. Return true if the two
8891 variables have the same points-to set.
8893 * opts.c (common_handle_option): Add "none" as a points-to option.
8895 2003-08-10 Paul Brook <paul@nowt.org>
8897 * doc/install.texi: Mention --enable-languages=f95.
8899 2003-08-09 Daniel Berlin <dberlin@dberlin.org>
8901 * tree-pretty-print.c (dump_vops): check bb->tree_annotations, not
8904 2003-08-08 Daniel Berlin <dberlin@dberlin.org>
8906 * tree-cfg.c (bsi_insert_on_edge_immediate): If there's only
8907 one statement in the block, and it's an empty statement, replace it.
8909 2003-08-08 Jason Merrill <jason@redhat.com>
8911 * c-decl.c (c_expand_body_1): Restore support for
8912 !keep_function_tree_in_gimple_form.
8913 (finish_function, c_expand_deferred_function): Do TDI_inlined dump.
8915 * gimplify.c (voidify_wrapper_expr): Set TREE_SIDE_EFFECTS on the
8916 wrapper if we insert a MODIFY_EXPR.
8918 2003-08-07 Diego Novillo <dnovillo@redhat.com>
8920 * Makefile.in (GTFILES): Add tree-ssa.c, tree-dfa.c and
8922 (gt-tree-ssa.h, gt-tree-dfa.h, gt-tree-ssa-ccp.h): Depend on
8924 * tree-dfa.c (struct clobber_data_d): Remove. Update all users.
8925 (struct alias_map_d): Mark for garbage collection.
8926 (struct walk_state): Add fields 'is_not_gimple' and
8928 (clobber_vars_r): Remove. Update all users.
8929 (get_stmt_operands): Abort if attempting to get operands from a
8930 non-GIMPLE statement.
8931 (get_expr_operands): Likewise.
8932 Do not force a virtual operand when scanning VA_ARG_EXPR.
8933 (add_stmt_operand): If the variable has hidden uses, mark the
8934 statement as having volatile operands and return.
8935 If the variable occurs inside a VA_ARG_EXPR, add it as a virtual
8937 (add_immediate_use): Call VARRAY_TREE_INIT instead of
8938 VARRAY_GENERIC_PTR_INIT.
8939 (dump_variable): Check is_in_va_arg_expr flag.
8940 (compute_may_aliases): Move code to find variables ...
8941 (find_referenced_vars): ... here.
8942 (find_vars_r): Abort if we find a non-GIMPLE expression
8944 Mark variables found inside a VA_ARG_EXPR.
8945 Do not scan arguments for non-GIMPLE CALL_EXPRs.
8946 Remove local variable saved_is_store.
8947 Reformat some code for readability.
8948 (add_referenced_var): If the variable is already marked as having
8949 hidden uses, ignore it.
8950 If the variable is found inside a non-GIMPLE expression, mark it.
8951 If the variable is found inside a VA_ARG_EXPR, mark it.
8953 * tree-flow.h (struct var_ann_d): Add field is_in_va_arg_expr.
8954 (find_referenced_vars): Declare.
8955 * tree-optimize.c (optimize_function_tree): Call
8956 find_referenced_vars before computing may aliases.
8958 * tree-ssa-dce.c (need_to_preserve_store): Do not check if the
8959 variable has hidden uses.
8960 * tree-ssa-live.c (type_var_init): Likewise.
8962 * tree-ssa-ccp.c (ssa_edges): Mark for garbage collection.
8963 (tree_ssa_ccp): Use VARRAY_.*_EDGE calls to manipulate the varray
8965 (add_control_edge): Likewise.
8966 (initialize): Likewise.
8967 * tree-ssa.c (struct def_blocks_d): Mark for garbage collection.
8968 (struct var_value_d): Likewise.
8969 (def_blocks_free): Remove. Update all users.
8970 (rewrite_into_ssa): Do not specify free function when creating
8971 def_blocks and currdefs.
8972 Call sbitmap_free instead of free.
8973 (mark_def_sites): Call sbitmap_free instead of free.
8974 (set_def_block): Use GC allocation.
8975 (set_livein_block): Likewise.
8976 (insert_phi_nodes): Adjust name of varray def_maps when creating it.
8977 (insert_phis_for_deferred_variables): Remove call to BITMAP_XFREE.
8978 (insert_phi_nodes_for): Use GC allocation for phi_insertion_points.
8979 (init_tree_ssa): Remove typecast in call to memset.
8980 (set_value_for): Use GC allocation.
8981 (get_def_blocks_for): Remove typecast in call to htab_find.
8982 * varray.c (element): Add entry for struct edge_def *.
8983 * varray.h (enum varray_data_enum): Add VARRAY_DATA_EDGE.
8984 (union varray_data_tag): Add field of type struct edge_def *.
8985 (VARRAY_EDGE_INIT): Define.
8986 (VARRAY_EDGE): Define.
8987 (VARRAY_PUSH_EDGE): Define.
8988 (VARRAY_TOP_EDGE): Define.
8990 2003-08-06 Diego Novillo <dnovillo@redhat.com>
8992 * tree-cfg.c (handle_switch_fallthru): Do not abort when the last
8993 statement of the case block needs to be the last statement of the
8995 (find_insert_location): Fix typo.
8997 2003-08-06 Steven Bosscher <steven@gcc.gnu.org>
8999 * tree-dfa.c (remove_phi_arg): When the PHI no longer has
9000 arguments, don't remove it here, but do so...
9001 (remove_phi_arg_num): ...from here.
9003 2003-08-05 Jason Merrill <jason@redhat.com>
9005 * gimplify.c (gimplify_cond_expr): Gimplify shortcut expansion in
9006 a conditional context.
9008 * tree-cfg.c (make_catch_expr_blocks): Don't change next_block_link.
9009 (make_eh_filter_expr_blocks): Likewise.
9011 * tree-dfa.c (add_referenced_var): Static locals are call
9014 2003-08-05 Steven Bosscher <steven@gcc.gnu.org>
9016 * tree-dfa.c (add_phi_arg): Allow PHI capacity to grow.
9017 * tree-flow.h (add_phi_arg): Adjust prototype.
9018 * tree-ssa-pre.c (code_motion): Adjust call.
9019 * tree-ssa.c (rewrite_block): Likewise.
9020 * tree.c (resize_phi_node): New function.
9021 * tree.h (resize_phi_node): Add prototype.
9023 2003-08-05 Jeff Law <law@redhat.com>
9025 * tree-ssa-dom.c (optimize_block): Be more aggressive about
9026 creating equivalences from PHI nodes.
9028 * tree-ssa-dom.c (optimize_stmt): Strip away certain NOP_EXPRs
9029 before determining if we have an equivalence to enter into
9030 the const_and_copies table.
9032 * tree-ssa-dce.c (remove_dead_stmts): Iterate backwards through the
9033 basic blocks removing dead statements. Within each block iterate
9034 backwards through the statements removing those which are dead.
9036 * tree-ssa-optimize.c (optimize_function_tree): Call
9037 remove_useless_stmts_and_vars before building the flow graph.
9038 * tree-cfg.c (remove_useless_stmts_and_vars): Rename argument from
9039 first_iteration to remove_unused_vars.
9041 * tree-cfg.c (remove_unreachable_blocks): Remove blocks in reverse
9043 (remove_bb): Remove unwanted call to bsi_next.
9044 (bsi_remove): Refine code which removes useless COMPOUND_EXPRs to allow
9045 removal if one of the arms is not associated with a basic block.
9046 (remove_stmt): Improve check for testing when a basic block head/end
9047 pointer needs to be updated when removing a COMPOUND_EXPR.
9049 * tree-cfg.c (phi_alternatives_equal): New function.
9050 (linearize_cond_expr): Allow linearization if the PHI nodes at the
9051 target have equivalent arguments for the incoming edges from the THEN
9054 * tree-ssa-dce.c (mark_tree_necessary): Empty statements may be
9056 (process_worklist): Handle any incoming abnormal edges the first
9057 time a statement in each block becomes executable.
9059 * tree-ssa-ccp.c (substitute_and_fold): Substitute known
9060 constants into PHI nodes.
9062 2003-08-04 Sebastian Pop <s.pop@laposte.net>
9064 * basic-block.h: Declare bb_ann_d.
9065 (basic_block_def): Add a field tree_annotations.
9066 * cfg.c (entry_exit_blocks): Initialize tree_annotations to NULL.
9067 * cfghooks.c: Remove the definition of cfg_level.
9068 (rtl_register_cfg_hooks): Remove the initiallization of cfg_level.
9069 * cfghooks.h (cfg_hooks): Add cfgh_loop_optimizer_init, and
9070 cfgh_loop_optimizer_finalize.
9071 (loop_optimizer_init, loop_optimizer_finalize): New macros.
9072 (cfg_level): Remove.
9073 * cfgloop.h (loop_optimizer_init, loop_optimizer_finalize): Rename
9074 to rtl_loop_optimizer_init and rtl_loop_optimizer_finalize.
9075 * cfgrtl.c (rtl_loop_optimizer_init, rtl_loop_optimizer_finalize):
9076 Declare, and register them in rtl_cfg_hooks and cfg_layout_rtl_cfg_hook.
9077 * loop-init.c (loop_optimizer_init, loop_optimizer_finalize): Rename
9078 to rtl_loop_optimizer_init and rtl_loop_optimizer_finalize. Remove
9079 the checks to cfg_level.
9080 * tree-cfg.c (block_tree_ann_obstack, first_block_tree_ann_obj): New.
9081 (create_blocks_annotations, create_block_annotation,
9082 free_blocks_annotations, clear_blocks_annotations): New functions.
9083 (tree_loop_optimizer_init, tree_loop_optimizer_finalize): New
9084 functions. Register them in tree_cfg_hooks.
9085 (build_tree_cfg, dump_tree_bb, delete_tree_cfg, tree_split_edge): Use
9086 create_blocks_annotations instead of alloc_aux_for_blocks,
9087 create_block_annotation instead of alloc_aux_for_block,
9088 .tree_annotations instead of .aux,
9089 free_blocks_annotations instead of free_aux_for_blocks.
9090 (tree_register_cfg_hooks): Remove initialization of cfg_level.
9091 * tree-flow-inline.h (bb_ann): Use .tree_annotations.
9092 * tree-flow.h: Update comment.
9094 2003-08-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
9096 * Makefile.in (c-pretty-print.o): Add TREE_H and C_TREE_H dependencies.
9098 2003-08-01 Paul Brook <paul@nowt.org>
9100 * Makefile.in (GMPINC): Set and use.
9102 * configure.in: Add test and switches for the GMP library.
9103 (all_need_gmp): Set from config-lang.in.
9104 * sourcebuild.texi: Document need_gmp.
9107 2003-08-01 Steven Bosscher <steven@gcc.gnu.org>
9109 * tree-inline.c (expand_calls_inline): Fix comments.
9111 2003-07-31 Diego Novillo <dnovillo@redhat.com>
9113 * Makefile.in (tree-ssa-ccp.o): Depend on $(EXPR_H).
9114 * builtins.c (c_strlen): Remove static declaration.
9115 (simplify_builtin_fputs): Remove static declaration.
9116 (simplify_builtin_sprintf): New local function.
9117 (expand_builtin_sprintf): Remove by surrounding with #if 0.
9118 (expand_builtin): Add BUILT_IN_SPRINTF to the list of built-ins
9119 handed over to simplify_builtin.
9120 (validate_arglist): Do not allow arguments with TREE_SIDE_EFFECTS.
9121 (simplify_builtin_fputs): Add new argument KNOWN_LEN. If it's set,
9122 use it instead of trying to compute the length of the string.
9124 * expr.h (simplify_builtin_fputs): Declare.
9125 * tree-flow.h (fold_stmt): Change argument type to tree *. Update
9127 * tree-ssa-ccp.c: Include expr.h.
9128 (replace_uses_in): If the statement makes a call to some selected
9129 built-ins, mark it for folding.
9130 (get_strlen): New local function.
9131 (ccp_fold_builtin): New local function.
9132 (fold_stmt): Call it.
9133 (set_rhs): Fix if-else-if chaining. Handle cases where the whole
9134 statement needs to be replaced.
9135 * tree.h (c_strlen): Declare.
9137 2003-07-31 Diego Novillo <dnovillo@redhat.com>
9139 Fix PR optimization/11373
9140 * tree-ssa-dce.c (stmt_useful_p): Get statement operands before
9141 checking for volatile operands.
9142 * tree-dfa.c (get_expr_operands): If a constant is dereferenced as a
9143 pointer, mark the statement as having volatile operands.
9144 (may_access_global_mem_p): If a non-NULL constant is used as a
9145 pointer, consider it as pointing to global memory.
9146 * tree-ssa-dom.c (optimize_stmt): Set addr_expr_propagated_p when
9147 propagating pointers that are integer constants.
9149 2003-07-31 Andrew MacLeod <amacleod@redhat.com>
9151 * tree-dfa.c (add_stmt_operand): Don't treat complex types as scalars.
9152 * tree-ssa-live.c (var_union): Change comment.
9153 (coalesce_tpa_members): Don't proceed if var_union fails.
9154 * tree-ssa.c (insert_copy_on_edge): Change comment.
9155 (coalesce_abnormal_edges): Handle var_union failing.
9156 (coalesce_vars): Skip constant PHI arguments.
9158 2003-07-30 Jeff Law <law@redhat.com>
9160 * tree-cfg.c (bsi_remove): Don't remove a COMPOUND_EXPR with empty
9161 arms if the arms are in different basic blocks.
9163 * tree-ssa-dom.c (record_cond_is_false): New function.
9164 (record_cond_is_true): Similarly.
9165 (get_eq_expr_value): Use record_cond_expr_is_{true,false}.
9166 (optimize_stmt): Fix minor formatting issue. If we encounter an
9167 INDIRECT_REF, record that the dereferenced pointer can not be
9170 2003-07-30 Daniel Berlin <dberlin@dberlin.org>
9172 * tree-dump.c (dump_option_value_in): "all" is now everything but
9173 TDF_RAW and TDF_SLIM.
9175 2003-07-30 Diego Novillo <dnovillo@redhat.com>
9177 * tree-simple.c (is_gimple_const): Accept CONST + CONST expressions
9178 as GIMPLE constants.
9180 2003-07-30 Daniel Berlin <dberlin@dberlin.org>
9182 * tree-ssa-pre.c: #include real.h
9183 (defs_match_p): Change arguments to something normal now that we use
9184 the new renaming algorithm. Update all callers.
9186 (defs_y_dom_x): Ditto.
9187 (defs_hash_expr): New. Based on iterative_hash_expr.
9188 (generate_exr_as_of_bb): If there aren't any uses, return.
9189 (subst_phis): Call modify_stmt on the actually modified statement. :)
9190 (get_default_def): Only walk SSA_NAME arguments in PHI's.
9192 2003-07-30 Jason Merrill <jason@redhat.com>
9194 Don't modify code that is already GIMPLE.
9195 * gimplify.c (gimplify_expr): Don't return early if the predicate
9197 Use a variable temp if the caller wants an lvalue.
9198 Don't call gimplify_constructor if we're on the rhs of a MODIFY_EXPR.
9199 (add_tree, add_stmt_to_compound): Do add an empty stmt if we
9200 previously had nothing at all.
9201 (gimplify_return_expr): Don't mess with iterators if it was already
9203 (gimplify_cond_expr): Remove a COND_EXPR with two empty arms.
9204 (gimplify_call_expr): Try to simplify a builtin again after
9205 gimplifying the args.
9206 (internal_get_tmp_var): Gimplify the new MODIFY_EXPR.
9207 (gimplify_expr, gimple_push_cleanup): Use boolean_false_node.
9208 (gimplify_init_constructor): New fn, broken out from...
9209 (gimplify_modify_expr): ...here. Be smarter about zero-initialization.
9210 * tree-simple.c (is_gimple_rhs): Accept any CONSTRUCTOR.
9211 * tree-simple.h: Adjust add_tree prototype.
9213 2003-07-29 Daniel Berlin <dberlin@dberlin.org>
9215 * tree-alias-common.c (create_alias_vars): If we created global_var,
9216 delete it when we are done.
9217 (ptr_may_alias_var): Handle case that global_var is now NULL_TREE.
9219 2003-07-29 Jeff Law <law@redhat.com>
9221 * tree-ssa-dom.c (optimize_stmt): Propagate copies into VUSEs and
9224 2003-07-29 Andrew MacLeod <amacleod@redhat.com>
9226 * tree-ssa.c (insert_copy_on_edge): Only set used bit on DECL nodes.
9228 2003-07-29 Andrew MacLeod <amacleod@redhat.com>
9230 * common.opt (ftree-combine-temps): Add new option.
9231 * flags.h (flag_tree_combine_temps): New flag.
9232 * opts.c (decode_options): Initialize flag_tree_combine_temps.
9233 (common_handle_option): Handle new flag.
9234 * toplev.c (flag_tree_combine_temps): Declare.
9235 (lang_independent_options f): Add tree-combine-temp.
9236 * tree-ssa-live.c (var_union): When combining 2 root variables, choose
9237 the user variable over a temporary as the new variable.
9238 (compact_var_map): Use renamed root_var routines.
9239 (calculate_live_on_exit): Reformatting.
9240 (tpa_init): Initialize a tpa object.
9241 (tpa_remove_partition): Remove a partition from a tpa list.
9242 (tpa_delete): Delete a tpa object.
9243 (tpa_compact): Hide single elemenet lists.
9244 (root_var_init): Split common part into tpa_init and rename.
9245 (remove_root_var_partition, delete_root_va, dump_root_var): Delete.
9246 (type_var_init): New. Initialize a type_var object.
9247 (create_coalesce_list): New. Create a coalesce_list object.
9248 (delete_coalesce_list): New. Free a coalesce list's memory.
9249 (find_partition_pair): New. Find a coalesce pair in a coalesce list.
9250 (add_coalesce): New. Add a coalesce between 2 partitions.
9251 (sort_coalesce_list): New. Sort coalesce pairs by importance.
9252 (pop_best_coalesce): New. Get best remaining pair to coalesce.
9253 (add_conflicts_if_valid): Move from tree-ssa.c.
9254 (build_tree_conflict_graph): Move from coalesce_ssa_name in tree-ssa.c.
9255 Genericize to use tpa_p instead of root_var object. Don't add
9256 interferences between copies. Update coalesce list.
9257 (coalesce_tpa_members): Move from coalesce_ssa_name in tree-ssa.c. Use
9258 tpa_p instead of root_var. Use coalesce list if provided.
9259 (dump_coalesce_list): New. Show debug info for a coalesce list.
9260 (tpa_dump): Rename from dump_root_var and genericize to use tpa_p.
9261 * tree-ssa-live.h (root_var_p): Rename structure type to tpa_p
9262 (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition,
9263 tpa_find_tree): New. Generic versions of existing root_var routines.
9264 (tpa_decompact): New. Include single version lists.
9265 (root_var_p): Declare as type tpa_p.
9266 (root_var_num, root_var, root_var_first_partition,
9267 root_var_next_partition, root_var_dump, root_var_delete,
9268 root_var_remove_partition, root_var_find , root_var_compac,
9269 root_var_decompac): Rename and call generic versions.
9270 (type_var_p): New. Use tpa_p structure for a type based association.
9271 (type_var_num, type_var, type_var_first_partition,
9272 type_var_next_partition, type_var_dump, type_var_delete,
9273 type_var_remove_partition, type_var_find, type_var_compact,
9274 type_var_decompact): New. Call generic versions of the routine.
9275 (struct partition_pair_d): New. Represent a desired coalesce.
9276 (struct coalesce_list_d): New. Organize lists of desired coalesces.
9277 (NO_BEST_COALESCE): Define value.
9278 * tree-ssa.c (set_if_valid): Remove.
9279 (insert_copy_on_edge): Set variable as used when inserting a copy.
9280 (add_conflicts_if_valid): Remove. Move to tree-ssa-live.c.
9281 (print_exprs): New. Routine for commonly used output format.
9282 (coalesce_abnormal_edges): New. Split from coalece_ssa_name. Force
9283 partition coalesces across abnormal edges.
9284 (coalesce_ssa_name): Split out build_tree_conflict_graph,
9285 coalesce_abnormal_edges, and coalesce_tpa_members. Return live
9286 range info if required. Use renamed root_var routines.
9287 (assign_vars): Use renamed root_var routines.
9288 (replace_variable): Mark as inline.
9289 (coalesce_vars): Coalesce variable memory storage.
9290 (rewrite_out_of_ssa): Don't compact varmap anymore. Free live range
9291 info if required. Call coalesce_vars if combining temps.
9293 2003-07-29 Andrew MacLeod <amacleod@redhat.com>
9295 * tree-cfg.c (handle_switch_fallthru): Use bsi_link_after if stmt is
9298 2003-07-28 Diego Novillo <dnovillo@redhat.com>
9300 * opts.c (decode_options): Disable must-alias optimization.
9302 2003-07-28 Andrew MacLeod <amacleod@redhat.com>
9304 * tree-ssa.c (struct _elim_graph): Add varray for constant copies.
9305 (new_elim_graph): Initialize constant copy array..
9306 (eliminate_build): Push constant copies onto stack instead of emitting.
9307 (eliminate_phi): Emit any pending constant copies.
9309 2003-07-28 Jeff Law <law@redhat.com>
9311 * tree-ssa-dom.c (optimize_block): If a PHI has a single argument
9312 that is a constant, then that creates a useful equivalence.
9313 Propagate constant values into PHI nodes.
9315 * tree-flow-inline.h (may_propagate_copy): Allow RHS to be a
9318 * tree-dfa.c (compute_immediate_uses_for): Do not assume that
9319 PHI arguments are SSA_NAMEs.
9320 * tree-ssa-dce.c (process_worklist): Likewise.
9321 * tree-ssa-copyprop.c (copyprop_phi): Likewise. Use may_propagate_copy.
9322 * tree-ssa-ccp.c (visit_phi_node): Do not assume that PHI arguments
9323 are SSA_NAMEs. Create a suitable value if a PHI argument is a
9326 * tree-cfg.c (move_outgoing_edges): Correctly handle case where
9327 an edge already exists from BB1 to BB2's successor.
9329 2003-07-27 Daniel Berlin <dberlin@dberlin.org>
9331 * tree.h (EREF_TEMP): Rename to EPHI_TEMP.
9332 (tree_eref_common): Move temp to tree_ephi_node.
9333 * tree-ssa-pre.c: Remove #if 0'd code.
9334 Use EPHI_TEMP rather than EREF_TEMP, remove EREF_TEMP on EUSE nodes.
9335 (finalize_1): Handle empty blocks properly.
9337 2003-07-27 Andreas Jaeger <aj@suse.de>
9339 * tree.c: Convert remaining K&R prototypes to ISO C90.
9340 * tree-dump.c: Likewise.
9341 * tree-inline.c: Likewise.
9342 * stmt.c (expand_asm_expr): Likewise.
9344 * diagnostic.h: Remove PARAMS.
9346 2003-07-26 Paul Brook <paul@nowt.org>
9348 * Makefile.in: Rename check-g95 to check-gfortran.
9349 * gcc.c (default_compilers): Add entries for .f90 and .f95.
9350 * doc/frontends.texi: Document new F95 front end.
9351 * doc/install.texi: Ditto.
9352 * doc/invoke.texi: Ditto.
9353 * doc/sourcebuild.texi: Ditto.
9354 * fortran: New front end.
9356 2003-07-25 Jeff law <law@redhat.com>
9358 * tree-ssa-dom.c (optimize_block): Use may_propagate_copy.
9360 2003-07-25 Diego Novillo <dnovillo@redhat.com>
9362 * opts.c (decode_options): Re-enable must-alias optimizations.
9364 2003-07-25 Daniel Berlin <dberlin@dberlin.org>
9366 * configure.in: Update BANSHEEREBUILD for PWD change.
9369 2003-07-25 Andreas Jaeger <aj@suse.de>
9371 * c-call-graph.c: Convert to ISO C90.
9372 * c-common.c: Likewise.
9373 * c-mudflap.c: Likewise.
9374 * c-pretty-print.c: Likewise.
9375 * cfganal.c (find_edge): Likewise.
9376 * dependence.c: Likewise.
9377 * diagnostic.c (debug_output_buffer): Likewise.
9378 * except.c (expand_eh_handler): Likewise.
9379 * fold-const.c: Likewise.
9380 * langhooks.c: Likewise.
9381 * tree-cfg.c (last_exec_block): Likewise.
9382 * tree-ssa-pre.c: Likewise.
9383 * builtins.c: Likewise.
9385 * tree.h: Remove remaining PARAMS.
9386 * c-common.h: Likewise.
9387 * c-pretty-print.h: Likewise
9388 * c-tree.h: Likewise.
9389 * except.h: Likewise.
9390 * langhooks-def.h: Likewise.
9391 * langhooks.h: Likewise.
9393 2003-07-24 Diego Novillo <dnovillo@redhat.com>
9395 * tree-dfa.c (cleanup_operand_arrays): New local function. Remove
9396 superfluous VUSE operands.
9397 (get_stmt_operands): Call it.
9399 2003-07-24 Jason Merrill <jason@redhat.com>
9401 * gimplify.c (gimple_boolify): New fn.
9402 (gimplify_expr) <TRUTH_NOT_EXPR>: Boolify arg.
9403 (gimplify_cond_expr): Boolify condition.
9404 (gimplify_boolean_expr): Boolify args.
9405 (gimple_push_cleanup): Make flag boolean.
9407 * tree-simple.c (is_gimple_relop): TRUTH_{AND,OR,XOR}_EXPR
9408 are not comparisons.
9409 (is_gimple_binary_expr): They are binary ops.
9411 * tree-mudflap.c (mf_build_check_statement_for): Use TRUTH_OR_EXPR
9412 rather than BIT_IOR_EXPR.
9414 2003-07-23 Jason Merrill <jason@redhat.com>
9415 Diego Novillo <dnovillo@redhat.com>
9417 * c-common.h (DECL_C_HARD_REGISTER): Replace ...
9418 * tree.h (DECL_HARD_REGISTER): ... with this. Update all users.
9420 2003-07-23 Diego Novillo <dnovillo@redhat.com>
9422 * tree-flow-inline.h (may_propagate_copy): New function.
9423 * tree-flow.h (may_propagate_copy): Declare.
9424 * tree-ssa-copyprop.c (copyprop_stmt): Call it.
9425 (get_original): Likewise.
9426 * tree-ssa-dom.c (optimize_stmt): Likewise.
9428 2003-07-23 Frank Ch. Eigler <fche@redhat.com>
9430 * gcc.c (MFWRAP_SPEC): Also wrap pthread_join and pthread_exit.
9432 2003-07-23 Steven Bosscher <steven@gcc.gnu.org>
9434 * tree-flow-inline.h (remove_dom_child): New function.
9435 (clear_dom_children): New function.
9436 * tree-cfg.c (bsi_insert_on_edge_immediate): Do not clear
9437 the annotation for the new bb, it is already memset to zero
9438 in alloc_aux_for_block().
9439 (move_outgoing_edges): Use dom_children() instead of looking
9440 at the dom_children field in the basic block annotation.
9441 * tree-ssa.c (rewrite_into_ssa): Use clear_dom_children().
9443 * tree-cfg.c (dump_tree_cfg): Dump to `file', not `dump_file'.
9445 2003-07-23 Diego Novillo <dnovillo@redhat.com>
9447 * tree.h (DECL_ESTIMATED_INSNS): Move from c-common.h.
9449 2003-07-23 Steven Bosscher <steven@gcc.gnu.org>
9451 * tree-ssa-dom.c (tree_ssa_dominator_optimize): Make
9452 found_unreachable a bool. Create/delete hash tables for
9453 copies and available exprs outside the main loop. Use
9454 htab_clean to wipe them after each iteration.
9456 2003-07-22 Diego Novillo <dnovillo@redhat.com>
9458 * opts.c (decode_options): Add temporary test for environment
9459 variable TREE_SSA_DO_PRE.
9460 Do not disable dominator optimizations when PRE is enabled.
9462 2003-07-22 Daniel Berlin <dberlin@dberlin.org>
9464 * tree-ssa-pre.c (finalize_1): Change to not use bsi_last.
9466 2003-07-22 Daniel Berlin <dberlin@dberlin.org>
9468 * tree-cfg.c (remove_stmt): Revert 07-15 change. Turns out the bug is in
9469 the reverse iterator.
9471 2003-07-22 Diego Novillo <dnovillo@redhat.com>
9473 * tree-ssa-ccp.c (visit_phi_node): Assume default value of CONSTANT
9474 if the PHI value was already constant.
9476 2003-07-22 Andrew MacLeod <amacleod@redhat.com>
9478 * c-pretty-print.c (print_call_name): Handle COND_EXPR correctly.
9479 * tree-pretty-print.c (print_call_name): Handle COND_EXPR correctly and
9481 * tree-dfa.c (add_phi_arg, remove_phi_arg_num): Remove references to
9482 SSA_NAME_HAS_REAL_REFS.
9483 * tree-ssa-ccp.c (visit_phi_node): Remove SSA_NAME_HAS_REAL_REFS.
9484 * tree-ssa-copyprop.c (copyprop_phi): Remove SSA_NAME_HAS_REAL_REFS.
9485 * tree-ssa-live.c (register_ssa_partition): Register the PHI and it's
9486 arguments if this variable is defined by a PHI.
9487 (create_ssa_var_map): Only register real uses and defs, and virtual
9488 operands of ASM_EXPR's. Remove SSA_NAME_HAS_REAL_REFS. Don't set
9489 used flag on variables here.
9490 (calculate_live_on_entry): Ignore constants in PHI arguments.
9491 (calculate_live_on_exit): Ignore constants in PHI arguments.
9492 (dump_live_info): New. Dump live range information.
9493 * tree-ssa-live.h (dump_live_info): New prototype and flags.
9494 * tree-ssa-pre.c (create_expr_ref, finalize_1, repair_use_injury,
9495 code_motion): Remove SSA_NAME_HAS_REAL_REFS.
9496 * tree-ssa.c (rewrite_operand, register_new_def): Remove real_ref
9497 parameter and SSA_NAME_HAS_REAL_REFS.
9498 (rewrite_block): Remove real_ref parameter from register_new_def call.
9499 (eliminate_build): Remove SSA_NAME_HAS_REAL_REFS. Insert copy if PHI
9500 argument is a constant. Handle irregular PHI argument ordering.
9501 (elim_create): Remove dead code to count PHI nodes.
9502 (assign_vars): Set used flag on variables when assigned.
9503 (replace_variable): Eliminate dead code.
9504 (coalesce_ssa_name): Remove SSA_NAME_HAS_REAL_REFS. Print error for
9505 constant argument across an abnormal edge.
9506 (eliminate_extraneous_phis): New. Remove PHI nodes which are not in
9508 (rewrite_out_of_ssa): Call eliminate_extraneous_phis.
9509 (rewrite_stmt): Remove real_ref parameter from rewrite_operand and
9511 * tree.h (SSA_NAME_HAS_REAL_REFS): Remove.
9512 (struct tree_ssa_name): Remove 'has_real_refs' field.
9514 2003-07-22 Daniel Berlin <dberlin@dberlin.org>
9516 * tree-ssa-pre.c (factor_through_injuries): Take new argument specifying
9517 whether use was injured or not (needed for SR). Update all callers.
9518 (maybe_find_rhs_use_for_var): Take new argument specifying which
9519 operand to start search with. Update all callers.
9520 (phi_opnd_from_res): #if 0 out.
9523 (defs_match_p): Take new arguments specifying which defs were injured.
9525 (defs_y_dom_x): Ditto.
9526 (generate_expr_as_of_bb): Fix small memory overwrite.
9527 (process_delayed_rename): Propagate injured flag around.
9528 (new_rename_1): Ditto.
9529 (finalize_1): Get correct variable names for newly created statement if
9530 necessary due to PHI.
9531 (repair_use_injury): Note the repair in the stats. Insert repair
9533 (repair_euse_injury): Fix handling of PHI_NODE.
9534 (code_motion): Fix algorithm so it can handle using reaching_def all the
9535 time (needed for SR).
9536 Use reaching_def rather than EREF_TEMP.
9538 2003-07-21 Diego Novillo <dnovillo@redhat.com>
9540 * tree-dfa.c (get_stmt_operands): Remove FIXME note
9541 regarding virtual operands for ASM_EXPRs.
9543 2003-07-21 Diego Novillo <dnovillo@redhat.com>
9545 * tree-dfa.c (add_def): Renamed from set_def. Update all users.
9546 (get_stmt_operands): Don't force ASM_EXPR operands to be virtual.
9547 (add_stmt_operand): Allow non-assignments to create new defs.
9548 * tree-dump.c (dump_function): Move header dump...
9549 (dump_function_to_file): ... here.
9550 * tree-flow-inline.h (def_ops): Renamed from def_op. Return a
9551 varray with all the definitions made by the statement.
9553 * tree-flow.h (struct operands_d): Rename field 'def_op' to
9554 'def_ops'. Convert it into a varray.
9555 * tree-must-alias.c (tree_compute_must_alias): Call
9556 dump_function_to_file instead of dump_function.
9557 * tree-ssa-ccp.c (tree_ssa_ccp): Likewise.
9558 (visit_stmt): Only visit statements that make new definitions using
9560 Definitions coming from other statements are considered VARYING.
9561 * tree-ssa-copyprop.c (tree_ssa_copyprop): Call
9562 dump_function_to_file instead of dump_function.
9563 * tree-ssa-dce.c (tree_ssa_dce): Likewise.
9564 * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
9565 (optimize_stmt): Don't abort if a statement makes more than one
9567 Check for MODIFY_EXPR statements directly, instead of relying on
9568 the presence of a single definition.
9569 * tree-ssa-pre.c (tree_perform_ssapre): Call dump_function_to_file
9570 instead of dump_function.
9571 * tree-ssa.c (rewrite_into_ssa): Likewise.
9572 Dump the function before dominator optimizations if TDF_DETAILS is
9574 (rewrite_stmt): Don't abort if the statement makes more than one
9577 2003-07-21 Jeff Law <law@redhat.com>
9579 * tree-ssa-dom.c (tree_ssa_dominator_optimize): If we made any
9580 blocks unreachable, repeat the dominator optimizations.
9581 (optimize_block): Enter PHIs with a single source argument into
9582 the const_and_copies table. When propagating into a PHI node,
9583 break the loop over the PHI arguments when a propagation is performed.
9584 If the PHI agument is not an SSA_VAR, then no propagation is possible.
9585 (optimize_stmt): If an operand is not an SSA_VAR, then no propagation
9588 2003-07-21 Diego Novillo <dnovillo@redhat.com>
9590 * Makefile.in (tree-ssa-dom.o): Add dependency on $(TREE_DUMP_H).
9591 * fold-const.c (fold): Remove unusued local variable 'invert'.
9592 * tree-dump.c (dump_files): Add entry for -fdump-tree-dom.
9593 * tree-flow.h (tree_ssa_dominator_optimize): Change declaration to
9594 accept a function decl.
9595 * tree-ssa-dom.c: Include timevar.h and tree-dump.h.
9596 (tree_ssa_dominator_optimize): Change to receive the function decl
9597 for the function to optimize. Update callers.
9598 Use own dump file instead of dumping on the .ssa dump file.
9599 Dump function at the end.
9600 Push and pop TV_TREE_SSA_DOMINATOR_OPTS.
9601 * tree-ssa.c (rewrite_into_ssa): Restore check for number of times
9602 that the rename loop has been executed. Abort if the loop executes
9604 * tree.h (enum tree_dump_index): Add TDI_dom.
9605 * doc/invoke.texi: Document -fdump-tree-dom.
9607 2003-07-21 Steven Bosscher <steven@gcc.gnu.org>
9608 Diego Novillo <dnovillo@redhat.com>
9610 * Makefile.in (install-po): Check if $CATALOGS is empty to avoid
9612 * basic-block.h (rtl_verify_flow_info): Remove.
9613 (tree_verify_flow_info): Remove.
9614 (verify_flow_info): Declare.
9615 * builtins.c: Rearrange to simplify merges. Add #if 0 around
9616 expand_ functions that are not used in the branch and move new code
9617 to the end of the file.
9618 * c-opts.c (c_common_handle_option): Move handling of -fdump- to
9620 * cfgloopmanip.c (loop_split_edge_with_NULL): Remove. Update all
9622 * common.opt: Add all the tree-ssa switches.
9623 * opts.c: Handle them.
9624 * flags.h (flag_tree_cp): Remove unused variable.
9625 (enum pta_type): Move from tree-must-alias.h
9626 (flag_tree_points_to): Likewise.
9627 * toplev.c (flag_tree_cp): Remove unused variable.
9628 * tree-cfg.c: Move cfg_hooks structures and functions for
9629 trees from cfghooks.c.
9630 * tree-mudflap.c (mudflap_enqueue_decl): Don't use %D to
9631 avoid warning about format specifiers.
9633 2003-07-21 Diego Novillo <dnovillo@redhat.com>
9635 * gimplify.c (gimplify_function_tree): Move gimplification of the
9637 (gimplify_body): ... here.
9638 * tree-simple.h (gimplify_body): Declare.
9639 * tree-inline.c (initialize_inlined_parameters): If the
9640 emitted assignment is not in GIMPLE form, gimplify the
9641 body of assignments emitted.
9643 2003-07-17 Jeff Law <law@redhat.com>
9645 * tree-dfa.c (remove_phi_arg): Update PHI_ARG_CAPACITY.
9647 * tree-ssa.c (mark_def_sites): Do not build the dominator tree here.
9648 (rewrite_into_ssa): Do not depend on mark_def_sites to build the
9649 dominator tree. Move computation of dominance frontiers out
9650 of main loop (even though it was only done once). Free immediate
9651 dominator information as soon as we're done with it.
9653 * tree-flow.h (remove_phi_nodes_and_edges_for_unreachable_block):
9655 * tree-cfg.c (remove_phi_nodes_and_edges_for_unreachable_block): New
9656 function extracted from remove_bb.
9657 (remove_bb): Call remove_phi_nodes_and_edges_for_unreachable_block.
9659 * tree-ssa-dom.c (optimize_block): Propagate values into PHI nodes.
9660 Do not optimize a block which has become unreachable.
9661 If a COND_EXPR has a compile-time constant condition, then remove
9662 outgoing from the COND_EXPR which can not execute.
9664 2003-07-16 Frank Ch. Eigler <fche@redhat.com>
9666 * tree-mudflap.c (mx_xfn_indirect_ref): Correct source locations
9667 for tracked expressions by ignoring incidental decl source loci.
9669 2003-07-16 Jeff Law <law@redhat.com>
9671 * tree-cfg.c (remove_bb): Remove statements in reverse order.
9672 Simplify code to issue warnings for unreachable code.
9674 * tree-ssa-dom.c (get_eq_expr_value): Also enter expressions
9675 into the available expression hash table. Callers changed to
9676 pass in the block_avail_exprs varray and const_and_copies hash
9678 (optimize_stmt): Allow optimization of the condition in
9679 a COND_EXPR statement.
9680 (lookup_avail_expr): For COND_EXPRs, just see if their condition
9681 has been recorded into the hash table, do not enter them into
9682 the hash table. Only do a lookup of the result in the
9683 const_and_copies table if it is an SSA_VAR.
9684 (avail_expr_hash): Handle COND_EXPRs, specifically we only care
9685 about their condition and virtual operands.
9686 (avail_expr_eq): Likewise. If one statement has virtual operands
9687 and the other does not, then the expressions are not equal.
9689 * tree-ssa.c (rewrite_into_ssa): If we have done dominator
9690 optimizations, then call cleanup_tree_cfg after rewriting is
9692 * tree-ssa-dom.c (optimize_block): Get eq_expr_value for the
9693 current block rather than having it passed in by the caller.
9694 Propagate eq_expr_value into the false arm of a COND_EXPR.
9695 (get_eq_expr_value): Return equivalences for the false
9696 arm of a COND_EXPR if requested.
9698 2003-07-16 Daniel Berlin <dberlin@dberlin.org>
9700 * c-decl.c (store_parm_decls): Also strip NON_LVALUE_EXPRs and
9701 CONVERT_EXPRs when setting DECL_NONLOCAL.
9703 2003-07-15 Daniel Berlin <dberlin@dberlin.org>
9705 * tree-cfg.c (remove_stmt): Update bb->end_tree_p properly when
9706 stmt_p is the end of the bb.
9708 2003-07-15 Jeff Law <law@redhat.com>
9710 * tree-ssa-dom.c (optimize_stmt): Consider two types equivalent if
9711 their TYPE_MAIN_VARIANT is equivalent.
9712 (avail_expr_eq): Likewise.
9714 * Makefile.in (OBJS): Add tree-ssa-dom.o
9715 (tree-ssa-dom.o): Add dependencies.
9716 (ssa.o, cfghooks.o): Use $(TREE_FLOW_H), not tree-flow.h.
9717 * timevar.def: Add new timevar for dominator optimizer. Reorder
9719 * tree-dfa.c (add_stmt_operand): Do not consider references to
9720 static storage as volatile operands.
9721 (add_referenced_var): Static storage items reference global memory.
9722 * tree-ssa.c: Simplify by moving everything specific to the
9723 dominator optimizer into tree-ssa-dom.c. Call into the dominator
9724 optimizer after rewriting all the basic blocks.
9725 * tree-ssa-dom.c: New file. Mostly extracted from tree-ssa.c
9726 * tree-flow.h (tree_ssa_dominator_optimize): Prototype.
9727 (dump_dominator_optimization_stats): Likewise.
9728 (debug_dominator_optimization_stats): Likewise.
9730 2003-07-15 Diego Novillo <dnovillo@redhat.com>
9732 * tree-dfa.c (add_stmt_operand): Move volatile handling...
9733 (find_vars_r): ... here.
9734 Mark when the walker is inside an ASM_EXPR.
9735 (struct walk_state): Add field 'is_asm_expr'.
9736 Change flag fields to bitfields.
9737 (add_referenced_var): If the variable is a pointer being stored by
9738 an ASM_EXPR, mark it as a global memory pointer.
9739 * tree-flow-inline.h (is_optimizable_addr_expr): New function.
9740 * tree-flow.h (is_optimizable_addr_expr): Declare it.
9741 * tree-ssa.c (rewrite_and_optimize_stmt): Use it.
9742 (lookup_avail_expr): Likewise.
9743 (get_eq_expr_value): Likewise.
9744 (avail_expr_eq): Return 'true' when comparing a statement against
9746 * tree-ssa-dce.c (need_to_preserve_store): Move volatile checking...
9747 (stmt_useful_p): ...here.
9749 2003-07-15 Andreas Jaeger <aj@suse.de>
9751 * c-simplify.c: Convert prototypes to ISO C90.
9752 * gimplify.c: Likewise.
9753 * simple-break-elim.c: Likewise.
9754 * simple-goto-elim.c: Likewise.
9756 * tree-alias-ander.c: Convert prototypes to ISO C90.
9757 * tree-alias-common.c: Likewise.
9758 * tree-alias-type.c: Likewise.
9759 * tree-browser.c: Likewise.
9760 * tree-dchain.c: Likewise.
9761 * tree-mudflap.c: Likewise.
9762 * tree-nomudflap.c: Likewise.
9763 * tree-optimize.c: Likewise.
9764 * tree-pretty-print.c: Likewise.
9765 * tree-simple.c: Likewise.
9767 * tree-alias-common.h: Convert prototypes to ISO C90, remove extra
9769 * tree-alias-type.h: Convert prototypes to ISO C90.
9770 * tree-dchain.h: Likewise.
9771 * tree-flow-inline.h: Likewise.
9772 * tree-flow.h: Likewise.
9773 * tree-iterator.h: Likewise.
9774 * tree-mudflap.h: Likewise.
9775 * tree-simple.h: Likewise.
9777 2003-07-14 Daniel Berlin <dberlin@dberlin.org>
9779 * tree-ssa-pre.c (tree_perform_ssapre): Fix dom_children after DCE
9782 2003-07-14 Diego Novillo <dnovillo@redhat.com>
9784 * tree-dfa.c (add_vdef): Initialize variable 'vdef'.
9785 (add_vuse): Initialize variable 'vuse'.
9787 2003-07-14 Diego Novillo <dnovillo@redhat.com>
9789 Must alias analysis. Allow the SSA rename pass to be done on a set
9792 * Makefile.in (OBJS): Add tree-must-alias.o.
9793 * flags.h (flag_tree_must_alias): Declare.
9794 * timevar.def (TV_TREE_MUST_ALIAS): Define.
9795 * toplev.c (flag_tree_must_alias): Declare.
9796 (f_options): Add entry for -ftree-must-alias.
9797 (parse_options_and_default_flags): Enable must-alias analysis at -O1.
9799 * tree-cfg.c (remove_useless_stmts_and_vars): Do not remove
9800 addressable variables.
9802 * tree-dfa.c (dump_file, dump_flags): New local variables to
9803 replace tree_ssa_dump_file and tree_ssa_dump_flags. Update every
9805 (get_stmt_operands): Clear the array of virtual operands before
9806 scanning the statement.
9807 (get_expr_operands): Do not add an operand for ADDR_EXPR if the
9808 expression takes the address of a VAR_DECL or a PARM_DECL. Instead
9809 add the variable to the list of variables whose address has been
9810 taken by the statement.
9811 Allow INDIRECT_REF expressions of the form *&VAR. Convert them
9812 into an operand for VAR.
9813 When processing function calls, add a VUSE for .GLOBAL_VAR if the
9814 function is pure but not const.
9815 (add_stmt_operand): If the operand is an ADDR_EXPR, add the
9816 variable to the list of variables whose address has been taken by
9818 (add_vdef): If the statement had virtual definitions, try to find
9819 an existing VDEF for the variable, to preserve SSA information. If
9820 none is found, create a new one.
9821 (add_vuse): Likewise.
9822 (remove_all_phi_nodes_for): New function.
9823 (get_call_flags): New function to replace call_may_clobber. Update
9826 * tree-dump.c (dump_files): Add entry for -fdump-tree-mustalias.
9827 * tree-flow-inline.h (addresses_taken): New function.
9828 (is_unchanging_value): New function.
9830 * tree-flow.h (addresses_taken): Declare.
9831 (remove_all_phi_nodes): Declare.
9832 (init_tree_ssa): Declare.
9833 (propagate_copy): Declare.
9834 (is_unchanging_value): Declare.
9835 (tree_compute_must_alias): Declare.
9837 * tree-inline.c (copy_body_r): Fold instances of *&VAR.
9839 * tree-must-alias.c: New file.
9841 * tree-optimize.c (optimize_function_tree): Call init_tree_ssa and
9842 compute_may_aliases before calling rewrite_into_ssa.
9843 After the SSA pass, run dead code elimination and compute
9846 * tree-simple.c (is_gimple_call_expr): Add comment that
9847 is_gimple_* predicates should not have side effects.
9849 * tree-ssa-ccp.c: Replace calls to really_constant_p with
9850 is_unchanging_value everywhere.
9851 (fold_stmt): Don't fold if the RHS is already a constant.
9853 * tree-ssa-copyprop.c (copyprop_stmt): Remove unnecessary
9855 Call propagate_copy to replace the operand with its new value.
9856 (copyprop_phi): Remove unnecessary variable 'vuse'.
9857 (get_original): Remove unused parameter 'vuse_p'.
9858 (propagate_copy): New function.
9860 * tree-ssa-dce.c (need_to_preserve_store): Update comments.
9862 * tree-ssa.c (dump_file, dump_flags): New local variables to
9863 replace globals tree_ssa_dump_file and tree_ssa_dump_flags. Update
9865 (addr_expr_propagated_p): New local variable.
9866 (vars_to_rename): New local variable.
9867 (check_for_new_variables): New local function.
9868 (rewrite_into_ssa): Add new argument VARS which is a bitmap
9869 representing all the variables that should be renamed into SSA. If
9870 VARS is NULL, all the variables in the program are renamed.
9871 Don't call init_tree_ssa nor compute_may_aliases.
9872 Initialize all the local hash tables and bitmaps.
9873 Add support for repeating the SSA rename process more than once.
9874 If the dominator optimizations produced new symbols, repeat the
9876 (mark_def_sites): Ignore operands that are in SSA form already.
9877 (insert_phi_nodes): Only add PHI nodes for variables in the
9878 VARS_TO_RENAME bitmap.
9879 (rewrite_block): Ignore PHI nodes that have been renamed already.
9880 (rewrite_and_optimize_stmt): Ignore operands that are already in
9882 When propagating ADDR_EXPR set addr_expr_propagated_p to 'true'.
9883 Call propagate_copy when doing copy propagation.
9884 Call is_unchanging_value to decide if the RHS of an assignment is a
9886 (rewrite_stmt): Ignore operands that are already in SSA form.
9887 (init_tree_ssa): Make external.
9888 Move initialization of local hash tables and bitmaps to
9890 (remove_annotations_r): Don't special case MODIFY_EXPR nodes.
9891 (lookup_avail_expr): Call is_unchanging_value.
9892 (get_eq_expr_value): Likewise.
9894 * tree.h (enum tree_dump_index): Add TDI_must_alias.
9896 * cp/optimize.c (optimize_function): Don't call the tree optimizers
9897 if -fdisable-tree-ssa is given.
9899 * doc/invoke.texi: Add documentation for -ftree-must-alias.
9901 2003-07-07 Jeff Law <law@redhat.com>
9903 * fold-const.c (nondestructive_fold_unary_to_constant: For BIT_NOT_EXPR
9904 make sure OP0 is a suitable constant before trying to fold it.
9906 * tree-cfg.c (handle_switch_fallthru): Set DECL_CONTEXT for
9907 newly created labels.
9909 * tree-cfg.c (move_outgoing_edges): New function.
9910 (merge_tree_blocks): Use it.
9911 (remove_bb): Remove the block from the pdom_info structures
9912 as well if they exist.
9913 (linearize_cond_expr): Move important edges from the then and
9914 else arms to BB as appropriately
9916 * tree-cfg.c (remove_stmt): When removing a COMPOUND_EXPR, make
9917 sure that any basic block pointers to the arms of the COMPOUND_EXPR
9920 * tree-cfg.c (make_goto_expr_edges): Computed gotos create
9923 2003-07-05 Daniel Berlin <dberlin@dberlin.org>
9925 * tree-ssa-pre.c (defs_match_p): Check for copies of the same version.
9927 2003-07-03 Frank Ch. Eigler <fche@redhat.com>
9929 * tree-nomudflap.c (mf_marked_p, mf_mark): New dummy functions.
9931 2003-07-03 Jeff Law <law@redhat.com>
9933 * tree-ssa.c (lookup_avail_expr): Accept new argument containing the
9934 const_and_copies table. All callers changed. If we find the
9935 given expression in the availe expression hash table, then lookup
9936 the LHS of the hash table's entry in the const_and_copies_table.
9937 Do record type casts into the available expression table.
9939 * tree-nomudflap.c (mf_marked_p): Mark arguments as being unused.
9940 (mf_mark): Likewise.
9942 * c-decl.c (store_parm_decls): Strip away NOP_EXPRs when looking
9943 for hidden use variables.
9945 2003-07-02 Frank Ch. Eigler <fche@redhat.com>
9947 * varasm.c (build_constant_desc): Propagate mudflap marked-ness
9948 across constant copying.
9950 2003-07-02 Daniel Berlin <dberlin@dberlin.org>
9952 * tree-ssa-pre.c (tree_perform_ssapre): Don't optimize things with
9953 volatile ops or making aliased loads right now.
9954 (create_expr_ref): Mark the phi result of the new phi as having
9956 (finalize_1): Mark the new temp as having real refs.
9957 (repair_use_injury): Ditto.
9958 (code_motion): Ditto.
9960 2003-07-01 Daniel Berlin <dberlin@dberlin.org>
9962 * tree.h (struct tree_eref_common): Add injured flag.
9963 Add EREF_INJURED macro.
9965 2003-07-01 Daniel Berlin <dberlin@dberlin.org>
9967 * tree-flow-inline.h (stmt_ann): We have stmt_ann on E*_NODE's as well,
9968 so use is_essa_node as well.
9969 * tree-dfa.c (create_stmt_ann): Ditto.
9970 * tree.h (is_essa_node): Declare.
9971 * tree.c (is_essa_node): Define.
9973 2003-07-01 Jason Merrill <jason@redhat.com>
9975 * tree-cfg.c (prepend_stmt_to_bb): New fn.
9976 (bsi_insert_after): Add to the beginning of an empty block.
9978 2003-07-01 Jeff Law <law@redhat.com>
9980 * expr.c (expand_expr, case COND_EXPR): Correctly (?) handle
9981 cases where a containing block has a stack level. Handle
9982 cases where one arm is a GOTO_EXPR and the other arm has
9985 * stmt.c (containing_blocks_have_cleanups_or_stack_level): New
9987 (any_pending_cleanups): Further simplification.
9988 * tree.h (containing_blocks_have_cleanups_or_stack_level): Prototype.
9990 2003-06-30 Diego Novillo <dnovillo@redhat.com>
9992 * tree-flow.h (struct tree_ann_common_d): Remove 'stmt' field.
9994 (struct var_ann_d): Remove field 'has_real_refs'. Update all callers
9995 with calls to SSA_NAME_HAS_REAL_REFS.
9996 Remove field 'occurs_in_abnormal_phi'. Update all callers with
9997 calls to SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
9998 * tree-flow-inline.h (var_ann): Only accept _DECL nodes.
9999 (stmt_ann): Only accept GIMPLE statements.
10000 (tree_stmt): Remove. Update all users.
10002 * tree-cfg.c (linearize_cond_expr): Handle cases where BB doesn't
10003 have a postdominator.
10004 (find_contained_blocks): Do not look inside COND_EXPR_COND nor
10005 SWITCH_COND expressions.
10007 * tree-dfa.c (get_stmt_operands): Force virtual operands on
10009 (get_expr_operands): Handle SSA names when adding operands for
10011 (add_stmt_operand): Handle SSA names.
10012 Move checks for volatile operands earlier in the code.
10013 (add_vdef): Re-format for readability.
10014 (create_var_ann): Only allow _DECL nodes.
10015 (create_stmt_ann): Only allow GIMPLE statements.
10016 (dump_variable): Handle SSA names.
10017 (dump_may_aliases_for): Likewise.
10018 (may_access_global_mem_p): Handle SSA names.
10019 (remove_phi_arg): If the argument removed was the last one with
10020 real references, update the LHS of the PHI node.
10021 (add_phi_arg): If the argument added has real references, propagate
10022 the attribute into the LHS of the PHI node.
10024 * tree-pretty-print.c (dump_generic_node): Only retrieve basic
10025 block information from GIMPLE statements.
10026 Always output the THEN and ELSE clauses of COND_EXPR nodes.
10028 * tree-simple.c (is_gimple_stmt): Accept PHI_NODEs.
10029 (is_gimple_id): Accept SSA_NAMEs.
10031 * tree-ssa-copyprop.c (copyprop_phi): If an argument is used as a
10032 real operand, propagate the attribute into the LHS of the PHI.
10034 * tree-ssa-live.c (create_ssa_var_map): Don't set 'used' flag on
10035 both the operand and the result of VDEFs.
10036 Only register PHI results and arguments that have been used as real
10038 (calculate_live_on_entry): Fix formatting in debugging message.
10040 * tree-ssa.c (register_new_def): Add new argument
10041 'is_real_operand'. If it's set, set SSA_NAME_HAS_REAL_REFS for the
10042 new name. Update all callers.
10043 (rewrite_operand): Add new argument 'is_real_operand'. If it's
10044 set, set SSA_NAME_HAS_REAL_REFS to the operand.
10045 (eliminate_build): Ignore PHI arguments and PHI results that have
10046 not been used in real operands.
10047 (rewrite_vdefs): Remove. Update all users.
10048 (set_is_used): Don't handle SSA names.
10049 (coalesce_ssa_name): Ignore PHI arguments that have not had real
10050 references in the program.
10052 * tree.c (make_ssa_name): Update documentation.
10053 * tree.h (IS_EMPTY_STMT): Call integer_zerop instead of comparing
10054 against size_zero_node.
10055 (SSA_NAME_HAS_REAL_REFS): Define.
10056 (SSA_NAME_OCCURS_IN_ABNORMAL_PHI): Define.
10057 (struct tree_ssa_name): Add bitfields 'has_real_refs' and
10058 'occurs_in_abnormal_phi'.
10060 2003-06-30 Jeff Law <law@redhat.com>
10062 * c-simplify.c (gimplify_c_loop): Don't return a LOOP_EXPR for
10063 a do ... while (0) loop.
10065 * expr.c (expand_expr, case COND_EXPR): Be smarter about expanding
10066 a COND_EXPR with only one useful arm, which happens to be a GOTO_EXPR.
10068 * tree-cfg.c (remove_useless_stmts_and_vars): Don't remove user
10069 variables unless we're at -O2 or higher.
10071 2003-06-30 Daniel Berlin <dberlin@dberlin.org>
10073 * tree-ssa-pre.c (expr_phi_insertion): Stop optimizing the expression
10074 if we have > some very large number of ephi operands, as it will
10075 take an ungodly amount of memory and time.
10076 (pre_expression): Push/pop gc context so we can do gc collection
10077 in between expressions.
10078 Throw away expression info right after done optimizing it.
10080 2003-06-30 Jason Merrill <jason@redhat.com>
10082 * gimplify.c (gimplify_call_expr): Check PUSH_ARGS_REVERSED.
10084 * gimplify.c (gimplify_modify_expr): Also force a call with a
10085 possible nonlocal goto into a temporary.
10086 (gimplify_return_expr): Don't duplicate the MODIFY_EXPR.
10087 * tree-iterator.h (tsi_one_before_end_p): New fn.
10089 2003-06-29 Jeff Sturm <jsturm@one-point.com>
10091 * fold-const.c (fold): Don't save_expr unless TREE_SIDE_EFFECTS.
10093 2003-06-26 Diego Novillo <dnovillo@redhat.com>
10095 * c-simplify.c (gimplify_stmt_expr): Handle statement-expressions
10096 that don't end in a non-void expression. Emit a warning in that
10099 2003-06-26 Daniel Berlin <dberlin@dberlin.org>
10101 * tree-ssa-pre.c (fixup_domchildren): Rename from
10102 compute_domchildren, change to not use our own array.
10103 (domchildren): Remove variable.
10104 (insert_occ_in_preorder_dt_order_1): Use dom_children now.
10105 (insert_euse_in_preorder_dt_order_1): Ditto.
10106 (search_dt_preorder): Ditto.
10107 (handle_bb_creation): Fix to work properly.
10108 (tree_perform_ssapre): Remove remnants of domchildren.
10109 Redo dominator info if we have to due to a new block.
10111 2003-06-26 Andrew MacLeod <amacleod@redhat.com>
10113 * tree-cfg.c (handle_switch_split): Use a tree iterator to find the
10114 real split point rather than a block iterator.
10116 2003-06-26 Jason Merrill <jason@redhat.com>
10118 * tree-simple.c (is_gimple_stmt): Complete.
10120 2003-06-24 Jeff Law <law@redhat.com>
10122 * tree-cfg.c (remove_useless_stmts_and_vars): On the first
10123 iteration, remove unused variables from BIND_EXPRs.
10124 * tree-flow.h (var_ann_d): Add new field USED.
10125 (set_is_used): Prototype.
10126 (remove_useless_stmts_and_vars): Update prototype.
10127 * tree-ssa-live.c (create_ssa_var_map): Note which variables
10128 are used so that we can delete those which are not used.
10129 * tree-ssa.c (create_temp): Mark the new temporary as being used.
10130 (rewrite_out_of_ssa): Note if the call to remove_useless_stmts_and_vars
10131 is the first iteration or not.
10132 (set_is_used): New function.
10134 * c-decl.c (store_parm_decls): Variables and parameters on the
10135 pending_sizes chain have nonlocal uses.
10137 2003-06-25 Daniel Berlin <dberlin@dberlin.org>
10139 * tree-ssa-pre.c: Convert to ISO C.
10140 (handle_bb_creation): New function.
10141 (ephi_will_be_avail): Remove dead code.
10142 (finalize_1): Use handle_bb_creation, start to fix edge insertion
10144 (maybe_find_rhs_use_for_var): Stop using tree_stmt.
10145 (code_motion): Always get the temporary from the right place.
10147 2003-06-24 Jason Merrill <jason@redhat.com>
10149 * gimplify.c (gimplify_self_mod_expr): Add want_value parm.
10150 For postfix ops, make sure it returns an rvalue.
10151 (gimplify_expr): Copy a volatile reference into a temp.
10152 (create_tmp_var): Require a complete type.
10153 (create_tmp_alias_var): Use TYPE_VOLATILE on types.
10154 * tree-simple.c (is_gimple_stmt): Flesh out a bit.
10155 (is_gimple_val): Don't allow volatiles.
10157 * c-simplify.c (gimplify_expr_stmt): Don't insert a null pointer.
10159 * gimplify.c (gimplify_return_expr): Search through the gimple
10160 form for the interesting MODIFY_EXPR.
10161 (gimplify_modify_expr): Don't suppress posteffects if want_value.
10163 2003-06-24 Diego Novillo <dnovillo@redhat.com>
10165 * tree-dfa.c (struct dfa_stats_d): Remove obsolete fields
10166 num_tree_refs and size_tree_refs. Update all users.
10167 (dump_dfa_stats): Also dump information about VUSE and VDEF
10169 * tree-ssa.c (rewrite_vdefs): Dump information about VDEF operators
10170 promoted to real copies if -fdump-tree-optimized-details is given.
10172 2003-06-23 Jeff Law <law@redhat.com>
10174 * tree-ssa.c (avail_expr_eq): Verify types are the same before
10175 handing expressions to operand_equal_p.
10177 * tree-cfg.c (make_edges): Remove fake edges before building
10178 extra edges for TRY_FINALLY_EXPRs. Delete unnecessary edges
10179 leaving the TRY block in a TRY_FINALLY_EXPR.
10180 (find_contained_blocks): Don't consider statements in the CATCH
10181 clause of a TRY_CATCH_EXPR when noting the last statement in
10183 * tree-dfa.c (remove_phi_arg): If we removed the last PHI argument,
10184 then remove the entire PHI node.
10185 * tree-ssa-dce.c (stmt_useful_p): Consider the other EH related
10186 nodes useful as well (TRY_FINALLY_EXPR, TRY_CATCH_EXPR, and
10189 * tree-cfg.c (remove_useless_stmts_and_vars): If the body of a
10190 TRY_CATCH_EXPR is empty, then the entire TRY_CATCH_EXPR can
10193 * tree-cfg.c (find_contained_blocks): Renamed from
10194 find_contained_blocks_and_edge_targets. Remove targets
10195 bitmap argument and no longer record targets of edges.
10196 All callers changed.
10197 (make_edges): No longer need TRY_TARGETS bitmap. Kill it.
10198 Simplify code which creates additional edges out of the TRY
10199 block and the FINALLY block in a TRY_FINALLY_EXPR.
10201 2003-06-23 Diego Novillo <dnovillo@redhat.com>
10203 * tree-alias-common.c (ptr_may_alias_var): Don't handle memory
10205 * tree-dfa.c (struct alias_set_d): Remove. Update all users.
10206 (alias_sets): Remove. Update all users.
10207 (struct walk_state): Remove field aliased_objects_found.
10208 (struct alias_map_d): New.
10209 (addressable_vars): New local variable.
10210 (pointers): New local variable.
10211 (add_stmt_operand): Do not force aliased variables to be in virtual
10213 (register_alias_set): Remove. Update all users.
10214 (find_alias_for): Remove. Update all users.
10215 (get_memory_tag_for): New local function.
10216 (num_referenced_vars): Remove.
10217 (num_aliased_objects): Remove. Update all users.
10218 (aliased_objects): Remove. Update all users.
10219 (aliased_objects_alias_set): Remove. Update all users.
10220 (num_call_clobbered_vars): Remove. Update all users.
10221 (dump_variable): Move code to dump aliases ...
10222 (dump_may_aliases_for): ... here.
10223 (debug_may_aliases_for): New function.
10224 (compute_may_aliases): Initialize 'addressable_vars' and 'pointers'
10226 (compute_alias_sets): Re-implement matching pointers with
10227 addressable variables. Limit the size of may-alias sets.
10228 (may_alias_p): Re-implement to compare pointers against variables,
10229 instead of memory tags.
10230 (dump_alias_info): Re-implement to display pointers and addresable
10232 (add_referenced_var): Collect addressable variables and pointers.
10233 Share memory tags among pointers that may alias each other.
10234 * tree-flow.h (num_referenced_vars): Change to macro.
10235 (referenced_var): Likewise.
10236 (num_call_clobbered_vars): Likewise.
10237 (call_clobbered_var): Likewise.
10238 (dump_may_aliases_for): Declare.
10239 (debug_may_aliases_for): Declare.
10240 * tree-ssa.c (rewrite_vdefs): New local function.
10241 (rewrite_out_of_ssa): Call it.
10243 2003-06-23 Jeff Law <law@redhat.com>
10245 * tree-cfg.c (make_edges): Walk TRY_FINALLYs inner to outer and
10246 simplify creation of special edges related to the TRY_FINALLY_EXPR.
10248 * tree-cfg.c (remove_useless_stmts_and_vars): More aggressively
10249 remove TRY_CATCH_EXPRs and TRY_FINALLY_EXPRs.
10251 * tree-cfg.c (make_edges): Remove fake edges.
10252 (make_exit_edges): Mark edges from nonreturning functions to the
10253 exit block as being fake edges.
10255 * gimplify.c (gimplify_modify_expr): Don't create a new MODIFY_EXPR,
10256 reuse the existing one.
10258 2003-06-23 Andrew MacLeod <amacleod@redhat.com>
10260 * tree-cfg.c (find_insert_location): Default case should insert after
10261 the last stmt in the block.
10263 2003-06-22 Jeff Sturm <jsturm@one-point.com>
10265 * Makefile.in (old-tree-inline.o): Remove rule.
10266 * old-tree-inline.c: Remove.
10268 2003-06-19 Jeff Law <law@redhat.com>
10270 * tree-cfg.c (make_ctrl_stmt_edges): Do not create bogus edges
10271 to the successor block of TRY_CATCH_EXPR, TRY_FINALLY_EXPR,
10272 CATCH_EXPR or EH_FILTER_EXPR nodes.
10274 * gimplify.c (gimplify_modify_expr): If the RHS of an MODIFY_EXPR
10275 might throw, then make sure its result goes into a temporary.
10277 * tree-cfg.c (handle_switch_split): Handle case where target
10278 block has only one statement (the case label itself).
10280 2003-06-19 Diego Novillo <dnovillo@redhat.com>
10282 * doc/invoke.texi: Add documentation for -ftree-dominator-opts
10283 that was missing from an earlier patch.
10285 2003-06-19 Jeff Sturm <jsturm@one-point.com>
10287 * gimplify.c (gimplify_expr): Handle LABELED_BLOCK_EXPR
10288 and EXIT_BLOCK_EXPR.
10289 (gimplify_labeled_block_expr): New function.
10290 (gimplify_exit_block_expr): New function.
10292 2003-06-18 Andrew MacLeod <amacleod@redhat.com>
10294 * tree-cfg.c (EDGE_INSERT_LOCATION_BSI_AFTER): New location code.
10295 (cleanup_switch_expr_graph): Find default case correctly.
10296 (bsi_insert_after): Get BB from stmt when its avialble.
10297 (bsi_insert_before): Get BB from stmt when its avialble.
10298 (handle_switch_fallthru): New. Handle edge from switch to the fallthru.
10299 (handle_switch_split): Re-implement using new scheme.
10300 (find_insert_location): Use handle_switch_fallthru ().
10301 (bsi_insert_on_edge_immediate): Handle EDGE_INSERT_LOCATION_BSI_AFTER.
10302 * tree-iterator.h (tsi_last): New. Find last stmt in a chain.
10304 2003-06-17 Daniel Berlin <dberlin@dberlin.org>
10306 * tree-alias-common.c (find_func_aliases): Guard cast op
10308 (ptr_may_alias_var): Small optimization to avoid calling
10309 decl_function_context so often.
10310 * tree-alias-ander.c (ander_simple_assign): Ignore if lhs == rhs.
10312 2003-06-17 Steven Bosscher <steven@gcc.gnu.org>
10314 * timevar.def (TV_TREE_BUILD_FUD_CHAINS): Remove.
10316 2003-06-16 Diego Novillo <dnovillo@redhat.com>
10318 * tree-ssa-ccp.c (DONT_SIMULATE_AGAIN): Define.
10319 (visit_phi_node): Don't do anything if the PHI node doesn't need to
10321 If the PHI variable does not have real references, consider it
10323 If the PHI node has a lattice value of VARYING, set
10324 DONT_SIMULATE_AGAIN.
10325 (visit_stmt): Don't do anything if the statement doesn't need to be
10327 Only visit conditional branches COND_EXPR and SWITCH_EXPR.
10328 If the statement doesn't produce a result mark it with
10329 DONT_SIMULATE_AGAIN.
10330 (visit_assignment): Remove unnecessary def_op() check.
10331 If the value is VARYING, mark the statement with
10332 DONT_SIMULATE_AGAIN.
10333 (visit_cond_stmt): Remove unnecessary is_ctrl_stmt() check.
10334 If the predicate is VARYING, mark the statement with
10335 DONT_SIMULATE_AGAIN.
10336 (initialize): Clear DONT_SIMULATE_AGAIN flag for every statement
10338 (likely_value): Get statement operands after checking if it makes
10339 aliased loads or has volatile operands.
10341 2003-06-16 Jeff Law <law@redhat.com>
10342 Jason Merrill <jason@redhat.com>
10344 * except.c (enum eh_region_type): Don't declare the enumeration
10345 members here. Instead do it in except.h.
10346 (expand_eh_hander): Use expr_first instead of open-coding it.
10347 * except.h (enum eh_region_type): Define the enumeration memebers
10349 * tree-cfg.c (last_exec_block): Break out from make_edges.
10350 (could_trap_p): No longer static.
10351 (get_eh_region_type): New function.
10352 (make_try_expr_blocks): Keep the whole TRY_CATCH_EXPR or
10353 TRY_FINALLY_EXPR instead of just the handler part in the
10354 EH_STACK varray. For a cleanup, record which cleanup higher
10355 in the EH_STACK it can reach.
10356 (make_edges): Use last_exec_block.
10357 (make_ctrl_stmt_edges): Thread cleanups as needed.
10358 (compute_reachable_eh): Use get_eh_region_type. Properly
10359 track when we can skip cleanups. Skip cleanups when possible.
10360 * tree-flow.h (could_trap_p): Prototype.
10362 2003-06-16 Andrew Macleod <amacleod@redhat.com>
10364 * tree-cfg.c (find_insert_location): Check for control_altering stmts,
10365 and abort if its an unrecognized BB ending stmt.
10366 (bsi_commit_first_edge_insert): Rename to bsi_insert_on_edge_immediate,
10367 externalize, and change the interface to an on-demand inserter.
10368 (bsi_commit_edge_inserts): Call bsi_insert_on_edge_immediate().
10369 * tree-flow.h (bsi_insert_on_edge_immediate): Prototype.
10370 * tree-pretty-print.c (dump_block_info): Add 'ab' for abnormal edges.
10371 * tree-ssa-dce.c (process_worklist): Use sparse bitmaps.
10372 * tree-ssa-live.c (calculate_live_on_entry): Abort if ssa_name has a
10373 definition, but is also live on entry.
10374 * tree-ssa.c (coalesce_ssa_name): Call abort() instead of error(), and
10375 provide more detailed info.
10376 (rewrite_out_of_ssa): Provide CFG dumps before and after rewritting.
10378 2003-06-16 Frank Ch. Eigler <fche@redhat.com>
10380 * tree-mudflap.c (mf_mark): Use GC-compatible htab_create_ggc.
10382 2003-06-15 Jeff Law <law@redhat.com>
10384 * tree-ssa-ccp.c (visit_phi_node): If the PHI is already known
10385 to be varying, don't recompute its value.
10387 2003-06-14 Jeff Law <law@redhat.com>
10388 Jason Merrill <jason@redhat.com>
10390 * tree-cfg.c (make_blocks): Do not return early if presented
10391 with an empty statement.
10392 (make_ctrl_stmt_edges): Do not try to optimize an empty TRY
10393 block in a TRY_FINALLY_EXPR. Simplify TRY_FINALLY_EXPR,
10394 TRY_CATCH_EXPR, CATCH_EXPR, and EH_FILTER_EXPR now that empty
10395 statements are no longer shared.
10397 2003-06-14 Kazu Hirata <kazu@cs.umass.edu>
10399 * tree-ssa-pre.c: Fix a comment typo.
10401 2003-06-13 Diego Novillo <dnovillo@redhat.com>
10403 * tree-dfa.c (get_stmt_operands): Abort if the statement is a
10405 (create_var_ann): Abort if the variable is not a _DECL node.
10407 2003-06-13 Frank Ch. Eigler <fche@redhat.com>
10409 * tree-mudflap.c (mudflap_c_function): Change calling conventions so
10410 as to return the instrumented function body rather than changing the
10411 given fndecl in place. Gimplify at the very end, for cosmetic
10413 * tree-mudflap.h, tree-nomudflap.c: Corresponding changes.
10414 * c-decl.c (c_expand_body_1): Call mudflap_c_function just before
10415 rtl expansion of function body; don't interfere with inlining.
10417 2003-06-13 Diego Novillo <dnovillo@redhat.com>
10419 * c-simplify.c: Fix typo in previous change.
10421 2003-06-13 Diego Novillo <dnovillo@redhat.com>
10423 * c-common.c, c-common.h, c-decl.c, c-lang.c, c-simplify.c,
10424 flags.h, gimplify.c, langhooks-def.h, langhooks.c, langhooks.h,
10425 simple-break-elim.c, simple-goto-elim.c, toplev.c,
10426 tree-alias-common.c, tree-cfg.c, tree-dfa.c, tree-dump.c,
10427 tree-inline.c, tree-mudflap.c, tree-simple.c, tree-simple.h,
10428 tree-ssa-ccp.c, tree-ssa-pre.c, tree-ssa.c, tree.h, doc/invoke.texi:
10429 Rename SIMPLE to GIMPLE everywhere.
10431 2003-06-13 Andrew MacLeod <amacleod@redhat.com>
10433 * tree-cfg.c (bsi_commit_first_edge_insert): Only consider non-abnormal
10434 edges when determining whether an edge needs to be split.
10436 * tree-ssa-dce.c (process_worklist): When checking for GOTO and
10437 COND_EXPR's that are necessary, check each BB's predecessors only once.
10439 2003-06-12 Jeff Law <law@redhat.com>
10441 * tree-ssa.c (avail_expr_eq): Add some checking code to
10442 detect when equal expressions have different hash values.
10444 * tree.c (iterative_hash_expr): Don't hash types associated
10445 with conversions. Instead hash on the signedness of the
10446 toplevel object and the operand of the conversion.
10448 * Makefile.in (gimplify.o): Depend on $(RTL_H). Ugh.
10449 * gimplify.c: Include "rtl.h".
10450 (simplify_call_expr): Use call_expr_flags and check for ECF_CONST
10451 rather than checking bits in the tree node directly.
10453 * fold-const.c (operand_equal_p): CALL_EXPRs with side effects
10456 2003-06-11 Frank Ch. Eigler <fche@redhat.com>
10458 * gcc.c (MFWRAP_SPEC): Always wrap main().
10459 * tree-mudflap.c (mudflap_enqueue_decl): Mark enqueued decls
10460 to prevent their repeated processing.
10462 2003-06-11 Daniel Berlin <dberlin@dberlin.org>
10464 * tree-ssa-pre.c: add graph_dump_file, graph_dump_flags.
10465 (finalize_1): Modify to use temporary in expr_info structure,
10466 remove temporary from arguments.
10467 Use bsi_insert_on_edge for ephi insertions.
10468 Set EREF_TEMP on inserted euses.
10469 (repair_phi_injury): Note (to dump file) injuries we have
10471 (repair_use_injury): Ditto.
10472 (repair_euse_injury): Ditto.
10473 (count_stmts_in_bb): Count both forwards and backwards, and make
10474 sure the numbers agree. This makes sure both the head and end are
10476 (code_motion): Use the EREF_TEMP, rather than calculating the
10477 reaching def, when possible, because it's faster.
10478 Add the phi we created when we insert the ephi. We should always
10479 be able to get the reaching def of the ephi from EREF_TEMP (since
10480 the args should have already been inserted, or in the case of
10481 phi's, have a phi already allocated), so abort if we can't.
10482 (create_expr_ref): Take expr_info parameter. Make a phi for the
10483 ephi's, but don't add to the bb yet. Update all callers.
10484 (get_default_def): New function.
10485 (get_reaching_def): Use it to find the default def when we hit the
10486 top of the dom tree.
10487 (struct expr_info): Add temp.
10488 (new_rename_1): Dump out occurrences after rename 1, but before
10490 (requires_edge_placement): Now that we can insert on edges, we
10491 shouldn't need this, so make it always return false.
10492 Will remove unless something bad comes up.
10493 (pre_expression): Start working on dumping the redundancy graph.
10495 * tree.h (struct treeeref_common): Add the temp member.
10496 Add EREF_TEMP macro.
10497 (tree_dump_index): Reorder to match actual optimization order.
10500 * tree-dump.c: Ditto.
10502 2003-06-11 Jeff Law <law@redhat.com>
10504 * gimplify.c (simplify_call_expr): Clear TREE_SIDE_EFFECTS for
10505 calls to "const" functions.
10507 * tree-inline.c (expand_call_inline): Recalculate TREE_SIDE_EFFECTS
10508 properly when inlining gimplified functions.
10510 * fold-const.c (operand_equal_p): Handle CALL_EXPRs.
10512 * tree-cfg.c (first_exec_block): Kill.
10513 (make_edges): Use bb_for_stmt rather than first_exec_block.
10514 (make_ctrl_stmt_edges, make_exit_edges): Likewise.
10515 (make_loop_expr_edges, make_cond_expr_edges): Likewise.
10516 (successor_block): Don't skip empty statements.
10518 * tree-ssa.c (rewrite_and_optimize_stmt): Do not special case
10519 CALL_EXPRs they're caught by the TREE_SIDE_EFFECTS test.
10521 * tree-ssa.c (rewrite_and_optimize_stmt): Improve/correct setting of
10522 may_optimize_p. Simplify later code knowing may_optimize_p is
10524 (avail_expr_hash): Do not use iterative_hash_object or deal with
10525 SSA names for real operands. Instead use iterative_hash_expr
10526 which handles both.
10527 (avail_expr_eq): Use operand_equal_p to test for equality.
10529 2003-06-11 Steven Bosscher <steven@gcc.gnu.org>
10531 * tree-flow.h, tree-ssa-ccp.c, tree-ssa-copyprop.c,
10532 tree-ssa-dce.c, tree-ssa-live.c, tree-ssa-live.h:
10533 Convert function prototypes to ISO C.
10535 2003-06-10 Jeff Law <law@redhat.com>
10537 * toplev.c (parse_options_and_default_flags): Fix typo in last change.
10539 * gimplify.c (simplify_expr, case BIT_FIELD_REF): Make sure
10540 to call recalculate_side_effects after gimplifying the
10543 2003-06-10 Diego Novillo <dnovillo@redhat.com>
10545 * toplev.c (flag_tree_dom): New variable.
10546 (f_options): Add new entry for -ftree-dominator-opts.
10547 (parse_options_and_default_flags): Enable flag_tree_dom for
10548 -O1 and higher. At -O2 and higher, disable flag_tree_dom is
10549 SSA-PRE is also specified.
10550 * flags.h (flag_tree_dom): Declare.
10551 * doc/invoke.texi: Document -ftree-dominator-opts.
10552 * tree-ssa.c (rewrite_block): Disable tracking of available
10553 expressions when not doing dominator optimizations.
10554 Call rewrite_stmt when not doing dominator optimizations.
10555 Otherwise, call rewrite_and_optimize_stmt.
10556 (rewrite_stmt): Don't optimize the statement. Just rename.
10557 (rewrite_and_optimize_stmt): Optimize the statement while rewriting
10559 (lookup_avail_expr): Update comments.
10561 2003-06-10 Andrew Haley <aph@redhat.com>
10563 * c-simplify.c (c_simplify_stmt): case ASM_STMT: Ensure qualifiers
10564 come from input statement.
10566 2003-06-09 Andrew MacLeod <amacleod@redhat.com>
10568 * tree-cfg.c (handle_switch_split): Update PHI nodes when splitting.
10569 (tree_split_edge): Update PHI nodes in destination block.
10571 2003-06-09 Steven Bosscher <steven@gcc.gnu.org>
10573 * basic-block.h, tree-dfa.c, tree-ssa.c, tree-cfg.c,
10574 tree-flow.h: Convert function prototypes to ISO C.
10576 2003-06-09 Daniel Berlin <dberlin@dberlin.org>
10578 * tree-cfg.c (bsi_commit_edge_inserts): Fix computation of
10581 2003-06-08 Diego Novillo <dnovillo@redhat.com>
10583 * tree-cfg.c (handle_switch_split): Don't allocate basic block
10584 annotations more than once.
10585 (bsi_commit_first_edge_insert): Likewise.
10587 2003-06-07 Jeff Sturm <jsturm@one-point.com>
10589 * tree-cfg.c (could_trap_p): New function.
10590 (stmt_ends_bb_p): Handle flag_non_call_exceptions.
10591 (make_exit_edges): Handle flag_non_call_exceptions.
10592 (is_ctrl_altering_stmt): Handle flag_non_call_exceptions.
10593 * tree-inline.c (walk_tree): Add case for CHAR_TYPE.
10594 * tree-ssa-dce.c (stmt_useful_p): Keep all CATCH_EXPRs.
10596 2003-06-05 Jason Merrill <jason@redhat.com>
10598 * stmt.c (asm_op_is_mem_input): New fn.
10599 * tree.h: Declare it.
10600 * gimplify.c (simplify_asm_expr): Call resolve_asm_operand_names.
10601 Use is_simple_modify_expr_lhs for mem input ops.
10603 2003-06-05 Frank Ch. Eigler <fche@redhat.com>
10605 * c-mudflap.c (mflang_register_call): Give the synthetic decl
10606 undefined (not zero) size.
10608 2003-06-05 Frank Ch. Eigler <fche@redhat.com>
10610 * tree-mudflap.c (mx_flag): Remove. Update callers to use mf_mark.
10611 (TREE_MUDFLAPPED_P): Remove. Update callers to use mf_marked_p.
10612 (mf_mark, mf_marked_p): Replacement functions to replace old node
10613 marking based on tree flag-bits.
10614 (mf_mostly_copy_tree_r): Preserve markedness across copies.
10615 * tree-mudflap.h: Add new decls
10616 * c-mudflap.c (mx_flag): Remove. Update callers to use mf_mark.
10618 2003-06-04 Diego Novillo <dnovillo@redhat.com>
10620 * tree-dfa.c (add_stmt_operand): Always consider non-scalar types
10623 2003-06-04 Andrew MacLeod <amacleod@redhat.com>
10625 * toplev.c (parse_options_and_default_flags): Turn tree_copyprop on by
10627 * tree-cfg.c (linearize_control_structures, linearize_cond_expr,
10628 replace_stmt, merge_tree_blocks, remap_stmts): Fix PROTOS.
10629 (find_insert_location): Add additional basic block parameter. Handle
10631 (handle_switch_split): New. Split edges to switch labels.
10632 (bsi_commit_first_edge_insert): Add extra parameter to
10633 find_insert_location call. Fix split block chaining in THEN & ELSE.
10634 * tree-ssa-live.c (calculate_live_on_entry): Process all PHI def's
10635 after all the arguments have been processed.
10636 * tree-ssa.c (struct ssa_stats_d, struct loops *loops, var_is_live,
10637 rewrite_into_ssa): Remove old UNSSA code.
10638 (rewrite_block): Remove stmt is rewrite_stmt returns 1.
10639 (assign_vars): Remove abort and enable overlapping live ranges.
10640 (replace_variable): New. Replace SSA name with the partition variable.
10641 (rewrite_out_of_ssa): Use replace_variable().
10642 (dump_tree_ssa_stats): Remove old UNSSA code.
10643 (rewrite_stmt): Return 1 if stmt should be deleted. Remove old
10646 2003-06-03 Diego Novillo <dnovillo@redhat.com>
10648 * gimplify.c (simplify_call_expr): Move code to mark MD builtins
10649 non-simplifiable...
10650 * tree-simple.c (is_simple_call_expr): ... here.
10652 2003-06-03 Diego Novillo <dnovillo@redhat.com>
10654 * c-parse.in: Fix botched merge.
10656 2003-06-03 Diego Novillo <dnovillo@redhat.com>
10658 * tree-mudflap.c (MARK_TREE_MUDFLAPPED, TREE_MUDFLAPPED):
10659 Use TREE_VISITED instead of TREE_BOUNDED.
10660 * c-mudflap.c (TREE_MUDFLAPPED): Likewise.
10661 * tree-pretty-print.c (dump_generic_node): Remove
10662 references to TYPE_QUAL_BOUNDED.
10664 2003-06-03 Jason Merrill <jason@redhat.com>
10666 * gimplify.c (simplify_cond_expr): Call truthvalue_conversion
10667 before invert_truthvalue.
10669 2003-06-02 Daniel Berlin <dberlin@dberlin.org>
10671 * tree-dfa.c (compute_may_aliases): Call delete_alias_vars whenever we
10672 call create_alias_vars.
10674 * tree-alias-common (ptr_may_alias_var): Cleanup determination of
10675 global vars and whatnot.
10677 2003-06-02 Diego Novillo <dnovillo@redhat.com>
10679 * Makefile.in (tree-ssa.o, tree-cfg.o): Add dependency on cfgloop.h
10680 (tree-optimize.o): Remove dependency on cfgloop.h.
10681 * basic-block.h (struct basic_block_def): Fix documentation for
10682 field 'loop_father'.
10683 * tree-dfa.c (add_referenced_var): Fix type of element
10684 pushed into aliased_objects_alias_set.
10685 * tree-optimize.c: Don't include cfgloop.h
10686 (optimize_function_tree): Move code to initialize loop optimizer...
10687 * tree-cfg.c (build_tree_cfg): ... here.
10688 * tree-ssa.c: Include cfgloop.h.
10689 (loops): New file local variable.
10690 (rewrite_into_ssa): Initialize/finalize loop optimizer.
10691 (rewrite_stmt): Call var_is_live when processing redundant
10692 assignments to the same LHS.
10693 (var_is_live): Add heuristic to discover overlapping definitions in
10694 loops that do not have PHI nodes for VAR at the loop header.
10696 2003-06-02 Jason Merrill <jason@redhat.com>
10698 * gimplify.c (simplify_expr): Only allow a cast from a 'val'.
10699 * tree-simple.c (is_simple_cast): Likewise.
10701 2003-06-02 Andrew MacLeod <amacleod@redhat.com>
10703 * tree-cfg.c (bsi_insert_before): Update end of block pointer if we
10704 inserted before the last stmt in a block. (The container changed).
10705 * tree-ssa.c (elim_backward): Inserting copy should be within
10707 (elim_create): Only select one bit instead of the all.
10709 2003-06-01 Jason Merrill <jason@redhat.com>
10711 * Makefile.in: Remove lots of -Wno-error targets.
10713 * tree-simple.c (recalculate_side_effects): Check TREE_THIS_VOLATILE.
10715 * gimplify.c (simplify_compound_lval): Call
10716 recalculate_side_effects on each of the subexpressions.
10718 * expr.c (expand_expr) <COND_EXPR>: Use the if-statement code if
10721 2003-06-01 Daniel Berlin <dberlin@dberlin.org>
10723 * tree-alias-common.c: Remove setting of DECL_CONTEXT in temp vars,
10724 it's done in create_tmp_alias_var for us.
10725 (ptr_may_alias_var): Check if the variables are memory tags, and get
10726 the associated pointers if they are.
10728 2003-05-30 Frank Ch. Eigler <fche@redhat.com>
10730 * tree-mudflap.c (mudflap_c_function, enqueue_constant, enqueue_decl):
10731 Rework dumping logic.
10733 2003-05-27 Jason Merrill <jason@redhat.com>
10735 * tree-ssa.c (avail_expr_hash): Simplify by using iterative_hash_expr
10737 * tree.c (iterative_hash_expr): Handle SSA_NAME.
10739 2003-05-29 Jeff Law <law@redhat.com>
10741 * tree-ssa.c (rewrite_stmt): Detect and remove redundant
10743 (avail_expr_hash): Use iterative_hash_expr, not iterative_hash_object
10746 2003-05-27 Jason Merrill <jason@redhat.com>
10748 * gimplify.c (shortcut_cond_expr): Avoid jumps to jumps.
10750 2003-05-26 Jason Merrill <jason@redhat.com>
10752 * c-simplify.c (simplify_switch_stmt): A SWITCH_EXPR also gets the
10753 source location of its first line.
10755 2003-05-24 Diego Novillo <dnovillo@redhat.com>
10757 Do not consider INDIRECT_REF nodes to be variables.
10759 * gimplify.c (create_tmp_alias_var): Allow temporaries of
10760 ARRAY_TYPE to be created.
10761 Create new temporaries with function scope.
10762 Don't call build_type_variant.
10763 Mark the temporary volatile if its type is volatile.
10765 * tree-dfa.c: Change every function that received a variable and
10766 its base symbol to just receive the variable. Update all callers.
10767 (struct alias_set_d): Remove field 'tag_sym'.
10768 Add documentation for fields.
10769 (struct walk_state): Add field 'is_indirect_ref'.
10770 Add documentation for fields.
10771 (opf_ignore_bp): Remove. Update all users.
10772 (aliased_objects_base): Remove. Update all users.
10773 (get_stmt_operands): If the statement had virtual operands, do not
10775 (get_expr_operands): Handle INDIRECT_REF nodes by adding an operand
10776 for the memory tag represented and a use for the base pointer.
10777 Don't add VUSE operands for pointer arguments to functions.
10778 Force a virtual operand when processing ADDR_EXPR nodes.
10779 (add_stmt_operand): If the variable is an alias tag, always add it
10780 as a virtual operand.
10781 Remove code to handle INDIRECT_REF nodes.
10782 Move code to determine if a pointer may point to global memory to
10784 Set has_volatile_ops flag in the statement when adding operands for
10785 globals and local statics.
10786 If the variable is an alias tag, mark the statement as making
10787 aliased loads or stores.
10788 (set_def): Mark the variable as having real references.
10789 (add_use): Likewise.
10790 (add_vdef): Remove code to re-add previous virtual operands.
10791 If PREV_VOPS is set, don't add a new virtual operand.
10792 (add_vuse): Likewise.
10793 (dump_variable): Show annotation bitfields 'mem_tag',
10794 'occurs_in_abnormal_phi', 'is_alias_tag' and 'is_stored'.
10795 (compute_may_aliases): Initialize walk_state.is_indirect_ref to 0.
10796 (compute_alias_sets): Don't remove alias sets with exactly one
10798 (register_alias_set): Re-implement to support memory tags instead
10799 of INDIRECT_REF nodes. Document algorithm.
10800 (find_alias_for): Likewise.
10801 (may_alias_p): Likewise.
10802 (add_may_alias): Likewise.
10803 (find_vars_r): If a pointer assignment is found and the RHS of the
10804 assignment may access global memory, mark the pointer as pointing
10806 Handle INDIRECT_REF nodes by marking the base pointer as
10808 Do not share INDIRECT_REF nodes.
10809 (add_referenced_var): Don't handle INDIRECT_REF nodes.
10810 If called from a store operation, mark the variable as stored.
10811 By default mark the variable as not having real references.
10812 When processing a pointer that has been dereferenced, create a
10813 memory tag for the pointer.
10814 (add_indirect_ref_var): Remove. Update all callers.
10815 (get_virtual_var): Don't handle INDIRECT_REF nodes.
10816 (find_hidden_use_vars_r):
10818 * tree-flow-inline.h (get_var_ann): New function. Change all
10819 functions that called var_ann and create_var_ann to call
10821 (get_stmt_ann): Likewise.
10822 (set_indirect_ref): Remove. Update all callers.
10823 (indirect_ref): Remove. Update all callers.
10824 (create_indirect_ref): Remove. Update all callers.
10826 * tree-flow.h (struct var_ann_d): Remove fields 'is_loaded',
10827 'unused' and 'indirect_ref'.
10828 Add fields 'mem_tag', 'is_mem_tag', 'is_alias_tag' and
10830 (get_var_ann, get_stmt_ann): Declare.
10831 (create_indirect_ref, set_indirect_ref, indirect_ref): Remove.
10833 * tree-pretty-print.c (dump_generic_node): Don't handle
10834 INDIRECT_REF nodes inside SSA_NAME nodes.
10836 * tree-simple.c (get_base_symbol): Don't handle INDIRECT_REF nodes.
10837 (is_simple_unary_expr): Don't call STRIP_NOPS.
10839 * tree-ssa-copyprop.c (get_original): Don't handle INDIRECT_REF
10840 nodes. Allow pointers to be copy propagated.
10842 * tree-ssa-dce.c (need_to_preserve_store): Don't handle
10843 INDIRECT_REF nodes.
10845 * tree-ssa-live.c (create_ssa_var_map): Only process variables that
10846 have real references.
10848 * tree-ssa.c: Update documentation regarding INDIRECT_REF nodes.
10849 (update_indirect_ref_vuses): Remove. Update all users.
10850 (update_pointer_vuses): Remove. Update all users.
10851 (MAY_COPYPROP_P): Remove. Update all users.
10852 (create_temp): Don't handle INDIRECT_REF nodes.
10853 (coalesce_ssa_name): Ignore variables that have no real references.
10854 (rewrite_stmt): Mark the statement modified if a new copy or
10855 constant was propagated into it.
10856 Don't special-case pointers.
10857 (rewrite_operand): Don't handle INDIRECT_REF nodes.
10858 * tree.h (SSA_VAR_P): Remove. Update all users.
10859 (SSA_DECL_P): Rename to SSA_VAR_P.
10861 2003-05-22 Jeff Law <law@redhat.com>
10863 * gimplify.c (simplify_expr): Avoid gimplifying expressions which
10864 are already in gimple form.
10865 * tree-simple.c (is_simple_constructor): No longer treat TREE_STATIC
10866 constructors specially.
10867 (is_simple_addr_expr_arg): If we're taking the address of a label
10868 for the first time, then the ADDR_EXPR is not in gimple form.
10870 2003-05-22 Jason Merrill <jason@redhat.com>
10872 * tree-cfg.c (compute_reachable_eh): Don't skip cleanups.
10874 * tree-dfa.c (add_referenced_var): Read-only INDIRECT_REFs can
10875 also be clobbered by function calls.
10877 2003-05-22 Jeff Law <law@redhat.com>
10879 * expr.c (convert_move): Avoid making silly copies.
10880 (expand_expr, case BIND_EXPR): Correctly determine when the
10881 result of the BIND_EXPR will not be used.
10883 2003-05-21 Jason Merrill <jason@redhat.com>
10885 * tree-cfg.c (compute_reachable_eh): Handle multiple CATCH_EXPRs.
10887 * builtins.c (simplify_builtin_next_arg): Split out from...
10888 (expand_builtin_next_arg): ...here.
10889 (simplify_builtin_va_start): Split out from...
10890 (expand_builtin_va_start): ...here.
10891 (simplify_builtin): Call it.
10892 * gimplify.c (simplify_call_expr): If simplify_builtin worked,
10895 2003-05-20 Jason Merrill <jason@redhat.com>
10897 * gimplify.c (shortcut_cond_expr, shortcut_cond_r): Rewrite.
10898 (simplify_cond_expr): Also invert ifs with no 'then'.
10899 (build_and_jump): New fn, split out from...
10900 (gimplify_exit_expr): ...here. Don't bother gimplifying the
10903 * gimplify.c (simplify_save_expr): Add post-effects to the
10906 * gimplify.c (mostly_copy_tree_r): Don't unshare constants.
10908 2003-05-20 Jeff Law <law@redhat.com>
10910 * expr.c (expand_expr, case COND_EXPR): Avoid useless RTL generation
10911 when the THEN or ELSE arm is empty.
10913 * tree-cfg.c (make_loop_expr_blocks): Do not accept next_block_link
10914 as an argument, make it a local variable. Callers changed.
10916 * tree-cfg.c (remove_useless_stmts_and_empty_vars): Eliminate
10917 GOTO_EXPRs which jump to the next statement occuring in an
10918 outer control/block structure nest.
10920 2003-05-20 Diego Novillo <dnovillo@redhat.com>
10922 * tree-ssa-ccp.c (set_rhs): Fix typo in handling of
10925 2003-05-19 Daniel Berlin <dberlin@dberlin.org>
10927 * tree-alias-common.c (alias_get_name): Handle unnamed variables once
10930 2003-05-19 Jeff Law <law@redhat.com>
10932 * tree-ssa-dce.c (remove_conditional): If the conditional's block
10933 has no post dominator in the CFG, then wire it to the exit node.
10934 Avoid unnecessary check of bb->succ.
10936 2003-05-17 Daniel Berlin <dberlin@dberlin.org>
10938 * tree-pretty-print.c (MASK_POINTER): Parameter is P, not node.
10940 2003-05-17 Daniel Berlin <dberlin@dberlin.org>
10942 * tree-alias-common.c (get_alias_var): Handle REFERENCE_EXPR.
10943 (find_func_aliases): Ditto.
10944 (get_alias_var): Use POINTER_TYPE_P.
10946 2003-05-16 Frank Ch. Eigler <fche@redhat.com>
10948 * gcc.c (cc1_options): Correct "-fmudflapth" handling.
10949 * tree-mudflap.c (mudflap_c_function, mf_build_check_statement_for):
10950 Use locally cached mask/shift values only in single-threaded mode.
10952 2003-05-16 Daniel Berlin <dberlin@dberlin.org>
10954 * tree-alias-common.c (ptr_may_alias_var): Fix DECL_CONTEXT
10957 2003-05-16 Andrew MacLeod <amacleod@redhat.com>
10959 * tree-flow.h (ssa_make_edge): Remove prototype.
10960 * tree-ssa-dce.c (remove_dead_stmt): Change comment about removing
10962 (remove_conditional): Don't update PHI nodes or call ssa_make_edge.
10963 * tree-ssa.c (ssa_make_edge): Remove.
10965 2003-05-16 Jeff Law <law@redhat.com>
10967 * tree-cfg.c (remove_useless_stmts_and_vars): Handle case where
10968 both arms of an if-then-else simply jump to the same location.
10970 * tree-ssa-ccp.c (get_rhs): Correctly handle MODIFY_EXPR embedded in
10972 (set_rhs): Likewise.
10974 2003-05-15 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
10976 * Makefile.in (regmove.o-warn): Change to -Wno-error.
10978 2003-05-15 Andrew MacLeod <amacleod@redhat.com>
10980 * tree-cfg.c (enum find_location_action): Enum for find_insert_location.
10981 (bsi_insert_before): Handle insert at start of a BB and update pointers
10982 from parents if appropriate.
10983 (find_insert_location): Handle COND_EXPR properly. Return
10984 an enum type indicating what action to take on the returned value.
10985 (bsi_commit_first_edge_insert): Use new returned action.
10987 2003-05-15 Jeff Law <law@redhat.com>
10989 * tree-cfg.c (make_edges): Factor out loop invariants from
10990 code to insert edges from the TRY to the FINALLY block.
10991 Avoid creating unnecessary edges from the end of the
10992 FINALLY block back to the start of the FINALLY block.
10994 2003-05-15 Diego Novillo <dnovillo@redhat.com>
10996 * tree-ssa.c (rewrite_out_of_ssa): Undo previous patch.
10998 2003-05-15 Diego Novillo <dnovillo@redhat.com>
11000 * tree-ssa.c (rewrite_out_of_ssa): Don't dump the optimized
11001 function after the SSA->normal pass.
11003 2003-05-14 Toon Moene <toon@moene.indiv.nluug.nl>
11005 * Makefile.in: Add additional -Wno-error targets for Alpha.
11007 2003-05-13 Jason Merrill <jason@redhat.com>
11009 * gdbinit.in (pgs, pge): New macros.
11011 Implement expression temporary optimization.
11012 * gimplify.c (gimplify_ctx): Add temp_htab field.
11013 (push_gimplify_context): Initialize it.
11014 (pop_gimplify_context): Destroy it.
11015 (simplify_expr): If there's no internal postqueue, generate an
11016 expression temporary.
11017 (gimple_tree_hash, gimple_tree_eq): New fns.
11018 (create_tmp_from_val, lookup_tmp_var): New fns.
11019 (get_formal_tmp_var): New fn.
11020 (internal_get_tmp_var): New fn.
11021 (get_initialized_tmp_var): Use it.
11022 * tree-simple.h: Declare it.
11024 * gimplify.c (simplify_cond_expr): Reorganize.
11025 (shortcut_cond_expr, shortcut_cond_r): New fns.
11026 (build_and_jump): New fn.
11027 (gimplify_exit_expr): Use it.
11029 * gimplify.c (simplify_expr): Do better at stripping unnecessary
11030 NOPs. Tidy GOTO_EXPR handling. Don't allow NON_LVALUE_EXPR.
11031 * tree-simple.c (is_simple_modify_expr): Don't allow NON_LVALUE_EXPR.
11032 (is_simple_binary_expr, is_simple_condexpr): Likewise.
11033 (is_simple_unary_expr, is_simple_compound_lval): Likewise.
11034 (is_simple_id): Likewise.
11036 * tree-ssa.c (rewrite_stmt): Discard redundant assignments.
11037 (avail_expr_eq): Don't test ops1 == ops2.
11038 (avail_expr_hash): Use iterative_hash_object.
11040 2003-05-13 Jeff Law <law@redhat.com>
11042 * tree-cfg.c (cleanup_tree_cfg): Update comments. Set repeat
11043 anytime we remove a control structure.
11045 * tree-flow.h (struct var_ann_d): New field occurs_in_abnormal_phi.
11046 * tree-ssa.c (MAY_COPYPROP_P): Do not allow copy propagations
11047 if either argument occurs in an abnormal phi.
11048 * tree-dfa.c (add_phi_arg): Set occurs_in_abrnomal_phi as needed.
11049 * tree-ssa-copyprop.c (copyprop_stmt): Do not allow copy
11050 propagations if either argument occurs in an abnormal phi.
11051 (copyprop_phi): Likewise.
11053 2003-05-12 Diego Novillo <dnovillo@redhat.com>
11055 * c-common.h (STATEMENT_CODE_P): Use size_t cast instead
11057 (INIT_STATEMENT_CODES): Change type of local variable i to
11060 2003-05-12 Diego Novillo <dnovillo@redhat.com>
11062 * c-pretty-print.c (dump_c_node): Call CONSTRUCTOR_ELTS
11063 to access the operand of a CONSTRUCTOR node.
11064 * tree-pretty-print.c (dump_generic_node): Likewise.
11066 2003-05-11 Diego Novillo <dnovillo@redhat.com>
11068 * c-simplify.c (simplify_if_stmt): Replace calls to
11069 warning_with_file_and_line with warning.
11071 2003-05-12 Frank Ch. Eigler <fche@redhat.com>
11073 * toplev.c (lang_independent_options): Add "-fmudflapth".
11074 * flags.h (flag_mudflap): Document meaning of >1 value.
11075 * gcc.c (MFWRAP_SPEC, MFLIB_SPEC): Add -fmudflapth support.
11076 (cpp_unique_options, cc1_options): Ditto.
11078 2003-05-10 Sebastian Pop <s.pop@laposte.net>
11080 * gimplify.c (simplify_expr): Replace CONST_DECL with its DECL_INITIAL.
11082 2003-05-09 Sebastian Pop <s.pop@laposte.net>
11084 * tree-optimize.c (optimize_function_tree): Clarify the use of the
11087 2003-05-09 Jeff Law <law@redhat.com>
11089 * c-simplify.c (simplify_cleanup): Remove code which optimizes
11090 TRY_FINALLY and TRY_CATCH. It doesn't trigger.
11092 * tree-cfg.c (remove_useless_stmts_and_vars): Optimize away
11093 TRY_CATCH and TRY_FINALLY blocks when possible.
11095 2003-05-09 Diego Novillo <dnovillo@redhat.com>
11097 * tree-pretty-print.c (dump_generic_node): CONSTRUCTOR
11098 nodes have only one operand now.
11100 2003-05-08 Andrew MacLeod <amacleod@redhat.com>
11102 * tree-cfg.c (pdom_info): New file level static.
11103 (cleanup_tree_cfg): Free dominance info, if it was used.
11104 (bsi_replace): New. Replace a stmt with a new one.
11105 (linearize_cond_expr): Use post dominator info to determine is a
11106 conditional can be safely removed.
11107 (find_insert_location): New. Determine where to insert a new stmt that
11108 is placed on a split edge.
11109 (bsi_commit_first_edge_insert): Use find_insert_location to determine
11110 where to link a stmt when splitting an edge.
11111 (merge_tree_blocks): When deleting a basic block, remove it from the
11112 dominance structure if it exists.
11113 * tree-dfa.c (add_stmt_operand): Don't rename local statics. Treat
11114 them just like globals.
11115 * tree-flow.h (struct var_ann_d): Add root_var_processed bit and
11117 * tree-ssa-dce.c (process_worklist): Mark conditions feeding PHI's as
11119 (remove_dead_phis): Add missing debug information.
11120 * tree-ssa-live.c (var_union): Handle combining partitions when one
11121 has a root_variable as a representative.
11122 (compact_var_map): Add comments and use flags.
11123 (init_root_var): Use new root_var fields in struct var_ann_d.
11124 (dump_root_var): Send output to specified file, not stderr.
11125 (dump_var_map): Remove dump_flag parameter & some grotesque debug info.
11126 * tree-ssa-live.h (VAR_ANN_ROOT_INDEX): Define.
11127 (VARMAP_NORMAL, VARMAP_NO_SINGLE_DEFS): Define flags for compact_var_map.
11128 (var_to_partition_to_var): Return NULL if not in a partition.
11129 (find_root_var): Use VAR_ANN_ROOT_INDEX.
11130 * tree-ssa.c (insert_copy_on_edge): Add listing info.
11131 (coalesce_ssa_name): Coalesce live-on-entry variables to their root.
11132 Coalesce partitions across abnormal edges.
11133 (assign_vars): Remove redundant initialization code. Handle root_vars
11134 which have already been coalesced to a partition.
11135 (rewrite_out_of_ssa): Add debug info & remove PHI nodes when processed.
11136 (rewrite_stmt): Don't redefine redundant expressions.
11138 2003-05-08 Jeff Law <law@redhat.com>
11140 * c-simplify.c (simplify_expr_stmt): Make sure to
11141 simplify the body of the EXPR_STMT.
11143 * tree-dfa.c (remove_decl): Accept new argument for the block
11144 to start the search.
11145 * tree-flow.h (remove_decl): Update prototype.
11146 * tree-cfg.c (remove_stmt): Pass the toplevel block to
11149 * tree-dfa.c (find_hidden_use_vars): No longer returns a value.
11150 Callers and prototype updated. No longer need to look for
11151 nested functions, instead just mark any variables and
11152 parameters with DECL_NONLOCAL set as having hidden uses.
11154 2003-05-08 Diego Novillo <dnovillo@redhat.com>
11156 * version.c (version_string): Change format to show daily
11157 datestamp and merged date.
11159 2003-05-07 Jeff Law <law@redhat.com>
11161 * tree-cfg.c (remove_useless_stmts_and_vars): Do not remove
11162 the toplevel BIND_EXPR for an inlined function.
11164 * tree-dfa.c (find_hidden_use_vars): Look at the size of
11165 VAR_DECLs, not the size of ARRAY_TYPES. Also make sure
11166 to reset *inside_vla to its original value when done
11167 processing any particular VAR_DECL.
11169 2003-05-06 Diego Novillo <dnovillo@redhat.com>
11171 * c-simplify.c (simplify_if_stmt): Warn if
11172 -Wunreachable-code is given and the conditional is always
11173 true or always false.
11175 * expr.c (expand_expr): Don't try to expand FUNCTION_DECL
11176 nodes when processing BIND_EXPR_VARS.
11178 * varasm.c (output_constant_def_contents): Re-use the
11179 label when emitting a label for mudflap.
11181 Disable the following patch:
11183 2003-04-30 Steven Bosscher <steven@gcc.gnu.org>
11185 * ggc-page.c (TREE_EXP_SIZE): Define.
11186 (extra_order_size_table): New entry for expr trees with
11189 2003-05-06 Jeff Law <law@redhat.com>
11191 * tree-cfg.c (make_exit_edges): Fix handling of blocks which
11194 * tree-cfg.c (remove_useless_stmts_and_vars): Remove GOTO_EXPRs
11195 to the immediately following tree node.
11197 * tree-cfg.c (make_goto_expr_edges): Fix typo in comment.
11198 (remove_useless_stmts_and_vars): New function.
11199 * tree-flow.h (remove_useless_stmts_and_vars): Prototype.
11200 * tree-ssa.c (rewrite_out_of_ssa): After returning to normal
11201 form, call remove_useless_stmts_and_vars.
11203 2003-05-02 Daniel Berlin <dberlin@dberlin.org>
11205 * tree-alias-common.c (alias_get_name): Given unnamed result decls
11207 (create_fun_alias_var): Use DECL_RESULT if available.
11209 2003-05-02 Jeff Law <law@redhat.com>
11211 * tree-inline.c (expand_call_inline): Avoid creating naked
11212 _DECL nodes for inlined functions which had NRV optimizations
11215 2003-05-02 Diego Novillo <dnovillo@redhat.com>
11217 * tree-cfg.c (build_tree_cfg): Update comment.
11218 (make_blocks): Don't skip over empty statements.
11219 Move exception handling code ...
11220 (compute_reachable_eh): ... here.
11221 (set_parent_stmt): Don't skip over empty statements.
11222 (bsi_remove): Don't return early on empty statements.
11223 Don't call STRIP_NOPS.
11224 (remove_stmt): Don't call STRIP_NOPS.
11225 Always compute the block holding the statement.
11226 After replacing the statement with an empty statement, add the
11227 empty statement to the block.
11228 (successor_block): Don't call STRIP_NOPS.
11229 (first_exec_stmt): Likewise.
11230 (first_exec_block): Don't return early for empty statements.
11231 (first_stmt): Don't test for NULL blocks.
11232 Reformat to improve legibility.
11233 (bsi_next_in_bb): Don't call STRIP_NOPS.
11234 Reformat to improve legibility.
11235 (set_bb_for_stmt): Don't ignore empty statements.
11237 * tree-dfa.c (get_stmt_operands): Don't call STRIP_NOPS.
11238 (create_stmt_ann): Don't abort on emtpy statements.
11239 Don't call STRIP_NOPS.
11240 (copy_stmt): Remove unused function.
11241 * tree-flow.h (copy_stmt): Remove prototype.
11243 * tree-flow-inline.h: Don't call STRIP_NOPS.
11244 Remove local variable 't'.
11245 (bsi_stmt): Don't return NULL_TREE for empty statements.
11246 Ignore error_mark_node.
11248 * tree-iterator.h (tsi_next): Don't call STRIP_NOPS.
11249 (tsi_stmt_ptr): Likewise.
11250 (tsi_stmt): Likewise.
11251 Don't return NULL_TREE for empty statements.
11253 * tree-pretty-print.c (dump_generic_node): Don't ignore empty
11256 * tree-ssa-ccp.c (fold_stmt): Don't call STRIP_NOPS.
11257 * tree-ssa-dce.c (find_useful_stmts): Likewise.
11258 (remove_dead_stmt): Likewise.
11259 * tree-ssa.c (mark_def_sites): Likewise.
11260 (rewrite_out_of_ssa): Likewise.
11261 (rewrite_stmt): Likewise.
11263 * tree.c (make_ssa_name): Don't ignore empty statements.
11264 (body_is_empty): Fix comment.
11266 2003-05-01 Jeff Law <law@redhat.com>
11268 * tree-dfa.c (find_hidden_use_vars): Renamed from find_vla_decls.
11269 Now returns a value indicating if nested function was found.
11270 When nested functions are found, mark suitable variables as
11271 having hidden uses.
11272 (find_hidden_use_vars_r): Renamed from find_vla_decls_r.
11273 (compute_may_alias): Corresponding changes. Handle
11274 multiple BLOCKs at the toplevel of a function.
11276 2003-04-30 Diego Novillo <dnovillo@redhat.com>
11278 * tree.c (build_empty_stmt): New function.
11279 * tree.h (IS_EMPTY_STMT): Define.
11280 (TI_EMPTY_STMT): Remove.
11281 (empty_stmt_node): Remove.
11282 Replace 'X = empty_stmt_node' with 'X = build_empty_stmt ()',
11283 and 'X == empty_stmt_node' with 'IS_EMPTY_STMT (X)' everywhere.
11284 (build_empty_stmt): Declare.
11286 * cp/cp-simplify.c (cp_simplify_stmt): Use IS_EMPTY_STMT.
11288 * java/java-tree.h (build_java_empty_stmt): Declare.
11289 * java/expr.c (build_java_empty_stmt): New function.
11290 * java/decl.c (java_init_decl_processing): Don't build empty_stmt_node.
11291 Replace 'X = empty_stmt_node' with 'X = build_java_empty_stmt ()',
11292 and 'X == empty_stmt_node' with 'IS_EMPTY_STMT (X)' everwhere.
11294 2003-04-30 Jeff Law <law@redhat.com>
11296 * tree-dfa.c (get_expr_operands): Do not ignore operands of an
11297 an ADDR_EXPR if it is a PARM_DECL or VAR_DECL.
11299 * tree-dfa.c (get_expr_operands): Look inside operands in
11302 2003-04-29 Diego Novillo <dnovillo@redhat.com>
11304 * builtins.def (BUILTIN_CONSTANT_P): Mark as constant.
11306 * tree-dfa.c (get_expr_operands): Do not add VDEF operands for
11307 dereferenced pointers at call sites.
11308 * tree-ssa.c (assign_vars): Abort if we couldn't coalesce all the
11311 2003-04-29 Andrew MacLeod <amacleod@redhat.com>
11313 * tree-cfg.c (bsi_start): If there are no stmts in a block, use the
11314 context pointer to represent the basic block.
11315 (bsi_insert_after): Handle inserting into empty blocks better.
11316 (bsi_insert_before): Call bsi_insert_after to handle empty blocks.
11317 * tree-ssa.c (elim_create): Clear bitmap after its been processed
11318 instead of during loop.
11320 2003-04-27 Diego Novillo <dnovillo@redhat.com>
11322 * Makefile.in (tree-mudflap.o): Add dependency on $(TREE_DUMP_H).
11323 * c-decl.c (c_expand_body_1): Don't call simplify_function_tree
11324 after mudflap_c_function.
11325 Move mudflap instrumentation after SSA optimizers.
11326 * tree-dump.c (dump_files): Add entry for -fdump-tree-mudflap.
11327 * tree.h (enum tree_dump_index): Add TDI_mudflap.
11328 * doc/invoke.texi: Document -fdump-tree-mudflap.
11329 * tree-mudflap.c: Include tree-dump.h.
11330 (dump_file): New local variable.
11331 (dump_flags): New local variable.
11332 (mudflap_c_function): Call dump_begin, dump_end and dump_function.
11333 (mf_decl_cache_locals): Set DECL_CONTEXT for __mf_lookup_shift_l
11334 and __mf_lookup_mask_l to current_function_decl.
11335 (mf_offset_expr_of_array_ref): Likewise for __mf_index_X.
11336 (mf_build_check_statement_for): Re-implement to emit a proper
11338 (mx_xfn_indirect_ref): Emit detailed debugging info if
11339 -fdump-tree-mudflap-details is given.
11340 (mudflap_enqueue_decl): Likewise
11341 * tree-optimize.c (optimize_function_tree): Don't check for
11344 2003-04-26 Diego Novillo <dnovillo@redhat.com>
11346 * c-simplify.c (build_bc_goto): If the target label couldn't be
11347 found, emit an error message.
11349 2003-04-25 Andrew MacLeod <amacleod@redhat.com>
11351 * tree-ssa-live.c (compact_var_map): Add parameter to exclude variables
11352 with a single SSA version.
11353 (init_root_var): Allow that a var_map might not be compacted yet.
11354 * tree-ssa-live.h (compact_var_map): Change Prototype.
11355 * tree-ssa.c (rewrite_out_of_ssa): When coalescing, don't include single
11356 reference variables during the compaction.
11358 2003-04-25 Jeff Law <law@redhat.com>
11360 * tree-optimize.c (optimize_function_tree): Simplify slightly.
11362 2003-04-25 Andrew MacLeod <amacleod@redhat.com>
11364 * tree-ssa.c (struct _elim_graph): Change type of fields
11365 'pred' and 'succ' to be bitmaps instead of sbitmaps.
11368 2003-04-25 Diego Novillo <dnovillo@redhat.com>
11370 * tree-cfg.c (linearize_cond_expr): Reformat.
11371 * tree-dfa.c (get_expr_operands): Check for read-only
11372 status the dereferenced argument pointer, not the pointer
11374 (add_stmt_operand): Always consider global variables as
11377 2003-04-24 Jason Merrill <jason@redhat.com>
11379 * gimplify.c (simplify_cond_expr): Avoid redundant gimplification.
11381 Add TREE_VEC of case labels to the SWITCH_EXPR during gimplification.
11382 * tree.def (CASE_LABEL_EXPR): Add an operand for the LABEL_DECL.
11383 * tree.h (SWITCH_LABELS, CASE_LABEL): New macros.
11384 * c-simplify.c (c_simplify_stmt) <CASE_LABEL>: Create LABEL_DECL here.
11385 * expr.c (expand_expr) <CASE_LABEL_EXPR>: Not here.
11386 * gimplify.c (gimplify_ctx): Add case_labels field.
11387 (gimplify_switch_expr, gimple_add_case_label): New fns.
11388 (simplify_expr): Use them.
11390 2003-04-24 Andrew MacLeod <amacleod@redhat.com>
11392 * tree-flow.h (processed_out_of_ssa): Rename to out_of_ssa_tag.
11393 * tree-ssa-live.c (register_ssa_partition): Add variable to partition.
11394 (change_partition_var): Use out_of_ssa_tag.
11395 (create_ssa_var_map): Add all uses, defs and PHI elements to partition.
11396 (new_tree_live_info): Create a live range info structure.
11397 (delete_tree_live_info): Free storage.
11398 (live_worklist): Fill in the live range info for a variable for the
11399 blocks between the def and all the blocks containing uses.
11400 (set_if_valid): Set partition bit if variable is in a partition.
11401 (add_livein_if_notdef): Set live on entry bit for a var's partition
11402 if a definition has not been seen.
11403 (calculate_live_on_entry): Create partition live on entry bitmaps for
11405 (calculate_live_on_exit): Calculate live on exit information for each
11407 (init_root_var): Initialize and fill in a root_var structure.
11408 (remove_root_var_partition): remove a partition from a root_var list.
11409 (delete_root_var): Free storage.
11410 (dump_root_var): Display root_var summary.
11411 (dump_var_map): Show extra info for ssa name versions.
11412 * tree-ssa-live.h (NO_PARTITION): Define.
11413 (register_ssa_partition): Remove.
11414 (partition_to_var): Use partition_find after decompressing.
11415 (var_to_partition): Return NO_PARTITION if var is not in a partition.
11416 (struct tree_live_info_d): Define live range info structure.
11417 (partition_is_global): Return 1 if used outside a basic block.
11418 (live_entry_blocks): Return bitmap over blocks that partition is live
11420 (live_on_exit): Return bitmap of partitions live on exit from a block.
11421 (struct root_var_d): Define a root_var structure.
11422 (ROOT_VAR_NONE): Define.
11423 (num_root_vars): Number of variables in root_var object.
11424 (root_var): Return variable for a root_var index.
11425 (first_root_var_partition): Return first partition for a root_var.
11426 (next_root_var_partition): Get next partition for a root_var.
11427 (find_root_var): Find root_var index for a specific partition.
11428 * tree-ssa.c (eliminate_extraneous_phis): Remove.
11429 (set_if_valid): Set partition bit if variable is in a partition.
11430 (add_conflicts_if_valid): Add conflict between variable and all
11431 related partitions set in a bitvector.
11432 (coalesce_ssa_name): Create a conflict graph and coalesce all
11433 partitions which don't conflict and are related by the same root_var.
11434 (assign_vars): Use a root_var object, and assign different real
11435 variables to all partitions.
11436 (rewrite_out_of_ssa): Call compact_var_map() once, and don't call
11437 eliminate_extraneous_phis.
11439 2003-04-23 Daniel Berlin <dberlin@dberlin.org>
11441 * tree-flow.h (create_global_var): Add prototype.
11443 * tree-dfa.c (create_global_var): Externalize.
11445 * tree-alias-common.c: Set DECL_CONTEXT on our temp alias vars.
11446 (call_may_clobber): Make a copy of this function, since our version
11447 will be slightly different soon.
11448 (create_alias_vars): We need global_var, so create it if necessary.
11450 2003-04-23 Daniel Berlin <dberlin@dberlin.org>
11452 * tree-ssa-pre.c (do_proper_save): Remove old code, since the new
11453 insertion code works okay.
11454 (pre_expression): Use new_rename_1, it removes a *lot* of useless
11457 2003-04-23 Jeff Law <law@redhat.com>
11459 * gimplify.c (simplify_target_expr): Make sure to simplify
11462 * tree-ssa.c (struct def_blocks_d): Add new field phi_insertion_points.
11463 (compute_global_livein): Accept varray rather than bitmaps. Callers
11464 updated. Rewrite to compute global life information for all the
11465 objects in the varray in parallel.
11466 (insert_phis_for_deferred_variables): New function.
11467 (insert_phi_nodes_for): New argument DEF_MAPs. When an object
11468 crosses the threshold for using fully pruned PHI insertions,
11469 push it on the def_maps varray for deferred processing.
11470 (insert_phi_nodes): Initialize def_maps. Pass it to
11471 insert_phi_nodes_for. Drain the def_maps varray as it grows.
11472 Also drain any residual objects in def_maps. Zero def_maps
11475 2003-04-21 Jeff Law <law@redhat.com>
11477 * tree-cfg.c (find_contained_blocks_and_edge_targets): New function.
11478 (try_finallys): New varray used during edge creation.
11479 (make_edges): Initialize try_finallys varray. After creating
11480 all the "normal" edges, go back and create the special edges
11481 for the try-finally blocks.
11482 (make_ctrl_stmt_edges): Create edges for the EH nodes. Also
11483 make sure to build the try-finally stack.
11484 (make_exit_edges): Create edges from calls which may throw
11485 to any directly reachable exception handlers.
11486 (is_ctrl_altering_stmt): Statements which may throw alter
11489 * tree-cfg.c: Include except.h.
11490 (eh_stack): New file-scoped varray.
11491 (build_tree_cfg): Initialize eh_stack.
11492 (make_catch_expr_blocks): New function.
11493 (make_try_expr_blocks, make_eh_filter_expr_blocks): Likewise.
11494 (make_blocks): Call new functions as needed. When ending a block
11495 due to a statement that may throw, compute the reachable exception
11496 handlers and store it in the statement's annotation.
11497 (is_ctrl_stmt): Handle EH nodes.
11498 (stmt_ends_bb_p): Likewise.
11499 * tree-flow.h (stmt_ann_d): Add new field reachable_exception_handlers.
11501 * except.c (check_handled): No longer static.
11502 * except.h (check_handled): Prototype.
11504 * c-simplify.c (c_build_bind_expr): Revert change from earlier today.
11506 * c-common.h (find_reachable_label): Prototype.
11507 * c-semantics.c (find_reachable_label): No longer static.
11508 * c-simplify.c (c_build_bind_expr): Avoid creating unnecessary
11510 (simplify_cleanup): Avoid creating unnecessary TRY_CATCH_EXPRs
11511 or TRY_FINALLY_EXPRs.
11512 (simplify_if_stmt): If the condition is constant and the
11513 unexecuted arm has no reachable code, then just emit
11516 2003-04-18 Sebastian Pop <s.pop@laposte.net>
11518 * cfghooks.h, cfghooks.c: New files.
11519 * Makefile.in (BASIC_BLOCK_H): Depends on cfghooks.h.
11520 (OBJS): Add cfghooks.o.
11521 (tree-optimize.o): Depends on cfgloop.h.
11522 (cfghooks.o): New rule.
11523 * basic-block.h (split_edge): Rename to rtl_split_edge.
11524 (tree_split_edge): Declare.
11525 (create_bb): Declare extern here.
11526 (verify_flow_info): Rename to rtl_verify_flow_info.
11527 (tree_verify_flow_info): Declare.
11528 (cfghooks.h): Included here.
11529 * cfgloop.c (tree.h, tree-flow.h): Included.
11530 (make_forwarder_block): Renamed to rtl_make_forwarder_block.
11531 (tree_make_forwarder_block): New static function.
11532 (blocks_headers): Declared static.
11533 (HEADER_BLOCK): Use blocks_headers instead of bb's .aux field.
11534 (redirect_edge_with_latch_update, make_forwarder_block,
11535 canonicalize_loop_headers): Don't allocate .aux, but makes grow
11536 the blocks_headers array.
11537 (canonicalize_loop_headers): Register tree_make_forwarder_block
11538 into the tree_cfg_hooks and rtl_make_forwarder_block into the
11539 rtl_cfg_hooks structure.
11540 (canonicalize_loop_headers): Initialize/free the blocks_headers
11541 array rather than the bb's .aux field.
11542 * cfgloopmanip.c (loop_split_edge_with_NULL): New static function.
11543 (remove_path, force_single_succ_latches):
11544 Call loop_split_edge_with_NULL instead of loop_split_edge_with.
11545 * cfgrtl.c (split_block): Update the comment.
11546 (split_edge): Renamed rtl_split_edge.
11547 (verify_flow_info): Renamed rtl_verify_flow_info.
11548 * loop-init.c (loop_optimizer_init, loop_optimizer_finalize):
11549 Execute code following the value of cfg_level.
11550 * toplev.c (rest_of_compilation): Call rtl_register_cfg_hooks.
11551 * tree-cfg.c (create_bb): Declared extern.
11552 (build_tree_cfg): Call tree_register_cfg_hooks.
11553 (make_edges, make_exit_edges): Remove the use of EDGE_FALLTHRU.
11554 (bsi_commit_first_edge_insert): Use split_edge.
11555 (tree_split_edge, tree_verify_flow_info): New functions.
11556 * tree-optimize.c (cfgloop.h): Included.
11557 (optimize_function_tree): Add #if 0'ed calls to
11558 loop_optimizer_init and loop_optimizer_finalize.
11560 2003-04-16 Jeff Law <law@redhat.com>
11562 * Makefile.in (tree-ssa.o): Depend on langhooks.h.
11563 (tree-dfa.o, tree-cfg.o): Likewise.
11564 * tree-cfg.c: Include langhooks.h
11565 (dump_tree_cfg): Revamp how we get the current function's name
11566 to not rely on current_function_name (and implicitly cfun).
11567 (dump_cfg_stats, tree_cfg2dot): Likewise.
11568 * tree-dfa.c: Include langhooks.h
11569 (dump_immediate_uses): Revamp how we get the current function's name
11570 to not rely on current_function_name (and implicitly cfun).
11571 (dump_dfa_stats, dump_alias_info): Likewise.
11572 * tree-ssa.c: Include langhooks.h
11573 (dump_tree_ssa): Revamp how we get the current function's name
11574 to not rely on current_function_name (and implicitly cfun).
11576 * tree-cfg.c (make_loop_expr_blocks): When determining the value for
11577 NEXT_BLOCK_LINK, correctly handle empty statement nodes at the
11579 (make_cond_expr_blocks, make_switch_expr_blocks): Likewise.
11580 (make_bind_expr_blocks): Likewise.
11582 * gimplify.c (keep_function_tree_in_gimple_form): Move check of
11583 flag_disable_simple here. Include flags.h.
11584 * Makefile.in (gimplify.o): Depends on flags.h
11585 * c-decl.c (c_expand_body_1): No longer check flag_disable_simple.
11586 * tree-inline.c (copy_body_r): Avoid creating non-gimple code
11587 when inlining a function where the RESULT_DECL's initialization
11588 is not on the RETURN_EXPR.
11590 2003-04-15 Jeff Law <law@redhat.com>
11592 * tree-flow.h (struct var_ann_d): Renamed is_vla_decl field to
11594 (has_hidden_use, set_has_hidden_use): Renamed from is_vla_decl
11596 * tree-flow-inline.h (has_hidden_use): Renamed from is_vla_decl.
11597 Updated to use "has_hidden_use" instead of "is_vla_decl" field.
11598 (set_has_hidden_use): Renamed from set_vla_decl.
11599 Updated to use "has_hidden_use" instead of "is_vla_decl" field.
11600 * tree-dfa.c (dump_variable): Corresponding changes.
11601 (find_vla_decls_r): Likewise.
11602 * c-simplify.c (simplify_decl_stmt): Likewise.
11603 * tree-ssa-dce.c: Likewise.
11605 2003-04-09 Jeff Law <law@redhat.com>
11607 * tree-dfa.c (struct alias_set_d, field tag_sym_set): Remove
11609 (register_alias_set): Rework to avoid incorrect coalescing of
11610 entries. Fix memory leak. No longer set field tag_sym_set.
11611 (get_expr_operands): ADDR_EXPR expressions may have interesting
11612 operands in some cases.
11614 2003-04-09 Diego Novillo <dnovillo@redhat.com>
11616 * gimplify.c (simplify_expr): Handle VECTOR_CST nodes.
11617 * tree-cfg.c (make_blocks): Ignore empty statement containers.
11618 Create a basic block before processing containers that only have
11620 (make_loop_expr_blocks): Use the container instead of the statement
11621 when setting NEXT_BLOCK_LINK.
11622 (make_cond_expr_blocks): Likewise.
11623 (make_switch_expr_blocks): Likewise.
11624 (make_bind_expr_blocks): Likewise.
11625 (successor_block): If the last statement of the block is the empty
11626 statement, use its container to get NEXT_BLOCK_LINK.
11627 (stmt_starts_bb_p): Return false if the statement is NULL.
11628 * tree-pretty-print.c (dump_generic_node): Handle VECTOR_CST nodes.
11629 * tree-simple.c (is_simple_const): Accept VECTOR_CST as constants.
11630 * objc/objc-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P):
11633 2003-04-06 Diego Novillo <dnovillo@redhat.com>
11635 * tree-cfg.c (remove_bb): Call ssa_remove_edge.
11636 (cleanup_cond_expr_graph): Likewise.
11637 (cleanup_switch_expr_graph): Likewise.
11638 (disconnect_unreachable_case_labels): Likewise.
11639 (merge_tree_blocks): Likewise.
11640 Update PHI nodes at BB2's successor.
11641 (dump_tree_bb): Show PHI nodes in the block.
11642 * tree-dfa.c (add_phi_arg): Update comment.
11643 (remove_phi_arg_num): New function.
11644 (remove_phi_arg): Call it.
11645 Move from tree-ssa.c.
11646 (remove_phi_node): Move from tree-ssa.c.
11647 * tree-flow.h (ssa_make_edge): Declare.
11648 (ssa_remove_edge): Declare.
11649 * tree-pretty-print.c (dump_generic_node): Show block where PHI
11650 arguments are coming from.
11651 * tree-ssa-dce.c (pdom_info): New local variable.
11652 (remove_dead_stmts): Initialize it and free it at the end.
11653 (remove_conditional): New function.
11654 (remove_dead_stmt): Call it.
11655 * tree-ssa.c (eliminate_phi): If the edge index is -1, abort
11657 (ssa_remove_edge): New function.
11658 (ssa_make_edge): New function.
11660 2003-04-06 Andrew MacLeod <amacleod@redhat.com>
11662 * tree-cfg.c (push_bsi): New. Push a block_stmt_iterator onto a stack.
11663 (pop_bsi): New. Pop a block_stmt_iterator off a stack.
11664 * tree-flow-inline.h (struct bsi_list_d): Block iterator stack struct.
11665 (new_bsi_list): Start a new bsi stack.
11666 (empty_bsi_stack): Is stack empty.
11667 (FOR_EACH_BSI_IN_REVERSE): Macro for processing bsi's in reverse.
11668 (FOR_EACH_STMT_IN_REVERSE): Macro for processing stmt's in reverse.
11670 2003-04-06 Andreas Jaeger <aj@suse.de>
11672 * treelang/treetree.c (tree_code_create_function_initial): Replace
11673 calls to non-existent function annotate_with_file_line_column with
11674 calls to annotate_with_file_line.
11675 (tree_code_create_variable): Likewise.
11677 2003-04-05 Diego Novillo <dnovillo@redhat.com>
11679 * tree-dfa.c (get_expr_operands): Do not clobber readonly operands
11681 (find_vars_r): Likewise.
11682 (add_indirect_ref_var): When creating new INDIRECT_REF variables,
11683 copy the readonly attribute from the variable's type.
11685 2003-04-05 Diego Novillo <dnovillo@redhat.com>
11687 * tree.c (copy_node): Never copy tree annotations.
11689 2003-04-05 Diego Novillo <dnovillo@redhat.com>
11691 * tree-ssa-ccp.c (visit_cond_stmt): Don't short circuit evaluation
11692 of UNDEFINED conditional expressions.
11694 2003-04-04 Andrew MacLeod <amacleod@redhat.com>
11696 * Makefile.in : Add tree-ssa-live.c and tree-ssa-live.h files.
11697 * tree-ssa.c (struct _var_map, create_var_map, delete_var_map,
11698 var_from_partition, get_var_partition, mapped_var_from_ref,
11699 compact_var_map, dump_tree_partition, set_partition_for_var,
11700 set_var_mapping, create_var_partition): Remove.
11701 (create_temp): Allow temps to be created from SSA_NAME vars as well.
11702 (eliminate_name, eliminate_build, elim_backward, elim_create,
11703 eliminate_phi): Use new var map interface.
11704 (coalesce_ssa_name): New. Coalesce ssa_name ranges together.
11705 (assign_vars): Assign real variables to ssa_name partitions.
11706 (rewrite_out_of_ssa): Use new varmap partition and routines.
11707 * tree-ssa-live.h: New file
11708 (var_map): Structure for variable map.
11709 (num_var_partitions): Number of partitions.
11710 (partition_to_var): Return variable for partition.
11711 (var_to_partition): Return partition variable is in.
11712 (var_to_partition_to_var): Return variable representing partition
11713 another variable is in.
11714 (register_ssa_partition): Initialize a partition element as used.
11715 * tree-ssa-live.c: New file.
11716 (init_var_map): Initialize a var_map.
11717 (delete_var_map): Free storage for a var_map.
11718 (var_union): Combine 2 partitions.
11719 (compact_var_map): Reduce the number of partitions in a var_map.
11720 (change_partition_var): Assign a specific var to a partition.
11721 (create_ssa_var_map): Initialize a var_map with referenced variables.
11722 (dump_var_map): Debug output for a var_map.
11724 2003-04-03 Diego Novillo <dnovillo@redhat.com>
11726 * fold-const.c (fold_relational_hi_lo): Add missing comparison when
11727 folding comparisons to signed_max+1.
11729 2003-04-02 Jason Merrill <jason@redhat.com>
11730 Diego Novillo <dnovillo@redhat.com>
11732 * tree-inline.c (initialize_inlined_parameters): Cast argument
11733 types appropriately when emitting initialization assignments.
11735 2003-04-01 Andrew MacLeod <amacleod@redhat.com>
11737 * tree-cfg.c (PENDING_STMT, SET_PENDING_STMT): New Macros.
11738 (bsi_insert_on_edge): Rename to bsi_commit_first_edge_insert. Add an
11739 empty annotation record to the new basic_block.
11740 (bsi_commit_edge_inserts): New. Commit all pending edge inserts.
11741 (bsi_insert_on_edge): New. Add stmt to edge's pending insert list.
11742 * tree-flow-inline.h (phi_arg_from_edge): Return PHI index for an edge.
11743 (phi_element_for_edge): Return PHI element for an edge.
11744 * tree-flow.h (struct var_ann_d): Add auxiallary field and new
11745 bit 'processed_out_of_ssa'.
11746 * tree-ssa.c (_var_map): Structure for variable parition map.
11747 (struct _elim_graph): Elimination graph for out-of-ssa pass.
11748 (create_var_map): Create a new var_map.
11749 (delete_var_map): Delete a var_map.
11750 (var_from_parition): Return var for a specified partition.
11751 (get_var_partition): Return partition a var belongs to.
11752 (mapped_var_from_ref): Get root var for a var's partition.
11753 (compact_var_map): Re-map the partitions to make the list dense.
11754 (dump_var_parition): Print var_map.
11755 (set_partition_for_var): Associate a real var with a partition.
11756 (set_var_mapping): Associate an SSA version var with a real var.
11757 (create_var_partition): Create a partition for processing.
11758 (create_temp): Create a new temp variable for a partition.
11759 (insert_copy_on_edge): Insert a copy between variables on an edge.
11760 (new_elim_graph): Create a new elimination graph.
11761 (clear_elim_graph): clear an elimination graph.
11762 (delete_elim_graph): Delete an elimination graph.
11763 (eliminate_name, eliminate_build, elim_forward,
11764 elim_unvisited_predecessor, elim_backward, elim_create,
11765 eliminate_phi): Routines to implement Morgans PHI elimination algorithm.
11766 (eliminate_extraneous_phis): Eliminate PHI nodes which will never
11768 (rewrite_out_of_ssa): Use partitions and PHI elimination algorithm.
11770 2003-04-01 Jeff Law <law@redhat.com>
11772 * tree-cfg.c (make_blocks): Make sure the BIND_EXPR's subgraph
11773 actually ended in a statement before seeing of the statement should
11776 * tree-cfg.c (dump_tree_cfg): Avoid crashing when cfun is NULL.
11777 (tree_cfg2dot): Likewise.
11778 * tree-dfa.c (dump_immediate_uses): Likewise.
11779 * tree-pretty-print.c (dump_generic_node): Dump the EH_FILTER_FAILURE
11780 nodes attached to an EH_FILTER_EXPR.
11782 * tree-dfa.c (get_stmt_operands): Add cases for TRY_FINALLY_EXPR,
11783 TRY_CATCH_EXPR, CATCH_EXPR and EH_FILTER_EXPR.
11784 (get_expr_operands): Add case for EXC_PTR_EXPR.
11786 * tree-dfa.c (compute_may_aliases): Accept FNDECL as an argument.
11787 Use FNDECL instead of relying on CURRENT_FUNCTION_DECL.
11788 * tree-flow.h (compute_may_aliases): Update prototype.
11789 * tree-ssa.c (rewrite_into_ssa): Corresponding changes.
11791 * tree-inline.c (expand_calls_inline): Correctly handle EH_FILTER_EXPR.
11793 2003-03-31 Diego Novillo <dnovillo@redhat.com>
11795 * Makefile.in (STRICT_WARN, STRICT2_WARN): Remove -Wtraditional.
11796 * timevar.def (TV_TREE_CLEANUP_CFG): Define.
11797 * tree-cfg.c (set_parent_stmt): Add documentation.
11798 (replace_stmt): New function.
11799 (merge_tree_blocks): New function.
11800 (remap_stmts): New function.
11801 (linearize_cond_expr): New function.
11802 (linearize_control_structures): New function.
11803 (cleanup_tree_cfg): Call it.
11804 Use new timevar TV_TREE_CLEANUP_CFG.
11805 (remove_bb): Update debugging message.
11806 Make sure that bb->head_tree_p and bb->end_tree_p exist before
11807 resetting their basic blocks.
11808 (remove_stmt): When removing a control flow expression, update
11810 (cleanup_control_flow): Make sure that the block contains
11812 (last_stmt): Reformat for readability.
11813 (last_stmt_ptr): Return NULL if the block has no statements.
11814 * tree-flow-inline.h (parent_block): Check that the block is not
11816 * tree-flow.h (bb_empty_p): Remove.
11817 * tree-inline.c (copy_tree_r): Do not copy empty_stmt_node.
11818 * tree-ssa-dce.c (tree_ssa_dce): Call cleanup_tree_cfg.
11819 * tree.c (body_is_empty): New function.
11820 * tree.h (body_is_empty): Declare.
11822 2003-03-31 Jeff Law <law@redhat.com>
11824 * tree-ssa-ccp.c (simulate_block): Add abnormal edges out of a
11825 block to the edge worklist after simulating a block for the
11826 first time. If the block has a single outgoing normal edge,
11827 add that edge to the worklist after simulating the block for
11830 2003-03-31 Frank Ch. Eigler <fche@redhat.com>
11832 * gcc.c (MFLIB_SPEC): Remove -ld.
11833 (MFWRAP_SPEC): Remove dlopen wrapping.
11835 2003-03-28 Diego Novillo <dnovillo@redhat.com>
11837 * tree-ssa.c (rewrite_block): Add new argument 'eq_expr_value'.
11839 If 'eq_expr_value' is given, use it to register a new
11840 value for the variable given on the LHS.
11841 If the block ends in a conditional expression of the form 'X == Y',
11842 propagate 'X = Y' into the THEN_CLAUSE.
11843 (MAY_COPYPROP_P): Define.
11844 (rewrite_stmt): Call it.
11845 (register_new_def): Fix comment.
11846 (get_eq_expr_value): New function.
11848 2003-03-28 Diego Novillo <dnovillo@redhat.com>
11850 * basic-block.h (BB_COMPOUND_ENTRY): Remove. Update all users
11852 * tree-cfg.c: Minor fixes to various comments.
11853 * tree-optimize.c (optimize_function_tree): Dump optimized function
11854 after SSA->normal conversion.
11856 2003-03-26 Daniel Berlin <dberlin@dberlin.org>
11858 * tree-ssa-pre.c: Implement open64 renaming algorithm.
11859 (subst_phis): New function.
11860 (generate_expr_as_of_bb): Ditto.
11861 (new_rename_1): Ditto.
11862 (process_delayed_rename): Ditto.
11863 (do_proper_save): Use bsi_* functions for insertion, don't remove
11864 old code quite yet, haven't fully tested.
11865 Also add argument that says whether to insert before use or after use.
11866 (defs_y_dom_x): Factor through injuries properly.
11867 (defs_match_p): Ditto.
11868 (phi_opnd_from_res): Attempt to fix, and remove useless argument.
11869 (reset_can_be_avail): Fix broken condition that would cause infinite
11871 (update_old_new): #if 0 updating of bb heads.
11872 (finalize_1): We occasionally get 5 + a rather than a + 5, so we
11873 need to make sure 5 is a DECL before trying to get a reaching def.
11874 (repair_use_injury): If we couldn't find a reaching def, we don't need
11876 (assign_new_class): Only push to stack2 if it exists (so we can
11877 share this function in both rename implementations).
11878 (create_ephi_node): Add argument that says whether to add ephi
11879 to block or not (we create them sometimes for validation only).
11880 (tree_perform_ssapre): Skip expressions without any uses.
11882 * tree.h: Add EREF_DELAYED_RENAME.
11883 (struct tree_eref_common): Add delayed_rename bit.
11885 2003-03-25 Diego Novillo <dnovillo@redhat.com>
11887 * tree-simple.c: Use tree codes to document grammar for relational
11888 operators &&, || and ^.
11890 2003-03-25 Diego Novillo <dnovillo@redhat.com>
11892 * cfg.c (dump_edge_info): Add labels for EDGE_TRUE_VALUE,
11893 EDGE_FALSE_VALUE and EDGE_EXECUTABLE.
11894 * tree-cfg.c (dump_tree_bb): Change formatting. Show all
11895 statements in the block.
11896 * tree-simple.c: Update documentation for GIMPLE conditional
11899 2003-03-24 Diego Novillo <dnovillo@redhat.com>
11901 * tree-dfa.c (get_expr_operands): If there are no call clobbered
11902 variables, don't create a VDEF for GLOBAL_VAR at clobbering
11904 * tree-flow.h (fold_stmt): Declare.
11905 * tree-ssa-ccp.c (fold_stmt): Change to extern declaration.
11906 * tree-ssa.c (rewrite_stmt): Call it.
11908 2003-03-22 Diego Novillo <dnovillo@redhat.com>
11910 * Makefile.in (gtype-desc.o): Add dependency on $(TREE_FLOW_H).
11912 * tree-dfa.c (struct alias_set_d): Add field 'num_elements'.
11913 (struct walk_state): Move declaration earlier in the file.
11914 (create_global_var): New local function.
11915 (num_referenced_vars, num_aliased_objects): Change type to
11916 'size_t'. Update all users.
11917 (aliased_objects, aliased_objects_base, aliased_objects_aliase_set):
11918 Mark for garbage collection.
11919 (num_call_clobbered_vars, call_clobbered_vars): New global
11921 (get_expr_operands): For CALL_EXPRs, add a VUSE or VDEF reference
11922 for every pointer argument. If the call may clobber, add a VDEF,
11923 otherwise add a VUSE.
11924 If the call may clobber, add VDEF for GLOBAL_VAR.
11925 (dump_variable): Show whether the variable is call clobbered.
11926 (dump_dfa_stats): Show call clobbered variables.
11927 (compute_may_aliases): Minor formatting changes.
11928 (compute_alias_sets): If the function makes clobbering calls, add
11929 GLOBAL_VAR as an alias to every call-clobbered variable.
11930 Remove alias sets that have exactly one element.
11931 (register_alias_set): Set 'num_elements' to zero for every newly
11933 (find_alias_for): Don't make a second call to add_may_alias to make
11934 alias tags alias themselves. It's redundant.
11935 Increment 'num_elements' when adding a new alias to an alias set.
11936 (may_alias_p): Don't handle GLOBAL_VAR.
11937 Check for structure aliasing when either PTR or VAR are a
11938 structure. Don't do it only when both are structures.
11939 (dump_alias_info): Show all aliases of each variable.
11940 (find_vars_r): When processing a CALL_EXPR node, set
11941 walk_state->is_store if the function may clobber and create a
11942 reference to GLOBAL_VAR.
11943 (add_indirect_ref_var): Change type of second argument from 'void *'
11944 to 'struct walk_state *'. Update all users.
11945 (add_referenced_var): Likewise. If a potentially aliased variabe
11946 is not declared 'const', add it to the list of call clobbered
11949 * tree-flow.h (struct var_ann_d): Add field 'is_call_clobbered'.
11950 Change type of field 'uid' to size_t. Update all users.
11951 (stmt_ann_d): Add field 'makes_clobbering_call'.
11952 (next_tree_ref_id): Remove unused variable.
11953 (call_clobbered_vars): Declare.
11954 (num_call_clobbered_vars): Declare.
11955 (call_clobbered_var): New inline function.
11957 * tree-ssa-ccp.c (visit_phi_node): If the LHS of a PHI node is
11958 volatile, mark the PHI node VARYING without checking its arguments.
11959 (visit_assignment): Likewise.
11960 (set_value): Remove. Update all users.
11961 (likely_value): If the statement makes aliased loads or has
11962 volatile operands, consider it VARYING.
11963 (get_default_value): If a variable is volatile, consider it
11966 * tree-ssa.c (init_tree_ssa): Initialize num_call_clobbered_vars
11967 and call_clobbered_vars.
11968 Do not create GLOBAL_VAR. Set it to NULL_TREE.
11969 Increase initial size for various hash tables.
11970 (delete_tree_ssa): Reset num_call_clobbered_vars and
11971 call_clobbered_vars.
11972 (get_reaching_def): Rename from currdef_for. Update all users.
11973 Always create default definitions for variables that need them.
11974 Callers that use to call currdef_for with the second argument set
11975 to false now call get_value_for.
11976 (htab_statistics): New function.
11977 (dump_tree_ssa): Call it.
11978 (avail_expr_eq): Also compare VUSE operands.
11980 2003-03-21 Jeff Law <law@redhat.com>
11982 * tree-dfa.c: Revert vla changes from yesterday.
11983 (find_vla_decls_r): Do not look inside TYPE_DECLs.
11985 2003-03-20 Jeff Law <law@redhat.com>
11987 * gimplify.c (simplify_return_expr): Tighten condition for
11988 converting the RHS of a MODIFY_EXPR in a RETURN_EXPR to a
11989 simple_val. Allow returning a RESULT_DECL directly.
11990 * tree-dfa.c (get_expr_operands): A RESULT_DECL can have
11991 interesting operands.
11992 (clobber_vars_r): Handle RESULT_DECLs.
11993 (compute_may_aliases): Initialize and free vla_htab.
11994 (find_vla_decls): Pass vla_htab to walk_tree.
11995 (find_vla_decls_r): Likewise.
11996 * tree.h (SSA_DECL_P): Accept RESULT_DECLs.
11998 2003-03-19 Jeff Law <law@redhat.com>
12000 * gimplify.c (simplify_return_expr): Only allow simple values
12001 on the RHS of a MODIFY_EXPR appearing in a RETURN_EXPR.
12002 * tree-cfg.c (make_exit_edges): We no longer need to look for
12003 CALL_EXPRs on the RHS of a MODIFY_EXPR inside RETURN_EXPRs.
12005 2003-03-18 Andrew Macleod <amacleod@redhat.com>
12007 * tree-cfg.c (make_blocks): Use append_stmt_to_bb. Check for NULL
12008 tsi_stmt when deciding whether to start a new block.
12009 (add_stmt_to_bb): Don't update the basic block end pointer.
12010 (append_stmt_to_bb): New. Add stmt and update the BB end pointer.
12011 (first_stmt): Use only 1 return.
12012 (last_stmt): Modified to use bsi_last().
12013 (last_stmt_ptr): Modified to use bsi_last().
12014 (bsi_last): New. Return an iterator to the last stmt in a block.
12015 (bsi_from_tsi): Fix bug which wouldn't set the context properly when
12016 within a nested BIND_EXPR.
12017 (bsi_update_from_tsi): Insert helper which is more efficient than
12019 (bsi_link_after): link in a new stmt and update the basic block
12021 (bsi_insert_after): Insert a new stmt into a block.
12022 (bsi_insert_before): Insert a new stmt into a block.
12023 (bsi_insert_on_edge): Insert a new stmt on an edge.
12024 * tree-flow-inline.h (is_label_stmt): Return true if stmt can be a
12025 target of a control transfer.
12026 * tree-flow.h (is_label_stmt, bsi_last): New prototypes.
12028 2003-03-12 Jeff Law <law@redhat.com>
12030 * c-simplify.c (simplify_switch_stmt): Save the type of the original
12031 condition in TREE_TYPE (SWITCH_EXPR (...)). Annotate the SWITCH_EXPR
12032 with file/line information.
12033 * expr.c (expand_expr, case SWITCH_EXPR): Use expand_end_case_type.
12034 * tree.def (SWITCH_EXPR): Document meaning of TREE_TYPE field of
12037 * c-simplify.c (simplify_block): Set the current line number to
12038 the line associated with the end of the block.
12040 * c-decl.c (finish_function): No longer save/restore the
12041 current filename or linenumber around simplification. Instead
12042 save/restore it around inlining.
12043 (c_expand_body_1): Save/restore current filename and linenumber
12044 around expansion of trees into RTL.
12045 * gimplify.c (simplify_function_tree): Make the current file/line
12046 number match the non-gimple code at the end of a function.
12048 * tree-cfg.c: Include toplev.h.
12049 (remove_bb): Warn about unreachable code.
12051 * cfgrtl.c (verify_flow_info): Ignore EDGE_EXECUTABLE, it's for
12052 the CCP optimizer only.
12054 * ssa.c (convert_to_ssa): Use last_basic_block, not n_basic_blocks.
12056 2003-03-11 Jeff Law <law@redhat.com>
12058 * builtins.c: Fix minor comment typo.
12059 (expand_builtin_strcmp, expand_builtin_strncmp): Remove.
12060 (expand_builtin_strcat, expand_builtin_strncat): Likewise.
12061 (expand_builtin_strspn, expand_builtin_strcspn): Likewise.
12062 (expand_builtin_strcopy, expand_builtin_strstr): Likewise.
12063 (expand_builtin_strpbrk, expand_builtin_strchr): Likewise.
12064 (expand_builtin_strrchr, expand_builtin_fputs): Likewise.
12065 (simplify_builtin_memcmp, simplify_builtin_strcmp): New functions.
12066 (simplify_builtin_strpbrk, simplify_builtin_strstr): Likewise
12067 (simplify_builtin_strchr, simplify_builtin_strrchr): Likewise
12068 (simplify_builtin_strcpy, simplify_builtin_strncpy): Likewise
12069 (simplify_builtin_strncmp, simplify_builtin_strcat): Likewise
12070 (simplify_builtin_strncat, simplify_builtin_strspn): Likewise
12071 (simplify_builtin_strcspn, simplify_builtin_fputs): Likewise
12072 (expand_builtin_memcmp): Use simplify_builtin_memcmp.
12073 (simplify_builtin): New function
12074 (expand_builtin): Use simpify_builtin to collapse several common
12076 * gimplify.c (simplify_call_expr): Accept new argument. All
12077 callers updated. Call simplify_builtin to try and simplify builtin
12078 function calls before we simplify their arguments.
12079 * tree.h (simplify_builtin): Prototype.
12081 2003-03-11 Jeff Law <law@redhat.com>
12083 * timevar.def (TV_TREE_SSA_TO_NORMAL): New timevar.
12084 * tree-cfg.c (remove_stmt): Also remove special annotations
12085 on RHS of MODIFY_EXPR statements.
12086 * tree-dfa.c (create_stmt_ann): Update comments. Fix formatting.
12087 (compute_may_aliases): Make sure timevar encloses entire routine.
12088 * tree-ssa.c (rewrite_out_of_ssa): Enclose with a timevar.
12089 (remove_annotations_r): Avoid walking into subtrees of anything
12090 except container nodes. Remove the special annotation on the
12091 RHS of MODIFY_EXPRs.
12093 2003-03-10 Frank Ch. Eigler <fche@redhat.com>
12095 * tree-mudflap.c (mx_xfn_indirect_ref): Allow unfolded "& ptr->field"
12096 constructs to pass uninstrumented. Remove TREE_ADDRESSABLE settings.
12097 Keep array accesses to non-ADDRESSABLE objects uninstrumented. Update
12098 __MF_TYPE_* constants for __mf_register calls.
12100 2003-03-10 Jeff Law <law@redhat.com>
12102 * c-decl.c (c_expand_body_1): Update comments relating to
12103 re-simplification after mudflap instrumentation. Avoid
12104 unnecessary simplification of the function tree.
12105 * gimplify.c (keep_function_tree_in_gimple_form): New function.
12106 * tree-inline.c: Include tree-iterator.h and tree-simple.h
12107 (struct inline_data): Add new TSI field.
12108 (copy_body_r): Keep tree in gimple form when transforming a
12109 RETURN_EXPR into a MODIFY_EXPR and GOTO_EXPR.
12110 (initialize_inlined_parameters): Use MODIFY_EXPR, not INIT_EXPR
12111 for initialization of inlined parameters.
12112 (expand_call_inline): Save and restore the TSI around the
12113 call to expand_calls_inline. Keep the tree in gimple form
12114 when replacing a CALL_EXPR with a BIND_EXPR for the inlined
12116 (expand_calls_inline): Revamp to provide the current TSI to
12117 expand_call_inline when we're working with gimple form.
12118 * Makefile.in (tree-inline.o): Update dependencies.
12119 * tree.h (keep_function_tree_in_gimple_form): Prototype.
12121 2003-03-10 Andrew MacLeod <amacleod@redhat.com>
12123 * Makefile.in (tree.o): Add tree-iterator.h dependancy.
12124 * sbitmap.c (sbitmap_realloc): Grow a sbitmap structure.
12125 * sbitmap.h (sbitmap_realloc): New Prototype.
12126 * tree-cfg.c (remove_bb): Use new format for bsi_remove.
12127 (bsi_remove): Update iterator to refer to the next stmt.
12128 (bsi_prev): Implement previous stmt routine.
12129 (bsi_from_tsi): Create a block iterator from a tree iterator.
12130 * tree-flow-inline.h (bsi_prev): Remove.
12131 (tsi_from_bsi): Create a tree iterator from a block iterator.
12132 * tree-flow.h (bsi_prev,bsi_remove): Update prototypes.
12133 (bsi_from_tsi, tsi_from_bsi, bsi_insert_*): New prototypes.
12134 (bsi_iterator_update): New enum type.
12135 * tree-iterator.h (tree_stmt_anchor, tsi_iterator_update): New type.
12136 (tsi_link_before, tsi_link_after, tsi_delink, tsi_new_stmt_list,
12137 tsi_stmt_list_head): New prototypes.
12138 * tree-ssa-dce.c (remove_dead_stmts): Update removal loop to allow
12139 that remove_dead_stmt update's the iterator.
12140 (remove_dead_stmt): Use a pointer to the iterator since bsi_remove
12142 * tree.c (tsi_link_before): New function to link a stmt before an
12144 (tsi_link_after): New function links stmt after an iterator.
12145 (tsi_delink): Removes a stmt from a list.
12146 (tsi_new_stmt_list): New function to begin a new stmt list.
12147 (tsi_stmt_list_head): New function to get the first stmt in a list.
12149 2003-03-07 Diego Novillo <dnovillo@redhat.com>
12151 * tree-cfg.c (remove_stmt): Don't assume that the statement is in
12154 * tree-flow.h (dump_tree_ssa_stats): Declare.
12155 (debug_tree_ssa_stats): Declare.
12156 (stmt_ann_d): Add new statement flags 'makes_aliased_loads',
12157 'makes_aliased_stores', and 'has_volatile_ops'.
12158 * tree-dfa.c (add_stmt_operand): Set new statement flags accordingly.
12160 * tree-pretty-print.c (dump_generic_node): Various cosmetic changes
12161 to the rendering of some expressions.
12163 * tree-ssa.c (struct var_value_d): Rename from struct currdef_d.
12164 Rename field 'currdef' to 'value'. Update all users.
12165 (avail_exprs): New local hash table.
12166 (const_and_copies): New local hash table.
12167 (struct ssa_stats_d): Declare.
12168 (ssa_stats): New local variable.
12169 (rewrite_into_ssa): Deallocate avail_exprs and const_and_copies
12171 Call dump_tree_ssa_stats() if -fdump-tree-ssa-stats is given.
12172 (rewrite_block): Document the renaming process.
12173 Add new local stack block_avail_exprs to keep track of expressions
12174 made available in this block and its children.
12175 (rewrite_stmts): Move body inside rewrite_block.
12176 (dump_tree_ssa_stats): New function.
12177 (debug_tree_ssa_stats): New function.
12178 (get_def_blocks): New function.
12179 (insert_phi_nodes_for): Call it.
12180 (rewrite_stmt): Add support for keeping track of copies, constants
12181 and globally redundant expressions.
12182 (rewrite_operand): If a pointer has been copy propagated into
12183 another one, rewrite INDIRECT_REF nodes of the original pointer to
12184 refer to the new one.
12185 (register_new_def): Add new argument 'var' indicating which
12186 variable is this new definition for. Update all users.
12187 (update_indirect_ref_vuses): New function.
12188 (update_pointer_vuses): New function.
12189 (init_tree_ssa): Set variable 'ssa_stats' to zero.
12190 Allocate memory for 'avail_exprs' and 'const_and_copies'.
12191 (currdef_for): Don't mark inline.
12192 Call get_value_for and set_value_for.
12193 (set_currdef_for): Remove. Update all users.
12194 (var_value_hash): Rename from currdef_hash. Update all users.
12195 (var_value_eq): Rename from currdef_eq. Update all users.
12196 (get_value_for): New function.
12197 (set_value_for): New function.
12198 (lookup_avail_expr): New function.
12199 (avail_expr_hash): New function.
12200 (avail_expr_eq): New function.
12201 (get_def_blocks_for): New function.
12202 (var_is_live): New function.
12204 2003-03-06 Diego Novillo <dnovillo@redhat.com>
12206 * tree-ssa-ccp.c (likely_value): Don't assume CONSTANT if the
12207 statement has virtual uses.
12209 2003-03-05 Diego Novillo <dnovillo@redhat.com>
12211 * tree-dfa.c (opf_none, opf_is_def, opf_force_vop, opf_ignore_bp):
12212 New flags to alter the behavior of add_stmt_operand.
12213 (get_expr_operands): Change operand IS_DEF with FLAGS. Update all
12215 When adding a VUSE for pointer dereferences in function arguments,
12216 don't add a superfluous VUSE for the base pointer.
12217 (add_stmt_operand): Remove operands IS_DEF and FORCE_VOP. Add
12218 operand FLAGS. Update all users.
12220 2003-03-05 Jason Merrill <jason@redhat.com>
12222 * c-pretty-print.c (do_niy): Only print operands of expressions.
12223 * tree-pretty-print.c: Likewise.
12225 * c-simplify.c (simplify_decl_stmt): Only simplify DECL_SIZE_UNIT.
12226 * gimplify.c (simplify_array_ref_to_plus): New fn.
12227 (simplify_array_ref): Use it.
12228 (build_addr_expr_with_type): Split out from build_addr_expr.
12229 (simplify_compound_lval): Break out an ARRAY_REF with non-constant
12232 2003-03-05 Frank Ch. Eigler <fche@redhat.com>
12234 * gcc.c (MFWRAP_SPEC): Remove most --wrap entries.
12236 2003-03-03 Daniel Berlin <dberlin@dberlin.org>
12238 * tree-ssa-pre.c (is_strred_cand): Temporarily disable strength
12239 reduction while working on bootstrapping.
12240 (requires_edge_placement): Reenable for now, until an insertion
12241 infrastructure exists that can handle critical edges.
12242 (count_stmts_in_bb): New function, used for verifying we do
12243 insertions properly.
12244 (update_old_new): Fix up bb heads as well.
12245 (do_proper_save): Handle single statement bb properly.
12246 Handle BB's contained in BIND_EXPRS.
12247 (code_motion): Count number of statements in bb before and after
12248 to make sure we don't screw up boundaries.
12249 (finalize_1): Ditto.
12250 (rename_2): Fix subtle rename bug.
12251 (phi_opnd_from_res): Do this the right way, by cloning the
12252 occurrence and modifying it, as every other PRE implementation
12254 (tree_perform_ssapre): Handle comparisons too (unary exprs
12255 currently disabled till load PRE is reimplemented).
12256 (reset_can_be_avail): Fix can_be_avail test.
12258 2003-03-01 Diego Novillo <dnovillo@redhat.com>
12260 * doc/invoke.texi: Fix typo.
12262 2003-02-28 Aldy Hernandez <aldyh@redhat.com>
12263 Diego Novillo <dnovillo@redhat.com>
12265 * Makefile.in (OBJS): Add tree-ssa-copyprop.o.
12266 (tree-ssa-copyprop.o): New rule.
12267 (tree-ssa-ccp.o): Add dependency on $(TREE_SIMPLE_H).
12269 * timevar.def (TV_TREE_COPYPROP): New timevar.
12270 * flags.h (flag_tree_copyprop): Declare.
12271 * toplev.c (flag_tree_copyprop): Define.
12272 (f_options): Add -ftree-copyprop.
12273 * tree.h (tree_dump_index): Add TDI_copyprop.
12274 * tree-dump.c (dump_files): Add entry for -fdump-tree-copyprop.
12275 * doc/invoke.texi: Document -ftree-copyprop and -fdump-tree-copyprop.
12277 * tree-ssa-copyprop.c: New file.
12278 * tree-flow.h (tree_ssa_copyprop): Declare.
12279 * tree-optimize.c (optimize_function_tree): Call it.
12280 * tree-dfa.c (add_vuse): Make extern. Update all users.
12282 * tree-ssa.c (mark_def_sites): VUSEs are stored in a varray of trees.
12284 2003-02-28 Frank Ch. Eigler <fche@redhat.com>
12286 * tree-mudflap.c (mudflap_enqueue_decl): Ignore extern artificial
12287 variable declarations.
12289 2003-02-27 Diego Novillo <dnovillo@redhat.com>
12291 * tree-dfa.c (get_stmt_operands): INIT_EXPR nodes cannot
12292 appear in GIMPLE form. Don't handle them.
12293 (get_expr_operands): Likewise.
12294 (find_vars_r): Likewise.
12295 * tree-ssa-ccp.c (get_rhs): Likewise.
12296 (set_rhs): Likewise.
12297 * tree-ssa-pre.c (tree_perform_ssapre): Likewise.
12299 2003-02-27 Diego Novillo <dnovillo@redhat.com>
12301 * tree-ssa-ccp.c (ccp_fold): Fold builtins by replacing and
12302 restoring their arguments.
12304 2003-02-27 Jeff Law <law@redhat.com>
12306 * tree-dfa.c (find_vars_r): Clear *walk_subtrees appropriately
12307 to avoid useless walking of subtrees.
12309 * fold-const.c (nondestructive_fold_binary_to_constant): Renamed
12310 from nondestructive_fold_binary. Update comments slightly.
12311 (nondestructive_fold_unary_to_constant): Similarly.
12312 (fold_relational_hi_lo): Corresponding changes.
12313 * tree-ssa-ccp.c (ccp_fold): Corresponding changes.
12314 * tree.h: Corresponding changes.
12316 2003-02-26 Jeff Law <law@redhat.com>
12318 * tree-ssa-ccp.c (ccp_fold): Also handle folding of calls to
12321 * fold-const.c (nondestructive_fold_binary): Handle truth ops
12322 when both arguments are constant (duh!). Handle CONJ_EXPR.
12324 2003-02-26 Daniel Berlin <dberlin@dberlin.org>
12326 * flags.h: Remove flag_ip.
12328 * tree-alias-ander.c: s/flag_ip/flag_unit_at_a_time/g.
12329 (andersen_cleanup): Set region to null when done.
12330 (andersen_function_call): Check DECL_PTA_TYPEVAR, not
12332 * tree-alias-common.c: s/SSA_DECL_P/DECL_P/g.
12333 (get_alias_var_decl): Remove dead code, fix bug in what is a
12335 (find_func_aliases): Use get_alias_var, not create_fun_alias_var.
12336 (create_fun_alias_var): Fix to use DECL_PTA_TYPEVAR.
12337 Use get_alias_var rather than create_alias_var.
12338 (create_fun_alias_var_ptf): Ditto.
12339 (create_alias_vars): Ditto.
12340 * tree-dfa.c (compute_may_aliases): Fix check for
12342 Move deletion of alias vars back to here, from tree-ssa.c
12343 * tree-ssa.c (delete_tree_ssa): Remove delete_alias_vars call.
12345 2003-02-25 Jeff Law <law@redhat.com>
12346 Diego Novillo <dnovillo@redhat.com>
12348 * tree-ssa-ccp.c (likely_value): If the statement has no
12349 use operands, then return CONSTANT.
12351 * fold-const.c (nondestructive_fold_binary): Handle TRUTH_AND_EXPR
12352 and TRUTH_OR_EXPR. Placeholder for TRUTH_XOR_EXPR.
12353 * tree-ssa-ccp.c (ccp_fold): Handle TRUTH_{AND,OR,XOR}_EXPR.
12354 (def_to_undefined): Re-enable VARYING->UNDEFINED state transition
12357 * tree-ssa-ccp.c (likely_value): Renamed from may_fold_p. Now
12358 returns a latticevalue indicating the likely value for the
12359 the RHS of the statement.
12360 (evaluate_stmt): Update to use likely_value instead of may_fold_p.
12361 Statements with UNDEFINED operands produce an UNDEFINED result.
12362 (set_lattice_value): Reenable VARYING->CONSTANT sanity check.
12364 2003-02-25 Andrew MacLeod <amacleod@redhat.com>
12366 * tree-cfg.c (bsi_init): Handle BIND_EXPR nodes inside a basic block.
12367 (bsi_next_in_bb): Likewise.
12369 2003-02-25 Diego Novillo <dnovillo@redhat.com>
12371 * tree-cfg.c (parent_array): Remove. Update all users.
12372 (struct cfg_stats_d): Add field 'num_failed_bind_expr_merges'.
12373 (NEXT_BLOCK_LINK): Define.
12374 (build_tree_cfg): Call alloc_aux_for_blocks instead of
12375 create_block_annotations.
12376 (make_blocks): Rewrite to support basic blocks that can span whole
12377 BIND_EXPR bodies and put control statements at the end of blocks.
12378 Add arguments 'next_block_link' and 'bb'. Replace 'parent_block'
12379 with 'parent_stmt'. Update all users.
12380 (make_loop_expr_blocks): Replace argument 'parent_block' with 'entry'.
12381 Add argument 'next_block_link'. Update all users.
12382 Don't create an empty latch block.
12383 (make_cond_expr_blocks): Add argument 'next_block_link'. Update
12385 (make_switch_expr_blocks): Likewise.
12386 (make_bind_expr_blocks): Replace 'parent_block' with 'parent_stmt'.
12387 Add argument 'next_block_link' and 'entry'.
12388 Don't create a new block for the BIND_EXPR node. Extend the
12390 (add_stmt_to_bb): New function.
12391 (create_bb): Remove argument 'parent_block'. Update all users.
12392 (create_block_annotations): Remove. Update all users.
12393 (make_edges): Don't handle BIND_EXPR nodes.
12394 (make_ctrl_stmt_edges): Don't create an extra edge to the body of
12396 (make_loop_expr_edges): Only create an edge to the body of the
12398 (remove_unreachable_block): Add more documentation for the special
12399 case where a control statement entry is unreachable but its body
12401 Remove the basic block annotation from the head and end containers
12403 (disconnect_unreachable_case_labels): Don't keep the edge that goes
12404 to the BIND_EXPR at the start of the switch body.
12405 (dump_tree_bb): Call is_latch_block_for.
12406 (dump_cfg_stats): Show stats about basic blocks that could not span
12407 beyond the end of a BIND_EXPR body.
12408 (successor_block): Use NEXT_BLOCK_LINK if the block is the last
12409 inside a control structure.
12410 (is_ctrl_stmt): Update documentation.
12411 (stmt_starts_bb_p): Add new argument 'prev_t'. Update all users.
12412 Only labels may start a new basic block.
12413 (stmt_ends_bb_p): Add LOOP_EXPR, TRY_FINALLY_EXPR and
12414 TRY_CATCH_EXPR to the list.
12415 (latch_block): Remove.
12416 (is_latch_block_for): New function.
12417 (set_bb_for_stmt): Reformat some code.
12419 * tree-flow-inline.h (set_parent_block): Remove. Update all users.
12420 (parent_stmt): New function.
12421 (parent_block): Call it.
12423 * tree-flow.h (struct stmt_ann_d): Add field 'parent_stmt'.
12424 (struct bb_ann_d): Remove block parent_block.
12426 * tree-pretty-print.c (dump_generic_node): Don't handle empty latch
12429 * tree-ssa-ccp.c (def_to_undefined): Temporarily disable check for
12430 VARYING->UNDEFINED transitions.
12431 (set_lattice_value): Likewise for VARYING->CONSTANT transitions.
12433 * tree-ssa-dce.c (mark_necessary): Use parent_stmt() to traverse
12434 all the control statements that contain the current
12436 (makr_control_parent_necessary): Remove. Update all users.
12437 (stmt_useful_p): Add BIND_EXPR to the list of useful
12439 (process_worklist): Check that the statement is
12440 associated to a basic block.
12441 (remove_dead_stmt): Don't assume that the block has a
12444 2002-02-20 Daniel Berlin <dberlin@dberlin.org>
12446 * tree-alias-ander.c: Store cached ptsets in the typevar, not
12447 a seperate hash table.
12448 (ptset_map): Removed;
12449 (ptset_map_eq): Ditto.
12450 (ptset_map_hash): Ditto.
12451 (andersen_init): Remove ptset_map.
12452 (andersen_cleanup): Ditto.
12453 (andersen_add_var): Ditto.
12454 (andersen_add_var_asm): Ditto.
12455 (andersen_may_alias): Ditto.
12456 * tree-alias-common.c: Store typevars for DECL nodes in the tree_decl
12458 (get_alias_var_decl): Use DECL_PTA_TYPEVAR for DECL's.
12459 (create_alias_var): Ditto.
12460 (find_func_aliases): CONST functions don't affect aliasing either.
12461 (ptr_may_alias_var): Don't call get_base_symbol.
12462 Remove decl_function_context, use DECL_CONTEXT instead.
12463 For DECL's, use DECL_PTA_TYPEVAR.
12464 * tree-alias-type.c (struct alias_typevar_aterm): Add ptset member.
12465 (ALIAS_TVAR_PTSET): New macro.
12466 * tree.h (DECL_PTA_TYPEVAR): New macro.
12467 (struct tree_decl): Add typevar member.
12469 2003-02-20 Jeff Law <law@redhat.com>
12471 * c-simplify.c (simplify_decl_stmt): Call set_vla_decl on the
12472 temporary holding the size and unit size for a VLA. Minor
12475 * ssa.c: Revert caching of immediate dominators change made on
12478 * tree-dfa.c: Fix comment.
12480 2003-02-20 Jeff Law <law@redhat.com>
12482 * tree-cfg.c (remove_bb): Update PHI nodes as edges are removed.
12483 (cleanup_cond_expr_graph): Likewise.
12484 (cleanup_switch_expr_graph): Likewise.
12485 (disconnect_unreachable_case_labels): Likewise.
12487 * tree-ssa-dce.c (mark_control_parent_necessary): Be much more
12488 selective about what statements in the control parents are marked
12491 * tree-dfa.c (INDIRECT_REFs and ADDRESSABLE_VARs varrays): Replace
12492 with a single ALIASED_OBJECTs set of varrays.
12493 (dump_dfa_stats): Corresponding changes.
12494 (compute_may_aliases, dump_alias_info): Likewise.
12495 (compute_alias_sets): Likesise. Update comments. Register
12496 alias sets for all potentially aliased objects which are stored.
12497 Check each potentially aliased object with the registered alias
12499 (register_alias_set): If DEREF aliases a single registered _DECL,
12500 then replace the _DECL's entry with DEREF.
12501 (find_alias_for): Update comments. Do not stop the search when
12502 an alias is found. There may be multiple entries with conflicting
12504 (struct walk_state): New structure for statement walker callbacks.
12505 (find_vars_r): Add logic to track loads and stores of potentially
12506 aliased objects separately. Various changes related to
12507 using a single set of varrays for all aliased objects.
12508 (add_referenced_var): Record in the var's annotation if the
12509 var is read or written. Various changes related to using a
12510 single set of varrays for all the aliased objects.
12511 (add_stmt_operand): Only set may_point_to_global_mem for INDIRECT_REFs.
12512 * tree-flow.h (struct var_ann_d): Add new fields indicating if
12513 the var is loaded or stored. Explicitly note unused bitfield
12516 2003-02-19 Jeff Law <law@redhat.com>
12518 * fold-const.c (fold_negate_const): New function. Broken out of
12519 the generic fold code.
12520 (fold_abs_const, fold_relational_const): Likewise.
12521 (fold_relational_hi_lo): Likewise.
12522 (nondestructive_fold_unary, nondestructive_fold_binary): Likewise.
12523 (fold): Use fold_negate_const, fold_abs_const, fold_relational_const,
12524 and fold_relational_hi_lo.
12525 * tree.h (nondestructive_fold_unary): Declare.
12526 (nondestructive_fold_binary): Declare.
12527 * tree-ssa-ccp.c (ccp_fold): New function.
12528 (add_control_edge): Fix trivial formatting bug.
12529 (evaluate_stmt): Rework to use ccp_fold instead of copying
12532 2003-02-18 Jeff Law <law@redhat.com>
12534 * tree-ssa-ccp.c (visit_assignment): For simple copies, copy the
12536 (defs_to_undefined): Add missing abort.
12537 (replace_uses_in): Do not do a replacement if it would create
12540 2002-02-14 Jeff Law <law@redhat.com>
12542 * tree-ssa-ccp.c (def_to_undefined): Improve sanity checking code
12543 so that it can detect invalid VARYING->UNDEFINED transitions.
12544 (set_lattice_value): Improve sanity checking code so that it
12545 does not trip on valid VARYING->CONSTANT transitions.
12547 * tree-flow.h (struct stmt_ann_d): Add new field in_ccp_worklist.
12548 * tree-ssa-ccp.c (simulate_stmt): Renamed from simulate_def_use_edges.
12549 (add_var_to_ssa_edges_worklist): New function. Only add statements
12550 to the ssa_edges worklist if they are not already on the worklist.
12551 (def_to_undefined, def_to_varying, set_lattice_value)
12552 (tree_ssa_ccp): Only reevaluate the statement if in_ccp_worklist
12553 is set for the element popped off the ssa_edges worklist.
12554 (simulate_statement): Simplify now that ssa_edges is a worklist
12555 of statements to reevaluate rather than a worklist of defs
12556 that need their immediate uses reevaluated.
12557 (visit_stmt): Clear in_ccp_worklist.
12559 * tree-ssa-ccp.c (def_to_undefined): Directly store the new
12560 lattice values rather than call set_value.
12561 (def_to_varying): Likewise.
12562 (set_lattice_value): Likewise.
12564 * tree-ssa-ccp.c (def_to_undefined): Add some state transition
12565 sanity checking. Avoid calling set_value if nothing changed.
12566 (def_to_varying): Avoid calling set_value if nothing changed.
12567 (set_lattice_value): Add some state transition sanity checking
12568 for transitions into the CONSTANT state. If the object's
12569 "constant" value has changed to a new constant value, then the
12570 object has a VARYING value.
12572 * tree-ssa-ccp.c (tree_ssa_ccp): Work through the entire
12573 ssa_edges worklist each iteration through the main loop.
12575 2002-02-13 Jeff Law <law@redhat.com>
12577 * tree-ssa-ccp.c: Fix comment formatting glitches.
12579 * tree-ssa-ccp.c (may_fold_p): New function. Returns nonzero if
12580 the given statement may fold after replacement of operands with
12582 (evaluate_stmt): Only create a copy of the statement if there is
12583 a reasonable chance the statement will fold.
12585 2002-02-13 Diego Novillo <dnovillo@redhat.com>
12587 * Makefile.in (OBJS): Add tree-ssa-pre.o.
12589 2003-02-13 Daniel Berlin <dberlin@dberlin.org>
12591 * tree-dfa.c (create_stmt_ann): Do stmt part of common annotation.
12592 * tree-flow-inline.h (tree_stmt): Return statement tree is part of.
12593 * tree-flow.h (struct bb_ann_d): Add ephi_nodes.
12594 * tree-optimize.c (optimize_tree): Activate SSAPRE again.
12595 * tree-pretty-print.c (debug_generic_expr): New function.
12596 (debug_generic_stmt): Ditto.
12597 (dump_generic_node): Pretty print EUSE's, EREF's, and EPHI's.
12599 * tree-ssa-pre.c: Rewrite almost entirely. Now performs more
12600 strength reduction, EPHI minimization, and keeps SSA up to date.
12601 * tree.c (tree_size): Handle EUSE, EPHI, EREF nodes.
12602 (tree_node_structure): Ditto.
12603 (ephi_node_elt_check_failed): New function.
12604 * tree.def: Add EUSE_NODE, ELEFT_NODE, EKILL_NODE, EPHI_NODE,
12606 * tree.h (EREF_NODE_CHECK): New.
12607 (EPHI_NODE_ELT_CHECK): New.
12608 (struct tree_eref_common): New.
12609 (struct tree_euse_node): New.
12610 (struct tree_ephi_node): New.
12611 (union tree_node): Add euse, eref, ephi members.
12612 (enum tree_node_structure): Add TS_EPHI_NODE, TS_EUSE_NODE,
12615 2003-02-13 Daniel Berlin <dberlin@dberlin.org>
12616 Andreas Jaeger <aj@suse.de>
12618 * tree-flow.h: Add some garbage collector marks.
12620 2003-02-12 Jeff Law <law@redhat.com>
12622 * Makefile.in (ssa.o): Depends on $(TREE_H) and tree-flow.h
12623 * ssa.c: Include tree.h and tree-flow.h.
12624 (compute_dominance_frontiers_1): Use the sparse bitmap
12625 of dominator children from the basic block's annotation
12626 if it's available. Otherwise build the sparse bitmap
12627 using the result of get_dominated_by.
12628 * tree-ssa.c (rewrite_into_ssa): Reorder things slightly so
12629 that we can use the cached dominator children computed
12630 by mark_def_sites in compute_dominance_frontiers.
12632 2003-02-12 Andreas Jaeger <aj@suse.de>
12634 * tree-dfa.c (dump_alias_info): Cast variable of size_t properly.
12636 2003-02-12 Daniel Berlin <dberlin@dberlin.org>
12638 * tree-dfa.c (find_may_aliases_for): Remove
12639 (compute_may_aliases): Always call compute_alias_sets.
12641 2003-02-10 Jeff Law <law@redhat.com>
12643 * ssa.c (compute_dominance_frontiers_1): Use a sparse bitmap
12645 (compute_dominance_frontiers): Corresponding changes.
12646 (convert_to_ssa): Similarly. Convert the sparse bitmap to
12647 a simple bitmap to avoid lots of collateral damage.
12648 * ssa.h (compute_dominance_frontiers): Update prototype.
12649 * tree-ssa.c (added, in_work): Kill, no longer needed.
12650 (struct def_blocks_d): Add new bitmap (livein_blocks).
12651 (rewrite_into_ssa): Make dominance frontiers be a sparse
12652 bitmap instead of a simple bitmap. Rename the "nonlocals"
12653 simple bitmap to "globals". Pass it into mark_def_sites.
12654 (compute_global_livein): New function.
12655 (mark_def_sites): Also keep track of variables which are
12656 used before they are set. Allow caller to allocate and
12657 pass in a simple bitmap for global variables. Process
12658 items defined in the statement last.
12659 (set_def_block): Also allocate bitmap for globals.
12660 (set_livein_block): New function.
12661 (def_blocks_free): Free def_blocks correctly. Also free
12663 (debug_def_blocks_r): Also dump the livein_blocks.
12664 (insert_phi_nodes): Simplify now that we don't need the
12665 added and in_work varrays. Accept DFS as a sparse bitmap
12666 instead of a simple bitmap.
12667 (insert_phi_nodes_for): Rework significantly. Pre-compute all
12668 the insertion points for semi-pruned form. While computing those
12669 insertion points keep track of how many phi vector entries
12670 would be needed at those insertion points. When the number of
12671 entries gets large (32), compute global life information and
12672 use that to further pruned the number of PHI insertion points
12675 2003-02-09 Diego Novillo <dnovillo@redhat.com>
12677 * tree-dfa.c (find_vars_r): Assume that the RHS of an INDIRECT_REF,
12678 that is also an SSA variable, is a VAR_DECL.
12679 (get_virtual_var): Handle INDIRECT_REF nodes that are not valid SSA
12682 * tree-ssa-dce.c (stmt_useful_p): Revert kludge in previous commit.
12683 VA_ARG_EXPR nodes are not inherently live.
12685 * tree-ssa.c (mark_def_sites): Don't process the LHS of assignments
12687 The operand of a virtual definition constitutes a use of the
12688 variable which should be considered a non-local if it had not been
12689 killed inside the block.
12691 * tree.h (SSA_VAR_P): Only return true for INDIRECT_REFs if their
12692 operand is a _DECL node.
12694 2003-02-09 Diego Novillo <dnovillo@redhat.com>
12696 * config/rs6000/t-rs6000 (simplify-rtx.o): Compile with -Wno-error.
12698 2003-02-08 Diego Novillo <dnovillo@redhat.com>
12700 * toplev.c (parse_options_and_default_flags): Enable SSA DCE by
12703 * tree-dfa.c (get_expr_operands): Recurse into LHS of an ARRAY_REF
12704 when it's not a regular variable. Always recurse into the RHS.
12705 (add_stmt_operand): Set may_point_to_global_mem for pointers that
12706 are assigned expressions that may reference global memory. Also
12707 set its dereference variable to be an alias of global memory.
12708 (dump_variable): Show may_point_to_global_mem flag.
12709 (compute_alias_sets): Also dump all referenced variables when
12710 dumping alias information.
12711 (add_may_alias): Check for global memory aliasing.
12712 (may_access_global_mem_p): Rename from may_access_global_mem.
12713 Return true if the expression is a variable that may point to or
12714 alias global memory.
12715 (add_referenced_var): Pointer arguments and global pointers may
12716 point to global memory.
12717 (set_may_alias_global_mem): Move ...
12718 * tree-flow-inline.h (set_may_alias_global_mem): ... here.
12719 (set_may_point_to_global_mem): New function.
12720 (may_point_to_global_mem_p): New function.
12722 * tree-ssa-dce.c (stmt_useful_p): VA_ARG_EXPRs are inherently live.
12723 * tree-ssa.c (rewrite_into_ssa): Don't call dump_referenced_vars.
12725 2003-02-06 Diego Novillo <dnovillo@redhat.com>
12727 * tree-dfa.c (struct alias_tags, alias_tags, num_alias_tags):
12728 Remove. Update all users.
12729 (struct alias_set_d): New.
12730 (alias_sets): New file local variable.
12731 (compute_alias_sets): New function.
12732 (compute_may_aliases): Call it when not doing points-to analysis.
12733 (register_alias_set): New function.
12734 (find_alias_for): New function.
12735 (may_alias_p): Declare static.
12736 Don't assume that VAR may not be aliased if it's a non-addressable
12738 If VAR and PTR are aggregate types, check if they can have a field
12739 that points to the other one.
12740 (find_may_aliases_for): Move handling of global memory aliasing ...
12741 (add_may_alias): ... here.
12742 Also accept the base symbols for the variable and its alias.
12743 (register_new_alias): Remove. Update all users.
12744 (find_alias_tag): Remove. Update all users.
12745 (find_vars_r): Update VAR after re-writing *TP when sharing
12746 INDIRECT_REF nodes.
12747 * tree-flow.h (may_alias_p): Remove declaration.
12749 * tree-ssa.c (rewrite_into_ssa): Include referenced variables in
12750 default debug dumps.
12754 * tree-dfa.c (find_vla_decls): New function.
12755 (compute_may_aliases): Call it.
12756 (find_vla_decls_r): New function.
12757 (dump_variable): Show whether the variable is used in a VLA
12759 * tree-flow-inline.h (is_vla_decl): New function.
12760 (set_vla_decl): New function.
12761 * tree-flow.h (struct var_ann_d): Add bitfield 'is_vla_decl'.
12762 * tree-ssa-dce.c (need_to_preserve_store): Return true if SYM is
12763 used inside a VLA declaration.
12765 2003-02-05 Andrew MacLeod <amacleod@redhat.com>
12767 * Makefile.in : Include new file tree-iterator.h in tree-simple.h
12768 * gimplify.c (simplify_cleanup_point_expr): Use tsi_ rather than gsi_.
12769 * tree-cfg.c (make_blocks, remove_bb): Use tsi_ not gsi_ routines.
12770 (bsi_remove): Renamed from gsi_remove, use bsi_ routines.
12771 (successor_block, first_exec_stmt): Use tsi_ not gsi_ routines.
12772 (first_stmt, last_stmt, last_stmt_ptr): Use bsi_ not gsi_ routines.
12773 (bsi_init): Split out from bsi_start.
12774 (bsi_start): Renamed from gsi_start_bb, use bsi_ routines.
12775 (bsi_next_in_bb): Moved from tree-flow-inline.h and renamed from
12776 gsi_step_in_bb. Also verify BB of new stmt.
12777 * tree-dfa.c (compute_immediate_uses, dump_immediate_uses,
12778 collect_dfa_stats, compute_may_aliases): Use block_stmt_iterator.
12779 * tree-flow-inline.h (gsi_step_in_bb): Moved to tree-cfg.c
12780 (bsi_end_p): Renamed from gsi_end_bb_p.
12781 (bsi_next): renamed from gsi_step_bb
12782 (bsi_prev): New function.
12783 (bsi_stmt_ptr): Block version of gsi_stmt_ptr.
12784 (bsi_stmt): Block version of gsi_stmt.
12785 (bsi_container): Block version of gsi_container.
12786 * tree-flow.h (block_stmt_iterator): New iterator type.
12787 * tree-iterator.h: New include file for tree_iterator.
12788 * tree-simple.h : Include tree-iterator.h
12789 (gimple_stmt_iterator, gsi_start, gsi_end_p, gsi_stmt_ptr,
12790 gsi_stmt, gsi_container): Move to tree-iterator.h and rename to tsi_.
12791 (gsi_step): Move to tree-iterator.h and renamed to tsi_next.
12792 * tree-ssa-ccp.c (simulate_block, substitute_and_fold): Use block
12793 iterators instead of gimple_stmt_iterator.
12794 * tree-ssa-dce.c (mark_control_parent_necessary, find_useful_stmts,
12795 remove_dead_stmts, remove_dead_stmt): Use block_stmt_iterator.
12796 * tree-ssa.c (mark_def_sites, rewrite_out_of_ssa, rewrite_stmts): Use
12797 block_stmt_iterator.
12799 2003-02-04 Daniel Berlin <dberlin@dberlin.org>
12801 * tree-alias-common.c (get_alias_var_decl): If it's a global var,
12802 make sure it doesn't get added to local_alias_vars.
12803 (get_name): Return the right name for FUNCTION_DECL's.
12805 2003-02-04 Diego Novillo <dnovillo@redhat.com>
12807 * tree-dfa.c (add_stmt_operand): Do not add a VUSE for a pointer
12808 when clobbering its associated INDIRECT_REF variable.
12810 2003-02-04 Diego Novillo <dnovillo@redhat.com>
12812 * config/rs6000/t-rs6000 (jump.o, regmove.o, c-typeck.o, cfgrtl.o,
12813 combine.o, fold-const.o, ifcvt.o, reload1.o, rtlanal.o,
12814 cp/decl2.o, cp/pt.o, f/where.o, java/expr.o, objc/objc-act.o,
12815 rs6000.o, insn-emit.o): Compile with -Wno-error.
12817 2003-02-03 Diego Novillo <dnovillo@redhat.com>
12818 Jeff Law <law@redhat.com>
12820 * tree-cfg.c (make_blocks): Don't always start a new block with
12821 COND_EXPR and SWITCH_EXPR statements.
12822 Call stmt_ends_bb_p to determine if the current statement should be
12823 the last in the block.
12824 (make_cond_expr_blocks): Second argument is now the entry block
12825 to the conditional.
12826 (make_switch_expr_blocks): Second argument is now the entry block
12828 (make_edges, make_ctrl_stmt_edges, make_loop_expr_edges,
12829 cleanup_control_flow, cleanup_cond_expr_graph,
12830 cleanup_switch_expr_graph, disconnect_unreachable_case_labels,
12831 find_taken_edge, successor_block, latch_block, is_latch_block,
12832 switch_parent): Work with the last statement of the block, not the
12834 (is_ctrl_altering_stmt): Pre-compute the code of the statement.
12835 (stmt_starts_bb_p): Declare file local.
12836 Don't call is_ctrl_stmt. Check if T is a LOOP_EXPR instead.
12837 (stmt_ends_bb_p): New function.
12839 * tree-flow.h (stmt_starts_bb_p): Remove declaration.
12841 2003-02-03 Diego Novillo <dnovillo@redhat.com>
12843 * tree-dfa.c (find_vars_r): Share INDIRECT_REF nodes whose operand
12845 (add_referenced_var): Add additional argument 'sym'. Update all users.
12846 Don't call get_base_symbol.
12847 (add_indirect_ref_var): Rename argument 'var' to 'ptr'.
12848 (htab_hash_var): Remove. Update all users to use htab_hash_pointer.
12849 (htab_var_eq): Remove. Update all users to use htab_eq_pointer.
12851 * tree-flow-inline.h (var_ann): Don't retrieve the annotation of
12852 the base pointer for INDIRECT_REF variables.
12853 (is_aliased): Remove. Update all users.
12854 (is_dereferenced): Remove. Update all users.
12855 (same_var_p): Remove. Update all users to use pointer equality.
12857 * tree-simple.c (get_base_symbol): Convert tail recursion into
12860 * tree-ssa.c (rewrite_out_of_ssa): Add FIXME note about overlapping
12861 live ranges for different versions of the same variable.
12863 2003-02-03 Jeff Law <law@redhat.com>
12865 * tree-dfa.c (add_referenced_var): Annotate each item in the
12866 REFERENCED_VARS varray with a unique id.
12867 * tree-flow.h (struct var_ann_d): Add new uid field.
12868 * tree-ssa.c (mark_def_sites): Compute the set of variables
12869 live across basic blocks and return them in an sbitmap.
12870 (insert_phi_nodes): Use the set of nonlocal variables computed
12871 by mark_def_sites to reduce the number of PHI nodes inserted.
12872 (rewrite_into_ssa): Updated to deal with changes in
12873 insert_phi_nodes and mark_def_sites. Free the sbitmap returned
12876 2003-02-03 Diego Novillo <dnovillo@redhat.com>
12878 * c-common.h (GOTO_DESTINATION): Remove. Fix botched
12881 2003-02-03 Diego Novillo <dnovillo@redhat.com>
12883 Fix warnings to allow bootstrapping with -Werror.
12885 * Makefile.in (c-semantics.o-warn): Add -Wno-error.
12886 (emit-rtl.o-warn): Likewise.
12887 (profile.o-warn): Likewise.
12888 (tree.o-warn): Likewise.
12889 (OBJS): Remove simple-break-elim.o and simple-goto-elim.o.
12890 * c-pretty-print.c (print_function_decl): Remove unused function.
12891 * bitmap.c (bitmap_last_set_bit): Initialize variable 'word'.
12892 * c-typeck.c (build_binary_op): Initialize variable 'type'.
12893 * combine.c (combine_simplify_rtx): Initialize variable 'reversed'.
12894 (make_compound_operation): Initialize variable 'i'.
12895 * dwarf2out.c (dwarf2out_finish): Initialize variable 'context'.
12896 * expr.c (store_constructor): Initialize variables 'lo', 'hi',
12897 'startb' and 'endb'.
12898 (expand_expr): Initialize variable 'op0'.
12899 * fold-const.c (fold): Initialize variable 'tem'.
12900 * profile.c (branch_prob): Initialize variable 'prev_file_name'.
12901 * reload.c (find_equiv_reg): Initialize variables 'valtry and
12903 * rtlanal.c (get_jump_table_offset): Initialize variable 'set'.
12904 * ssa-ccp.c (ssa_const_prop): Fix sign mismatch warning.
12905 * varasm.c (output_constant_def): Initialize variable 'defstr'.
12906 * gimplify.c (simplify_expr): Initialize variables
12907 'saved_input_filename' and 'saved_lineno'.
12908 (simplify_compound_lval): Initialize variable 'code'.
12909 * tree-alias-ander.c (pta_bottom): De-ansify.
12910 (andersen_cleanup): Remove unused variables.
12911 (andersen_heap_assign): Mark argument lhs ATTRIBUTE_UNUSED.
12912 (pta_bottom): Remove unused function.
12913 (pta_get_ptsize): Remove unused function.
12915 2003-02-02 Diego Novillo <dnovillo@redhat.com>
12917 * tree-dfa.c (get_expr_operands): Add a VUSE for the dereference of
12918 every pointer passed in a function call.
12919 Move code to add an operand for the base pointer of an
12921 (add_stmt_operand): ... here.
12922 Add a VUSE for the base pointer of every INDIRECT_REF variable.
12923 (find_may_aliases_for): Fix starting index for the loop that scans
12924 INDIRECT_REFs for aliasing.
12925 Factor code that marks two variables aliased into
12926 register_new_alias.
12927 (register_new_alias): New function.
12928 (may_alias_p): Handle aliasing of structure fields.
12929 (add_may_alias): Fix documentation.
12930 (find_vars_r): Factor code that adds a new referenced variable into
12931 add_referenced_var.
12932 (add_referenced_var): New function.
12933 (add_indirect_ref_var): New function.
12934 (get_virtual_var): Handle variables wrapped in SSA_NAMEs.
12935 (set_may_alias_global_mem): Move from ...
12936 * tree-flow-inline.h: ... here.
12938 * tree-ssa-dce.c (need_to_preserve_store): CALL_EXPRs are
12939 implicitly live. VA_ARG_EXPRs are not.
12942 * tree.h (SSA_NAME_VAR): Rename from SSA_NAME_DECL. Update all
12944 (struct tree_ssa_name): Rename field 'decl' to 'var'. Update all
12946 (SSA_DECL_P): Accept only VAR_DECLs and PARM_DECLs possibly wrapped
12947 inside an SSA_NAME node.
12948 (SSA_VAR_P): Also accept SSA_NAME nodes.
12950 2003-02-01 Daniel Berlin <dberlin@dberlin.org>
12952 * Makefile.in (tree-ssa-pre2.o): Remove accidental addition.
12954 2003-01-31 Diego Novillo <dnovillo@redhat.com>
12956 * tree-cfg.c (find_taken_edge_cond_expr): New function.
12957 (find_taken_edge_switch_expr): New function.
12958 (value_matches_some_label): New function.
12959 (find_taken_edge): Re-structure to use the three new functions.
12961 2003-01-30 Jason Merrill <jason@redhat.com>
12963 * gimplify.c (simplify_function_tree): Set TREE_SIDE_EFFECTS on
12964 the BIND_EXPR wrapper.
12966 2003-01-30 Diego Novillo <dnovillo@redhat.com>
12968 * tree-dfa.c (call_may_clobber): New function.
12969 (get_expr_operands): Call it.
12970 (find_vars_r): Call it.
12972 2003-01-30 Jeff Law <law@redhat.com>
12974 * tree-dfa.c (struct alias_tags): New. Collector for key information
12975 regarding alias tags.
12976 (indirect_refs_base, indirect_refs_alias_set): New varrays.
12977 (addressable_vars_base, addressable_vars_alias_set): Likewise.
12978 (compute_may_aliases): Initialize and finalize the new varrays.
12979 Update allocation of alias tags information.
12980 (find_may_aliases_for): Extract base symbols and alias set
12981 information for V1 and V2 from the virtual arrays and store
12982 them into local variables. Pass them as necessary to
12983 may_alias_p, may_access_global_mem, find_alias_tag. Add base
12984 symbol and alias set when creating a new alias tag.
12985 (find_vars_r): Fill in new varrays as needed.
12986 (may_alias_p): Add new arguments for base and alias set of the
12987 two origianl incoming arguments. No longer call get_base_symbol
12989 (find_alias_tag, may_access_global_mem): Similarly.
12990 (add_stmt_operand): Update to pass additional argument to
12991 may_access_global_mem.
12992 (dump_alias_info): Update to deal with new alias tag structure.
12993 * tree-flow.h (may_alias_p): Update prototype with new arguments.
12994 * tree-ssa-pre.c (process_left_occs_and_kills): Update to pass
12995 new arguments to may_alias_p.
12997 2003-01-30 Daniel Berlin <dberlin@dberlin.org>
12999 Remove all traces of steensgaard's algorithm.
13000 * tree-alias-steen.c: Removed.
13001 * tree-alias-steen.h: Ditto.
13002 * tree-alias-ecr.c: Ditto.
13003 * tree-alias-ecr.h: Ditto.
13004 * disjoint-set.c: Ditto.
13005 * disjoint-set.h: Ditto.
13006 * Makefile.in: Remove removed files.
13007 * c-config-lang.in: Ditto.
13008 * gengtype.c: Ditto.
13009 * tree-alias-common.c: Don't use steen_alias_ops anymore.
13010 * toplev.c: Remove help text and steen option.
13011 * tree-alias-common.h: Remove PTA_STEEN.
13012 * tree-alias-type.c: Remove all steensgaard related types and
13014 * tree-alias-type.h: Ditto.
13016 2003-01-30 Diego Novillo <dnovillo@redhat.com>
13018 * tree-cfg.c (struct cfg_stats_d): New.
13019 (cfg_stats): New file local.
13020 (build_tree_cfg): Start TV_TREE_CFG timer before allocating memory.
13021 Initialize cfg_stats.
13022 (make_blocks): Count coalesced label blocks.
13023 (dump_tree_cfg): Call dump_cfg_stats if TDF_STATS is enabled.
13024 (dump_cfg_stats): New.
13025 (debug_cfg_stats): New.
13027 * tree-dfa.c (SCALE, LABEL, PERCENT): Move ...
13028 * tree-flow.h: ... here
13030 2003-01-29 Diego Novillo <dnovillo@redhat.com>
13032 * tree-cfg.c (make_blocks): Do not start a new block if the
13033 previous statement and the current statement are labels of the same
13036 2003-01-29 Diego Novillo <dnovillo@redhat.com>
13038 * tree-cfg.c (parent_array): Make file local.
13039 (label_to_block_map): New file local variable.
13040 (build_tree_cfg): Initialize label_to_block_map.
13041 (make_edges): Don't pre-scan all the blocks looking for blocks with
13043 (make_exit_edges): Remove argument label_to_block_map. Update all
13045 (make_goto_expr_edges): Likewise.
13046 (dump_tree_bb): Check that the block has a valid annotation.
13047 (set_bb_for_stmt): If the statement is a label, add the label to
13048 the label_to_block_map.
13050 * tree-pretty-print.c (dump_vops): Check that the block has a valid
13053 2003-01-29 Jeff Law <law@redhat.com>
13055 * tree-dfa.c (find_may_aliases_for): Just accept the index of
13056 the current indirect_ref. Caller updated.
13057 (num_indirect_refs, num_addressable_vars): New variables.
13058 (indirect_refs, addressable_vars): New varrays.
13059 (dump_dfa_status): Dump info on the indirect refs and
13061 (dump_alias_info): Similarly.
13062 (compute_may_aliases): Initialize and finalize the new virtual
13063 arrays and hash tables for indirect refs and addressable vars.
13064 Include setup/teardown in the cost for alias analysis.
13065 (find_may_aliases_for): Split main loop into two. The first
13066 walks over the indirect refs and takes advantage of the
13067 symmetric properties of the aliasing relationship to avoid
13068 useless work. The second loop iterates over the addressable
13070 (find_vars_r): Rework to build all three arrays we need.
13072 2003-01-29 Andreas Jaeger <aj@suse.de>
13074 * tree-alias-common.c (find_func_aliases): Remove unused variable.
13075 (display_points_to_set_helper): #if 0 function to avoid warning
13076 about unused function.
13078 * tree-alias-ecr.c (ECR_new): Remove ISO C style function
13080 * disjoint-set.c (disjoint_set_new): Likewise.
13082 2003-01-29 Frank Ch. Eigler <fche@redhat.com>
13084 * tree-mudflap.c (mx_xfn_indirect_ref): Use a stack of flags for
13085 tracking pointer dereference reads vs writes.
13086 (mf_build_check_statement_for): Pass access-type value to __mf_check.
13087 * c-mudflap.c (mflang_register_call): Adapt to mf-runtime.h API change.
13089 2003-01-29 Diego Novillo <dnovillo@redhat.com>
13091 * Makefile.in (ssa.o): Add dependency on $(TIMEVAR_H).
13092 * timevar.def (TV_DOM_FRONTIERS): Define.
13093 * ssa.c (compute_dominance_frontiers): Use.
13095 2003-01-29 Diego Novillo <dnovillo@redhat.com>
13097 * tree-ssa-dce.c (remove_dead_stmt): Fix uninitialized use
13100 2003-01-28 Diego Novillo <dnovillo@redhat.com>
13102 * timevar.def (TV_TREE_SSA_REWRITE_BLOCKS): Adjust legend.
13103 * tree-ssa.c (rewrite_into_ssa): Use TV_TREE_SSA_REWRITE_BLOCKS.
13104 (mark_def_sites): Add comment.
13106 2003-01-28 Jeff Law <law@redhat.com>
13108 * ssa.c (compute_dominance_frontiers_1): Use get_dominated_by
13109 to avoid useless walks over all the basic blocks. Use cache
13110 of immediate dominators to avoid silly calls to get_immediate_dominator.
13111 Do not clear elements of the frontiers bitmap.
13112 (compute_dominance_frontiers): Compute cache of immediate
13113 dominators and pass it to compute_dominance_frontiers_1. Clear
13114 the entire vector of frontiers bitmaps.
13116 * timevar.def (TV_TREE_SSA_REWRITE_BLOCKS): Renamed from
13118 (TV_TREE_SSA_OTHER): New timevar.
13119 * tree-ssa.c (rewrite_into_ssa): Updated. Use new TV_TREE_SSA_OTHER
13122 * tree.h (LABEL_DECL_INDEX): Define for use by CFG builder.
13123 * tree-cfg.c (make_exit_edges): Accept and pass though label to
13124 block mapping array.
13125 (make_goto_expr_edges): For simple gotos, lookup the destination
13126 in the label to block mapping array. Zap old slow code to
13127 handle simple gotos.
13128 (make_edges): Build the label to block mapping array.
13130 * tree.h (PHI_NODE_ELT_CHECK): Provide version when ENABLE_CHECKING
13133 2003-01-28 Diego Novillo <dnovillo@redhat.com>
13135 * tree-flow-inline.h (parent_block, set_parent_block, phi_nodes):
13136 Assume that blocks always have valid annotations.
13137 (add_dom_child): New function.
13138 (dominator_children): New function.
13140 * tree-flow.h (struct bb_ann_d): Add field 'dom_children'.
13142 * tree-ssa.c (mark_def_sites): Add parameter 'idom'.
13143 Add each block BB to the set of dominator children of BB's
13144 immediate dominator.
13145 (rewrite_block): Remove 'idom' parameter.
13146 Recurse into blocks set in the dominator children bitmap.
13148 2003-01-28 Diego Novillo <dnovillo@redhat.com>
13150 * flags.h (flag_disable_tree_ssa): New flag.
13151 * c-decl.c (c_expand_body): Use it.
13152 * toplev.c: Declare it.
13153 (f_options): Add help text for -fdisable-tree-ssa.
13154 * doc/invoke.texi: Add documentation for -fdisable-tree-ssa.
13156 2003-01-28 Diego Novillo <dnovillo@redhat.com>
13158 * Makefile.in (TREE_FLOW_H): Add dependency on $(HASHTAB_H)
13159 (OBJS): Temporarily remove tree-ssa-pre.o.
13160 (tree-ssa.o, c-decl.o): Add dependency on $(TREE_DUMP_H).
13162 * c-decl.c: Include tree-dump.h
13164 * c-pretty-print.c (dump_c_node): Fix rendering of GOTO_STMTs to
13165 computed locations.
13166 (op_prio): Don't abort on unknown operators.
13168 * c-simplify.c (mostly_copy_tree_r): Don't copy statement
13171 * gimplify.c (simplify_addr_expr): Mark the RHS of the simplified
13172 ADDR_EXPR addressable.
13173 (mostly_copy_tree_r): Don't copy statement annotations.
13175 * old-tree-inline.c (walk_tree): Handle SSA_NAME nodes.
13177 * timevar.def (TV_TREE_RDEFS): Remove.
13178 (TV_TREE_BUILD_SSA): Define.
13179 (TV_TREE_DFA): Define.
13181 * tree-cfg.c: Update copyright notices.
13182 Remove doxygen markers everywhere.
13183 (remove_unreachable_block): New local function
13184 (remove_unreachable_blocks): Call it.
13185 (remove_bb): Rename from remove_tree_bb. Update all callers.
13186 (validate_loops): Remove unused function.
13187 (block_invalidates_loop): Remove unused function.
13188 (remove_stmt): Invalidate the defining statement of all the
13189 definitions made by the statement.
13190 Remove the annotation before replacing the statement with
13193 * tree-dfa.c: Update copyright notices.
13194 Remove doxygen markers everywhere.
13195 (struct clobber_data_d): Remove existing fields. Add fields 'stmt'
13196 and 'prev_vops'. Update all users.
13197 (alias_tags): Rename from alias_leaders.
13198 (num_alias_tags): Rename from num_alias_leaders.
13199 (struct dfa_stats_d): Declare.
13200 (struct dfa_counts_d): Remove. Update all users.
13201 (TRM_*): Remove. Update all users.
13202 (find_tree_refs): Remove. Update all users.
13203 (get_stmt_operands): Rename from find_refs_in_stmt. Update all users.
13204 (get_expr_operands): Rename from find_refs_in_expr. Update all users.
13205 (add_stmt_operand): New function.
13206 (set_def): New function.
13207 (add_use): New function.
13208 (add_vdef): New function.
13209 (add_vuse): New function.
13210 (create_phi_node): New function.
13211 (copy_stmt): New function.
13212 (compute_immediate_uses): New function.
13213 (compute_immediate_uses_for): New function.
13214 (compute_reached_uses): New function.
13215 (compute_reaching_defs): New function.
13216 (add_immediate_use): New function.
13217 (create_var_ann): New function.
13218 (create_stmt_ann): New function.
13219 (dump_immediate_uses): New function.
13220 (debug_immediate_uses): New function.
13221 (dump_immediate_uses_for): New function.
13222 (debug_immediate_uses_for): New function.
13223 (create_ref_list, empty_ref_list, add_ref_to_list_begin,
13224 add_ref_to_list_end, add_list_to_list_begin, add_list_to_list_end,
13225 find_list_node, rli_start, rli_start_last, rli_start_at,
13226 rli_delete, add_ref_to_list_after, tree_ref_size, create_ref,
13227 add_ephi_arg, add_referenced_var, replace_ref_with,
13228 try_replace_ref_with, replace_ref_r, replace_ref_stmt_with,
13229 remove_ref, remove_def, reset_def_def_links, replace_phi_arg_with,
13230 create_tree_ann, function_may_recurse_p, dump_ref, debug_ref,
13231 dump_ref_list, dump_ref_array, debug_ref_list, debug_ref_array,
13232 dump_phi_args, dump_if_different, count_tree_refs, ref_type_name,
13233 ref_defines, is_killing_def, tree_ref_structure, output_ref):
13234 Remove. Update all users.
13235 (dump_referenced_vars): Remove parameter 'details'. Update all
13237 (dump_variable): Don't abort if the variable is nil. Display all
13238 the aliases for the variable.
13239 (dump_dfa_stats): Handle new counters.
13240 (collect_dfa_stats): Likewise.
13241 (collect_dfa_stats_r): Likewise.
13242 (find_vars_r): New function.
13243 (compute_may_aliases): Call it via walk_tree before computing aliases.
13244 Only use alias tags if -ftree-points-to is not given.
13245 Call add_may_alias.
13246 (find_may_aliases_for): Only use alias tags if -ftree-points-to is
13248 (add_may_alias): New function.
13249 (find_alias_tag): Rename from find_alias_leader.
13250 (dump_alias_info): New function.
13251 (debug_alias_info): New function.
13252 (htab_hash_var): New function.
13253 (htab_var_eq): New function.
13254 (get_virtual_var): New function.
13256 * tree-dump.c (struct dump_option_value_info): Rename -block to
13257 -blocks. Add new option -vops.
13258 (dump_function): Don't display which pass enabled the dump.
13260 * tree-flow-inline.h: Update copyright notices.
13261 (var_ann): New function.
13262 (stmt_ann): New function.
13263 (ann_type): New function.
13264 (bb_ann): Rename from bb_annotation.
13265 (may_aliases): New function.
13266 (set_may_alias_global_mem): New function.
13267 (may_alias_global_mem_p): New function.
13268 (set_indirect_ref): New function.
13269 (indirect_ref): New function.
13270 (is_dereferenced): New function.
13271 (modify_stmt): New function.
13272 (unmodify_stmt): New function.
13273 (stmt_modified_p): New function.
13274 (def_op): New function.
13275 (use_ops): New function.
13276 (vdef_ops): New function.
13277 (vuse_ops): New function.
13278 (immediate_uses): New function.
13279 (reaching_defs): New function.
13280 (phi_nodes): New function.
13281 (same_var_p): New function.
13282 (gsi_step_in_bb): Re-implement. Check if the iterator stepped out
13283 of the block by calling bb_for_stmt.
13284 (gsi_end_bb_p): Rename from gsi_end_bb. Update all users.
13285 Call gsi_stmt to determine if the iterator has reached the end of
13287 (ref_id, ref_type, ref_bb, ref_stmt, ref_var, imm_uses,
13288 reached_uses, imm_reaching_def, set_imm_reaching_def,
13289 set_phi_arg_def, phi_arg_def, set_phi_arg_edge, phi_arg_edge,
13290 reaching_defs, phi_args, num_phi_args, phi_arg, set_phi_arg,
13291 tree_annotation, tree_refs, add_tree_ref, remove_tree_ref,
13292 alias_leader, set_alias_leader, set_tree_flag, clear_tree_flag,
13293 reset_tree_flags, tree_flags, indirect_var, set_indirect_var,
13294 bb_refs, remove_bb_ref, set_exprref_class, exprref_class,
13295 set_exprref_inserted, exprref_inserted, set_exprref_save,
13296 exprref_save, set_exprref_reload, exprref_reload,
13297 set_exprref_processed, set_exprref_processed2, exprref_processed2i,
13298 exprref_uses, set_exprref_uses, set_expruse_def, expruse_def,
13299 set_expruse_phiop, expruse_phiop, set_expruse_phi, expruse_phi,
13300 set_expruse_has_real_use, expruse_has_real_use,
13301 set_exprphi_phi_args, exprphi_phi_args, num_ephi_args, ephi_arg,
13302 set_ephi_arg, set_exprphi_downsafe, exprphi_downsafe,
13303 set_exprphi_canbeavail, exprphi_canbeavail, set_exprphi_later,
13304 exprphi_later, set_exprphi_extraneous, exprphi_extraneous,
13305 exprphi_willbeavail, is_assignment_stmt, is_may_ref, is_may_def,
13306 is_may_use, is_partial_ref, is_partial_use, is_volatile_ref,
13307 is_volatile_def, is_volatile_use, is_clobbering_def,
13308 is_relocating_def, is_addressof_use, is_pure_use, is_pure_def,
13309 rli_after_end, rli_step, rli_step_rev, rli_ref, get_last_ref,
13310 get_first_ref, ref_list_is_empty): Remove. Update all users.
13312 * tree-flow.h: Update copyright notices.
13313 Remove doxygen markers.
13315 (enum tree_ann_type): New.
13316 (struct tree_ann_common_d): New.
13317 (struct var_ann_d): New.
13318 (struct operands_d): New.
13319 (struct voperands_d): New.
13320 (operands_t): New type.
13321 (voperands_t): New type.
13322 (struct dataflow_d): New.
13323 (dataflow_t): New type.
13324 (struct stmt_ann_d): New.
13325 (tree_ann): New type.
13326 (var_ann_t): New type.
13327 (stmt_ann_t): New type.
13328 (bb_ann_t): Rename from bb_ann.
13329 (enum tree_ref_type, TRM_*, struct ref_list_node, struct
13330 ref_list_priv, ref_list, struct tree_ref_common, struct var_ref_d,
13331 struct var_def_d, struct var_phi_d, struct var_use_d, struct
13332 phi_node_arg_d, phi_node_arg, struct expr_ref_common, struct
13333 expr_phi_d, struct expr_use_d, enum tree_ref_structure_enum, union
13334 tree_ref_d, tree_ref, struct tree_ann_d, tree_ann, enum tree_flags,
13335 struct dfa_counts_d, ref_list_iterator): Remove. Update all users.
13336 (TDFA_USE_OPS): Define.
13337 (TDFA_USE_VOPS): Define.
13339 * tree-inline.c (walk_tree): Handle SSA_NAME nodes.
13341 * tree-optimize.c: Update copyright notices.
13342 Remove doxygen markers.
13343 (optimize_function_tree): Temporarily disable call to
13344 tree_perform_ssapre.
13347 * tree-pretty-print.c (MASK_POINTER): Define.
13348 (dump_vops): New function.
13349 (dump_generic_node): Shorten made-up names for unnamed objects.
13350 Hanlde PHI_NODE, VDEF_EXPR and SSA_NAME nodes.
13351 Keep track of basic block transitions.
13352 Call dump_vops if -vops dump option is given.
13353 (op_prio): Don't abort if the operand is nil.
13354 (dump_block_info): Don't keep track of basic block transitions.
13356 * tree-simple.c: Update copyright notices.
13357 (get_base_symbol): Call STRIP_NOPS.
13358 Handle SSA_NAME nodes.
13360 * tree-simple.h: Update copyright notices.
13361 (gsi_end_p): Rename from gsi_end. Update all callers.
13363 * tree-ssa-ccp.c: Update copyright notices.
13364 Update code to use the new SSA infrastructure.
13365 (const_values): New hash table to keep track of constants.
13366 (struct value_map_d): New.
13367 (cfg_edges): Rename from edges. Update all users.
13368 (set_value): New function.
13369 (get_value): New function.
13370 (get_default_value): New function.
13371 (value_map_hash): New function.
13372 (value_map_eq): New function.
13374 * tree-ssa-dce.c: Update copyright notice.
13375 Update code to use new SSA infrastructure. Factor some code into
13377 (dom_info): Declare with file scope.
13378 (struct stmt_stats): Add fields 'total_phis' and 'removed_phis'.
13379 (needed_stmts): New hash table to keep track of needed statements.
13380 (stmt_useful_p): New function.
13381 (find_useful_stmts): Call it.
13382 (remove_dead_stmt, remove_dead_phis): New functions.
13383 (remove_dead_stmts): Call them.
13384 (need_to_preserve_store): Preserve stores to volatile variables.
13385 (tree_ssa_dce): Rename from tree_ssa_eliminate_dead_code. Update
13388 * tree-ssa.c: Update copyright notice.
13389 Change basic algorithm to rewrite the function into SSA form
13390 instead of building factored use-def chains.
13391 Include hashtab.h and tree-dump.h
13392 (next_ssa_version): New global variable.
13393 (def_blocks): New file local variable.
13394 (struct def_blocks_d): New.
13395 (currdefs): New file local variable.
13396 (struct currdef_d): New.
13397 (rewrite_into_ssa): Rename from build_tree_ssa. Update all users.
13398 Call compute_may_aliases, mark_def_sites and rewrite_block.
13399 (rewrite_block): Rename from search_fud_chains. Call
13401 (mark_def_sites): New function.
13402 (set_def_block): New function.
13403 (rewrite_stmts): New function.
13404 (rewrite_stmt): New function.
13405 (rewrite_operand): New function.
13406 (rewrite_out_of_ssa): New function.
13407 (remove_phi_node): New function.
13408 (register_new_def): New function.
13409 (def_blocks_free): New function.
13410 (def_blocks_hash): New function.
13411 (def_blocks_eq): New function.
13412 (currdef_hash): New function.
13413 (currdef_eq): New function.
13414 (debug_def_blocks): New function.
13415 (debug_def_blocks_r): New function.
13416 (build_fud_chains, compute_reaching_defs, follow_chain,
13417 dump_reaching_defs, debug_reaching_defs, set_ssa_links): Remove.
13418 (remove_phi_arg): Rename from tree_ssa_remove_phi_alternative.
13420 (init_tree_ssa): Set next_ssa_version to 1.
13421 Create hash tables def_blocks and currdefs.
13422 (delete_tree_ssa): Accept a FUNCTION_DECL tree as argument. Update
13424 (currdef_for): Add new parameter 'create_default'. If nonzero,
13425 create a new SSA name if none is found for the variable.
13426 (set_currdef_for): Search in the currdefs hash table.
13428 * tree.c (tree_node_kind): Add new values phi_kind and
13430 (tree_node_kind_names): Likewise.
13431 (tree_size): Handle PHI_NODE and SSA_NAME nodes.
13432 (make_node): Likewise.
13433 (tree_node_structure): Likewise.
13434 (phi_node_elt_check_failed): New function.
13435 (make_phi_node): New function.
13436 (make_ssa_name): New function.
13437 (build_vdef_expr): New function.
13439 * tree.def (SSA_NAME): New code.
13440 (VDEF_EXPR): New code.
13441 (PHI_NODE): New code.
13443 * tree.h (union tree_ann_d): Forward declare.
13444 (struct tree_common): Change type of field 'ann'.
13445 (PHI_NODE_ELT_CHECK): Define.
13446 (phi_node_elt_check_failed): Declare.
13447 (VDEF_RESULT): Define.
13449 (SSA_NAME_DECL): Define.
13450 (SSA_NAME_DEF_STMT): Define.
13451 (SSA_NAME_VERSION): Define.
13452 (struct tree_ssa_name): New.
13453 (PHI_RESULT): Define.
13454 (PHI_NUM_ARGS): Define.
13455 (PHI_ARG_CAPACITY): Define.
13456 (PHI_ARG_ELT): Define.
13457 (PHI_ARG_EDGE): Define.
13458 (PHI_ARG_DEF): Define.
13459 (struct phi_arg_d): New.
13460 (struct tree_phi_node): New.
13461 (SSA_DECL_P): Define.
13462 (SSA_VAR_P): Define.
13463 (enum tree_node_structure_enum): Add values TS_SSA_NAME and
13465 (union tree_node): Add fields 'ssa_name' and 'phi'.
13466 (make_phi_node): Declare.
13467 (make_ssa_name): Declare.
13468 (build_vdef_expr): Declare.
13469 (TDF_BLOCKS): Rename from TDF_BLOCK.
13470 (TDF_VOPS): Define.
13472 * doc/invoke.texi: Document new tree dump option -vops. Update
13473 documentation for switch -blocks.
13475 2003-01-27 Jeff Law <law@redhat.com>
13477 * gimplify.c (simplify_return_expr): Correctly handle return
13478 expressions with side effects in functions returning void.
13480 * tree-ssa-ccp.c (widen_bitfield): Do not try to widen anything
13481 except constant integers.
13483 2003-01-26 Jeff Law <law@redhat.com>
13485 * c-simplify.c (simplify_decl_stmt): Fix comment typo.
13486 Use correct predicate when "simplifying" a static initializer.
13488 2003-01-26 Andreas Jaeger <aj@suse.de>
13490 * Makefile.in (gt-dependence.h): New rule.
13492 2003-01-23 Jeff Law <law@redhat.com>
13494 * c-simplify.c (simplify_decl_stmt): Arrange to examine initializers
13495 for static variables.
13496 * gimplify.c (simplify_constructor): Kill initial is_simple_constructor
13498 (simplify_modify_expr): Get the type from the destination rather than
13499 the toplevel expression. Handle case where type is ARRAY_TYPE. Ignore
13500 TREE_STATIC for the RHS.
13502 2003-01-24 Frank Ch. Eigler <fche@redhat.com>
13504 * tree-mudflap.c (mf_varname_tree): Check for non-NULL DECL_NAME
13505 before trying to cplus_demangle it.
13507 2003-01-23 Jeff Law <law@redhat.com>
13509 * tree-cfg.c (make_exit_edges): Fix thinkos.
13511 2003-01-22 Jeff Law <law@redhat.com>
13513 * tree-cfg.c (make_goto_expr_edges): Check the underlying
13514 LABEL_DECL, not the LABEL_EXPR for FORCED_LABEL and NONLOCAL_LABEL.
13516 * gimplify.c (simplify_expr, case GOTO_EXPR): Identify and mark
13517 labels which are targets of nonlocal gotos and mark functions which
13518 have labels which are targets of nonlocal gotos.
13519 (simplify_expr, case LABEL_DECL): New case. Mark labels which
13520 have their address taken.
13521 * tree-cfg.c (is_nonlocal_label_block): Remove. All callers
13523 (make_exit_edges, case GOTO_EXPR): Handle computed gotos sanely.
13524 (make_exit_edges, case CALL_EXPR): Handle abnormal edges from
13525 nonlocal gotos at call sites.
13526 (make_exit_edges, case RETURN_EXPR): Likewise.
13527 (make_exit_edges, case MODIFY_EXPR): New case to handle abnormal
13528 edges from nonlocal gotos as call sites.
13529 (make_goto_expr_edges): Handle computed gotos and nonlocal gotos.
13530 (is_ctrl_altering_stmt): Handle abnormal edges in CALL_EXPRs
13531 functions which receive nonlocal gotos. Similarly for CALL_EXPRs
13532 which occur on the RHS of a MODIFY_EXPR.
13533 * tree.h (FORCED_LABEL, NONLOCAL_LABEL): New defines.
13534 (FUNCTION_RECEIVES_NONLOCAL_GOTO): Likewise.
13536 2003-01-22 Frank Ch. Eigler <fche@redhat.com>
13538 * doc/invoke.texi: Provide some information about -fmudflap.
13540 * tree-mudflap.c (mf_varname_tree): Conditionally invoke the C++
13541 demangler in libiberty. Reduce function printing verbosity.
13542 (mf_file_function_line_tree): Reduce function printing verbosity.
13543 (mudflap_enqueue_decl): Use COMPLETE_TYPE_P to avoid trying to
13544 register (get size of) void-typed objects.
13546 2003-01-21 Jose Renau <renau@uiuc.edu>
13548 * tree-flow-inline.h (get_lineno): Return -1 for nodes without
13550 (get_filename): Return "???" for nodes without locus information.
13552 2003-01-21 Jeff Law <law@redhat.com>
13554 * tree-cfg.c (cleanup_switch_expr_graph): Wrap declaration of
13555 switch_expr with ENABLE_CHECKING block.
13557 * c-simplify.c (is_last_stmt_of_scope): Wrap definition and
13558 declaration inside and ENABLE_CHECKING block.
13560 2003-01-20 Frank Ch. Eigler <fche@redhat.com>
13562 * tree-mudflap.c (mx_xfn_indirect_ref): Use new TREE_LOCUS field
13563 as a predicate for finding TREE_FILENAME etc.
13565 2003-01-16 Daniel Berlin <dan@dberlin.org>
13567 * Remove dead PRE code.
13568 * tree-ssa-pre.c (tree_perform_ssapre): Collect left occurrences and
13569 kills *after* finishing collecting all expressions.
13571 2003-01-15 Jeff Law <law@redhat.com>
13573 * Death to WFL nodes.
13574 * c-aux-info.c: Replace DECL_SOURCE_FILE and DECL_SOURCE_LINE with
13575 TREE_FILENAME and TREE_LINENO respectively when retrieving file
13576 and line information. Use TREE_LOCUS to copy existing information
13577 from one node to another. Use annotate_with_file_line to add or
13578 replace location information on a node. Remove support for
13579 EXPR_WITH_FILE_LOCATION nodes. Remove STRIP_WFL statements.
13580 * c-common.c, c-parse.in, c-pretty-print.c, dbxout.c: Likewise.
13581 * diagnostic.c, dwarf2out.c, dwarfout.c: Likewise.
13582 * except.c, integrate.c, stmt.c, tree-alias-common.c: Likewise.
13583 * tree-cfg.c, tree-dfa.c, tree-dump.c, tree-flow-inline.h: Likewise.
13584 * tree-mudflap.c, tree-pretty-print.c, tree-simple.c: Likewise.
13585 * tree-ssa-ccp.c, tree-ssa-dce.c, tree-ssa-pre.c: Likewise.
13586 * varasm.c, xcoffout.c: Likewise.
13587 * config/alpha/alpha.c: Likewise.
13588 * config/mips/mips.c: Likewise.
13589 * c-decl.c: Likewise.
13590 (duplicate_decls): Also copy TREE_LOCUS from olddecl to newdecl.
13591 (finish_function): Save and restore the current filename and
13592 linenumber around genericizing of the function tree.
13593 * c-simplify.c (c_simplify_stmt): Use annotate_all_with_file_line
13594 instead of wrap_all_with_wfl. Remove STRIP_WFL statements.
13595 * expr.c (expand_expr): Emit line number notes for expressions
13596 with attached file/line information. Remove EXPR_WITH_FILE_LOCATION
13598 * gimplify.c: Kill STRIP_WFL statements. Remove EXPR_WITH_FILE_LOCATION
13600 (simplify_expr_wfl): Kill.
13601 (annotate_stmt_with_file_line): Renamed from wrap_with_wfl.
13602 (annotate_all_with_file_line): Renamed from wrap_all_with_wfl.
13603 (simplify_expr): Save and restore the current file/line around
13604 simplification of the given expression. Add annotation to more
13605 nodes created during simplification.
13606 (simplify_self_mod_expr): Add file/line location to nodes we create.
13607 (get_initialized_tmp_var): Similarly.
13608 * old-tree-inline.c (expand_call_inline): Use annotate_with_file_line
13609 to add file/line information to nodes instead of wrapping them
13610 with EXPR_WITH_FILE_LOCATION nodes.
13611 * print-tree.c: Use TREE_FILENAME and TREE_LINENO instead of
13612 DECL_SOURCE_FILE and DECL_SOURCE_LINE respectively. Remove
13613 support for EXPR_WITH_FILE_LOCATION nodes.
13614 (print_node): Dump any file/line information that is attached to
13616 * tree-inline.c (walk_tree): Set lineno appropriately.
13617 * tree-simple.h (annotate_all_with_file_line): Renamed from
13618 wrap_all_with_wfl. Remove STRIP_WFL statements.
13619 * tree.c (build_expr_wfl): Kill.
13620 (make_node): Use annotate_with_file_line.
13621 (annotate_with_file_line): New function.
13622 * tree.def: Remove EXPR_WITH_FILE_LOCATION.
13623 * tree.h (tree_common): Add locus field. Remove references to
13624 EXPR_WITH_FILE_LOCATION.
13625 (tree_decl): Remove locus field.
13626 (STRIP_WFL, EXPR_WFL_*): Kill.
13627 (DECL_SOURCE_LOCATION, DECL_SOURCE_FILE, DECL_SOURCE_LINE): Kill.
13628 (TREE_LOCUS, TREE_FILENAME, TREE_LINENO): new.
13629 (annotate_with_file_line): Renamed from build_expr_wfl.
13631 * objc/objc-act.c: Use TREE_FILENAME and TREE_LINENO to
13632 extract file/line information from tree nodes.
13634 2003-01-14 Frank Ch. Eigler <fche@redhat.com>
13636 * tree-mudflap.c (mx_xfn_indirect_ref): Handle ARRAY_REF of
13637 a COMPONENT_REF specially to avoid unnecessary checks.
13639 2003-01-13 Frank Ch. Eigler <fche@redhat.com>
13641 Front-end generalization.
13642 * Makefile.in (C_AND_OBJC_OBJS): Add c-mudflap.o and dependencies.
13643 * tree-mudflap.c: Don't include "c-tree.h" any more.
13644 (mf_init_extern_trees): Divert to mflang_lookup_decl().
13645 (mf_enqueue_register_call, mf_flush_enqueued_calls): Move and rename
13647 * tree-mudflap.h: Declare new mflang_* routines.
13648 * c-mudflap.c: New file with C front-end mflang_* routines.
13649 * tree-nomudflap.c (*): Call internal_error instead of abort.
13651 2003-01-07 Steven Bosscher <s.bosscher@student.tudelft.nl>
13653 * Makefile.in (check-g95): New test target.
13654 (check-f95): Alias for check-g95.
13656 2003-01-07 Diego Novillo <dnovillo@redhat.com>
13658 * tree-dump.c (dump_function_to_file): New function.
13659 (dump_function): Call it.
13660 Convert argument declaration to K&R format.
13661 * tree-dump.h: Include splay-tree.h.
13662 (dump_function_to_file): Declare.
13664 * tree-optimize.c (optimize_function_tree): Remove unused variables
13665 dump_file and dump_flags.
13666 (dump_current_function): Remove. Update all users by calling
13667 dump_function instead.
13668 * tree.h (dump_current_function): Remove declaration.
13670 * Makefile.in (TREE_DUMP_H): Define.
13671 Update targets depending on tree-dump.h to depend on $(TREE_DUMP_H).
13672 (tree-ssa-cp.o): Remove unused target.
13673 (tree-cfg.o): Add dependency on $(TREE_DUMP_H).
13674 (tree-optimize.o): Likewise.
13675 (tree-ssa-dce.o): Likewise.
13676 (tree-ssa-ccp.o): Likewise.
13677 (tree-ssa-pre.o): Likewise.
13679 2003-01-02 Daniel Berlin <dberlin@dberlin.org>
13681 * tree-ssa-pre.c (rename_2): Fix a false matching condition.
13682 This is actually fallout from is_default_def change.
13684 2003-01-02 Jason Merrill <jason@redhat.com>
13686 * c-simplify.c (c_genericize): Dump more info about the function.
13688 * tree-dump.c (dump_function): Move from cp/optimize.c.
13689 * tree-dump.h: Declare it.
13691 * gimplify.c (mostly_copy_tree_r): Remove unnecessary cases.
13692 (unshare_expr): New fn.
13693 * tree-inline.c (mark_local_for_remap_r, unsave_r): New fns, adapted
13695 (lhd_unsave_expr_now): Likewise.
13696 * tree.c (unsave_expr_now): Remove.
13697 (unsafe_for_reeval): Labels and BIND_EXPRs are only somewhat unsafe.
13699 * gimplify.c (simplify_function_tree): Add an outer BIND_EXPR if
13701 (voidify_wrapper_expr): Not static. Abort if we try to voidify an
13702 expression with TREE_ADDRESSABLE type. Be clever with INDIRECT_REFs.
13703 (foreach_stmt): Avoid redundant work.
13704 (create_tmp_var): Abort if we try to create a temp of ADDRESSABLE type.
13705 (simplify_expr): Simplify VTABLE_REF.
13706 * c-simplify.c (simplify_decl_stmt): Ignore DECL_EXTERNAL decls.
13707 (simplify_stmt_expr): Fix thinko.
13708 (simplify_block): Don't ignore partial scopes.
13709 (simplify_condition): New fn.
13710 (simplify_c_loop, simplify_if_stmt, simplify_switch_stmt): Call it.
13711 * expr.c (expand_expr) [BIND_EXPR]: Handle statics better.
13712 * tree-inline.c (remap_decl): Remap all decls.
13713 (declare_return_variable): Be clever with INDIRECT_REFs.
13714 (expand_call_inline): If we have an explicit return slot, the inlined
13716 (walk_tree): Fix type handling.
13717 (copy_tree_r): Don't walk into decls.
13718 * tree-simple.c (is_simple_unary_expr): Handle VTABLE_REF.
13719 (is_simple_id): Allow RESULT_DECL.
13720 * tree-simple.h (gsi_stmt): Strip WFLs and NOPs.
13722 * gimplify.c (simplify_cond_expr): Handle void arms. Add target parm.
13723 (simplify_modify_expr): Pass it. Add special handling for COND_EXPR
13724 and CONSTRUCTOR (from Daniel Berlin). Add want_value parm.
13725 (simplify_expr): Pass new args. Loop sooner if language-specific
13726 simplification happened.
13727 (simplify_return_expr): Pass the whole MODIFY_EXPR to simplify_expr.
13728 (simplify_target_expr): Simplify.
13730 * tree.def (CATCH_EXPR, EH_FILTER_EXPR): New tree codes.
13731 * except.c (expand_eh_handler): New fn.
13732 (expand_eh_region_end_allowed): If no types are allowed, hand off to
13733 expand_eh_region_end_must_not_throw.
13734 * except.h: Declare expand_eh_handler.
13735 * expr.c (expand_expr) [TRY_CATCH_EXPR]: Use it.
13736 [CATCH_EXPR, EH_FILTER_EXPR]: New cases.
13737 * gimplify.c (simplify_expr) [EXC_PTR_EXPR, CATCH_EXPR,
13738 EH_FILTER_EXPR]: New cases.
13739 (gimple_build_eh_filter): New fn.
13740 (maybe_protect_cleanup): New fn.
13741 (gimple_push_cleanup): Call it.
13742 (simplify_cleanup_point_expr): Fix thinko.
13743 * c-simplify.c (simplify_cleanup): Call it.
13744 * tree-simple.h: Declare it.
13745 * Makefile.in (gimplify.o): Depend on except.h.
13746 * tree.h (CATCH_TYPES, CATCH_BODY): New macros.
13747 (EH_FILTER_TYPES, EH_FILTER_FAILURE): New macros.
13748 * tree-simple.c (is_simple_id): Allow EXC_PTR_EXPR.
13749 * c-pretty-print.c (dump_c_node) [CLEANUP_POINT_EXPR]: Support.
13750 * tree-pretty-print.c (dump_generic_node): Likewise.
13751 [CATCH_EXPR, EH_FILTER_EXPR, EXC_PTR_EXPR]: Support.
13753 * c-pretty-print.c (NIY): Print operands.
13754 (dump_c_tree): Don't look at TREE_CHAIN if it doesn't matter.
13755 (dump_c_node) [ARRAY_TYPE]: Handle non-constant array bounds.
13756 [CALL_EXPR]: Pass spc down.
13757 [VTABLE_REF]: Support.
13758 (op_prio) [TARGET_EXPR]: Support.
13759 (print_call_name): Handle function pointers.
13760 * tree-pretty-print.c: Likewise.
13762 2002-12-31 Steven Bosscher <s.bosscher@student.tudelft.nl>
13764 * gimplify.c (create_tmp_var_noc): Remove unused function.
13765 * tree-simple.h: Kill prototype.
13767 2002-12-30 Diego Novillo <dnovillo@redhat.com>
13769 * tree-flow.h (tree_find_loops): Remove unused declaration.
13771 2002-12-29 Daniel Berlin <dberlin@dberlin.org>
13773 * toplev.c: Add flag_ip, enable by default at -O4+ (This is not
13774 set in stone, and thus, not documented).
13775 (decode_f_option): Add warning if andersen's PTA is selected but
13778 * flags.h: Add flag_ip.
13780 * tree-alias-ander.c: Fix todo.
13781 (andersen_function_call): Return 1 if we don't need to process
13783 (ptset_map): New map, cache points-to sets.
13784 (andersen_op): We can do IP on all statics without help.
13785 (andersen_init): Only init once if we are doing ip analysis.
13786 (andersen_cleanup): Don't cleanup if we need the info for ip.
13787 (andersen_add_var): Clear points-to set if it exists already.
13788 (andersen_add_var_same): Ditto.
13789 (andersen_function_call): We can do interprocedural analysis on
13791 (andersen_may_alias): Cache points-to sets.
13793 * c-decl.c (c_expand_body): Don't throw away tree if flag_ip is
13794 on, even if they are uninlinable, they may be wanted for ip
13797 * tree-alias-common.c (get_values_from_constructor): New
13798 function to collect alias_typevars from constructors.
13799 (alias_annot): Fix where the GTY is so gengtype picks it up.
13800 (intra_function_call): Ignore non-pointers for global var
13801 assignment. What arguments point to can now point to a global var
13803 (find_func_aliases): We need to handle decl's with initials as
13805 Only call intra_function_call if we have to.
13806 Handle constructors.
13807 (create_fun_alias_var): Incoming pointer arguments could be
13808 pointing to a global var, unless this is a static function and we
13809 are doing interprocedural analysis.
13810 (create_alias_vars): Take an fndecl argument, and use it.
13811 (init_alias_vars): Handle ip_partial as well.
13812 (ptr_may_alias_var): Simplify, fix.
13814 * tree-alias-common.h (tree_alias_ops): function_call now returns
13815 an int, and we have an extra member named ip_partial.
13817 * tree-alias-steen.c (steen_ops): We can't do ip_partial.
13818 (steen_function_call): Update definition and return 1.
13820 * tree-dfa.c (compute_may_aliases): Call create_alias_vars with
13821 current_function_decl.
13823 * tree-flow.h (create_alias_vars): Remove proto from here, it's
13824 in tree-alias-common.h.
13825 (tree_perform_ssapre): Take a tree, like the other optimizers.
13827 * tree-optimize.c (optimize_function_tree): Call
13828 tree_perform_ssapre with a tree.
13830 * tree-ssa-pre.c: Remove dead, #if 0'd code.
13831 (tree_perform_ssapre): Use passed in tree.
13833 2002-12-23 Frank Ch. Eigler <fche@redhat.com>
13835 * tree-mudflap.c (mf_decl_cache_locals, mf_decl_clear_locals): New
13837 (mudflap_c_function): Call them before/after basic transforms.
13838 (mf_cache_shift_decl_l, ..._mask_l): New variables to track local
13839 VAR_DECL shadows of cache parameters.
13840 (mf_build_check_statement_for): Use and update them.
13842 2002-12-23 Frank Ch. Eigler <fche@redhat.com>
13844 * tree-mudflap.c (mx_register_decls): Trust incoming TREE_ADDRESSABLE
13845 instead of own timetaking analysis.
13846 (mf_find_addrof, mx_xfn_find_addrof): Removed functions.
13848 2002-12-23 Steven Bosscher <s.bosscher@student.tudelft.nl>
13850 * tree-dfa.c: Add doxygen markers in comments.
13852 2002-12-22 Diego Novillo <dnovillo@redhat.com>
13854 * gimplify.c: Undo the following change:
13855 2002-12-11 Diego Novillo <dnovillo@redhat.com>
13856 * gimplify.c (simplify_return_expr): return statements should
13857 only have a GIMPLE value as argument.
13859 * tree-simple.c: Fix grammar for return statements.
13861 2002-12-20 Frank Ch. Eigler <fche@redhat.com>
13863 * tree-mudflap.c (mf_init_extern_trees): Rewrite last change
13864 without using statement-expressions.
13866 2002-12-19 Diego Novillo <dnovillo@redhat.com>
13868 * tree-cfg.c (build_tree_cfg): Make sure that TV_TREE_CFG
13869 is popped properly.
13871 2002-12-19 Frank Ch. Eigler <fche@redhat.com>
13873 * tree-mudflap.c (mf_init_extern_trees): Abort gracefully if
13874 <mf-runtime.h> was not included.
13875 (*): Correct some minor compiler warnings elsewhere.
13877 2002-12-18 Diego Novillo <dnovillo@redhat.com>
13879 * configure: Regenerate with autoconf 2.13.
13881 2002-12-17 Ben Elliston <bje@redhat.com>
13883 * tree-optimize.c (optimize_function_tree): Temporarily
13884 disable SSA optimizations if -fmudflap is present.
13886 2002-12-16 Ben Elliston <bje@redhat.com>
13888 * tree-mudflap.c (mx_flag): Assert that the tree node is valid.
13890 2002-12-14 Jason Merrill <jason@redhat.com>
13892 * tree-dump.c (dump_files): Add .generic. Move .inlined after it.
13893 * tree.h (tree_dump_index): Likewise.
13894 * c-simplify.c (c_genericize): Emit original and generic dumps here.
13895 * c-decl.c (c_expand_body): Not here.
13897 2002-12-13 Ben Elliston <bje@redhat.com>
13899 * tree-dfa.c (find_refs_in_expr): Terminate comment.
13901 2002-12-12 Steven Bosscher <s.bosscher@student.tudelft.nl>
13903 * tree-cfg.c: Update doxygen documentation.
13904 * tree-dfa.c: Add doxygen documentation.
13906 2002-12-11 Steven Bosscher <s.bosscher@student.tudelft.nl>
13908 * tree-cfg.c: Add doxygen markers in comments.
13909 * tree-optimize.c: Likewise.
13910 * tree-ssa.c: Likewise.
13912 2002-12-11 Diego Novillo <dnovillo@redhat.com>
13914 * gimplify.c (simplify_return_expr): return statements should only
13915 have a GIMPLE value as argument.
13916 * tree-cfg.c (call_expr_flags): New function.
13917 (is_ctrl_altering_stmt): Call it.
13918 * tree-flow.h (extern): Declare it.
13920 2002-12-06 Diego Novillo <dnovillo@redhat.com>
13922 * tree-cfg.c (make_goto_expr_edges): Temporary hack to prevent
13923 removing blocks with nonlocal labels.
13924 (is_nonlocal_label_block): Return true if DECL_NONLOCAL is set for
13927 * tree-dfa.c (alias_leaders): New local array.
13928 (num_alias_leaders): New local variable.
13929 (find_alias_leader): New local function.
13930 (may_access_global_mem): New local function.
13931 (find_may_aliases_for): Call them.
13932 (compute_may_aliases): Allocate and deallocate alias_leaders.
13933 Show alias information if -fdump-tree-...-alias flag is given.
13934 (may_alias_p): Return true if both variables are the same.
13935 (find_refs_in_expr): Strip WFL and NOPs from the parent statement.
13936 If a pointer relocation is due to a function call, assignment from
13937 a global or a function argument, mark the pointer as a may-alias
13938 for global storage.
13939 (dump_referenced_vars): Reformat output.
13940 (dump_variable): Likewise.
13942 * tree-dump.c (dump_option_value_info): Add entry for TDF_ALIAS.
13943 * tree.h (TDF_ALIAS): Define.
13944 * doc/invoke.texi: Document new flag.
13946 * tree-flow-inline.h (may_alias_global_mem_p): New function.
13947 * tree-flow.h (enum tree_flags): Add value TF_MAY_ALIAS_GLOBAL_MEM.
13948 (may_alias_global_mem_p): Declare.
13950 * tree-simple.c (get_base_symbol): Return NULL_TREE, not NULL.
13951 * tree-ssa-ccp.c (tree_ssa_ccp): Remove unused variable.
13952 * tree-ssa-dce.c (need_to_preserve_store): Call
13953 decl_function_context instead of DECL_CONTEXT.
13954 If the symbol may alias global memory, return nonzero.
13956 * tree-ssa.c (dump_reaching_defs): Reformat output.
13957 (set_currdef_for): Walk the alias leader chain, setting CURRDEF for
13958 all the alias sets that may be affected by the definition.
13960 2002-12-06 Daniel Berlin <dberlin@dberlin.org>
13962 * tree-dfa.c (may_alias_p): Fix global variables and points-to.
13964 2002-12-03 Daniel Berlin <dberlin@dberlin.org>
13966 * tree-ssa.c (delete_tree_ssa): Move call to delete_alias_vars
13967 above resetting num_referenced_vars.
13969 2002-12-03 Diego Novillo <dnovillo@redhat.com>
13971 * Makefile.in: Add dependencies on $(TM_H) and coretypes.h for the
13972 files mentioned below.
13973 * old-tree-inline.c: Include tm.h and coretypes.h.
13974 * c-pretty-print.c: Likewise.
13975 * disjoint-set.c: Likewise.
13976 * tree-alias-ecr.c: Likewise.
13977 * tree-alias-type.c: Likewise.
13978 * tree-alias-ander.c: Likewise.
13979 * tree-alias-steen.c: Likewise.
13980 * tree-alias-common.c: Likewise.
13981 * tree-ssa.c: Likewise.
13982 * tree-ssa-pre.c: Likewise.
13983 * tree-cfg.c: Likewise.
13984 * tree-dfa.c: Likewise.
13985 * tree-optimize.c: Likewise.
13986 * c-simplify.c: Likewise.
13987 * gimplify.c: Likewise.
13988 * tree-browser.c: Likewise.
13989 * simple-break-elim.c: Likewise.
13990 * simple-goto-elim.c: Likewise.
13991 * tree-dchain.c: Likewise.
13992 * c-call-graph.c: Likewise.
13993 * tree-simple.c: Likewise.
13994 * tree-nomudflap.c: Likewise.
13995 * tree-pretty-print.c: Likewise.
13996 * tree-ssa-dce.c: Likewise.
13997 * tree-ssa-ccp.c: Likewise.
13998 * dependence.c: Likewise.
13999 * tree-mudflap.c: Likewise
14000 (mx_xfn_indirect_ref): Use size_type_node instead of c_size_type_node.
14002 2002-12-03 Diego Novillo <dnovillo@redhat.com>
14004 * tree-dfa.c: Undo this change that causes bootstrap
14007 2002-12-02 Diego Novillo <dnovillo@redhat.com>
14009 * tree-dfa.c (may_alias_p): Artificial variables
14010 can also be aliased.
14012 2002-12-03 Andreas Jaeger <aj@suse.de>
14014 * tree-simple.c (right_assocify_expr): Remove unused variable.
14016 2002-12-02 Andrew MacLeod <amacleod@redhat.com>
14018 * gimplify.c (simplify_cleanup_point_expr): gsi_stmt can return NULL,
14020 * tree-cfg.c (make_blocks): Use gsi_end, gsi_stmt can return NULL. Set
14021 basic_block for empty_stmt_node containers.
14022 (make_edges): Stmt's can be NULL.
14023 (make_ctrl_stmt_edges, make_exit_edges, make_loop_expr_edges,
14024 make_cond_expr_edges, make_goto_expr_edges, is_nonlocal_label_block,
14025 block_invalidates_loop, cleanup_control_flow, cleanup_cond_expr_graph,
14026 cleanup_switch_expr_graph, disconnect_unreachable_case_labels,
14027 find_taken_edge, tree_cfg2dot, successor_block, is_latch_block,
14028 switch_parent, first_stmt, last_stmt): Check for first_stmt() or
14029 last_stmt() returning NULL.
14030 (remove_tree_bb, first_exec_stmt): Use gsi_end.
14031 (last_stmt_ptr): Iterate to find last execuatbel stmt_ptr in a block.
14032 (gsi_start_bb): Return first non-empty stmt, if there is one.
14033 (set_bb_for_stmt): Don't decend into an empty_stmt_node.
14034 * tree-dfa.c (find_tree_refs): Use gsi_end.
14035 (collect_dfa_stats): Use gsi_end_bb.
14036 * tree-flow-inline.h (gsi_step_bb): split.
14037 (gsi_step_in_bb): gsi_step with explicit bb specified. Never return
14039 (gsi_start_bb): Move to tree-cfg.c.
14040 (gsi_end_bb): New. Have we reached the end of a basic block.
14041 * tree-flow.h (gsi_start_bb): Make external.
14042 (gsi_end_bb, gsi_step_in_bb): New prototypes.
14043 * tree-simple.h (gsi_end): renamed from gsi_after_end.
14044 (gsi_stmt): Return NULL if stmt is an empty_stmt_node or error mark.
14045 * tree-ssa-ccp.c (simulate_block, substitute_and_fold): Use gsi_end.
14046 * tree-ssa-dce.c (mark_control_parent_necessary, find_useful_stmts,
14047 remove_dead_stmts): Use gsi_end_bb.
14048 (process_worklist): Check for NULL last_stmt.
14049 * tree-ssa-pre.c (finalize_1): Use gsi_end_bb, gsi_stmt can be NULL.
14051 2002-12-02 Diego Novillo <dnovillo@redhat.com>
14053 * tree-dfa.c (dump_ref): Display '<nil>' for NULL references.
14054 (dump_phi_args): Handle NULL arguments.
14055 (may_alias_p): Artificial variables can also be aliased.
14057 2002-12-02 Daniel Berlin <dberlin@dberlin.org>
14059 * tree-ssa-pre.c (okay_injuring_def): inj could be null.
14060 (get_operand): Use instead of special casing INDIRECT_REF and
14061 COMPONENT_REF everywhere.
14062 (names_match_p): Fix.
14063 (defs_match_p): Ignore partial uses.
14064 (rename_2): Fix non-matching condition.
14065 (update_old_new): Update the kills and lefts arrays.
14066 (finalize_1): Set the bb for the new statement.
14067 (update_ssa_for_new_use): Ditto.
14068 (code_motion): Ditto.
14069 (call_modifies_slot): Handle function pointers (where we end up
14070 with a _DECL as our argument).
14071 (pre_part_1_trav): Update the kills and lefts arrays.
14072 Just use TREE_TYPE (ei->expr) for type of expression.
14073 (add_left_occ): New helper function.
14074 (process_left_occs_and_kills): Add other cases we need to handle.
14075 (tree_perform_ssapre): Add new processed array, since for left
14076 occurrences and kills, we need to process *all* statements, not
14077 just ones we might consider candiates for PRE.
14079 2002-12-02 Diego Novillo <dnovillo@redhat.com>
14081 * tree-dfa.c (find_refs_in_expr): Look for references in
14084 2002-12-01 Diego Novillo <dnovillo@redhat.com>
14086 * tree-optimize.c (optimize_function_tree): Undo
14087 inadvertent change in previous commit.
14089 2002-12-01 Diego Novillo <dnovillo@redhat.com>
14091 * fold-const.c (operand_equal_p): Check for NULL TREE_TYPEs.
14093 * tree-cfg.c (remove_stmt): Call remove_ref.
14094 (disconnect_unreachable_case_labels): Do not disconnect the edge
14095 going to the block holding the BIND_EXPR node for the switch()
14097 (dump_tree_cfg): Call dump_current_function.
14099 * Makefile.in (tree-dfa.o): Depend on convert.h.
14100 * tree-dfa.c: Include convert.h.
14101 (remove_def): New local function.
14102 (reset_def_def_links): New local function.
14103 (replace_phi_arg_with): New local function.
14104 (replace_ref_with): New function.
14105 (try_replace_ref_with): Rename from replace_ref_in.
14106 Also look for V_USE references on the LHS of assignments.
14107 When replacing the callee of a CALL_EXPR, make sure that the type
14108 of the new callee is compatible with the old one.
14109 (replace_ref_r): Call operand_equal_p.
14110 (remove_ref): New function.
14111 (same_var_p): New function.
14112 (dump_referenced_vars): Add new flag DETAILS. Update all users.
14113 (debug_referenced_vars): Likewise.
14115 * tree-ssa.c (dump_reaching_defs): Change output format.
14116 (set_ssa_links): Don't set def-def links for PHI nodes.
14118 * tree-ssa-ccp.c (replace_uses_in): Add new argument COMMIT.
14121 * tree-optimize.c (dump_current_function): New function.
14122 (optimize_function_tree): Call it.
14123 * tree.h (dump_current_function): Declare.
14124 * c-decl.c (c_expand_body): Call dump_current_function.
14125 * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Likewise.
14126 * tree-ssa-pre.c (tree_perform_ssapre): Likewise.
14127 * tree-ssa.c (build_tree_ssa): Likewise.
14128 * tree-ssa-ccp.c (tree_ssa_ccp): Likewise.
14129 Dump variables and reaching definitions if TDF_DETAILS is set.
14131 * tree-pretty-print.c (print_call_name): Call dump_generic_node for
14134 * tree-ssa-pre.c: Don't include c-common.h nor c-tree.h
14135 Replace calls to build_modify_expr with build everywhere.
14136 Replace calls to deep_copy_node with copy_node_r everywhere.
14138 2002-11-29 Andreas Jaeger <aj@suse.de>
14140 * c-call-graph.c (construct_call_graph): Fix format.
14142 * tree-alias-ander.c: Declare print_out_result.
14144 * tree-ssa-pre.c: Declare is_on_lhs and call_modifies_slot.
14146 * tree.h: Declare expand_asm_expr and add_var_to_bind_expr.
14148 * tree-inline.c: Declare remap_decls.
14150 2002-11-28 Daniel Berlin <dberlin@dberlin.org>
14152 * tree-alias-common.h: Start adding doxygen docs.
14154 * tree-alias-common.c: Ditto
14156 2002-11-28 Daniel Berlin <dberlin@dberlin.org>
14158 * tree-alias-ander.c: Convert debug defines and ifdefs into
14161 * tree.h: Add TDI_pta.
14163 * tree-dump.c: Add dump-tree-pta and TDI_pta.
14165 2002-11-28 Diego Novillo <dnovillo@redhat.com>
14167 * Makefile.in (tree-ssa-pre.o, tree-cfg.o, gimplify.o, tree-ssa-dce.o,
14168 tree-ssa-ccp.o): Add dependency on $(TIMEVAR_H).
14169 * timevar.def (TV_TREE_GIMPLIFY, TV_TREE_MAY_ALIAS,
14170 TV_TREE_INSERT_PHI_NODES, TV_TREE_BUILD_FUD_CHAINS, TV_TREE_RDEFS):
14172 (TV_TREE_SSA): Remove.
14173 (TV_INTEGRATION, TV_EXPAND): Switch order.
14174 * c-decl.c (c_expand_body): Pop TV_EXPAND before running the tree
14176 * gimplify.c (simplify_function_tree): Push/pop TV_TREE_GIMPLIFY.
14177 * tree-cfg.c (build_tree_cfg): Push/pop TV_TREE_CFG.
14178 * tree-dfa.c (compute_may_aliases): Push/pop TV_TREE_MAY_ALIAS.
14179 * tree-ssa-ccp.c (tree_ssa_ccp): Push/pop TV_TREE_CCP.
14180 * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Push/pop
14182 Call compute_reaching_defs.
14183 Remove debugging dumps before DCE.
14184 * tree-ssa-pre.c (tree_perform_ssapre): Push/pop TV_TREE_PRE.
14185 * tree-ssa.c (build_tree_ssa): Don't call compute_reaching_defs.
14186 Don't call dump_reaching_defs.
14187 (insert_phi_nodes): Push/pop TV_TREE_INSERT_PHI_NODES.
14188 (build_fud_chains): Push/pop TV_TREE_BUILD_FUD_CHAINS.
14189 (compute_reaching_defs): Push/pop TV_TREE_RDEFS.
14190 Call dump_reaching_defs.
14191 * tree-optimize.c (optimize_function_tree): Remove calls to
14192 timevar_push and timevar_pop.
14194 2002-11-28 Diego Novillo <dnovillo@redhat.com>
14196 * Makefile.in (tree-ssa.o): Add dependency on $(TIMEVAR_H) and
14197 tree-alias-common.h.
14198 (tree-dfa.o): Likewise.
14199 (tree-optimize.o): Add dependency on $(TIMEVAR_H).
14200 * tree-dfa.c (compute_may_aliases): Move call to delete_alias_vars
14201 * tree-ssa.c (delete_tree_ssa): ... here.
14203 2002-11-27 Diego Novillo <dnovillo@redhat.com>
14205 * tree-dfa.c (add_may_alias): Remove. Update all users.
14206 (get_alias_index): Remove. Update all users.
14207 (dfa_stats_d): Remove fields num_may_alias, max_num_may_alias,
14208 num_alias_imm_rdefs and max_num_alias_imm_rdefs. Update all users.
14209 (may_alias_p): Make extern. Move declaration to tree-flow.h.
14210 (TRM_DEFAULT): Remove. Update all users. Update values of the
14211 other TRM_* constants.
14212 (create_ref): Don't initialize the PHI argument array with the
14213 number of incoming edges.
14214 (collect_dfa_stats): Do not traverse the function body with
14216 Free temporary hash table before returning.
14217 (compute_may_aliases): Update comment.
14218 (may_alias_p): Switch arguments if the first argument is not an
14219 INDIRECT_PTR or the artificial global_var.
14220 (find_may_aliases_for): If a pointer aliases a variable, set the
14221 pointer to be the alias leader for the variable.
14222 (ref_defines): Call may_alias_p.
14223 (is_killing_def): Return false if the reaching definition is NULL.
14224 Don't check for volatile definitions.
14225 Change second argument to be a tree. Update all users.
14227 * tree-flow-inline.h (alias_imm_reaching_def): Remove. Update all
14229 (may_alias): Remove. Update all users.
14230 (set_imm_reaching_def): Check for circularity.
14231 (alias_leader): New function.
14232 (set_alias_leader): New function.
14233 (is_aliased): New function.
14234 (is_default_def): Remove. Update all users.
14236 * tree-flow.h (struct var_ref_d): Remove field alias_imm_rdefs.
14238 (struct var_def_d): Remove field m_default. Update all users.
14239 (struct tree_ann_d): Remove field may_aliases. Update all users.
14240 Add field alias_leader.
14241 (struct dfa_counts_d): Remove fields num_may_alias and
14242 num_may_alias_imm_rdefs. Update all users.
14244 * tree-ssa.c: Update documentation on may-alias processing.
14245 (set_ssa_links): Remove third argument. Update all users.
14246 (set_alias_imm_reaching_def): Remove. Update all users.
14247 (create_default_def): Likewise.
14248 (analyze_rdefs): Likewise.
14249 (currdef_for): Move from tree-flow-inline.h
14250 (set_currdef_for): Likewise.
14251 (compute_reaching_defs): Rename from compute_tree_rdefs. Update
14253 (follow_chain): Call is_killing_def instead of is_partial_def.
14254 (tree_ssa_remove_phi_alternative): Remove unused variable ref.
14255 (set_ssa_links): When processing V_USE references, make sure that
14256 CURRDEF is a definition for the variable or one of its aliases.
14258 2002-11-26 Sebastian Pop <s.pop@laposte.net>
14260 * Makefile.in (OBJS): Add tree-browser.o.
14261 (tree-browser.o): New dependency.
14262 * tree-browser.c: New file.
14263 * tree-browser.def: New file.
14265 2002-11-26 Jason Merrill <jason@redhat.com>
14267 Gimplify C++ cleanups.
14268 * gimplify.c (voidify_wrapper_expr): Split out from...
14269 (simplify_bind_expr): ...here.
14270 (simplify_cleanup_point_expr): New fn.
14271 (simplify_target_expr): New fn.
14272 (gimple_conditional_context): New fn.
14273 (gimple_push_condition, gimple_pop_condition): New fns.
14274 (simplify_expr) [TRY_CATCH_EXPR]: Handle like TRY_FINALLY_EXPR.
14275 * c-simplify.c (simplify_cleanup): New fn.
14276 (c_simplify_stmt): Call it and lang_simplify_stmt.
14277 (simplify_expr_stmt): Wrap the expr in a CLEANUP_POINT_EXPR.
14278 (simplify_return_stmt, simplify_decl_stmt): Likewise.
14279 (simplify_stmt_expr): Handle the STMT_EXPR_NO_SCOPE case.
14280 (is_last_stmt_of_scope): Likewise.
14281 * c-common.h: Declare c_genericize, c_simplify_stmt and
14282 lang_simplify_stmt.
14283 * c-common.c (lang_simplify_stmt): Define.
14285 Gimplify EXIT_EXPRs.
14286 * gimplify.c (gimplify_loop_expr, gimplify_exit_expr): New fns.
14287 (simplify_expr): Call them.
14288 * expr.c (expand_expr) [LOOP_EXPR]: Pass 1 again for exit_flag.
14290 * tree-simple.c (right_assocify_expr): Also set TREE_SIDE_EFFECTS.
14292 * gimplify.c (simplify_expr): Call STRIP_TYPE_NOPS.
14293 [REALPART_EXPR]: Don't just return.
14295 * tree-pretty-print.c (dump_c_node): Handle REFERENCE_TYPE.
14296 * c-pretty-print.c (dump_c_node): Likewise. Handle null FOR_INIT_STMT.
14298 2002-11-25 Daniel Berlin <dberlin@dberlin.org>
14300 * config.gcc: Try committing the correct version.
14301 * tree-alias-ander.c (andersen_may_alias): Add "!= NULL" to make
14304 2002-11-24 Daniel Berlin <dberlin@dberlin.org>
14306 * configure.in: Add --with-libbanshee, passed to us by toplevel if
14307 libbanshee was configured. Substitute appropriate definitions for
14308 Makefile (IE disabling tree-alias-ander building) if it wasn't.
14309 * config.in: Regenerated.
14310 * config.gcc: Rebuild libbanshee with stage1 on darwin to work
14311 around system compiler problem.
14312 * configure: Regenerated.
14313 * Makefile.in: Add banshee stuff.
14314 * tree-alias-ander.c: New file.
14315 * tree-alias-ander.h: New file.
14316 * tree-alias-common.c (get_alias_var): Fix field based stuff.
14317 (find_func_aliases): Don't walk subtrees if we processed the tree.
14318 (ptr_may_alias_var): Fix both field-based and non-field-based lookup.
14320 2002-11-22 Andrew MacLeod <amacleod@redhat.com>
14322 * tree-ssa-dce.c (mark_necessary): Split out mark_tree_necessary. Don't
14323 mark if tree is already marked.
14324 (mark_tree_necessary): New. Mark tree without processing control parent.
14325 (mark_control_parent_necessary): Remove recursion, mark trees directly.
14326 (need_to_preserve_store): Can expression/symbol affect external values.
14327 (tree_ssa_eliminate_dead_code): Split.
14328 (find_useful_stmts): Find initial set of needed statements.
14329 (process_worklist): Find statements which calculate needed statements.
14330 (remove_dead_stmts): Delete statements which are dead.
14332 2002-11-16 Jason Merrill <jason@redhat.com>
14334 Improve tree dumps.
14335 * c-pretty-print.c, tree-pretty-print.c (dump_c_node): Handle
14336 integers larger than a host word.
14337 (op_prio): Handle INIT_EXPR.
14338 * gimplify.c (simplify_bind_expr): Set TREE_SIDE_EFFECTS and type
14339 of void_type_node on the COMPOUND_EXPRs as we walk.
14340 * tree-simple.c (right_assocify_expr): Propagate the type from cur
14343 * c-decl.c (finish_function): Call c_genericize instead of
14344 simplify_function_tree.
14345 * c-simplify.c (c_genericize): New function.
14346 (simplify_stmt_expr): Just genericize.
14347 (simplify_compound_literal_expr): Likewise.
14348 (c_build_bind_expr): Don't build a block for an artificial decl.
14349 (simplify_decl_stmt): Add the variable to the temps list iff it's
14351 (c_simplify_expr): Don't call push/pop_context.
14352 * c-decl.c (build_compound_literal): Set DECL_ARTIFICIAL.
14353 * c-tree.h: Declare c_genericize.
14355 * c-simplify.c (tree_build_scope): Remove.
14357 Remove INIT_EXPR from GIMPLE.
14358 * c-simplify.c (simplify_decl_stmt): Use MODIFY_EXPR.
14359 * gimplify.c (simplify_bind_expr): Likewise.
14360 (simplify_modify_expr): Convert INIT_EXPR to MODIFY_EXPR.
14362 * c-simplify.c (create_tmp_var_1): Drop; change all users to call
14364 (gimple_add_tmp_var): Now adds to the external temps list if
14365 available, or directly to the function otherwise.
14367 Avoid gratuitous unused warnings.
14368 * c-simplify.c (simplify_expr_stmt): Check TREE_SIDE_EFFECTS
14369 directly. Also check for explicit conversions to void.
14370 (expr_has_effect): Remove.
14372 * Makefile.in (OBJS): Remove tree-dchain.o.
14374 * stor-layout.c (variable_size): We don't care about
14375 global_bindings_p if the frontend doesn't want a list of the
14378 2002-11-13 Diego Novillo <dnovillo@redhat.com>
14380 * toplev.c (parse_options_and_default_flags): Enable SSA-CCP by
14381 default with optimization >= 1.
14382 * tree-dfa.c (find_refs_in_expr): Clobber '*.GLOBAL_VAR', not
14384 (collect_dfa_stats): Collect statistics on '*.GLOBAL_VAR'.
14385 (compute_may_aliases): Make sure that variable is an INDIRECT_REF.
14386 (may_alias_p): GLOBAL_VAR should alias INDIRECT_REFs.
14387 Only check addressability on VAR_DECLs.
14388 (find_may_aliases_for): Make sure argument is an INDIRECT_REF.
14389 * tree-flow-inline.h (indirect_var): Call DECL_P.
14390 (set_indirect_var): Call DECL_P.
14391 Create annotation if it doesn't exist.
14392 (create_indirect_ref): Move from tree-dfa.c.
14393 * tree-flow.h (create_indirect_ref): Declare.
14394 * tree-ssa-ccp.c (visit_phi_node): Avoid debugging dump from
14395 accessing uninitialized data.
14396 * tree-ssa.c (init_tree_ssa): Create an INDIRECT_REF node for
14399 2002-11-12 Diego Novillo <dnovillo@redhat.com>
14401 * tree-cfg.c (delete_tree_cfg): Call free_aux_for_blocks.
14402 Call free_basic_block_vars.
14404 * gimplify.c (simplify_expr): VA_ARG_EXPR nodes are in GIMPLE form
14406 Gimplify BIT_FIELD_REF nodes.
14407 (simplify_call_expr): Update comment.
14408 * tree-dfa.c (find_refs_in_expr): VA_ARG_EXPR nodes make no
14410 Handle BIT_FIELD_REF nodes.
14411 * tree-pretty-print.c (op_prio): Don't write an error message if
14412 the operand is not recognized.
14413 * tree-simple.c (is_simple_unary_expr): Handle BIT_FIELD_REFs.
14414 (is_simplifiable_builtin): Only return false for MD builtins.
14416 2002-11-08 Diego Novillo <dnovillo@redhat.com>
14418 * tree-cfg.c (cleanup_switch_expr_graph): Handle edges going to
14420 (first_stmt): Return NULL for ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR and
14422 * tree-dfa.c (find_refs_in_expr): Call mark_not_simple.
14424 2002-11-07 Diego Novillo <dnovillo@redhat.com>
14426 * Makefile.in (tree-ssa.o, tree-cfg.o, tree-dfa.o): Add dependency
14428 * tree-cfg.c: Include function.h.
14429 (build_tree_cfg): Set dump_file to NULL after closing the file.
14430 (remove_tree_bb): Don't dump warnings about statements being
14432 (dump_tree_cfg): Use current_function_name.
14433 Check that the flowgraph is not empty before dumping the function
14435 (tree_cfg2dot): Use current_function_name.
14436 * tree-dfa.c: Include function.h
14437 (dump_dfa_stats): Use current_function_name.
14438 * tree-optimize.c (optimize_function_tree): Set dump_file to NULL
14439 after closing the file.
14440 * tree-pretty-print.c (dump_generic_node): Make sure that the
14441 flowgraph exists before displaying block boundaries.
14442 * tree-ssa-ccp.c (tree_ssa_ccp): Set dump_file to NULL after
14444 * tree-ssa.c: Include function.h.
14445 (build_tree_ssa): Set tree_ssa_dump_file to NULL after closing the
14447 (dump_reaching_defs): Use current_function_name.
14448 (dump_tree_ssa): Likewise.
14450 2002-11-07 Diego Novillo <dnovillo@redhat.com>
14452 * tree-cfg.c (successor_block): Return EXIT_BLOCK_PTR if no
14453 successor can be found while walking the nesting chain.
14455 2002-11-07 Diego Novillo <dnovillo@redhat.com>
14457 * tree-cfg.c: Fix some formatting in code and comments.
14458 (set_bb_for_stmt): Move from tree-flow-inline.h
14459 * tree-dfa.c: Fix some formatting in code and comments.
14460 * tree-flow-inline.h: Likewise.
14461 * tree-flow.h: Likewise.
14462 * tree-ssa.c: Likewise.
14464 2002-11-06 Diego Novillo <dnovillo@redhat.com>
14466 * Makefile.in (tree-ssa-ccp.o): Add dependency on tree-inline.h
14467 * tree-cfg.c (find_taken_edge): New function.
14468 (cleanup_cond_expr_graph): Call it.
14469 (disconnect_unreachable_case_labels): Call it.
14471 * tree-dfa.c (struct clobber_data_d): Remove field
14472 parent_expr_p. Update all users.
14473 (find_refs_in_expr): Remove argument parent_expr_p. Update all users.
14474 (create_ref): Remove arguments parent_expr_p and operand_p. Update
14476 (replace_ref_in): Rename from replace_ref_operand_with. Update all
14477 users. Find the operand in the statement and replace it with a new
14479 (replace_ref_r): New local function.
14480 (is_killing_def): Also handle V_PHI references.
14481 (output_ref): Move from tree-flow-inline.h
14483 * tree-flow-inline.h (ref_expr): Remove. Update all users.
14484 (restore_ref_operand): Remove. Update all users.
14485 (set_output_ref): Remove. Update all users.
14486 (is_assignment_stmt): New function.
14487 (is_may_def, is_may_use, is_partial_def, is_partial_use,
14488 is_volatile_def, is_volatile_use, is_default_def,
14489 is_clobbering_def, is_initializing_def, is_relocating_def,
14490 is_addressof_use, is_pure_use): Check reference type first.
14491 (is_pure_def): New function.
14493 * tree-flow.h (struct tree_ref_common): Remove fields expr_p,
14494 operand_p and orig_operand. Update all users.
14495 (struct tree_ann_d): Remove field output_ref. Update all users.
14497 * tree-ssa-ccp.c: Include tree-inline.h.
14498 (simulate_block): Simulate every statement in the block, not its
14500 (simulate_def_use_chains): Simulate statements containing uses
14501 reached by the definition.
14502 (substitute_and_fold): Traverse statements, not references.
14504 (visit_phi_node): If PHI node is marked volatile, assume varying.
14505 (visit_stmt): Rename from visit_expression_for. Work on a
14506 statement, not a reference.
14507 (visit_assignment): Rename from visit_assignment_for. Work on a
14508 statement, not a reference.
14509 (visit_cond_stmt): Rename from visit_condexpr_for. Work on a
14510 statement, not a reference.
14511 (evaluate_stmt): Rename from evaluate_expr. Work on a statement,
14513 (initialize): Initialize special definitions to varying.
14514 (replace_uses_in): Work on a statement, not an expression.
14515 (fold_stmt): Rename from ccp_fold. Work on a statement, not an
14517 (get_rhs): New local function.
14518 (set_rhs): New local function.
14520 2002-11-06 Daniel Berlin <dberlin@dberlin.org>
14522 * tree-flow.h: Prototype set_bb_for_stmt, last_stmt_ptr,
14523 add_ephi_arg, num_ephi_args, set_ephi_arg, ephi_arg.
14524 (enum tree_ref_type): Add E_LEFT, E_KILL, E_EXIT.
14526 * tree-cfg.c (set_bb_for_stmt): Move to tree-flow-inline.h.
14527 (last_stmt_ptr): New function, gives pointer to last statement in
14530 * tree-flow-inline.h: Add exprref_processed, exprref_processed2,
14531 expruse_phi, num_ephi_args, set_ephi_arg, ephi_arg, add_ephi_arg.
14533 * tree-dfa.c (tree_ref_structure): Handle E_{LEFT,KILL,EXIT}.
14534 (ref_type_name): Ditto.
14535 (tree_ref_size): Ditto.
14536 (dump_ref): E_PHI's phi_args is now a varray of phi_arg structs.
14537 (add_ephi_arg): New function.
14538 (remove_ref_from_list): Fix crash when node not found.
14539 (compute_may_aliases): Add timing for points-to analysis.
14541 * timevar.def: Add TV_TREE_PTA.
14543 * tree-ssa-pre.c: Start of massive cleanup and rewriting (in
14544 preparation for load/store PRE). No more uses of ref_expr, proper
14545 call handling. Started removing unnecessary structures and lists,
14546 started removing redundant and inefficient operations (IE O(n^2)
14547 loops to process all phi operands, etc). Basic load PRE implemented.
14548 Code may look ugly due to large pieces commented out waiting for DFA
14549 updating of refs to redo.
14551 2002-11-05 Diego Novillo <dnovillo@redhat.com>
14553 * tree-cfg.c (create_block_annotations): New local function.
14554 (create_bb_ann): Remove. Update all users.
14555 (parent_array): New local variable.
14556 (build_tree_cfg): Initialize it.
14557 Call create_block_annotations.
14558 (create_bb): Call alloc_block instead of ggc_alloc to allocate
14559 memory for basic blocks.
14560 Don't call set_parent_block.
14561 Grow array parent_array.
14562 (dump_tree_cfg): Change meaning of second argument. Make it accept
14563 any of the TDF_* flags defined in tree.h.
14564 (delete_tree_cfg): Call free_aux_for_blocks.
14565 Free array parent_array.
14566 * tree-flow-inline.h (get_filename): New function.
14567 (is_exec_stmt): return false if T is error_mark_node.
14568 * tree-flow.h (struct var_ref_d): Mark alias_imm_rdefs field for
14569 garbage collection.
14570 (get_filename): Declare.
14571 (struct bb_ann_d): Rename from bb_ann_def.
14572 Remove garbage collection markers.
14573 (referenced_vars): Mark for garbage collection.
14574 (global_var): Likewise.
14575 (create_bb_ann): Remove.
14576 * tree-optimize.c (optimize_function_tree): Remove CFG and SSA
14577 after debugging dumps.
14579 * diagnostic.h (print_generic_stmt): Rename from print_generic_tree.
14581 (print_generic_expr): Rename from print_generic_node. Update all
14583 (PPF_BRIEF): Remove. Update all users.
14584 (PPF_BLOCK): Remove. Update all users.
14585 (PPF_LINENO): Remove. Update all users.
14586 (PPF_IS_STMT): Remove. Update all users.
14587 * flags.h (flag_dump_tree_all_ssa): Remove. Update all users.
14588 * toplev.c (f_options): Remove entry for -fdump-tree-all-ssa.
14590 * tree-dump.c (dump_enable_all): Rename from dump_enable_all_ssa.
14592 (dump_files): Add entry for -fdump-tree-all.
14593 (dump_option_value_info): Remove entries for TDF_REFS and
14595 Add entry for TDF_BLOCK.
14596 (dump_switch_p): If -fdump-tree-all was given, call dump_enable_all.
14597 * tree-pretty-print.c (PPF_BRIEF): Remove. Update all users.
14598 (PPF_BLOCK): Remove. Update all users.
14599 (PPF_LINENO): Remove. Update all users.
14600 (PPF_IS_STMT): Remove. Update all users.
14601 (dumping_stmts): New local variable.
14602 (print_generic_stmt): Rename from print_generic_tree. Update all
14604 Set dumping_stmts to true.
14605 (print_generic_expr): Rename from print_generic_node. Update all
14607 Set dumping_stmts to false.
14608 (maybe_init_pretty_print): Set last_bb to -1.
14609 (dump_block_info): If available, dump file and line number
14610 information for the first statement in the basic block.
14611 * tree-ssa.c (build_tree_ssa): Dump referenced variables and
14612 reaching definition information if -details is given.
14613 * tree.h (enum tree_dump_index): Rename TDI_all to TDI_tu. Update
14615 Add new index TDI_all.
14616 (TDF_DETAILS): Change value.
14617 (TDF_REFS): Remove. Update all users.
14618 (TDF_RDEFS): Remove. Update all users.
14619 (TDF_BLOCK): Define.
14620 * doc/invoke.texi: Update documentation for -fdump-tree-... flags.
14622 2002-11-05 Frank Ch. Eigler <fche@redhat.com>
14624 * tree-mudflap.c (mudflap_enqueue_decl, _constant): Use
14625 size_in_bytes, not c_size_in_bytes.
14626 (mf_init_extern_trees): Import uintptr_t typedef node from
14629 2002-11-01 Diego Novillo <dnovillo@redhat.com>
14631 * tree-cfg.c (remove_tree_bb): Add new argument remove_stmts.
14632 Update all callers.
14633 (make_ctrl_stmt_edges): Add an edge to the body of a SWITCH_EXPR.
14634 (make_cond_expr_edges): Don't try to linearize the if() subgraph.
14635 (make_case_label_edges): Don't remove the fallthru edge from the
14636 entry block to the switch() subgraph.
14637 (cleanup_tree_cfg): Call cleanup_control_flow.
14638 (remove_unreachable_blocks): Remove blocks of compound structures
14639 before removing the entry block.
14640 (remove_blocks): New local function.
14641 (blocks_unreachable_p): New local function.
14642 (is_nonlocal_label_block): New local function.
14643 (find_subblocks): New local function.
14644 (is_parent): New local function.
14645 (gsi_remove): New function.
14646 (remove_stmt): New local function.
14647 (cleanup_control_flow): New local function.
14648 (cleanup_cond_expr_graph): New local function.
14649 (cleanup_switch_expr_graph): New local function.
14650 (disconnect_unreachable_case_labels): New local function.
14652 * tree-dfa.c (remove_decl): New function.
14653 (find_decl_location): New function.
14655 * tree-flow.h (gsi_remove): Declare.
14656 (remove_decl): Declare.
14657 (find_decl_location): Declare.
14659 * tree-ssa-ccp.c (optimize_unexecutable_edges): Remove. Update all
14661 (ssa_ccp_df_delete_unreachable_insns): Remove. Update all users.
14662 (tree_ssa_ccp): Call print_generic_tree with PPF_BLOCK.
14664 2002-10-31 Diego Novillo <dnovillo@redhat.com>
14666 * tree-dfa.c (create_indirect_ref): New local function.
14667 (find_refs_in_expr): Call it.
14668 (create_ref): Check E_* reference types with == instead of &.
14669 (dump_ref): Likewise.
14670 (count_tree_refs): Likewise.
14671 * tree-ssa.c (set_ssa_links): Update documentation comment for
14674 2002-10-31 Diego Novillo <dnovillo@redhat.com>
14676 * tree-cfg.c (remove_tree_bb): Don't walk beyond the end of the
14679 2002-10-26 Daniel Berlin <dberlin@dberlin.org>
14681 * flags.h: Remove flag_tree_points_to from here.
14682 * toplev.c: Include tree-alias-common.h.
14683 (flag_tree_points_to): Now of type enum pta_type, rather than
14685 (lang_independent_options): Remove flag_tree_points_to.
14686 (display_help): Display help for tree-points-to here.
14687 (decode_f_option): Allow selecting of points-to algorithm.
14688 * tree-alias-common.c (varmap): Removed.
14689 (alias_annot): Changed to a hash table. Update all functions
14691 (FIELD_BASED): New macro, switches between field-based analysis,
14692 and field-independent analysis (field-based isn't quite done yet).
14693 (alias_annot_entry): New, used in hash table.
14694 (annot_eq): New function.
14695 (annot_hash): New function.
14696 (find_func_aliases): Handle casts, fix indendation.
14697 (splaycount): Removed.
14698 (splay_tree_count): Removed.
14699 (display_points_to_set): Removed.
14700 (splay_tree_size): Removed.
14701 (alias_get_name): New function.
14702 (ptr_may_alias_var): Globals are a bit funky to handle.
14703 * tree-alias-steen.c: Use alias_get_name, rather than
14704 print_generic_node.
14705 (steen_simple_assign): Handle assignment of PTF's.
14706 (test_assign): Remove.
14707 * tree-alias-common.h (enum pta_type): New.
14708 (alias_get_name): New.
14709 (flag_tree_points_to): New.
14711 2002-10-26 Diego Novillo <dnovillo@redhat.com>
14713 * tree-cfg.c (cleanup_tree_cfg): Uncomment call to
14716 2002-10-26 Diego Novillo <dnovillo@redhat.com>
14718 * Makefile.in (tree-pretty-print.o): Depend on $(TREE_FLOW_H)
14719 * basic-block.h (BB_COMPOUND_ENTRY): Rename from BB_CONTROL_ENTRY.
14720 * diagnostic.h (dump_generic_tree): Remove extern declaration.
14721 (print_generic_node_brief): Remove. Update all users.
14722 (PPF_BRIEF): Declare.
14723 (PPF_BLOCK): Declare.
14724 (PPF_LINENO): Declare.
14725 (PPF_IS_STMT): Declare.
14726 * tree-pretty-print.c (PPF_BRIEF): New constant.
14727 (PPF_BLOCK): New constant.
14728 (PPF_LINENO): New constant.
14729 (PPF_IS_STMT): New constant.
14730 (dump_block_info): New local function.
14731 (last_bb): New local variable.
14732 (dump_generic_tree): Remove unused function.
14733 (print_generic_tree): Add third argument 'flags'. Update all
14735 (print_generic_node_brief): Remove. Update all users.
14736 (print_generic_node): Add third argument 'flags'. Update all
14738 (dump_generic_node): Add third argument 'flags'. Update all users.
14739 If PPF_BLOCK is set, display basic block information at basic block
14741 If PPF_IS_STMT is set, change the way COMPOUND_EXPR nodes are
14743 If PPF_BRIEF is set, don't show the bodies of control statements.
14744 (print_declaration):
14746 * toplev.c (process_options): Update comment for -fdisable-simple.
14748 * tree-cfg.c (remove_tree_bb): Rename from tree_delete_bb.
14749 (latch_block): Move declaration to tree-flow.h. Declare extern.
14750 (make_blocks): Start a new block after finding a control flow
14751 altering statement.
14752 (make_loop_expr_blocks): Set the loop entry block to be the parent
14753 block for the loop latch block.
14754 (cleanup_tree_cfg): Rename from tree_cleanup_cfg.
14755 Call compact_blocks.
14756 (remove_tree_bb): Rename from tree_delete_bb. Update all users.
14757 (dump_tree_bb): Rename from dump_tree_bb. Update all users.
14758 Dump information about loop latch blocks.
14759 (debug_tree_bb): Rename from tree_debug_bb. Update all users.
14760 (debug_tree_cfg): Rename from tree_debug_cfg. Update all users.
14761 (dump_tree_cfg): Rename from tree_dump_cfg. Update all users.
14762 By default, dump the function with markers for basic block
14764 (successor_block): If we can't find a successor following the
14765 parent chain, return the next block in the linked list of blocks.
14766 Update documentation comments.
14767 (stmt_starts_bb_p): Don't let RETURN_EXPR start a new block.
14768 (is_latch_block): New function.
14769 (first_exec_stmt): Don't treat BIND_EXPR nodes as a special case.
14770 (first_stmt): Return NULL_TREE if the block does not exist.
14771 (last_stmt): Likewise.
14773 * tree-dfa.c (find_tree_refs): Rename from tree_find_refs. Update
14775 (find_refs_in_stmt): Handle BIND_EXPR nodes.
14776 (rli_start): Move from tree-flow-inline.h
14777 (rli_start_last): Likewise.
14778 (rli_start_at): Likewise.
14779 (rli_delete): Likewise.
14781 * tree-flow-inline.h (gsi_start_bb): Handle NULL blocks.
14782 (ref_list_is_empty): New function.
14783 * tree-flow.h (rli_start): Change declaration to extern.
14784 (rli_start_last): Likewise.
14785 (rli_start_at): Likewise.
14786 (rli_delete): Declare.
14787 (latch_block): Declare.
14788 (is_latch_block): Declare.
14789 (get_last_ref): Change to inline declaration.
14790 (get_first_ref): Likewise.
14791 (ref_list_empty): Declare.
14793 * tree-optimize.c (delete_tree_ssa): Remove declaration.
14795 * tree-ssa-dce.c (mark_control_parent_necessary): Call gsi_step_bb
14796 instead of gsi_step.
14797 (tree_ssa_eliminate_dead_code): Likewise.
14799 * tree-ssa.c (compute_tree_rdefs): Rename from compute_tree_rdefs.
14802 2002-10-22 Diego Novillo <dnovillo@redhat.com>
14804 * tree-dfa.c (struct dfa_stats_d): Add field size_tree_refs.
14805 (tree_ref_size): New function.
14806 (create_ref): Call it.
14807 (dump_dfa_stats): Get total size from dfa_stats.size_tree_refs.
14808 (count_tree_refs): Call tree_ref_size.
14809 * tree-flow-inline.h (get_last_ref): New function.
14810 (get_first_ref): New function.
14811 * tree-flow.h (struct var_ref_d): Rename from var_ref.
14812 (struct var_def_d): Rename from var_def.
14813 (struct var_phi_d): Rename from var_phi.
14814 (struct var_use_d): Rename from var_use.
14815 (struct expr_phi_d): Rename from expr_phi.
14816 (struct expr_use_d): Rename from expr_use.
14817 * tree-ssa-ccp.c (tree_ssa_ccp): Call get_last_ref.
14819 2002-10-21 Daniel Berlin <dberlin@dberlin.org>
14821 * timevar.def: Add TV_TREE_{PRE,CCP,DCE,CFG,SSA}} timevars.
14823 * tree-optimize.c (optimize_function_tree): Push and pop timevars
14824 for the tree optimizers.
14826 2002-10-21 Diego Novillo <dnovillo@redhat.com>
14828 * Makefile.in (OBJS): Move tree-mudflap.o ...
14829 (C_AND_OBJC_OBJS): ... here.
14831 2002-10-21 Diego Novillo <dnovillo@redhat.com>
14833 * tree-flow-inline.h (rli_start): New function.
14834 (rli_start_rev): New function.
14835 (rli_start_at): New function.
14836 (rli_after_end): New function.
14837 (rli_step): New function.
14838 (rli_step_rev): New function.
14839 (rli_ref): New function.
14840 * tree-flow.h (struct ref_list_iterator): Declare.
14841 (FOR_REF_BETWEEN, FOR_EACH_REF, FOR_EACH_REF_REV): Replace with new
14842 rli_* iterator functions. Update all users.
14844 2002-10-21 Frank Ch. Eigler <fche@redhat.com>
14846 * tree-cfg.c (make_blocks): Ignore TRY_FINALLY_EXPR and
14848 * tree-mudflap.c (mx_register_decls): Ignore local decls
14849 of extern variables of unknown size.
14851 2002-10-20 Daniel Berlin <dberlin@dberlin.org>
14853 * tree-ssa-pre.c (repair_injury): DTRT, rather than abort.
14855 * tree-dfa.c (ref_type_name): E_* don't have these modifier
14856 fields, but may have the same bits set, so don't print the
14859 * gimplify.c (create_tmp_var): New function, wraps calls to
14860 create_tmp_var_1 with pushing/popping of right context.
14861 All internal gimplify.c now use create_tmp_var_1.
14862 (create_tmp_var_noc): New function, create the var without
14863 pushing/popping, and without exposing internals of create_tmp_var_1.
14864 Only one use of this.
14866 * tree-simple.h (create_tmp_var_noc): New prototype.
14868 * c-simplify.c (simplify_stmt_expr): create_tmp_var changed to
14869 create_tmp_var_noc.
14871 * tree-ssa-pre.c: Add WAITING_FOR_DFA_UPDATE around code waiting for DFA
14872 functions to keep refs up to date.
14873 (add_call_to_ei): occurs and occurstmts is now an
14874 array of tree pointers, not trees. Update approriately.
14875 (insert_occ_in_preorder_dt_order_1): Ditto.
14876 (tree_perform_ssapre): Ditto.
14877 (find_use_for_var): Removed function.
14878 (orig_expr_map): Removed global, removed uses.
14879 (struct ei): Added injfixups member.
14880 (is_strred_cand): STRIP_WFL the expression.
14881 (calculate_increment): Ditto.
14882 (is_injuring_def): Ditto.
14883 (defs_y_dom_x): Ditto. Also account for fact that y is now a full
14884 expression, not just an RHS.
14885 (defs_match_p): Ditto (t2 is no longer just an RHS).
14886 (finalize_1): Do insertion by replacement.
14887 (repair_injury): Clean up, do insertion by replacement.
14888 (find_reaching_def_of_var): Do backwards search in a cleaner way.
14889 (update_ssa_for_new_use): Change how we do replacement.
14890 (code_motion): Insertion by replacement. Print EXPR_WFL_LINENO, not
14892 (pre_part_1_trav): Just create_tmp_var will now suffice.
14894 2002-10-18 Diego Novillo <dnovillo@redhat.com>
14896 * tree-dfa.c (find_refs_in_expr): Change type of second argument to
14897 enum tree_ref_type. Add third argument ref_mod. Update all users.
14898 (create_ref): Add third argument ref_mod. Decode bitmask to set
14899 the individual bitfields in the new reference.
14900 * tree-flow-inline.h (is_may_ref): New function.
14901 (is_may_def): New function.
14902 (is_may_use): New function.
14903 (is_partial_ref): New function.
14904 (is_partial_def): New function.
14905 (is_partial_use): New function.
14906 (is_volatile_ref): New function.
14907 (is_volatile_def): New function.
14908 (is_volatile_use): New function.
14909 (is_default_def): New function.
14910 (is_clobbering_def): New function.
14911 (is_initializing_def): New function.
14912 (is_relocating_def): New function.
14913 (is_addressof_use): New function.
14914 (is_pure_use): New function.
14915 * tree-flow.h (V_DEF, V_USE, V_PHI, E_PHI, E_USE, E_KILL): Redefine
14916 inside enum tree_ref_type. Update all users.
14917 (enum tree_ref_type): Define.
14918 (TRM_DEFAULT, TRM_CLOBBER, TRM_MAY, TRM_PARTIAL, TRM_INITIAL,
14919 TRM_VOLATILE, TRM_RELOCATE): Rename from M_*. Update all users.
14920 (struct tree_ref_common): Change type of field 'type' to enum
14921 tree_ref_type. Update all users.
14922 (struct var_ref): Add bitfields 'm_may', 'm_partial' and 'm_volatile'.
14923 (struct var_def): Add bitfield 'm_default', 'm_clobber', 'm_initial'
14925 (struct var_use): Add bitfield 'm_addressof'.
14926 (ref_type): Change return type to enum tree_ref_type. Update all
14928 (create_ref): Add new argument ref_mod. Update all users.
14929 (function_may_recurse_p): Change return type to bool. Update all
14931 (ref_type_name): Change argument type to tree_ref. Update all
14933 (validate_ref_type): Remove.
14935 2002-10-18 Diego Novillo <dnovillo@redhat.com>
14937 * cp/Make-lang.in (CXX_C_OBJS): Remove tree-cfg.o, tree-dfa.o,
14938 tree-optimize.o, tree-ssa.o, tree-ssa-pre.o, gimplify.o, tree-simple.o,
14939 tree-alias-steen.o, tree-alias-ecr.o, tree-alias-type.o,
14940 disjoint-set.o, tree-ssa-ccp.o, tree-dchain.o, tree-alias-common.o,
14941 and tree-ssa-dce.o.
14943 2002-10-17 Diego Novillo <dnovillo@redhat.com>
14945 * Makefile.in (TREE_FLOW_H): Add bitmap.h, basic-block.h,
14946 hard-reg-set.h and tree-simple.h. Update all users.
14947 (C_AND_OBJC_OBJS): Move tree-cfg.o, tree-dfa.o,
14948 tree-ssa.o, tree-optimize.o, c-simplify.o, c-call-graph.o,
14949 tree-simple.o, simple-break-elim.o, simple-goto-elim.o, tree-dchain.o,
14950 tree-ssa-pre.o, tree-alias-type.o, tree-mudflap.o, gimplify.o,
14951 tree-alias-ecr.o, tree-alias-common.o, tree-alias-steen.o,
14952 disjoint-set.o, tree-ssa-ccp.o and tree-ssa-dce.o ...
14954 (gimplify.o): Add dependency on $(TREE_FLOW_H).
14955 (tree-pretty-print.o): New rule.
14956 (GTFILES): Add tree-flow.h
14957 * c-config-lang.in (gtfiles): Remove tree-flow.h
14958 * c-simplify.c (copy_if_shared_r, unmark_visited_r,
14959 unshare_all_trees, mark_not_simple): Move ...
14960 * gimplify.c: ... here.
14961 Include tree-flow.h
14962 * tree-flow.h: Include hard-reg-set.h.
14964 * c-common.h (print_c_tree, print_c_node, print_c_node_brief,
14965 debug_c_tree, debug_c_node, debug_c_node_brief): Move declarations
14967 * c-call-graph.c (construct_call_graph): Call get_name.
14968 (print_callee): Likewise.
14969 * c-pretty-print.c (print_declaration): Declare static.
14970 (print_function_decl): Likewise.
14971 (print_struct_decl): Likewise.
14972 (dump_c_tree): Likewise.
14973 (dump_c_node): Likewise.
14974 * diagnostic.h (dump_generic_tree, dump_generic_node,
14975 print_generic_tree, print_generic_node, print_generic_node_brief):
14977 * tree-pretty-print.c: New file.
14978 * c-decl.c: Replace calls to print_c_node with print_generic_node.
14979 * tree-alias-common.c: Likewise.
14980 * tree-alias-steen.c: Likewise.
14981 * tree-cfg.c: Likewise.
14982 * tree-dfa.c: Likewise.
14983 * tree-mudflap.c: Likewise.
14984 * tree-optimize.c: Likewise.
14985 * tree-ssa-ccp.c: Likewise.
14986 * tree-ssa-pre.c: Likewise.
14987 * tree-ssa-dce.c: Likewise.
14988 Don't include c-common.h nor c-tree.h
14989 (tree_ssa_eliminate_dead_code): Don't call COMPOUND_BODY.
14990 Replace ASM_STMT with ASM_EXPR. Don't check for EXPR_STMT.
14992 2002-10-17 Daniel Berlin <dberlin@dberlin.org>
14993 Diego Novillo <dnovillo@redhat.com>
14995 * tree-cfg.c (remove_bb_ann): Remove. Update all users.
14996 (delete_tree_cfg): Set bb->aux to NULL in all basic blocks.
14997 * tree-dfa.c: Remove extern declaration for tree_find_refs.
14998 (create_ref_list): Allocate new list with ggc_alloc.
14999 (empty_ref_list): Just set first and last element to NULL.
15000 (delete_ref_list): Remove. Update all users.
15001 (remove_ref_from_list): Don't call free.
15002 (add_ref_to_list_begin): Allocate new node with ggc_alloc.
15003 (add_ref_to_list_end): Likewise.
15004 (add_ref_to_list_after): Likewise.
15005 (create_ref): Call BITMAP_GGC_ALLOC.
15006 (remove_tree_ann): Remove. Update all users.
15007 (tree_ref_structure): New function.
15008 * tree-flow.h (edge, basic_block): Forward declare if necessary.
15009 (struct ref_list_node): Mark for garbage collection.
15010 (struct ref_list_priv): Likewise.
15011 (struct tree_ref_common): Likewise.
15012 (struct var_ref): Likewise.
15013 (struct var_def): Likewise.
15014 (struct var_phi): Likewise.
15015 (struct var_use): Likewise.
15016 (struct phi_node_arg_d): Likewise.
15017 (struct expr_ref_common): Likewise.
15018 (struct expr_phi): Likewise.
15019 (struct expr_use): Likewise.
15020 (union tree_ref_d): Likewise.
15021 (struct tree_ann_d): Likewise.
15022 (struct bb_ann_def): Likewise.
15023 (referenced_vars): Likewise.
15024 (global_var): Likewise.
15025 (enum tree_ref_structure_enum): New.
15026 (call_sites): Remove unused function.
15027 * tree-inline.c (copy_tree_r): Copy the 'ann' field from tree_common.
15028 * old-tree-inline.c (copy_tree_r): Likewise.
15029 * tree-ssa.c (added): Mark for garbage collection.
15030 (in_work): Likewise.
15031 (work_stack): Likewise.
15032 (delete_tree_ssa): Set global_var to NULL_TREE.
15033 * tree.h (struct tree_ann_d): Forward declare.
15034 (struct tree_common): Rename field 'aux' to 'ann'. Update all
15035 users. Don't mark it 'skip' for garbage collection.
15037 2002-10-16 Daniel Berlin <dberlin@dberlin.org>
15039 * tree-dfa.c (compute_may_aliases): Call create/delete_alias_vars
15040 if flag_tree_points_to is on.
15041 (may_alias_p): Use points-to info if user asked us to generate it.
15043 * tree-optimize.c (optimize_function_tree): Don't call
15044 create_alias_vars here.
15046 2002-10-16 Diego Novillo <dnovillo@redhat.com>
15048 * tree-cfg.c (make_cond_expr_edges): If the conditional has known
15049 value, only make the edge to the corresponding branch.
15050 (tree_delete_bb): Write a warning to the dump file when removing
15051 blocks with executable statements.
15052 (first_exec_stmt): Skip over empty BIND_EXPR blocks.
15054 * tree-dfa.c (find_refs_in_expr): Don't look for references in non
15056 (remove_tree_ann): Clear the annotation with memset.
15057 (collect_dfa_stats_r): Don't call tree_annotation.
15058 (find_may_aliases_for): Avoid adding the same alias more than once.
15059 (may_alias_p): Fix comment grammar.
15061 * tree-flow-inline.h (is_exec_stmt): New function.
15062 * tree-flow.h (FOR_EACH_REF): Guard against NULL lists.
15063 (FOR_EACH_REF_REV): Likewise.
15064 (is_exec_stmt): Declare.
15066 * tree-ssa-ccp.c (visit_phi_node): Reformat debug dumping output.
15067 (visit_expression_for): Move check for clobbering definitions
15068 before check for NULL expressions.
15069 (visit_condexpr_for): Reformat debug dumping output.
15070 (set_lattice_value): Remove stale comments.
15071 (replace_uses_in): Don't clear TF_FOLDED flag from expression.
15073 * tree-ssa.c (add_phi_node): If possible, associate the PHI node to
15075 (create_default_def): Create initial declarations for static
15076 variables with DECL_INITIAL set.
15077 (delete_tree_ssa): Remove annotations from variables.
15079 2002-10-16 Daniel Berlin <dberlin@dberlin.org>
15081 * tree-alias-type.c (alias_tvar_new_with_aterm): New function.
15082 Update all allocations to allocate right type, rather than the union.
15083 Update to use macros to access members of alias_typevar.
15085 * tree-alias-type.h: Split alias_typevar into a common, an ECR, and
15086 an aterm, update all users.
15087 Add macros to access members of union.
15089 * tree-alias-common.c (create_alias_var): Handle function_decl's
15090 properly (needed for proper handling of function pointers).
15091 Updates for macros to access typevars.
15092 Fix some indentation.
15094 * tree-alias-steen.c: Updates for macros to access typevars.
15096 2002-10-16 Frank Ch. Eigler <fche@redhat.com>
15098 * c-decl.c (c_expand_body): Enable mudflap, only for gimple.
15099 * c-pretty-print.c (dump_c_node): Render try/catch/finally exprs.
15100 (op_prio): Accept BIND_EXPRs.
15101 * gcc.c (cpp_unique_options): Make -fmudflap -include mf-runtime.h.
15102 * toplev.c (process_options): Complain on -fmudflap -fdisable-simple.
15103 * tree-mudflap.c (*): Reorganize for generic/gimple operation.
15104 (mf_init_extern_trees): Extract decl nodes from -include'd file.
15105 (mf_external_ref, mf_decl_extern_trees): Removed; updated callers.
15106 (mf_offset_expr_of_array_ref): Don't bother store index type as
15108 (mf_build_check_statement_for): Use GIMPLE tree types and builders.
15109 (mx_register_decls): New function, replacing mx_register_decl.
15110 (mx_xfn_xform_decls): Support only GIMPLE input tree types.
15111 (mf_flush_enqueued_calls): Clean up enqueued call statements.
15113 2002-10-14 Diego Novillo <dnovillo@redhat.com>
15115 * toplev.c (parse_options_and_default_flags): Undo local
15116 hack that slipped in the previous commit.
15118 2002-10-14 Diego Novillo <dnovillo@redhat.com>
15120 * Makefile.in (c-decl.o): Add dependency on diagnostic.h.
15121 * c-decl.c: Include diagnostic.h
15122 (c_expand_body): Call get_name.
15124 * basic-block.h (struct basic_block_def): Rename head_tree to
15125 head_tree_p and end_tree to end_tree_p. Change type to tree *.
15127 (BLOCK_HEAD_TREE): Remove. Update all users.
15128 (BLOCK_END_TREE): Remove. Update all users.
15129 * tree-cfg.c (build_tree_cfg): Return if function body is empty.
15130 (make_blocks): Change first argument to tree *. Update all users.
15131 (make_bind_expr_blocks): Likewise.
15132 (make_loop_expr_blocks): Likewise.
15133 (make_cond_expr_blocks): Likewise.
15134 (make_switch_expr_blocks): Likewise.
15135 (create_bb): Likewise.
15136 (first_exec_block): Likewise.
15137 (first_exec_stmt): Likewise.
15138 (tree_delete_bb): Use a gimple statement iterator to unmap
15140 (insert_stmt_before): Remove empty function.
15141 (replace_expr_in_tree): Remove. Update all users.
15142 (find_expr_in_tree_helper): Likewise.
15143 (find_expr_in_tree): Likewise.
15144 (first_stmt): Call STRIP_NOPS.
15145 (last_stmt): Call STRIP_NOPS.
15147 * tree-dfa.c (struct clobber_data_d): Rename parent_stmt to
15148 parent_stmt_p and parent_expr to parent_expr_p. Change types to
15149 tree *. Update all users.
15150 (find_refs_in_stmt): Change first argument type to tree *. Update
15152 (find_refs_in_expr): Chnage arguments parent_stmt and parent_expr
15153 to tree *. Update all users.
15154 (create_ref): Don't add the same reference twice on the same list
15155 when parent_stmt and parent_expr are the same node.
15156 Don't set output_ref when the parent statement is not in GIMPLE
15158 (replace_ref_operand_with): Move from tree-flow-inline.h
15159 (replace_ref_expr_with): New function.
15160 (replace_ref_stmt_with): New function.
15161 (create_tree_ann): Abort if trying to annotate certain nodes.
15162 Don't create an empty ref list.
15163 In the presence of WFL or NOPS wrappers, add the annotation to the
15165 (dump_ref): Don't call tree_annotation to access the tree
15168 * tree-flow.h (struct tree_ref_common): Rename field stmt to stmt_p
15169 and field expr to expr_p. Change types to tree *. Update all
15171 (replace_ref_expr_with): Declare.
15172 (replace_ref_stmt_with): Declare.
15173 (insert_stmt_before, insert_stmt_after, replace_expr_in_tree,
15174 find_expr_in_tree): Remove.
15175 * tree-flow-inline.h (ref_expr): Return NULL_TREE if expr_p is
15177 (ref_stmt): Return NULL_TREE if stmt_p is NULL.
15178 (tree_annotation): Call STRIP_WFL and STRIP_NOPS before returning
15180 (add_tree_ref): Remove consistency checks. Create an empty list
15182 (get_lineno): Return -1 on NULL_TREE.
15183 (set_output_ref): Remove consistency.
15184 (set_tree_flag): Likewise.
15185 (clear_tree_flag): Likewise.
15186 (reset_tree_flags): Likewise.
15187 * tree-simple.h (gimple_stmt_iterator): Rename ptr to tp. Change
15188 type to tree *. Update all users.
15189 (gsi_start): Change argument type to tree *. Update all users.
15190 (gsi_stmt_ptr): New function.
15191 (gsi_container): New function.
15193 * tree-optimize.c (optimize_function_tree): Don't test fnbody for
15195 Re-enable optimizers.
15196 * tree-ssa-ccp.c: Update documentation comments.
15197 Don't include c-common.h and c-tree.h.
15198 (tree_ssa_ccp): Don't call COMPOUND_BODY.
15199 (ccp_fold): New private function.
15200 (substitute_and_fold): Call it.
15201 Call replace_ref_expr_with.
15202 Set TF_FOLDED flag on the statement, not the expression.
15203 (visit_assignment_for): Call STRIP_NOPS and STRIP_WFL.
15204 (evaluate_expr): Call ccp_fold. Only use the RHS of the simplified
15205 value in the case of MODIFY_EXPR or INIT_EXPR.
15207 * tree-ssa-dce.c (mark_control_parent_necessary): Use a gimple
15209 (tree_ssa_eliminate_dead_code): Likewise.
15210 * tree-ssa-pre.c: Disable and add warning comments for out-of-date
15211 calls to create_ref, find_refs_in_stmt and replace_expr_in_tree.
15213 2002-10-12 Daniel Berlin <dberlin@dberlin.org>
15215 * tree-alias-type.h (alias_typevar_def): Add struct aterm
15216 as a temporary hack for andersen's analysis.
15217 * tree-alias-common.c (current_alias_ops): New, use it
15218 instead of referring to steen_alias_ops everywhere.
15219 (get_alias_var): Use STRIP_WFL.
15220 (find_func_aliases): Ditto.
15221 (create_alias_vars): Call init function, move deletion to
15223 (delete_alias_vars): New function, move deletion code to here.
15224 (get_virtual_var): Removed.
15225 (ptr_may_alias_var): New function.
15226 * tree-alias-common.h (struct tree_alias_ops): Add may_alias
15228 * tree-alias-steen.c (steen_may_alias): New function.
15230 2002-10-10 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
15232 * diagnostic.h (dump_c_tree, dump_c_node,
15233 print_declaration, print_function_decl,
15234 print_struct_decl): Fix argument types.
15236 2002-10-10 Diego Novillo <dnovillo@redhat.com>
15238 * tree.h (struct tree_common): Rename field unused_0 to
15240 (TREE_NOT_GIMPLE): Define.
15241 * c-simplify.c (mark_not_simple_r): Remove. Update all users.
15242 (mark_not_simple): Set TREE_NOT_GIMPLE.
15243 * gimplify.c (simplify_call_expr): Enable call to mark_not_simple.
15244 * tree-flow.h (TF_NOT_SIMPLE): Remove. Update all users.
15246 * tree-cfg.c (build_tree_cfg): Rename from tree_find_basic_blocks.
15248 Find the first executable statement before starting basic block 0.
15249 (make_blocks): Do not accept TRY_FINALLY_EXPR and TRY_CATCH_EXPR
15251 (make_edges): Always create an edge from entry to basic block 0.
15252 (delete_tree_cfg): Rename from delete_cfg. Update all uses.
15253 (first_exec_stmt): Return the container for the first statement,
15254 not the statement itself.
15256 * tree-dfa.c (tree_find_refs): Re-implement using a GIMPLE
15258 (find_refs_in_stmt): Handle GIMPLE statements.
15259 (find_refs_in_expr): Call flags_from_decl_or_type when handling
15260 CALL_EXPR expressions.
15261 (create_ref): Call DECL_P.
15262 (remove_tree_ann): Call tree_annotation.
15264 * tree-flow-inline.h (gsi_step_bb): Stop if statement is not inside
15267 * tree-flow.h (build_tree_cfg): Rename from tree_find_basic_blocks.
15269 (delete_tree_cfg): Rename from delete_cfg.
15270 (tree_find_refs): Declare.
15271 (build_tree_ssa): Rename from tree_build_ssa.
15272 (is_upward_exposed): Remove unused function.
15273 * tree-optimize.c (delete_tree_ssa): Remove declaration.
15274 (optimize_function_tree): Re-enable SSA builder.
15275 * tree-simple.h (gsi_container): New function.
15277 * Makefile.in (tree-ssa.o): Remove dependencies on c-common.h and
15279 * tree-ssa.c: Don't include c-common.h nor c-tree.h.
15280 (tree_find_refs): Remove declaration.
15281 (remove_annotations_r): New local function.
15282 (build_tree_ssa): Rename from tree_build_ssa. Update all users.
15283 (analyze_rdefs): Don't call prep_stmt.
15284 (is_upward_exposed): Remove unused function.
15285 (add_phi_node): Don't associate the PHI node to a statement.
15286 (delete_tree_ssa): Receive the function body as argument.
15287 Walk the function body removing annotations from every tree.
15289 2002-10-10 Steven Bosscher <s.bosscher@student.tudelft.nl>
15291 * tree-ssa-dce (tree_ssa_eliminate_dead_code): Initialize prev to
15293 Don't close dump_file until end of function.
15294 Dump the tree after DCE for -fdump-tree-dce.
15296 2002-10-08 Richard Henderson <rth@redhat.com>
15297 Jason Merrill <jason@redhat.com>
15298 Diego Novillo <dnovillo@redhat.com>
15300 * tree-simple.h (gimple_stmt_iterator): New type.
15301 (gsi_start): New function.
15302 (gsi_after_end): New function.
15303 (gsi_step): New function.
15304 (gsi_stmt): New function.
15306 2002-10-08 Diego Novillo <dnovillo@redhat.com>
15308 * calls.c (flags_from_decl_or_type): Make extern.
15310 * rtl.h (ECF_*): ... here.
15311 (flags_from_decl_or_type): Declare.
15313 * tree.h (COND_EXPR_COND): Define.
15314 (COND_EXPR_THEN): Define.
15315 (COND_EXPR_ELSE): Define.
15316 (LABEL_EXPR_LABEL): Define.
15317 (optimize_function_tree): Declare.
15319 2002-10-08 Diego Novillo <dnovillo@redhat.com>
15321 * Makefile.in (TREE_FLOW_H): Define.
15322 (c-decl.o): Remove dependency on tree-optimize.h.
15323 (tree-alias-steen.o, tree-alias-common.o, tree-ssa.o, tree-ssa-pre.o,
15324 tree-cfg.o, tree-dfa.o, tree-optimize.o, c-simplify.o, c-call-graph.o,
15325 tree-ssa-dce.o, tree-ssa-ccp.o): Depend on $(TREE_FLOW_H).
15326 (tree-cfg.o): Remove dependencies on c-tree.h and c-common.h.
15327 * c-call-graph.c (construct_call_graph): Disable calls to removed
15329 * c-decl.c: Don't include tree-optimize.h.
15330 (c_expand_body): Enable calls to optimize_function_tree.
15332 * c-pretty-print.c (dump_c_node): Fix printf warnings.
15333 Only dump the first node of a COMPOUND_EXPR when brief_dump is set.
15334 Use COND_EXPR_COND, COND_EXPR_THEN and COND_EXPR_ELSE accessors.
15335 Only dump the opening brace of a BIND_EXPR when brief_dump is set.
15337 * tree-cfg.c: Don't include tree-optimize.h, c-common.h and c-tree.h.
15338 (binding_stack, make_for_stmt_blocks, make_if_stmt_blocks,
15339 make_while_stmt_blocks, make_switch_stmt_blocks,
15340 make_do_stmt_blocks, create_maximal_bb, make_for_stmt_edges,
15341 make_while_stmt_edges, make_do_stmt_edges, make_if_stmt_edges,
15342 make_break_stmt_edges, make_continue_stmt_edges, create_loop_hdr,
15343 insert_before_ctrl_stmt, insert_before_normal_stmt,
15344 insert_after_ctrl_stmt, insert_after_normal_stmt,
15345 insert_after_loop_body, tree_split_bb, stmt_ends_bb_p): Remove.
15347 (STRIP_CONTAINERS): Define.
15348 (make_bind_expr_blocks): New local function.
15349 (make_cond_expr_blocks): New local function.
15350 (make_loop_expr_blocks): New local function.
15351 (make_switch_expr_blocks): New local function.
15352 (make_loop_expr_edges): New local function.
15353 (make_cond_expr_edges): New local function.
15354 (make_case_label_edges): New local function.
15355 (first_exec_block): New local function.
15356 (make_goto_expr_edges): Rename from make_goto_stmt_edges.
15357 (make_blocks): Remove arguments COMPOUND_STMT and PREV_CHAIN_P.
15358 Use gimple_stmt_iterator to iterate over the statements in the
15359 function. Create maximal basic blocks during traversal.
15360 (create_bb): Remove arguments end, prev_chain_p and binding_scope.
15361 Rename control_parent to parent_block.
15362 (set_bb_for_stmt): Move from tree-flow.h.
15363 (make_edges): Don't assume that basic block 0 contains executable
15365 Handle BIND_EXPR nodes.
15366 (make_ctrl_stmt_edges): Handle LOOP_EXPR, COND_EXPR and
15368 (make_exit_edges): Handle GOTO_EXPR, CALL_EXPR and RETURN_EXPR.
15369 (tree_delete_bb): Call first_stmt and last_stmt.
15370 (block_invalidates_loop): Call last_stmt.
15371 (replace_expr_in_tree): Don't dump line number information.
15372 (find_expr_in_tree_helper): Don't call statement_code_p.
15373 (tree_dump_bb): Call get_lineno.
15374 (tree_cfg2dot): Ditto.
15375 (successor_block): Use a gimple_stmt_iterator to find the first
15376 executable block after the current one.
15377 (is_ctrl_stmt): Handle COND_EXPR, LOOP_EXPR and SWITCH_EXPR.
15378 (is_ctrl_altering_stmt): Call flags_from_decl_or_type to discover
15379 non-return functions.
15380 (is_loop_stmt): Handle LOOP_EXPR.
15381 (is_computed_goto): Handle GOTO_EXPR.
15382 (stmt_starts_bb_p): Handle CASE_LABEL_EXPR, LABEL_EXPR, RETURN_EXPR
15384 (first_exec_stmt): Use a gimple_stmt_iterator to traverse the
15386 (first_stmt): New function.
15387 (last_stmt): New function.
15389 * tree-dfa.c: Don't include c-common.h, c-tree.h and
15390 tree-optimize.h. Include diagnostic.h.
15391 (tree_find_refs): Disable.
15392 (find_refs_in_stmt): Disable.
15393 (find_refs_in_expr): Don't call prep_stmt.
15394 (tree_ann): Don't annotate empty_stmt_node.
15395 (find_declaration): Remove. Update all users.
15396 (dump_ref): Call get_lineno.
15397 (is_visible_to): Always return true.
15399 * tree-flow.h: Include tree-flow-inline.h, basic-block.h and
15401 (tree_ann_d): Remove compound_parent field.
15402 (set_bb_for_stmt): Declare extern.
15403 (compound_parent, set_compound_parent, struct for_header_blocks,
15404 union header_blocks, prev_chain_p, set_prev_chain_p, binding_scope,
15405 set_binding_scope, loop_hdr, for_init_bb, set_for_init_bb,
15406 for_cond_bb, set_for_cond_bb, for_expr_bb, set_for_expr_bb,
15407 end_while_bb, set_end_while_bb, do_cond_bb, set_cond_bb,
15408 stmt_ends_bb_p, loop_parent, latch_block, switch_parent,
15409 first_exec_stmt, last_exec_stmt, is_exec_stmt,
15410 is_statement_expression, first_non_decl_stmt, first_decl_stmt,
15411 first_non_label_in_bb, tree_split_bb, find_declaration): Remove.
15413 (get_lineno): New function.
15414 (struct bb_ann_def): Rename field parent to parent_block. Update
15416 Remove fields prev_chain_p, loop_hdr and binding_scope. Update all
15418 (parent_block): Rename from bb_parent.
15419 (set_parent_block): Rename from set_bb_parent.
15420 (prev_chain_p): Remove
15421 (bb_empty_p): Return true if block only contains empty_stmt_node.
15422 (gsi_step_bb): New function.
15423 (gsi_start_bb): New function.
15424 (gsi_insert_before, gsi_insert_after, gsi_delete, gsi_replace):
15426 (insert_stmt_before): Rename from insert_stmt_tree_before.
15427 (insert_stmt_after): Rename from insert_stmt_tree_after.
15428 (first_stmt): Declare.
15429 (last_stmt): Declare.
15430 (tree_perform_ssapre, tree_ssa_ccp,
15431 tree_ssa_eliminate_dead_code): Move declaration from tree-optimize.h.
15432 * tree-flow-inline.h: New file for all the inline functions
15433 declared in tree-flow.h
15435 * tree-optimize.c: Don't include tree-optimize.h, c-common.h and
15437 (optimize_function_tree): Disable call to double_chain_stmts.
15439 Call tree_find_basic_blocks.
15440 Disable calls to tree_build_ssa and optimizers.
15441 (build_tree_ssa): Remove. Update all users.
15442 * tree-optimize.h: Remove.
15443 * tree-ssa-ccp.c: Don't include tree-optimize.h
15444 * tree-ssa-dce.c: Don't include tree-optimize.h.
15445 Include diagnostic.h
15446 * tree-ssa-pre.c: Don't include tree-optimize.h.
15447 (requires_edge_placement): Disable unused function.
15448 (set_need_repair): Disable unused function.
15449 (finalize_1): Disable calls to insert_stmt_tree_before and
15450 insert_stmt_tree_after.
15451 (repair_injury): Ditto.
15452 (code_motion): Ditto.
15453 * tree-ssa.c: Don't include tree-optimize.h.
15454 (insert_phi_nodes_for): Remove unused variable.
15455 (add_phi_node): Don't call statement_code_p.
15456 * cp/optimize.c: Don't include tree-optimize.h
15457 * tree-alias-common.c: Don't include tree-optimize.h.
15458 (find_func_decls): Disable.
15459 (display_points_to_set): Disable.
15460 * tree-alias-steen.c: Don't include tree-optimize.h.
15462 2002-10-04 Jason Merrill <jason@redhat.com>
15464 * gimplify.c (declare_tmp_vars): Don't add temps to block vars.
15465 * tree-inline.c (remap_decls): Split out from remap_block.
15466 (copy_bind_expr): Remap BIND_EXPR_VARS separately from block vars.
15468 * c-simplify.c (simplify_expr_stmt): Call set_file_and_line_for_stmt.
15470 * gimplify.c: New file.
15471 (push_gimplify_context, pop_gimplify_context): New fns.
15472 (gimple_push_bind_expr, gimple_pop_bind_expr): New fns.
15473 (simplify_bind_expr): Use them.
15474 (gimple_current_bind_expr, gimple_add_tmp_var): New fn.
15475 (foreach_stmt): Recurse if necessary.
15476 (various): Use generic interfaces instead of c-specific ones.
15477 * c-simplify.c: Move language-independent code to gimplify.c.
15478 (simplify_c_loop): Use add_tree instead of add_stmt_to_compound.
15479 (various): Use new *_bind_expr interfaces.
15480 * Makefile.in (C_AND_OBJC_OBJS): Add gimplify.o.
15481 (gimplify.o): New rule.
15483 * c-decl.c (c_expand_body): Dump trees here.
15484 * c-simplify.c (simplify_function_body): Not here.
15486 2002-10-03 Frank Ch. Eigler <fche@redhat.com>
15488 * tree-mudflap.c (mf_offset_expr_of_array_ref): Don't emit
15489 intermediate variables for constant index values.
15490 (mx_xfn_indirect_ref): For constant valid index values and
15491 known valid array sizes, omit bounds checks.
15493 2002-10-03 Jason Merrill <jason@ariel.home>
15495 * c-simplify.c (simplify_bind_expr): Don't clear TREE_SIDE_EFFECTS
15496 if we have a block.
15498 * c-simplify.c (simplify_expr) [TRY_FINALLY_EXPR]: New case.
15500 * tree-inline.c (copy_body_r) [RETURN_EXPR]: Don't make an extra
15501 copy of the MODIFY_EXPR. Mark the return label used.
15502 (expand_call_inline): Don't push/pop_srcloc. Only emit the return
15503 label if it was used.
15505 * tree-simple.c (right_assocify_expr): Split out from
15506 rationalize_compound_expr. Don't move non-matching op0's.
15507 * tree-simple.h: Declare it.
15508 * c-simplify.c (simplify_boolean_expr): Call it.
15509 (simplify_cond_expr): Reorganize. Optimize if (a&&b).
15511 * c-simplify.c (wrap_with_wfl): Drop special loop handling.
15512 (simplify_c_loop): Wrap loop contents in wfls.
15514 * c-simplify.c (STRIP_WFL): Move...
15517 * c-common.c (c_walk_subtrees): Don't walk TREE_CHAIN.
15518 * tree-inline.c (walk_tree): Call langhook walk_subtrees first.
15519 For expressions, walk TREE_CHAIN if it matters.
15521 2002-10-01 Frank Ch. Eigler <fche@redhat.com>
15523 * builtins.c (expand_builtin_alloca): Disable if -fmudflap.
15524 * tree-mudflap.c (mudflap_enqueue_decl): Tweak logic to include
15526 (mx_xfn_indirect_ref): Handle bitfield COMPONENT_REFs; instrument
15527 BIT_FIELD_REF/INDIRECT_REFs.
15529 2002-10-01 Jason Merrill <jason@redhat.com>
15531 * c-decl.c (poplevel): Only add undeclared labels to the toplevel
15533 * c-parse.in (label_decl): Push the declared label.
15535 * c-decl.c (c_expand_body): If we've been simplified, use
15536 expand_expr_stmt_value instead.
15538 * c-decl.c (c_expand_decl): Rename from c_expand_decl_stmt.
15539 Handle all C-specific expansion semantics.
15540 * c-tree.h: Change prototype.
15541 * langhooks.h (struct lang_hooks): Add expand_decl hook.
15542 * langhooks.c (lhd_expand_decl): Default version.
15543 * langhooks-def.h (LANG_HOOKS_EXPAND_DECL): Provide default.
15544 * c-lang.c (LANG_HOOKS_EXPAND_DECL): Define.
15545 * c-semantics.c (lang_expand_decl_stmt): Remove.
15546 (genrtl_decl_stmt): Use lang_hooks.expand_decl.
15547 * Makefile.in (c-semantics.o): Depend on langhooks.h.
15548 * c-objc-common.c (c_objc_common_init): Don't set
15549 lang_expand_decl_stmt.
15551 * c-common.def (ASM_STMT): Only 4 operands.
15552 * c-common.h (ASM_CV_QUAL): Remove.
15553 (genrtl_asm_stmt): Adjust prototype.
15554 * c-typeck.c (build_asm_stmt): Adjust.
15555 * c-semantics.c (genrtl_asm_stmt): Change cv_qualifier parm to
15557 (expand_stmt): Adjust.
15559 * c-common.h (SWITCH_COND, SWITCH_BODY, CASE_LOW, CASE_HIGH,
15560 CASE_LABEL_DECL, GOTO_DESTINATION, ASM_STRING, ASM_OUTPUTS,
15561 ASM_INPUTS, ASM_CLOBBERS, ASM_VOLATILE_P, ASM_INPUT_P): Move to tree.h.
15563 * c-pretty-print.c (newline_and_indent): New fn.
15564 (dump_c_tree, dump_c_node): Make spc a plain int.
15565 (dump_c_node): Use output_add_identifier.
15566 Reorganize for bnw-simple; indent in the enclosing node rather
15567 than the subexpression.
15568 [FUNCTION_DECL]: Just print the name for now.
15569 [COMPOUND_EXPR, COND_EXPR]: Handle use as statements.
15570 [BIND_EXPR, GOTO_EXPR, EXIT_EXPR, LOOP_EXPR, LABELED_BLOCK_EXPR,
15571 EXIT_BLOCK_EXPR, RETURN_EXPR, SWITCH_EXPR, ASM_EXPR,
15572 CASE_LABEL_EXPR]: Implement.
15573 (print_declaration): Print 'static'.
15574 * c-tree.h: Move c-pretty-print decls to diagnostic.h.
15576 * expr.c (store_field): Don't always pass want_value==0 to store_expr.
15578 * expr.c (expand_expr) [EXIT_EXPR]: Handle EXIT_EXPR_IS_LOOP_COND.
15580 * expr.c (expand_expr) [LOOP_EXPR]: Pass exit_flag==0 to
15582 [BIND_EXPR]: Adjust for functions-as-trees mode.
15583 [COMPOUND_EXPR]: Avoid recursion if possible.
15584 [SWITCH_EXPR, LABEL_EXPR]: Move handling from java/expr.c.
15585 [CASE_LABEL_EXPR, ASM_EXPR]: New handling.
15587 * tree.h (struct tree_common): Add visited flag.
15588 (TREE_VISITED): New macro.
15589 * tree.c (copy_node): Clear TREE_VISITED.
15590 * print-tree.c (print_node): Print visted.
15592 * stmt.c (expand_asm_expr): New fn.
15594 * tree.c (build1): Always set TREE_SIDE_EFFECTS for 's' codes.
15596 * tree.h (enum tree_index): Add TI_EMPTY_STMT.
15597 (empty_stmt_node): New macro.
15598 * tree.c (build_common_tree_nodes_2): Initialize it.
15600 * tree.def: Change some codes from 'e' to 's'.
15601 (CASE_LABEL_EXPR, ASM_EXPR): New codes.
15603 * tree.def (SWITCH_EXPR): Now has three operands.
15605 * tree-inline.c: Retarget to generic trees. FIXME FIXME.
15606 * old-tree-inline.c: Old C/Java-specific inliner.
15607 * Makefile.in (old-tree-inline.o): New rule.
15608 * c-common.c (c_walk_subtrees): New fn.
15609 (c_tree_chain_matters_p): New fn.
15610 * c-lang.c: Use them for LANG_HOOKS_TREE_INLINING_WALK_SUBTREES
15611 and LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P.
15612 * c-common.h: Declare them.
15613 (DECL_NUM_STMTS): Move to tree.h.
15614 * c-decl.c (finish_function): Simplify the function trees.
15615 * c-objc-common.c (inline_forbidden_p): Look inside BIND_EXPRs
15616 for nested functions. Don't inline a function with _STMT trees.
15618 * basic-block.h: Include hard-reg-set.h.
15620 * c-decl.c (start_function): Don't call make_decl_rtl.
15621 (c_expand_body): Call it here instead.
15623 * Makefile.in (explow.o): Depend on langhooks.h.
15625 * unroll.c (copy_loop_body): Don't copy NOTE_INSN_DELETED_LABELs
15626 between copy_notes_from and loop_end, either.
15628 2002-09-30 Daniel Berlin <dberlin@dberlin.org>
15630 * tree-ssa-pre.c (repair_injury): Start work on updating SSA
15631 representation for strength reduction injuries.
15632 Print a new line after outputting tree node in debug statements.
15633 Fix strength reduction of a candidate with two variables (IE a *
15635 Put the repair after the injuring statement, not at the end of the
15637 Break the RHS use lookup if it's defined by a phi.
15638 (calculate_increment): Ditto on node printing.
15639 (code_motion): Ditto on updating SSA rep for strength reduction
15641 (find_rhs_use_for_var): Rewrite to use maybe_find_rhs_use_for_var.
15642 (maybe_find_rhs_use_for_var): Rename from find_rhs_use_for_var,
15643 don't abort, return NULL.
15644 (set_var_phis): Simplify break condition.
15645 Make sure RHS *has* a use before we go and get it.
15646 (rename2): Ditto on RHS checking.
15647 When looking up injuring defs, break on phis.
15648 (phi_opnd_from_res): Ditto.
15649 (defs_y_dom_x): Ditto.
15650 (TODO List): Add new TODO to fix the remapping crud.
15652 2002-09-27 Daniel Berlin <dberlin@dberlin.org>
15654 * tree-ssa-pre.c (tree_perform_ssapre): Move insertion into
15655 splay tree inside the is_simple_modify_expr block, to prevent
15656 tree check failure.
15658 2002-09-26 Daniel Berlin <dberlin@dberlin.org>
15660 * tree-ssa-pre.c (update_phis_in_list): New function.
15661 (update_ssa_for_new_use): New function.
15662 (code_motion): Start working on code to update SSA representation.
15663 (find_reaching_def_of_var): New function.
15665 2002-09-25 Steven Bosscher <s.bosscher@student.tudelft.nl>
15667 * Makefile.in (tree): Add dependency on c-tree.h
15668 * tree-optimize.c: Include c-tree.h
15669 (optimize_function_tree): React to -fdump-tree-optimized.
15671 2002-09-25 Daniel Berlin <dberlin@dberlin.org>
15673 * tree-dfa.c (add_list_to_ref_list_end): New function.
15674 (add_list_to_ref_list_begin): Ditto.
15675 (find_list_node): Handle searching in empty lists.
15676 (find_refs_in_stmt): De-staticify.
15678 * tree-flow.h (add_list_to_ref_list_end): New declaration.
15679 (add_list_to_ref_list_begin): Ditto.
15680 (find_refs_in_stmt): Add prototype.
15682 2002-09-25 Diego Novillo <dnovillo@redhat.com>
15684 * Makefile.in (tree-dfa.o): Depend on flags.h
15685 * tree-cfg.c (tree_dump_cfg): Alter output format slightly.
15686 (block_invalidates_loop): Look for clobbering definitions of
15688 * tree-simple.c (get_base_symbol): Handle EXPR_WITH_FILE_LOCATION
15690 * tree-optimize.c (init_tree_flow): Remove. Update all users.
15691 (build_tree_ssa): Don't call tree_find_refs.
15692 Don't call tree_compute_rdefs.
15694 * tree-dfa.c: Include flags.h
15695 (dump_file): Remove.
15696 (dump_flags): Remove.
15697 (pointer_refs): Remove.
15698 (struct dfa_stats_d): Add fields max_num_phi_args, num_may_alias,
15699 max_num_may_alias, num_alias_imm_rdefs and max_num_alias_imm_rdefs.
15700 Remove field num_fcalls.
15701 (dfa_counts): Declare.
15702 (tree_find_refs): Declare.
15703 (tree_ssa_dump_file): Declare.
15704 (tree_ssa_dump_flags): Declare.
15705 (dump_if_different): New function.
15706 (add_default_defs): Remove. Update all users.
15707 (add_call_site_clobbers): Remove. Update all users.
15708 (add_ptr_may_refs): Remove. Update all users.
15709 (compute_may_aliases): New function.
15710 (find_may_aliases_for): New function.
15711 (add_may_alias): New function.
15712 (may_alias_p): New function.
15713 (is_visible_to): New function.
15714 (get_alias_index): New function.
15715 (call_sites): Remove. Update all users.
15716 (global_var): Declare.
15717 (E_FCALL): Remove. Adjust other constants.
15718 (M_INDIRECT): Remove. Update all users.
15719 (M_RELOCATE): Declare.
15720 (tree_find_refs): Move debugging dumps to tree_build_ssa.
15721 Move initialization code to init_tree_ssa.
15722 Call compute_may_aliases.
15723 (find_refs_in_expr): For INDIRECT_REF nodes create a reference to
15724 the canonical INDIRECT_REF node associated with the pointer symbol.
15725 Given a pointer p, clobber the canonical INDIRECT_REF of p after
15726 creating a V_DEF for p.
15727 For CALL_EXPR nodes, if the called function is not pure nor
15728 const, create a use and a clobbering definition to GLOBAL_VAR.
15729 (create_ref): Allow INDIRECT_REF variables.
15730 (add_phi_arg): Keep track of number of PHI arguments created.
15731 (function_may_recurse_p): Look for clobbering definitions to
15733 (get_fcalls): Remove unused function.
15734 (is_pure_fcall): Remove unused function.
15735 (fcall_takes_ref_args): Remove unused function.
15736 (find_declaration): Stop iterating at ENTRY_BLOCK_PTR.
15737 (debug_variable): New function.
15738 (dump_variable): New function.
15739 (dump_referenced_vars): Call it.
15740 (dump_phi_args): Don't dump NULL arguments.
15742 (dump_dfa_stats): Re-format output.
15744 Call dump_if_different.
15745 (collect_dfa_stats): Also recurse into GLOBAL_VAR.
15746 (collect_dfa_stats_r): Collect may-alias information.
15747 (count_tree_refs): Collect information about def-def links for
15749 Keep track of maximum values for number of PHI arguments, aliases
15751 (ref_type_name): Handle M_RELOCATE.
15752 (validate_ref_type): Ditto.
15754 * tree-ssa.c: Add more documentation.
15755 (tree_ssa_dump_file): Rename from dump_file. Declare extern.
15756 (tree_ssa_dump_flags): Rename from dump_flags. Declare extern.
15757 (added): New local varray.
15758 (in_work): New local varray.
15759 (work_stack): New local varray.
15760 (dfa_counts): Declare.
15761 (insert_phi_nodes_for): New local function.
15762 (add_phi_node): New local function.
15763 (set_ssa_links): New local function.
15764 (set_alias_imm_reaching_def): New local function.
15765 (create_default_def): New local function.
15766 (init_tree_ssa): New local function.
15767 (tree_find_refs): Relocate declaration from tree-flow.h
15768 (tree_build_ssa): Call init_tree_ssa.
15769 Call tree_find_refs.
15770 Process all SSA-related dump options.
15771 (insert_phi_nodes): Rename from insert_phi_terms. Update all
15773 Call insert_phi_nodes_for.
15774 (build_fud_chains): Add more documentation.
15775 Initialize save_chain to 0.
15776 (search_fud_chains): Add more documentation.
15777 Call set_ssa_links.
15778 Call create_default_def.
15779 (tree_compute_rdefs): Initialize array marked to 0.
15780 (follow_chain): Follow def-def chains for non-killing definitions
15782 (dump_reaching_defs): Call dump_variable.
15784 * tree-flow.h (E_FCALL): Remove. Update all users.
15785 (M_INDIRECT): Remove. Update all users.
15786 (M_RELOCATE): Declare.
15787 (struct var_ref): Add field alias_imm_rdefs.
15788 (alias_imm_reaching_def): New inline function.
15789 (struct tree_ann_d): Add field indirect_var.
15790 Add field may_aliases.
15791 (enum tree_flags): Relocate.
15792 (indirect_var): New inline function.
15793 (set_indirect_var): New inline function.
15794 (may_alias): New inline function.
15795 (num_may_alias): New inline function.
15796 (struct dfa_counts_d): Declare.
15797 (global_var): Declare.
15798 (FCALL_NON_PURE, FCALL_PURE, FCALL_BUILT_IN): Remove.
15799 (tree_find_refs): Move to tree-ssa.c.
15800 (dump_variable): Declare.
15801 (debug_variable): Declare.
15802 (get_fcalls): Remove.
15803 (is_pure_fcall): Remove.
15804 (fcall_takes_ref_args): Remove.
15805 (ref_defines): Declare.
15806 (is_killing_def): Declare.
15807 (get_alias_index): Declare.
15808 (delete_tree_ssa): Rename from delete_ssa. Update all users.
15809 (set_currdef_for): Allow INDIRECT_REF nodes.
15810 (bb_annotation): Don't create a new one if the block didn't have an
15811 annotation already.
15813 * tree-ssa-ccp.c (substitute_and_fold): Rename from
15814 ssa_ccp_substitute_constants. Update all users.
15815 Call replace_uses_in.
15816 (replace_uses_in): New local function.
15817 (evaluate_expr): Call it.
15818 (initialize): Call get_base_symbol.
15820 * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Don't handle
15823 2002-09-22 Diego Novillo <dnovillo@redhat.com>
15825 * Makefile.in (tree-dfa.o): Depend on hashtab.h.
15826 * c-simplify.c (get_name): Declare extern.
15827 * tree-cfg.c (tree_dump_cfg): Call it.
15828 (tree_cfg2dot): Call it.
15829 * tree-ssa-ccp.c (tree_ssa_ccp): Call get_name.
15830 * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Call get_name.
15831 * tree-ssa-pre.c (tree_perform_ssapre): Call get_name.
15832 * tree-ssa.c (analyze_rdefs): Call get_name.
15833 (dump_reaching_defs): Call get_name.
15834 (dump_tree_ssa): Call get_name.
15835 * tree.h (get_name): Declare.
15837 * tree-dfa.c: Include "hashtab.h"
15838 (struct dfa_stats_d): New.
15839 (collect_dfa_stats): New local function.
15840 (collect_dfa_stats_r): New local function.
15841 (count_tree_refs): New local function.
15842 (count_ref_list_nodes): New local function.
15843 (tree_find_refs): Call dump_begin on entry to the function.
15844 (dump_referenced_vars): Call get_name.
15847 (dump_dfa_stats): New function.
15848 (debug_dfa_stats): New function.
15849 * tree-dump.c (struct dump_option_value_info): Add entry for TDF_STATS.
15850 * tree-flow.h (has_annotation): Remove. Update all users.
15851 (dump_dfa_stats): Declare.
15852 (debug_dfa_stats): Declare.
15853 (tree_annotation): Don't create one if the tree doesn't have one
15854 already. Update all users to new semantics.
15855 * tree-ssa-dce.c (print_stats): Dump if dump_flags has TDF_STATS bit
15857 * tree-ssa.c (tree_build_ssa): Open dump file on entry.
15858 Call dump_dfa_stats if dump_flags has TDF_STATS bit set.
15859 Call dump_tree_ssa if dump_flags has TDF_DETAILS bit set.
15860 * tree.h (TDF_STATS): Define.
15861 * doc/invoke.texi: Document 'stats' flag for -fdump-tree.
15863 * tree-dfa.c (next_tree_ref_id): Change type to unsigned long.
15865 tree-flow.h (tree_ref_common): Change type of field 'id' to
15866 unsigned long. Update all users.
15867 (ref_id): Change return type to unsigned long. Update all users.
15869 2002-09-21 Daniel Berlin <dberlin@dberlin.org>
15871 * tree-ssa-pre.c (struct expr_info): Add repaired member.
15872 (repair_injury): Track which injuries we repaired, so we don't
15873 repair them > 1 time.
15875 2002-09-20 Diego Novillo <dnovillo@redhat.com>
15877 * c-pretty-print.c (dump_c_node): Fix call to REAL_VALUE_TO_DECIMAL.
15879 2002-09-20 Diego Novillo <dnovillo@redhat.com>
15881 * tree-dfa.c (find_refs_in_stmt): Fix botched call to
15882 clobber_vars_r with CLEANUP_STMT nodes.
15884 2002-09-20 Diego Novillo <dnovillo@redhat.com>
15886 * toplev.c (flag_tree_ssa): Remove. Update all users.
15888 2002-09-20 Frank Ch. Eigler <fche@redhat.com>
15890 * gcc.c (cc1_options): Make -fmudflap imply -fno-merge-constants.
15891 * varasm.c (categorize_decl_for_section): Likewise, for strings.
15892 * tree-mudflap.c (mudflap_enqueue_decl): Don't be interested
15893 in !TREE_USED decls. Fix minor type warning.
15894 (mf_offset_expr_of_array_ref): Create explicit temporary variables
15895 for array index expressions instead of SAVE_EXPRs. Update callers.
15896 (mf_build_check_statement_for): Insert temp variables.
15897 (mx_xfn_indirect_ref): Correct recursion-protection checking
15898 sequence. Tweak array check-base calculation back to "&array[0]".
15899 (*): Use build_function_type_list instead of build_function_type.
15900 (mx_external_ref): Remove unused parameter. Update callers.
15902 2002-09-19 Diego Novillo <dnovillo@redhat.com>
15904 * c-decl.c (c_expand_body): Invoke tree optimizers with -O1 and
15906 * flags.h (flag_tree_ssa): Remove.
15907 * tree-cfg.c (find_expr_in_tree_helper): Change last argument type
15909 * tree-dfa.c (create_ref): Ditto.
15910 * tree-flow.h (num_referenced_vars): Change type to unsigned long.
15911 * doc/invoke.texi (-ftree-ssa): Remove.
15912 (-fdump-tree-{pre,ccp,dce}): Add to the summary section.
15913 (-fdump-tree-xxx-details): Update documentation.
15914 (-fdump-tree-ccp): Document.
15915 (-fdump-tree-simple): Move elsewhere.
15917 2002-09-19 Richard Henderson <rth@redhat.com>
15919 * function.c (insns_for_mem_hash): Cast to size_t first.
15920 * tree-dfa.c (num_referenced_vars): Unsigned long, not size_t.
15921 (dump_referenced_vars): Use %lu for it.
15922 (dump_ref): Use HOST_WIDE_INT_PRINT_DEC.
15923 * tree-nomudflap.c (mudflap_c_function): Use ATTRIBUTE_UNUSED.
15924 (mudflap_enqueue_decl, mudflap_enqueue_constant): Likewise.
15925 * tree-ssa-pre.c (compute_idfs): Cast to size_t first.
15927 * tree-optimize.c (optimize_function_tree): Fix missed renamings.
15928 * tree-ssa-pre.c (tree_perform_ssapre): Likewise.
15930 2002-09-19 Jeff Law <law@redhat.com>
15932 * tree-dfa.c (find_refs_in_stmt): Search for references in the call
15933 address of a CALL_EXPR.
15935 2002-09-19 Daniel Berlin <dberlin@dberlin.org>
15937 * toplev.c: tree-ssa-* -> tree-*.
15939 * doc/invoke.texi: Ditto.
15941 2002-09-19 Daniel Berlin <dberlin@dberlin.org>
15943 * flags.h: flag_tree_ssa_* -> flag_tree_*.
15947 * tree-optimize.c: Ditto.
15949 * tree-dump.c: dump-tree-ssa-* -> dump-tree-*.
15950 TDI_ssa_* -> TDI_*.
15954 * tree-ssa-dce.c (tree_ssa_eliminate_dead_code): Fix dump handling.
15956 2002-09-18 Daniel Berlin <dberlin@dberlin.org>
15958 * tree-dump.c (dump_files): Use dump-tree-ssa-??? for the option names
15959 and "ssa-???" for the dump files.
15961 * tree.h: TDI_ccp and TDI_dce -> TDI_ssa_ccp and TDI_ssa_dce.
15963 * tree-ssa-ccp.c: TDI_ccp->TDI_ssa_ccp.
15965 2002-09-18 Daniel Berlin <dberlin@dberlin.org>
15967 * tree-dump.c: Fix order of dump files
15969 2002-09-17 Daniel Berlin <dberlin@dberlin.org>
15971 * tree-ssa-pre.c: Remove a lot of finding refs in statements junk.
15972 Start on strength reduction.
15973 Only generate simple statements.
15974 Remove EXPR* macros in favor of inline functions.
15975 Update comparisons and sets to 1 and 0 to true and false where
15977 (toplevel): Add DEBUGGING_STRRED define (temporary, for
15978 implementation debugging, *not* useful as a dump option).
15980 Add global avdefs, orig_expr_map, need_repair_map,
15982 (set_var_phis): Add struct expr_info * argument.
15983 Update to handle injuring definitions.
15984 (defs_y_dom_x): Ditto.
15985 (phi_opnd_from_res): Ditto.
15986 (phi_for_operand): Remove extra \.
15987 (find_tree_ref_for_var): Renamed to find_use_for_var. Update all
15989 Use orig_expr_map to lookup original expression, remove statement
15991 (find_rhs_use_for_var): New function.
15992 (is_strred_cand): New function.
15993 (is_injuring_def): New function.
15994 (calculate_increment): New function.
15995 (repair_injury): New function.
15996 (set_need_repair): New function.
15997 (struct expr_info): Add strred_cand member.
15998 (rename_2): Update to handle injuring definitions.
15999 (expr_phi_insertion): Ditto.
16000 (code_motion): Update to repair injuries.
16001 Only insert SIMPLE statements.
16002 Free avdefs here now.
16003 (finalize_1): Don't free avdefs anymore here.
16004 (tree_perform_ssapre): Record original expresion for
16005 find_use_for_var's benefit.
16006 Determine strength reduction candidates.
16008 * tree-flow.h: Remove EXPR* macros in favor of inline functions.
16011 * tree-dfa.c: Change EXPR* macros to the new functions.
16014 2002-09-18 Diego Novillo <dnovillo@redhat.com>
16016 * tree-dfa.c (M_ADDRESSOF): Define.
16017 (find_refs_in_expr): Create addressof-use references for ADDR_EXPR
16019 Don't create references for FUNCTION_DECL nodes.
16020 (ref_type_name): Handle M_ADDRESSOF.
16021 (validate_ref_type): Ditto.
16022 (clobber_vars_r): Don't clobber FUNCTION_DECL nodes.
16023 * tree-flow.h (M_ADDRESSOF): Declare.
16025 2002-09-17 Diego Novillo <dnovillo@redhat.com>
16027 * doc/invoke.texi: Document -ftree-ssa-dce and -fdump-tree-dce.
16028 * cp/Make-lang.in (CXX_C_OBJS): Add tree-ssa-dce.o.
16030 2002-09-17 Ben Elliston <bje@redhat.com>
16032 * Makefile.in (C_AND_OBJC_OBJS): Add tree-ssa-dce.o.
16033 tree-ssa-dce.o): New target.
16034 * tree-ssa-dce.c: New file.
16035 * flags.h (flag_tree_ssa_dce): Declare flag.
16036 * tree.h (tree_dump_index): Add TDI_dce.
16037 * toplev.c (flag_tree_ssa_dce): New flag.
16038 (f_options): Add "dump-tree-all-ssa" option.
16039 * tree-flow.h (enum tree_flags): Add TF_NECESSARY.
16040 * tree-dump.c (dump_files): Add dump-tree-dce option.
16041 (dump_enable_all_ssa): Enable it when dumping all.
16042 * tree-optimize.h (tree_ssa_eliminate_dead_code): Declare.
16043 * tree-optimize.c (optimize_function_tree): Invoke the
16044 optimisation pass if flag_tree_ssa_dce is set.
16046 2002-09-17 Diego Novillo <dnovillo@redhat.com>
16048 * Makefile.in (tree-ssa.o): Add dependency on c-tree.h
16049 * c-simplify.c (mark_not_simple_r): Don't mark IDENTIFIER_NODEs.
16050 * tree-dfa.c (function_may_recurse_p): Fix comment.
16051 (dump_ref): Don't dump immediate uses for PHI nodes more than once.
16052 (dump_referenced_vars): Unparse the name of the variable.
16053 * tree-flow.h (dump_tree_ssa): Declare.
16054 (debug_tree_ssa): Declare.
16055 (replace_ref_operand_with): Check if OPERAND_P is NULL.
16056 (restore_ref_operand): Ditto.
16057 (tree_annotation): Check that constants, types and IDENTIFIER_NODEs
16058 are not being annotated.
16059 * tree-ssa.c: Include c-tree.h.
16060 (dump_reaching_defs): Unparse the variable name.
16061 (dump_tree_ssa): New function.
16062 (tree_build_ssa): Call it.
16063 (debug_tree_ssa): New function.
16065 2002-09-14 Steven Bosscher <s.bosscher@student.tudelft.nl>
16067 * dwarf2out.c (is_fortran): Return true for
16069 (gen_compile_unit_die): Return DW_LANG_Fortran95 if
16070 language is "GNU F95".
16072 2002-09-13 Daniel Berlin <dberlin@dberlin.org>
16074 * tree-dump.c (dump_switch_p): Get longest match, not first one.
16076 * tree.h: Put TDI_* back in order, now that we do longest match
16079 2002-09-13 Diego Novillo <dnovillo@redhat.com>
16081 * tree-dfa.c (add_call_site_clobbers): Call decl_function_context
16082 instead of DECL_CONTEXT.
16083 * tree-ssa-ccp.c (initialize): Ditto.
16084 * tree-ssa.c (analyze_rdefs): Ditto.
16086 2002-09-11 Diego Novillo <dnovillo@redhat.com>
16088 * tree-dfa.c (find_refs_in_stmt): Call clobber_vars_r to clobber
16089 CLEANUP_STMT nodes.
16090 (create_ref): Only add _DECL nodes to the list of referenced
16092 (clobber_vars_r): Create a may-use reference prior to clobbering
16094 (add_call_site_clobbers): Ditto.
16095 (add_ptr_may_refs): Move call to find_list_node where it's actually
16097 * tree-flow.h: Update documentation on M_CLOBBER.
16099 2002-09-10 Daniel Berlin <dberlin@dberlin.org>
16101 * tree-ssa-pre.c (defs_match_p): Fix typo ( | -> || ).
16103 2002-09-10 Diego Novillo <dnovillo@redhat.com>
16105 * tree-dfa.c (V_PHI_ARG): Remove. Adjust related constants.
16107 (add_ref_to_list_after): Don't allocate memory for the
16108 node when adding to the beginning or the end of the list.
16109 (add_phi_arg): Don't call create_ref to add a new argument.
16110 (debug_phi_args): New function.
16111 (dump_phi_args): New function.
16112 (dump_ref): Call it.
16113 (dump_referenced_vars): Use 'file' instead of 'dump_file'.
16115 * tree-flow.h (V_PHI_ARG): Remove. Update all users.
16116 (struct var_ref): Move fields used in distinct
16117 reference types to other structures. Update all users.
16118 (struct var_def): New.
16119 (struct var_phi): New.
16120 (struct var_use): New.
16121 (union tree_ref_d): Add members vdef, vphi, vuse and vphi_arg.
16123 (save_chain): Remove. Update all users.
16124 (set_save_chain): Remove. Update all users.
16125 (marked_with): Remove. Update all users.
16126 (mark_def_with): Remove. Update all users.
16127 (dump_reaching_defs): Declare.
16128 (debug_reaching_defs): Declare.
16130 (struct phi_node_arg_d): New structure.
16131 (phi_node_arg): New type.
16132 (phi_arg): Change return type to phi_node_arg.
16133 (imm_reaching_def_edge): Rename to phi_arg_edge.
16134 (set_imm_reaching_def_edge): Rename to set_phi_arg_edge.
16135 (phi_arg_def): New inline function.
16136 (set_phi_arg_def): New inline function.
16137 (debug_phi_args): Declare.
16138 (dump_phi_args): Declare.
16140 * tree-ssa-ccp.c: Use new phi_node_arg type when examining PHI node
16143 * tree-ssa-pre.c: Ditto.
16145 * tree-ssa.c (save_chain): New local variable.
16146 (build_fud_chains, search_fud_chains): Use it.
16147 (marked): New local variable.
16148 (tree_compute_rdefs, follow_chain): Use it.
16149 (dump_reaching_defs): New function.
16150 (debug_reaching_defs): New function.
16152 2002-09-09 Daniel Berlin <dberlin@dberlin.org>
16154 * Makefile.in (tree-alias-steen.o): Remove gt-tree-alias-steen.h
16155 (tree-alias-common.o): Add dependency on c-common.h
16157 * tree-ssa-pre.c: Fix PRE now that V_USE's expr's are the entire
16158 assignment, rather than just the right hand side.
16159 Stop generating our own call clobbers
16161 * tree-dfa.c (create_ref): Make sure var is not null before checking
16162 TREE_THIS_VOLATILE.
16164 * tree.h: Reorder TDI_* so ssapre comes before ssa.
16166 * tree-dump.c: dump-tree-ssapre has to come before dump-tree-ssa
16167 in the table, or else it'll never match.
16169 2002-09-09 Frank Ch. Eigler <fche@redhat.com>
16171 * tree-mudflap.c (mf_offset_expr_of_array_ref): Fold constants along
16173 (mf_build_check_statement_for): Ditto. Flag new COMPONENT_REFs.
16174 (mx_xfn_indirect_ref): Instrument COMPONENT_REFs specially. Tweak
16175 ARRAY_REF instrumentation to reduce need of copying and recursion.
16177 2002-09-09 Diego Novillo <dnovillo@redhat.com>
16179 * tree-ssa.c (analyze_rdefs): Disable uninitialized variable warnings.
16181 2002-09-09 Diego Novillo <dnovillo@redhat.com>
16183 * Makefile.in (tree-ssa.o): Add dependency on tree-simple.h.
16184 (tree-dfa.o): Add dependency on tree-simple.h and tree-inline.h.
16185 (tree-alias-steen.o): Add dependency on c-common.h.
16186 (tree-optimize.o): Add dependency on c-common.h.
16188 * c-simplify.c (deep_copy_node): Call walk_tree with mostly_copy_tree_r.
16189 (mostly_copy_tree_r): Also copy flags from original tree.
16190 (mark_not_simple_r): Call set_tree_flag.
16192 * tree-alias-steen.c: Include c-common.h.
16194 * tree-cfg.c (map_stmt_to_bb): Remove.
16195 (block_invalidates_loop): Change return type to bool.
16196 (create_loop_hdr): New function.
16197 (create_bb): Call it.
16198 (create_bb_ann): Return newly created annotation object.
16199 (remove_bb_ann): Nullify loop_hdr annotation, if there is one.
16200 (tree_delete_bb): Only remove basic block annotation from
16201 executables statements.
16202 (is_computed_goto): New function.
16204 * tree-dfa.c (pointer_refs): New file local variable.
16205 (call_sites): New global variable.
16206 (V_DEF, V_USE, V_PHI, V_PHI_ARG, E_FCALL, E_PHI, E_USE, E_KILL,
16207 E_INJ): New global constants.
16208 (M_DEFAULT, M_CLOBBER, M_MAY, M_PARTIAL, M_INITIAL, M_INDIRECT,
16209 M_VOLATILE): New global constants.
16210 (num_referenced_vars): New global variable.
16211 (referenced_vars): Rename from referenced_symbols. Update all
16213 (clobber_vars_r): New function.
16214 (add_default_defs): New function.
16215 (add_call_site_clobbers): New function.
16216 (add_ptr_may_refs): New function.
16217 (add_phi_arg): New function.
16218 (find_list_node): New function.
16219 (remove_ref_from_list): Call it.
16220 (add_ref_to_list_after): New function.
16221 (is_pure_fcall): New function.
16222 (fcall_takes_ref_args): New function.
16223 (dump_referenced_vars): New function.
16224 (debug_referenced_vars): New function.
16225 (ref_type_name): New function.
16226 (validate_ref_type): New function.
16227 (debug_phi_args): Remove.
16228 (dump_phi_args): Remove.
16229 (add_referenced_var): Rename from add_ref_symbol. Update all
16231 (dump_ref): Rename from dump_varref. Update all users.
16232 (debug_ref): Rename from debug_varref. Update all users.
16233 (dump_ref_list): Rename from dump_varref_list. Update all users.
16234 (dump_ref_array): Rename from dump_varref_array. Update all users.
16235 (next_tree_ref_id): Rename from next_varref_id. Update all users.
16237 (tree_find_refs): Rename from tree_find_varrefs. Update all users.
16238 Call add_default_defs.
16239 Call add_call_site_clobbers.
16240 Call add_ptr_may_refs.
16241 Call dump_referenced_vars.
16242 Create and destroy pointer_refs list.
16244 (find_refs_in_stmt): Set reference type to clobbering definition
16245 for the ASM_OUTPUTS and ASM_CLOBBERS expressions of an ASM_STMT.
16246 Set reference type to initial definition for the DECL_INITIAL node
16248 Clobber everything in CLEANUP_STMT nodes.
16250 (find_refs_in_expr): Re-write.
16251 Recursively clobber every VAR_DECL contained in non SIMPLE nodes.
16252 Mark indirect pointer references with M_INDIRECT flag.
16253 Add pointer references to pointer_refs list.
16254 Glob references to arrays and structures.
16255 Add function call expressions to call_sites list.
16257 (empty_ref_list): Do nothing if the list is empty already.
16258 (delete_ref_list): Ditto.
16259 (create_ref): Add new argument ADD_TO_BB.
16260 Set M_VOLATILE modifier if this is a reference to a volatile
16262 Count number of incoming edges for V_PHI references before
16263 initializing the V_PHI_ARG array.
16264 Only add reference to basic block if ADD_TO_BB is true.
16265 Set output reference for the parent expression for V_DEF
16267 (remove_tree_ann): Do nothing if the tree didn't have an
16270 * tree-flow.h (enum treeref_type): Remove. Update all users.
16271 (union varref_def): Ditto.
16272 (tree_ref): Rename from varref. Update all users.
16276 (V_PHI_ARG): Declare.
16277 (E_FCALL): Declare.
16282 (M_DEFAULT): Declare.
16283 (M_CLOBBER): Declare.
16285 (M_PARTIAL): Declare.
16286 (M_INITIAL): Declare.
16287 (M_INDIRECT): Declare.
16288 (M_VOLATILE): Declare.
16289 (struct tree_ref_common): Rename from treeref_common. Update all
16291 Change type of field 'type' to HOST_WIDE_INT.
16292 Rename field 'sym' to 'var'.
16293 (struct var_ref): Rename from varref. Update all users.
16294 Join the structures varuse
16295 and vardef into a single structure.
16296 (struct expr_ref_common): Rename from exprref_common. Update all
16298 (struct expr_use): Rename from expruse. Update all users.
16299 (struct expr_phi): Rename from exprphi. Update all users.
16300 (union tree_ref_d): Rename from varref_def. Update all users.
16301 (EXPRPHI_PHI_ARGS): Rename from EXPRPHI_PHI_CHAIN. Update all
16303 (struct tree_ann_d): Rename field 'compound_stmt' to
16305 Add field 'output_ref'.
16306 (enum tree_flags): New enum.
16307 (TF_REFERENCED): New flag.
16309 (get_num_phi_args): Remove.
16310 (get_phi_arg): Remove.
16312 (struct vardef): Remove. Update all users.
16313 (VARDEF_IMM_USES): Ditto.
16314 (VARDEF_SAVE_CHAIN): Ditto.
16315 (VARDEF_RUSES): Ditto.
16316 (VARDEF_MARKED): Ditto.
16317 (VARDEF_PHI_ARGS): Ditto.
16318 (struct varuse): Ditto.
16319 (VARUSE_IMM_RDEF): Ditto.
16320 (VARUSE_RDEFS): Ditto.
16321 (VARREF_ID): Ditto.
16322 (VARREF_TYPE): Ditto.
16323 (VARREF_BB): Ditto.
16324 (VARREF_EXPR): Ditto.
16325 (VARREF_OPERAND_P): Ditto.
16326 (VARREF_STMT): Ditto.
16327 (VARREF_SYM): Ditto.
16328 (IS_DEFAULT_DEF): Ditto.
16329 (IS_ARTIFICIAL_REF): Ditto.
16331 (BB_FOR_STMT): Ditto.
16332 (TREE_CURRDEF): Ditto.
16333 (TREE_REFS): Ditto.
16334 (TREE_COMPOUND_STMT): Ditto.
16335 (TREE_FLAGS): Ditto.
16337 (BB_PARENT): Ditto.
16339 (BB_PREV_CHAIN_P): Ditto.
16340 (BB_BINDING_SCOPE): Ditto.
16341 (BB_LOOP_HDR): Ditto.
16342 (FOR_INIT_STMT_BB): Ditto.
16343 (FOR_COND_BB): Ditto.
16344 (FOR_EXPR_BB): Ditto.
16345 (END_WHILE_BB): Ditto.
16346 (DO_COND_BB): Ditto.
16347 (BB_EMPTY_P): Ditto.
16349 (ref_type): New inline function.
16350 (ref_var): New inline function.
16351 (ref_stmt): New inline function.
16352 (ref_expr): New inline function.
16353 (ref_bb): New inline function.
16354 (ref_id): New inline function.
16355 (replace_ref_operand_with): New inline function.
16356 (restore_ref_operand): New inline function.
16357 (imm_uses): New inline function.
16358 (save_chain): New inline function.
16359 (set_save_chain): New inline function.
16360 (reached_uses): New inline function.
16361 (marked_with): New inline function.
16362 (mark_def_with): New inline function.
16363 (phi_args): New inline function.
16364 (num_phi_args): New inline function.
16365 (phi_arg): New inline function.
16366 (imm_reaching_def): New inline function.
16367 (set_imm_reaching_def): New inline function.
16368 (imm_reaching_def_edge): New inline function.
16369 (set_imm_reaching_def_edge): New inline function.
16370 (reaching_defs): New inline function.
16371 (tree_annotation): New inline function.
16372 (has_annotation): New inline function.
16373 (bb_for_stmt): New inline function.
16374 (set_bb_for_stmt): New inline function.
16375 (currdef_for): New inline function.
16376 (set_currdef_for): New inline function.
16377 (tree_refs): New inline function.
16378 (add_tree_ref): New inline function.
16379 (remove_tree_ref): New inline function.
16380 (compound_parent): New inline function.
16381 (set_compound_parent): New inline function.
16382 (set_tree_flag): New inline function.
16383 (clear_tree_flag): New inline function.
16384 (tree_flags): New inline function.
16385 (reset_tree_flags): New inline function.
16386 (output_ref): New inline function.
16387 (set_output_ref): New inline function.
16388 (bb_annotation): New inline function.
16389 (bb_parent): New inline function.
16390 (set_bb_parent): New inline function.
16391 (bb_refs): New inline function.
16392 (remove_bb_ref): New inline function.
16393 (prev_chain_p): New inline function.
16394 (set_prev_chain_p): New inline function.
16395 (binding_scope): New inline function.
16396 (set_binding_scope): New inline function.
16397 (header_blocks): New inline function.
16398 (for_init_bb): New inline function.
16399 (set_for_init_bb): New inline function.
16400 (for_cond_bb): New inline function.
16401 (set_for_cond_bb): New inline function.
16402 (for_expr_bb): New inline function.
16403 (set_for_expr_bb): New inline function.
16404 (end_while_bb): New inline function.
16405 (set_end_while_bb): New inline function.
16406 (do_cond_bb): New inline function.
16407 (set_do_cond_bb): New inline function.
16408 (bb_empty_p): New inline function.
16410 (referenced_vars): Rename from referenced_symbols. Update all
16412 (num_referenced_vars): Declare.
16413 (NREF_SYMBOLS): Remove. Update all users.
16414 (REF_SYMBOL): Ditto.
16415 (ADD_REF_SYMBOL): Ditto.
16416 (referenced_var): New inline function.
16417 (call_sites): Declare.
16418 (next_tree_ref_id): Rename from next_varref_id. Update all users.
16419 (is_computed_goto): Declare.
16420 (is_pure_fcall): Declare.
16421 (fcall_takes_ref_args): Declare.
16422 (add_ref_to_list_after): Declare.
16423 (find_list_node): Declare.
16424 (ref_type_name): Declare.
16425 (validate_ref_type): Declare.
16427 * tree-optimize.c: Include c-common.h.
16428 (optimize_function_tree): Store DECL_SAVED_TREE in a local
16431 * tree-ssa-ccp.c (cp_lattice_meet): New function.
16432 (visit_phi_node): Call it.
16433 (add_outgoing_control_edges): New function.
16434 (visit_expression_for): Call it.
16435 Don't handle static initializers.
16436 Handle computed gotos.
16437 (add_control_edge): New function.
16438 (visit_condexpr_for, simulate_block, add_outgoing_control_edges): Call
16440 (simulate_def_use_chains): Only look at unmodified V_USE references.
16441 (ssa_ccp_substitute_constants): Ditto.
16442 (evaluate_expr): Ditto.
16443 (initialize): Set initial value for incoming parameters and globals
16445 Set initial value for initialized static variables to VARYING,
16446 unless the variable is read-only.
16447 (set_lattice_value): Don't special case globals, volatiles and
16448 variables with their address taken.
16450 * tree-ssa.c: Include tree-simple.h.
16451 (tree_build_ssa): Don't add default definitions.
16452 (insert_phi_terms): Add new PHI nodes at the beginning of the list
16453 of references for the basic block.
16454 (search_fud_chains): Add def-def chains for non-killing
16456 (delete_ssa): Remove list call_sites.
16457 Set num_referenced_vars to 0.
16458 Set referenced_vars to NULL.
16459 (follow_chain): Follow def-def chains for non-killing definitions.
16460 (is_upward_exposed): Change return type to bool.
16461 (add_phi_arg): Remove.
16463 2002-09-06 Frank Ch. Eigler <fche@redhat.com>
16465 * tree-mudflap.c (deferred_static_decl*): Correct GTY markup.
16466 (mudflap_enqueue_decl): Correct iteration bounds.
16467 (mf_init_extern_trees): Add more constness to mf_cache_structptr_type.
16468 (mf_offset_expr_of_array_ref): Remove excess mx_flagging. save_expr
16470 (mf_build_check_statement_for): Reorganize to take explicit
16471 check-base/size arguments, in addition to value argument. save_expr
16472 array subscripts. Copy value/base/size subtrees.
16473 (mx_xfn_indirect_ref): Support marking of subtrees for nontraversal.
16474 Track source line numbers more aggressively. For arrays, check bounds
16475 from base through indexed element, not just the indexed element.
16476 Use nontraversal flagging to eliminate some excess instrumentation.
16477 (mf_xform_derefs): Support nontraversal by a hash table.
16478 (*): Remove "{{{"/"}}}" folding marks.
16480 2002-09-02 Daniel Berlin <dberlin@dberlin.org>
16482 * tree-alias-common.[ch]: New files.
16483 * tree-alias-steen.[ch]: Split out common stuff into
16484 tree-alias-common.[ch].
16485 * c-config-lang.in: Modify to use tree-alias-common.[ch] instead of
16486 tree-alias-steen, since this is where the GTY'd stuff is now.
16487 * Makefile.in: Add dependencies for tree-alias-common.[ch].
16489 2002-09-03 Diego Novillo <dnovillo@redhat.com>
16491 * c-simplify.c (simplify_goto_stmt): New function.
16492 (simplify_stmt): Call it.
16493 * tree-simple.c: Document grammar for GOTO_STMT nodes.
16494 (rationalize_compound_expr): Wrap it with #if 0/#endif.
16495 (get_base_symbol): Minor comment fixup.
16497 2002-09-03 Frank Ch. Eigler <fche@redhat.com>
16499 * gcc.c (MFWRAP_SPEC): Add --wrap=alloca.
16501 2002-09-01 Diego Novillo <dnovillo@redhat.com>
16503 * c-simplify.c (simplify_stmt): Mark CLEANUP_STMTs and ASM_STMTs
16505 (simplify_for_stmt): Do not allow expression sequences in
16506 FOR_INIT_STMT and FOR_EXPR nodes.
16507 * tree-simple.c: Document difference with original SIMPLE grammar.
16509 2002-08-31 Frank Ch. Eigler <fche@redhat.com>
16511 * tree-mudflap.c (mf_build_check_statement_for): Tolerate dereference
16513 (mx_register_decl): Correct typo in below patch.
16515 2002-08-30 Graydon Hoare <graydon@redhat.com>
16517 * tree-mudflap.c (mx_register_decl): Mark declarations as
16518 TREE_ADDRESSABLE when mudflap decides to register them.
16520 2002-08-29 Graydon Hoare <graydon@redhat.com>
16522 * tree-mudflap.c (mx_xfn_indirect_ref): Rewrite array references as
16523 pointer dereferences.
16524 (struct mf_xform_decls_data): New member: param_decls.
16525 (mx_register_decl): New function.
16526 (mx_xfn_xform_decls): Factor code out into mx_register_decl.
16527 Register live parameters with mudflap.
16528 (mx_xfn_find_addrof): Notice references to fields of structures
16529 and function parameters.
16531 2002-08-29 Frank Ch. Eigler <fche@redhat.com>
16533 * c-pretty-print.c (dump_c_tree): Detect loops in statement chains
16534 using a hash table to track visited status.
16535 * Makefile.in: Add hashtab.h dependency.
16537 2002-08-28 Frank Ch. Eigler <fche@redhat.com>
16539 * tree-mudflap.c (mudflap_enqueue_constant): Register non-string
16541 (mf_build_check_statement_for): Include pushlevel/pushdecl/poplevel
16542 for local variables.
16544 2002-08-27 Frank Ch. Eigler <fche@redhat.com>
16546 Better static registration:
16547 * varasm.c (make_decl_rtl): Handle DECL_RTL_SET_P case for
16548 mudflap static registration.
16549 * tree-mudflap.c (mudflap_enqueue_decl): Rewrite to handle
16551 (mudflap_finish_file): Call above fn back for deferred statics.
16554 * tree-mudflap.c (mf_varname_tree, mf_file_function_line_tree):
16555 Reorganize output_buffer reuse mechanism.
16556 (mf_build_check_statement_for): Set TREE_SIDE_EFFECTS.
16557 (mx_xfn_indirect_ref): Correct file/line collection tests.
16559 Dynamic linking support:
16560 * gcc.c (MFWRAP_SPEC): Make conditional on -static. Add the
16561 newer wrapped functions dlopen/mmap/munmap.
16562 (MFLIB_SPEC): Be sensitive to -static. Partial support for
16565 2002-08-26 Diego Novillo <dnovillo@redhat.com>
16567 * Makefile.in (tree-ssa.o): Add dependency on ggc.h
16568 (c-simplify.o): Add dependency on langhooks-def.h
16569 * c-simplify.c: Include langhooks-def.h
16570 (simplify_function_tree): Do nothing if the front end does not
16571 support simplification.
16573 * tree-flow.h (struct vardef): Remove fields 'phi_chain' and
16575 Add field 'phi_args'.
16576 (VARDEF_PHI_CHAIN): Remove. Update all users.
16577 (VARDEF_PHI_CHAIN_BB): Remove. Update all users.
16578 (VARDEF_PHI_ARGS): Define.
16579 (struct varuse): Rename field 'chain' to 'imm_rdef'. Update all
16581 (VARUSE_IMM_RDEF): Rename from VARUSE_CHAIN. Update all users.
16582 (phi_arg): New structure.
16583 (get_num_phi_args): New function.
16584 (get_phi_arg): New function.
16585 (set_phi_arg): New function.
16586 (add_phi_arg): New function.
16587 (debug_phi_args): Declare.
16588 (dump_phi_args): Declare.
16589 * tree-dfa.c (create_ref): Remove initialization of
16590 VARDEF_PHI_CHAIN and VARDEF_PHI_CHAIN_BB.
16591 Initialize array VARDEF_PHI_ARGS.
16592 (dump_varref): Call dump_phi_args.
16593 (dump_phi_args): New function.
16594 (debug_phi_args): New function.
16595 * tree-ssa-ccp.c (PHI_PARMS): Remove.
16597 (visit_phi_node): Get the argument's edge directly from the
16598 argument instead of calling find_edge.
16599 (initialize): Cast call to NUM_EDGES to unsigned.
16600 * tree-ssa-pre.c: Update uses of VARDEF_PHI_CHAIN,
16601 VARDEF_PHI_CHAIN_BB and VARUSE_CHAIN everywhere.
16602 * tree-ssa.c: Ditto.
16604 (search_fud_chains): Call add_phi_arg to add arguments to each PHI
16606 (tree_ssa_remove_phi_alternative): Call set_phi_arg to switch the
16607 last element with the element being removed.
16609 2002-08-26 Diego Novillo <dnovillo@redhat.com>
16611 * c-simplify.c (mostly_copy_tree_r): Unshare STMT_EXPR
16614 2002-08-25 Diego Novillo <dnovillo@redhat.com>
16616 * tree-dfa.c (find_refs_in_stmt): Replace calls to
16617 RETURN_EXPR with RETURN_STMT_EXPR.
16618 * c-simplify.c (simplify_return_stmt): Ditto.
16619 (deep_copy_node): Ditto.
16620 * c-pretty-print.c (dump_c_node): Ditto.
16622 2002-08-24 Diego Novillo <dnovillo@redhat.com>
16624 * c-pretty-print.c: Add `break' after calls to NIY in
16627 2002-08-23 Jeffrey A Law (law@redhat.com)
16629 * tree-ssa-ccp.c (tree_ssa_ccp): Remove #if 0 that accidentally
16630 got checked in. Cleanup the cfg to remove unreachable blocks
16633 * basic-block.h (EDGE_EXECUTABLE): New edge flag.
16635 * cfganal.c (find_edge): New function.
16637 * ssa-ccp.c: Convert to use EDGE_EXECUTABLE bit in the
16638 edge flags rather than a bitmap. Convert edge worklist
16639 into a varray. Avoids expensive find_index_edge calls.
16640 * tree-ssa-ccp.c: Likewise.
16642 * tree-flow.h (tree_ssa_remove_phi_alternative): Declare.
16643 * tree-ssa.c (tree_ssa_remove_phi_alternative): New function.
16644 * tree-ssa-ccp.c (optimize_unexecutable_edges): Remove
16645 PHI alternatives for unexecutable edges. Also remove
16646 unexecutable edges from the CFG.
16648 2002-08-22 Jeffrey A Law (law@redhat.com)
16650 * Makefile.in (tree-optimize.o): Depend on tree-dchain.o
16651 * tree-optimize.c: Include tree-dchain.h.
16652 (optimize_function_tree): Unconditionally build and tear down
16653 the backpointers for the statement chain.
16655 2002-08-22 Diego Novillo <dnovillo@redhat.com>
16657 * tree-dfa.c (find_refs_in_stmt): Look for VARUSE references in
16658 initialization expressions.
16659 (find_refs_in_expr): Reformat.
16660 (remove_ref_from_list): Optimize for the common case of removing
16661 the head or the tail of the list.
16662 (add_ref_to_list_end): Reformat comment.
16663 (create_ref): Store the reference to LHS of assignment expressions.
16664 (dump_varref): Also dump immediate uses of PHI nodes.
16665 * tree-flow.h (IS_GHOST_DEF): Rename to IS_DEFAULT_DEF. Update all
16666 callers everywhere.
16667 (struct tree_ann_def): Update comments for field 'currdef'.
16668 * tree-ssa-ccp.c (ssa_edges): Change type to ref_list.
16669 (SSA_NAME): Remove.
16670 (initialize): New function
16671 (finalize): New function.
16672 (visit_expression): Rename to visit_expression_for. Update all
16674 (visit_condexpr_for): New function.
16675 (visit_assignment): Rename to visit_assignment_for. Update all
16677 (examine_flow_edges): Rename to simulate_block. Update all
16679 (follow_def_use_chains): Rename to simulate_def_use_chains. Update
16681 (evaluate_expr_for): Rename to evaluate_expr. Change argument to
16683 (set_lattice_value): New function.
16684 (tree_ssa_ccp): Change main loop to visit flow_edges and ssa_edges
16686 (visit_phi_node): Do not set the lattice value to UNDEFINED when we
16687 find a non-executable edge.
16688 (visit_expression_for): Default definitions for PARM_DECLs are
16689 assigned a VARYING value.
16690 Default definitions for any other local variables are assigned an
16692 Clobber VARDEFs that are not the LHS of an assignment.
16693 Clobber VARDEFs that initialize non-const static variables.
16694 * tree-ssa.c (search_fud_chains): Set up def-use edges for PHI
16695 nodes and regular definitions.
16697 * tree.c (simple_cst_equal): Call simple_cst_list_equal to compare
16698 CONSTRUCTOR_ELTS pointers.
16700 2002-08-22 Diego Novillo <dnovillo@redhat.com>
16702 * c-pretty-print.c (buffer): New file local variable.
16703 (initialized): New file local variable.
16704 (print_c_tree): Don't call init_output_buffer. Call
16705 maybe_init_pretty_print.
16706 (print_c_node): Ditto.
16707 (print_c_node_brief): Ditto.
16708 (maybe_init_pretty_print): New function.
16709 * tree-mudflap.c (mf_varname_tree): Only call init_output_buffer
16710 once. Call output_clear_message_text before returning.
16712 2002-08-21 Frank Ch. Eigler <fche@redhat.com>
16714 Support source-file/line coordinates in check/violation messages.
16715 * tree-mudflap.c (mf_init_extern_trees): Add new "location" formal
16717 (mf_file_function_line_tree): New function to build an actual location
16719 (build_check_statement_for): Call it / pass it.
16720 (mx_xfn_indirect_ref): Track source file/line location via
16721 STMT_LINENO, FILE_STMT, EXPR_WITH_FILE_LOCATION traversal memos.
16723 2002-08-21 Daniel Berlin <dberlin@dberlin.org>
16725 * dominance.c: Cache immediate dominators.
16727 2002-08-20 Daniel Berlin <dberlin@dberlin.org>
16729 * tree-alias-steen.h (struct tree_alias_ops): Add flag for
16732 * tree-alias-steen.c (steen_alias_ops): Set interprocedural to 0
16734 (intra_function_call): New function to handle intraprocedural calling.
16735 (finc_func_aliases): Use it.
16736 Handle *x = *y, *x = &y, and *x = (cast) y.
16737 (display_points_to_set_helper): New function, split from ...
16738 (display_points_to_set): Here.
16739 (create_alias_vars): Try to print all alias vars we find in the
16740 alias_vars array, rather than just those that are linked directly to
16742 Clear arrays when we finish if we aren't interprocedural.
16744 2002-08-20 Frank Ch. Eigler <fche@redhat.com>
16746 static object registration support:
16747 * tree-mudflap.c (mudflap_enqueue_decl, mudflap_enqueue_constant):
16748 Replace stubs with real code.
16749 (mf_enqueue_register_call): New function to generate asm-object
16750 call to __mf_register.
16751 (mf_flush_enqueued_calls): New function to emit global ctor function
16752 with enqueued __mf_register calls.
16753 (mf_varname_tree): Tolerate being called from non-function context.
16754 * c-objc-common.c: #include <tree-mudflap.h>.
16756 gengtypes support for mudflap:
16757 * Makefile.in (GTFILES): Include tree-mudflap.c.
16758 (gt-tree-mudflap.h): New target.
16759 * tree-mudflap.c: Annotate global tree nodes with GTY(()).
16760 * tree-nomudflap.c: Add dummy ggc root table.
16762 2002-08-19 Diego Novillo <dnovillo@redhat.com>
16764 * tree-dfa.c (find_refs_in_expr): If the current sub-expression is
16765 not SIMPLE, mark its parent.
16766 (create_ref): If the parent expression is not SIMPLE, create
16767 VARDEFs regardless of the original reference type.
16769 * tree-ssa-ccp.c (widen_bitfield): New function.
16770 (evaluate_expr_for): Call it.
16772 2002-08-18 Diego Novillo <dnovillo@redhat.com>
16774 * tree-ssa-ccp.c (evaluate_expr_for): Fix thinko in
16777 2002-08-17 Diego Novillo <dnovillo@redhat.com>
16779 * tree-ssa-ccp.c (evaluate_expr_for): keep VARREF_SYM in a local
16782 2002-08-16 Diego Novillo <dnovillo@redhat.com>
16784 * basic-block.h (BB_CONTROL_EXPR): Update value.
16785 (BB_LOOP_CONTROL_EXPR): Define.
16786 (BB_CONTROL_ENTRY): Update value.
16787 * tree-cfg.c (make_for_stmt_blocks): Flag header blocks withh
16788 BB_LOOP_CONTROL_EXPR.
16789 (make_while_stmt_blocks): Ditto.
16790 (make_do_stmt_blocks): Ditto.
16791 (tree_delete_bb): Update annotations in the loop entry block when
16792 removing one of the loop expression blocks.
16794 * tree-dfa.c (tree_find_varrefs): Disregard empty blocks.
16795 (find_refs_in_stmt): Handle all the loop expression blocks in
16796 FOR_STMT and DO_STMT nodes.
16797 (find_refs_in_expr): Change first argument to tree *. Update all
16799 Force all references to be definitions when the expression is not
16801 Also create references for compound variables and array references.
16802 Not just their individual components.
16803 Always use the original parent expression when making recursive
16805 (create_ref): Add new argument operand_p. Update all callers.
16806 (remove_tree_ann): New function.
16807 (dump_varref): Don't assume that the referenced symbol is a _DECL
16809 * tree-flow.h (treeref_common): Add field operand_p.
16810 (VARREF_OPERAND_P): Define.
16811 (BB_EMPTY_P): Define.
16812 (remove_tree_ann): Declare.
16813 (create_ref): Add new argument operand_p.
16814 * tree-simple.c (get_base_symbol): New function.
16815 * tree-simple.h (get_base_symbol): Declare.
16816 * tree-ssa-ccp.c (visit_assignment): Call it.
16817 (ssa_ccp_substitute_constants): Use VARREF_OPERAND_P to replace
16818 values into the expression.
16819 (evaluate_expr_for): Ditto.
16820 Do not try to evaluate the expression if the reference is not of
16821 the same type as the expression.
16822 After evaluation, restore the expression to its original form.
16823 * tree-ssa-pre.c (insert_occ_in_preorder_dt_order_): Update calls
16825 (finalize_): Ditto.
16826 (expr_phi_insertion): Ditto.
16827 * tree-ssa.c (tree_build_ssa): Ditto.
16828 (insert_phi_terms): Ditto.
16829 (delete_ssa): Call remove_tree_ann.
16831 2002-08-15 Diego Novillo <dnovillo@redhat.com>
16833 * c-pretty-print.c: Move extern definitions to diagnostic.h.
16834 (print_c_node_brief): New function.
16835 (debug_c_node_brief): New function.
16836 (debug_c_node): Add option for showing brief versions of statement
16837 nodes. Update all callers.
16838 (print_declaration): Ditto.
16839 * c-simplify.c (simplify_function_tree): Add newline to debug
16841 * c-tree.h (print_c_node_brief): Declare.
16842 (debug_c_node_brief): Declare.
16843 * tree-cfg.c: Call print_c_node_brief in debugging otuput.
16844 * tree-mudflap.c (dump_c_node): Remove extern declaration.
16845 (mf_varname_tree): Update call to dump_c_node.
16847 2002-08-15 Daniel Berlin <dberlin@dberlin.org>
16849 * tree-cfg.c (find_expr_in_tree_helper): Renamed from find_expr_in_tree.
16850 (find_expr_in_tree): Redone.
16852 2002-08-15 Daniel Berlin <dberlin@dberlin.org>
16854 * tree-cfg.c (insert_before_ctrl_stmt): Fix insertion for various
16857 * tree-ssa-pre.c (finalize_1): Set EXPR_STMT type to type of
16860 2002-08-14 Frank Ch. Eigler <fche@redhat.com>
16862 * gcc.c (LINK_COMMAND_SPEC): Tweak placement of %(mflib).
16864 2002-08-14 Diego Novillo <dnovillo@redhat.com>
16866 * tree-simple.h (is_simple_decl_stmt): Declare.
16868 2002-08-13 Frank Ch. Eigler <fche@redhat.com>
16870 * gcc.c (MFWRAP_SPEC, MFLIB_SPEC): New macros, splitting MFLIB_SPEC.
16871 (mfwrap_spec, mflib_spec): Define corresponding vars.
16872 (static_specs): Define correponding spec aliases.
16873 (LINK_COMMAND_SPEC): Include -fmudflap refs to new spec aliases.
16874 (cpp_unique_options): Move -fmudflap MFCPP_SPEC clause here.
16875 (cc1_options): Move -fmudflap MFCC1_SPEC clause here.
16876 (MFCC1_SPEC, MFCPP_SPEC, MFLIB_SPEC): Remove macros and uses.
16878 2002-08-13 Graydon Hoare <graydon@redhat.com>
16880 * tree-mudflap.c (mf_build_check_statement_for): Factor code out of
16881 mx_xfn_indirect_ref for use in ARRAY_REF case.
16882 (mf_build_check_statement_for): Check size of underlying object
16883 rather than size of pointer.
16884 (mx_xfn_indirect_ref): Check ARRAY_REF expressions.
16885 (mf_offset_expr_of_array_ref): New function to calculate array ref
16888 2002-08-13 Diego Novillo <dnovillo@redhat.com>
16890 * tree-simple.c (is_simple_condexpr): Update comment.
16891 * tree-ssa-ccp.c (ssa_ccp_substitute_constants): Add debugging code.
16893 2002-08-12 Jason Merrill <jason@redhat.com>
16895 * c-typeck.c (build_component_ref): Don't add a NON_LVALUE_EXPR
16898 * c-simplify.c (simplify_expr): Always simplify. Loop if *expr_p
16900 (simplify_addr_expr): Just replace *expr_p if we have a '&*'.
16901 * tree-simple.c (is_simplifiable_builtin): Add more tree codes.
16903 2002-08-11 Diego Novillo <dnovillo@redhat.com>
16905 * c-simplify.c: Fix typo. Substitute CHECKING with ENABLE_CHECKING.
16906 * tree-cfg.c: Ditto.
16907 * tree-dfa.c: Ditto.
16908 * tree-ssa-ccp.c: Ditto.
16909 * tree-ssa.c: Ditto.
16911 2002-08-11 Diego Novillo <dnovillo@redhat.com>
16913 * tree-dfa.c (find_refs_in_expr): Use the given ref_type for some unary
16915 (create_ref): Insert ghost definitions at the beginning of the
16917 (find_expr_in_tree): Ignore IDENTIFIER_NODE.
16918 * tree-flow.h (treeref_common): Move the id field to the end of the
16920 (IS_GHOST_DEF): Redefine to return non zero for definitions
16921 without an associated expression in basic block 0.
16922 * tree-ssa-ccp.c (tree_ssa_ccp): Use last_basic_block to allocate
16924 (visit_expression): Set the lattice value for ghost definitions to
16926 (examine_flow_edges): Update comments.
16927 * tree-ssa.c (tree_build_ssa): Create ghost definitions in basic
16929 (insert_phi_terms): Don't ignore ghost definitions.
16931 * c-simplify.c (simplify_function_tree): Return 0 if the function's
16932 body is not a COMPOUND_STMT.
16933 Return 0 if simplification failed.
16934 (simplify_expr): Change to return int. Return non zero if
16935 simplification was successful.
16936 (c_simplify_expr): Add default case to avoid compile time warnings.
16937 (create_tmp_alias_var): Reformat comment.
16938 * tree-simple.h (simplify_expr): Change return type to int.
16940 * c-simplify.c: Guard consistency checks with #if defined CHECKING
16942 * tree-cfg.c: Ditto.
16943 * tree-dfa.c: Ditto.
16944 * tree-ssa-ccp.c: Ditto.
16945 * tree-ssa.c: Ditto.
16947 * c-simplify.c: Include hard-reg-set.h, basic-block.h and
16949 (mark_not_simple_r): New function.
16950 (simplify_expr): Temporarily mark VA_ARG_EXPR and BIT_FIELD_REF
16951 trees as not simplifiable.
16952 (simplify_call_expr): If the builtin cannot be simplified, flag it.
16953 * Makefile.in (c-simplify.o): Update dependencies.
16954 * tree-dfa.c (create_ref): Variable references inside
16955 non-simplifiable expressions are always considered definitions.
16956 * tree-flow.h (TF_NOT_SIMPLE): New flag.
16957 * tree-simple.c (is_simplifiable_builtin): Update comments.
16959 * c-pretty-print.c (dump_c_node): Unparse anonymous structures and
16961 Change rendering for SAVE_EXPR and BIT_FIELD_REF.
16963 * Makefile.in (tree-mudflap.o, tree-nomudflap.o): Add.
16965 2002-08-11 Frank Ch. Eigler <fche@redhat.com>
16967 Prototype -fmudflap support.
16968 * Makefile.in (C_AND_OBJC_OBJS): Add tree-mudflap.o.
16969 (OBJS): Add tree-nomudflap.o.
16970 * flags.h (flag_mudflap): New flag.
16971 * toplev.c: Map "-fmudflap" to that flag.
16972 * c-decl.c (c_expand_body): Call mudflap_c_function if flag_mudflap.
16973 * c-objc-common.c (c_objc_common_finish_file): Add mudflap hook.
16974 * varasm.c (make_decl_rtl): Add mudflap hook.
16975 (output_constant_def_contents): Ditto.
16976 * tree-mudflap.c: New file: implement mudflap instrumentation.
16977 * tree-nomudflap.c: New file: stub functions for non-C frontends.
16978 * tree-mudflap.h: New file: define exported functions.
16979 * gcc.c (MFLIB_SPEC, MFCC1_SPEC, MFCPP_SPEC): Add general
16980 -fmudflap spec mappings.
16981 * c-simplify.c (simplify_stmt): Stub: handle CLEANUP_STMT nodes.
16982 * tree-dfa.c (find_refs_in_stmt): Ditto.
16983 * c-pretty-print.c (dump_c_node): Ditto.
16984 (print_declaration): Handle "extern" decls. Handle arrays with
16986 * tree-simple.h (is_simple_stmt, is_simple_compstmt): Remove decls.
16988 2002-08-11 Jason Merrill <jason@redhat.com>
16990 * c-simplify.c (simplify_self_mod_expr): Unshare the lhs before
16992 (simplify_compound_lval): Don't unshare.
16994 * c-simplify.c (c_simplify_expr): Check statement_code_p.
16996 * c-simplify.c (maybe_fixup_loop_cond): Move to cp/cp-simplify.c.
16997 (simplify_for_stmt): Don't call it.
16998 (simplify_while_stmt): Don't call it.
17000 2002-08-11 Diego Novillo <dnovillo@redhat.com>
17002 * c-simplify.c (simplify_compound_lval): Use mostly_copy_tree_r.
17004 2002-08-09 Jason Merrill <jason@redhat.com>
17006 * langhooks-def.h: Replace the simplify_function_tree hook
17007 with a simplify_expr hook.
17008 * langhooks.h: Likewise.
17009 * langhooks.c: Replace lhd_simplify_function_tree with
17011 * c-lang.c (LANG_HOOKS_SIMPLIFY_FUNCTION_TREE): Don't define.
17012 (LANG_HOOKS_SIMPLIFY_EXPR): Define.
17013 * c-decl.c (c_expand_body): De-hook simplify_function_tree.
17014 * c-common.h: Declare c_simplify_expr.
17015 * c-simplify.c (simplify_function_tree): Rename from
17016 c_simplify_function_tree. Call simplify_expr instead of
17018 (c_simplify_expr): Split out from...
17019 (simplify_expr): ...here. No longer static. Call langhook.
17020 (is_simple_decl_stmt): Move here from tree-simple.c.
17021 * tree-simple.c: Don't include c-tree.h.
17022 (is_simple_stmt, is_simple_compstmt): Remove.
17023 (is_simple_decl_stmt): Move to c-simplify.c.
17024 * tree.h: Declare simplify_function_tree.
17025 * tree-simple.h: Declare simplify_expr, add_tree.
17027 * tree-simple.c (rationalize_compound_expr): New fn.
17029 2002-08-07 Diego Novillo <dnovillo@redhat.com>
17031 * basic-block.h (EDGE_TRUE_VALUE): Define.
17032 (EDGE_FALSE_VALUE): Define.
17033 * tree-cfg.c: Include c-tree.h.
17034 (make_for_stmt_edges): Call simple_cst_equal to determine infinite
17035 and zero iteration loops.
17036 Set EDGE_TRUE_VALUE and EDGE_FALSE_VALUE to edges coming out of
17038 (make_while_stmt_edges): Ditto.
17039 (make_do_stmt_edges): Ditto.
17040 (make_if_stmt_edges): Set EDGE_TRUE_VALUE and EDGE_FALSE_VALUE to
17041 edges coming out of predicate block.
17043 * c-simplify.c (simplify_compound_lval): Unshare the compound
17044 reference before simplification.
17046 * tree-cfg.c (insert_before_ctrl_stmt): Call print_c_node instead of
17048 (insert_before_normal_stmt): Ditto.
17049 (insert_after_ctrl_stmt): Ditto.
17050 (insert_after_normal_stmt): Ditto.
17051 (insert_after_loop_body): Ditto.
17052 (replace_expr_in_tree): Ditto.
17053 (tree_dump_bb): Ditto.
17055 * tree-dfa.c: Include c-tree.h
17056 (next_varref_id): New global variable.
17057 (tree_find_varrefs): Initialize it to 0.
17058 (create_ref): Increment it after creating a new reference. Store
17059 it in ref.common.id.
17060 Add the new reference to the list of references for the containing
17062 (dump_varref): Show the reference ID.
17063 * tree-flow.h (treeref_common): Add field 'id'.
17064 (VARREF_ID): Define.
17066 * tree-dump.c (dump_files): Re-order dump files.
17067 * tree.h (tree_dump_index): Ditto.
17069 * tree-optimize.c (optimize_function_tree): Remove blank lines.
17071 * tree-simple.c: Remove unary operator '!' from grammar.
17073 * tree-flow.h (tree_ann_def): Add field 'flags'.
17075 (TREE_ANN): Re-define into an lvalue.
17076 (BB_FOR_STMT): Ditto.
17077 (TREE_CURRDEF): Ditto.
17078 (next_varref_id): Declare.
17079 * tree-ssa-ccp.c: Include tree-simple.h
17080 (ssa_edges): Convert sbitmap into varray_type. Update all uses.
17081 (decl_map): Remove.
17082 (SSA_NAME): Use VARREF_ID instead of DECL_UID.
17083 (visit_assignment): New function.
17084 (evaluate_expr_for): New function.
17085 (dump_lattice_value): New function.
17086 (tree_ssa_ccp): Add debugging dumps.
17087 Remove #if 0 code everywhere.
17088 (visit_phi_node): Add debugging dumps.
17089 Also visit PHI arguments.
17090 Remove basic block argument
17091 (visit_expression): Re-implement.
17092 (examine_flow_edges): Add debugging dumps.
17093 (ssa_ccp_substitute_constants): Add debugging dumps.
17095 Mark and fold expressions with substituted constants.
17096 * tree-ssa.c (search_fud_chains): Don't check if BB_REFS(bb) is
17097 empty before iterating.
17098 Add comment explaining how we chain PHI node arguments to their
17099 originating basic block.
17101 * Makefile.in (tree-cfg.o, tree-dfa.o, tree-ssa-ccp.o): Update
17104 2002-07-29 Daniel Berlin <dberlin@dberlin.org>
17106 * tree-ssa-pre.c (tree_perform_ssapre): Ben forgot to add a
17107 dump_begin call when he removed the before dump.
17109 2002-07-24 Daniel Berlin <dberlin@dberlin.org>
17111 * tree-alias-ecr.c (ECR_new_with_type): Use correct number in mapping.
17113 2002-07-23 Daniel Berlin <dberlin@dberlin.org>
17115 * c-simplify.c (simplify_for_stmt): Deep copy the result of the
17116 tail_expression, so it's unshared.
17118 2002-07-23 Daniel Berlin <dberlin@dberlin.org>
17120 * tree-flow.h: Add prototype for create_alias_vars.
17122 * tree-alias-steen.c (display_points_to_set): New function.
17123 (init_alias_vars): Display points to sets when we are done.
17125 * disjoint-set.h (disjoint_set_def): ptr_alias to ECR_def so that
17126 we mark parent properly.
17128 2002-07-24 Diego Novillo <dnovillo@redhat.com>
17130 * Makefile.in (GTFILES): Move tree-alias-type.[ch],
17131 tree-alias-ecr.[ch], tree-alias-steen.[ch] from ...
17132 * c-config-lang.in (gtfiles): ... here.
17134 * tree-simple.c (is_simplifiable_builtin): Replace
17135 BUILT_IN_VARARGS_START with BUILT_IN_VA_START.
17137 2002-07-23 Andreas Jaeger <aj@suse.de>
17139 * tree-ssa-pre.c (hash_expr_tree): Remove.
17141 * c-call-graph.c (write_dtd): Remove.
17143 * tree-ssa.c (delete_refs): Remove.
17145 2002-07-23 Andreas Jaeger <aj@suse.de>
17147 * gengtype.c (open_base_files): Add tree.h.
17149 * tree-alias-type.h: Remove inclusion of tree.h.
17151 * tree-alias-steen.c: Include tree.h.
17152 Add prototype for create_fun_alias_var_ptf.
17154 * tree-alias-ecr.c: Add prototype for ECR_add_pending.
17156 * tree-ssa-pre.c (calculate_preorder): Remove unused variables.
17158 * tree-simple.c: Include expr.h and rtl.h for prototypes.
17160 * tree-optimize.c: Include tree-alias-steen.h for prototypes.
17162 * Makefile.in (tree-optimize.o): Add tree-alias-steen.h.
17163 (tree-simple.o): Add expr.h and rtl.h.
17164 (tree-alias-steen.o): Add tree.h.
17166 * diagnostic.h: Add declaration of debug_output_buffer.
17168 * c-call-graph.c (construct_call_graph): Make static to follow
17170 (construct_call_graph): Use #if 0 instead of C++ comments to
17173 2002-07-20 Andreas Jaeger <aj@suse.de>
17175 * doc/invoke.texi (Option Summary): Fix syntax.
17177 2002-07-19 Jason Merrill <jason@redhat.com>
17179 * c-simplify.c (simplify_return_stmt): Do simplify a returned
17180 expression in a void function.
17182 * c-simplify.c (simplify_stmt_expr): Handle C++ return semantics.
17184 2002-07-19 Jason Merrill <jason@redhat.com>
17186 * c-pretty-print.c (dump_c_node) [TARGET_EXPR]: Handle.
17187 [COND_EXPR]: Print a returned expression in a void function.
17189 2002-07-19 Ben Elliston <bje@redhat.com>
17191 * tree-ssa-pre.c (tree_perform_ssapre): Don't dump the original
17192 tree before applying this optimisation.
17194 * flags.h (flag_dump_tree_all_ssa): New flag.
17195 * toplev.c (flag_dump_tree_all_ssa): New flag.
17196 (f_options): Add "dump-tree-all-ssa" option.
17197 (process_options): Process flag_dump_tree_all_ssa.
17198 * tree.h (dump_enable_all_ssa): Declare.
17199 * tree-dump.c (dump_enable_all_ssa): New function.
17200 * doc/invoke.texi (Option Summary): Add -fdump-tree-all-ssa and
17201 -fdump-tree-ssapre options.
17202 (Debugging Options): Describe in more detail.
17203 * c-simplify.c (c_simplify_function_tree): Dump the original tree
17204 only if a TDI_original dump is requested, rather than TDI_simple.
17206 * tree-dump.c (dump_begin): Include phase number in dump filename.
17208 2002-07-18 Ben Elliston <bje@redhat.com>
17210 * tree-dump.c (dump_files): Rename "unparse" to "raw".
17211 * tree.h (TDF_UNPARSE): Rename from this ..
17212 (TDF_RAW): .. to this.
17213 * tree-ssa-pre.c (tree_perform_ssapre): Use TDF_RAW and invert the
17214 logical sense of this flag.
17215 * tree-ssa-ccp.c (tree_ssa_ccp): Likewise.
17216 * c-simplify.c (c_simplify_function_tree): Likewise.
17218 2002-07-18 Daniel Berlin <dberlin@dberlin.org>
17220 * tree-ssa-pre.c (calculate_preorder): New function.
17221 (tree_perform_ssapre): Use it, rather than
17222 flow_compute_preorder_tranversal, which seems to not do
17225 2002-07-18 Daniel Berlin <dberlin@dberlin.org>
17227 * tree-alias-type.c: Move gt-tree-alias-type include to end of file.
17229 * tree-alias-steen.c: Move gt-tree-alias-steen include to end of file.
17231 2002-07-18 Daniel Berlin <dberlin@dberlin.org>
17233 * gengtype.c (get_base_file_bitmap): Mark tree-alias-* and
17234 disjoint-set* as c/c++/objc files only.
17236 * Makefile.in (gt-tree-alias-type.h): Add.
17237 (tree-alias-type.o): Add dependency on gt-tree-alias-type.h.
17239 * tree-alias-type.c: Include gt-tree-alias-type.h.
17240 (alias_bottom): Add a GTY marked version of alias_bottom here.
17242 * tree-alias-type.h: Remove the GTY marker from alias_bottom.
17244 2002-07-17 Daniel Berlin <dberlin@dberlin.org>
17246 * tree-alias-ecr.c (ECR_union_pending_sets): Only clear bitmap if
17249 2002-07-16 Jason Merrill <jason@redhat.com>
17251 * c-simplify.c (add_tree): Build an EXPR_STMT immediately.
17252 (convert_to_stmt_chain): Remove.
17253 (simplify_stmt, simplify_for_stmt, simplify_while_stmt,
17254 simplify_do_stmt, simplify_expr_wfl, tail_expression): Adjust.
17256 2002-07-17 Daniel Berlin <dberlin@dberlin.org>
17258 * tree-alias-ecr.c: New file. Equivalence Class Representation.
17260 * tree-alias-steen.c: New file. Steengaard Alias Analysis.
17262 * disjoint-set.c: New file. Disjoint set data structure.
17264 * tree-alias-type.c: New file. Alias types.
17266 * c-simplify.c (create_tmp_alias_var): New function, like
17267 create_tmp_var, but doesn't add it to the current binding.
17269 * tree-simple.h: Prototype for create_tmp_alias_var.
17271 * tree-optimize.c (build_tree_ssa): Create alias variables, if
17274 * flags.h: Add flag_tree_points_to.
17278 * gengtype.c (open_base_files): Add disjoint-set.h,
17279 tree-alias-ecr.h, tree-alias-type.h, tree-flow.h.
17281 * Makefile.in (C_AND_OBJC_OBJS): Add disjoint-set.o,
17282 tree-alias-ecr.o, tree-alias-type.o, tree-alias-steen.o.
17283 (tree-alias-steen.o): Add dependencies.
17284 (tree-alias-ecr.o): Ditto.
17285 (tree-alias-type.o): Ditto.
17286 (disjoint-set.o): Ditto.
17288 2002-07-10 Daniel Berlin <dberlin@dberlin.org>
17289 Diego Novillo <dnovillo@redhat.com>
17291 * Makefile.in (C_AND_OBJC_OBJS): Add tree-ssa-ccp.o
17292 * flags.h (flag_tree_ssa_ccp): Declare.
17293 * fold-const.c (eval_subst): Make extern.
17294 * toplev.c (flag_tree_ssa_ccp): Define.
17295 (f_options): Document -ftree-ssa-ccp.
17296 * tree-dump.c (dump_files): Add -fdump-tree-ccp.
17297 * tree-flow.h (tree_perform_ssapre): Move declaration ...
17298 * tree-optimize.h: ... here.
17299 (tree_ssa_ccp): Declare.
17300 * tree-optimize.c (optimize_function_tree): Call tree_ssa_ccp.
17301 * tree-ssa-ccp.c: New file.
17302 * tree.c (next_decl_uid): Remove static declaration.
17303 * tree.h (next_decl_uid): Declare.
17304 (tree_dump_index): Add TDI_ccp.
17305 * cp/Make-lang.in (CXX_C_OBJS): Add tree-ssa-ccp.o.
17306 * doc/invoke.texi: Document -ftree-ssa-pre and -ftree-ssa-ccp.
17308 2002-07-09 Daniel Berlin <dberlin@dberlin.org>
17310 s/varrays of refs/ref_list of refs/g
17312 * tree-flow.h: Add ref_list structure.
17313 Add prototypes for ref_list functions.
17314 (FOR_EACH_REF, FOR_EACH_REF_REV): New macros to iterate through
17316 * tree-cfg.c, tree-ssa.c, tree-ssa-pre.c: Update all uses.
17318 * tree-dfa.c (create_ref_list): New function.
17319 (delete_ref_list): Ditto.
17320 (empty_ref_list): Ditto.
17321 (add_ref_to_list_end): Ditto.
17322 (add_ref_to_list_begin): Ditto.
17323 (remove_ref_from_list): Ditto.
17325 2002-07-04 Diego Novillo <dnovillo@redhat.com>
17327 * tree-simple.c (is_simplifiable_builtin): Don't simplify target
17330 2002-07-03 Diego Novillo <dnovillo@redhat.com>
17332 * c-simplify.c (simplify_decl_stmt): Unshare the
17333 initializer nodes before simplification.
17335 2002-06-29 Aldy Hernandez <aldyh@quesejoda.com>
17336 Diego Novillo <dnovillo@redhat.com>
17338 * c-simplify.c (simplify_call_expr): Do not bail on all builtins.
17339 (is_simple_call_expr): Same.
17340 (simplify_addr_expr): New function.
17341 (simplify_expr): Call it.
17343 * tree-simple.c (is_simplifiable_builtin): New.
17344 (is_simple_compound_lval): Do not bail on INDIRECT_REF.
17346 * tree-simple.h: New prototype for is_simplifiable_builtin.
17348 2002-06-26 Daniel Berlin <dberlin@dberlin.org>
17350 * tree-ssa.c (tree_build_ssa): Call free_dominance_info, not
17353 * tree-ssa-pre.c (compute_domchildren): Update to use new
17354 dominance_info structure, rather than idom array.
17355 (tree_perform_ssapre): Don't forget to free the dominance info.
17357 s/VARRAY_FREE/VARRAY_CLEAR/g now that VARRAY's are ggc allocated.
17359 2002-06-24 Diego Novillo <dnovillo@redhat.com>
17361 * tree-ssa.c (build_fud_chains): Use dominance_info instead of int *.
17362 (search_fud_chains): Ditto.
17363 Call get_immediate_dominator.
17364 * tree-ssa-pre.c (a_dom_b): Call dominated_by_p.
17365 (pre_idom): Change type to dominance_info. Update all uses.
17366 (pre_doms): Remove. Update all uses.
17368 2002-06-20 Jason Merrill <jason@redhat.com>
17370 Simplify DECL_STMT, CONSTRUCTOR and COMPOUND_LITERAL_EXPR.
17371 * tree-simple.c (is_simple_decl_stmt): New fn.
17372 (is_simple_constructor, is_simple_constructor_elt): New fns.
17373 (is_simple_stmt, is_simple_unary_expr): Use them.
17374 (is_simple_modify_expr): Accept an INIT_EXPR.
17375 (is_simple_id): Don't allow a COMPOUND_LITERAL_EXPR.
17376 (is_simple_unary_expr): Here either.
17377 * c-simplify.c (simplify_decl_stmt, simplify_constructor): New fns.
17378 (simplify_compound_literal_expr): New fn.
17379 (simplify_stmt, simplify_expr): Use them.
17380 (get_initialized_tmp_var): Use an INIT_EXPR.
17381 (simplify_modify_expr): Accept an INIT_EXPR.
17382 (simplify_for_stmt): Call simplify_decl_stmt.
17383 (get_name): Don't crash if the decl is anonymous.
17384 (tail_expression): New fn.
17385 * tree-simple.h: Declare new fns.
17386 * c-pretty-print.c (dump_c_node) [INIT_EXPR]: Print like MODIFY_EXPR.
17387 (dump_c_node, op_prio): Handle COMPOUND_LITERAL_EXPR.
17388 * c-simplify.c (simplify_expr_wfl): Only wrap pre and post stuff
17389 that came from our subexpression.
17390 (simplify_stmt): Restore stmts_are_full_exprs_p.
17392 * c-simplify.c (simplify_expr_wfl): Bracket substatements with
17393 FILE_STMTs rather than wrapping them in EXPR_WITH_FILE_LOCATION.
17394 (simplify_stmt): Update lineno and input_filename from stmts.
17395 (simplify_expr et al): Don't copy lineno between stmts. Don't pass
17396 enclosing stmt down.
17397 (update_line_number): Remove.
17399 * c-simplify.c (simplify_expr_stmt): Don't check
17400 is_last_stmt_of_scope.
17401 (simplify_stmt_expr): Check it here. Set *expr_p to void_zero_node
17402 instead of NULL_TREE.
17403 (expr_has_effect): No need to deal with NULL exprs now.
17404 (simplify_expr_wfl): Likewise.
17406 2002-06-18 Diego Novillo <dnovillo@redhat.com>
17408 * c-simplify.c (strip_off_ending): Rename to remove_suffix.
17410 (is_last_stmt_of_scope): New function.
17411 (simplify_expr_stmt): Call it.
17412 (stmt_has_effect): Ditto.
17413 (c_simplify_function_tree): Update comment.
17415 2002-06-18 Jason Merrill <jason@redhat.com>
17417 * c-simplify.c (maybe_fixup_loop_cond): New fn for C++ conditions.
17418 (simplify_for_stmt, simplify_while_stmt): Use it.
17420 * c-pretty-print.c (dump_c_node) [COMPONENT_REF]: Print "->" if
17423 2002-06-19 Jason Merrill <jason@redhat.com>
17425 * c-simplify.c (simplify_stmt_expr): New fn.
17426 (simplify_expr): Call it.
17427 (stmt_expr_level): Remove.
17428 (stmt_has_effect, c_simplify_function_tree): Remove refs.
17429 (expr_has_effect): Deal with null expression.
17430 (simplify_expr_wfl): If the subexpression is simplified away, drop
17431 this one, too. Don't wrap statements.
17432 * tree-simple.c (is_simple_unary_expr): Don't allow a STMT_EXPR.
17433 * tree-inline.c (copy_tree_r): Clear the aux field in the copies.
17435 2002-06-17 Frank Ch. Eigler <fche@redhat.com>
17437 * c-pretty-print.c (dump_c_node): Print pointer-type
17438 integer constants as raw numbers with a "B" (bytes) suffix.
17440 2002-06-17 Jason Merrill <jason@redhat.com>
17442 * c-simplify.c (simplify_stmt): Take a tree *.
17445 2002-06-16 Daniel Berlin <dberlin@dberlin.org>
17447 * c-simplify.c (get_name): New function.
17448 (get_initialized_tmp_var): Use it to try to get a prefix for
17449 create_tmp_var from the value we are initializing to.
17450 (simplify_cond_expr): Add prefix for create_tmp_var.
17451 (create_tmp_var): Add prefix argument.
17453 * tree-simple.h: Change create_tmp_var prototype to match.
17455 * tree-ssa-pre.c: Change create_tmp_var call.
17457 2002-06-15 Diego Novillo <dnovillo@redhat.com>
17459 * Makefile.in (c-decl.o): Add dependency on langhooks.h
17460 (c-simplify.o): Add dependency on flags.h, langhooks.h, toplev.h
17462 * c-decl.c: Include langhooks.h.
17463 (c_expand_body): Simplify the function. If it succeeds and
17464 -ftree-ssa is enabled, call optimize_function_tree.
17465 * c-simplify.c: Include flags.h, rtl.h and toplev.h.
17466 (simplify_expr_stmt): New function.
17467 (simplify_stmt): Call it.
17468 * tree-optimize.c: Don't include langhooks.h.
17469 (optimize_function_tree): Don't call lang_hooks.simplify_function_tree.
17471 * c-decl.c (c_expand_body): Do not simplify nor optimize the
17472 function if -fdisable-simple is given.
17473 * c-simplify.c (simplify_expr): Use is_simple_addr_expr_arg when
17474 simplifying ADDR_EXPR nodes.
17475 * flags.h (flag_disable_simple): Declare.
17476 * toplev.c (flag_disable_simple): Define.
17477 (f_options): Document -fdisable-simple.
17478 (process_options): Warn if -fdisable-simple is used with
17479 optimization enabled.
17480 * tree-simple.c (is_simple_addr_expr_arg): New function.
17481 (is_simple_unary_expr): Call it.
17482 * tree-simple.h (is_simple_addr_expr_arg): Declare.
17483 * doc/invoke.texi: Document -fdisable-simple.
17485 * c-pretty-print.c (dump_c_node): Handle DECL_STMT nodes inside
17487 * c-simplify.c (c_simplify_function_tree): Don't do anything if the
17488 program had errors.
17489 (simplify_stmt): Skip DECL_STMTs.
17490 (simplify_for_stmt): Handle DECL_STMT nodes inside FOR_INIT_STMT.
17491 (simplify_save_expr): New function.
17492 (simplify_expr): Call it.
17493 (tree_last_decl): Handle cases where DECL_STMTs are found before
17494 the body of the function.
17495 * tree-simple.c (is_simple_stmt): Handle DECL_STMT nodes inside
17497 (is_simple_compound_lval): Handle nodes wrapped in NON_LVALUE_EXPR.
17499 2002-06-14 Frank Ch. Eigler <fche@redhat.com>
17501 * c-pretty-print.c (dump_c_node): Print more type qualifiers,
17502 especially for pointers.
17504 2002-06-11 Diego Novillo <dnovillo@redhat.com>
17506 * c-simplify.c: Remove folding markers.
17507 (insert_before_first): Remove unused function.
17508 * tree-cfg.c: Remove folding markers.
17509 * tree-dfa.c: Ditto.
17510 * tree-flow.h: Ditto.
17511 * tree-optimize.c: Ditto.
17512 * tree-optimize.h: Ditto.
17513 * tree-simple.c: Ditto.
17514 * tree-ssa.c: Ditto.
17516 2002-06-11 Jason Merrill <jason@redhat.com>
17518 * c-simplify.c (add_tree): Don't deep-copy expressions.
17519 (simplify_for_stmt): Only deep-copy pre_cond_s the first time.
17520 Don't deep copy expr_chain.
17522 2002-06-10 Diego Novillo <dnovillo@redhat.com>
17524 * tree-cfg.c (remove_bb_ann): Don't call VARRAY_FREE.
17525 * tree-dfa.c (create_ref): Use sizeof (ref) instead of
17526 refs->element_size.
17527 * tree.h (struct tree_common): Skip field 'aux' from GC type
17529 * tree-optimize.c (optimize_function_tree): Don't call
17531 * tree-ssa.c (insert_phi_terms): Ditto.
17532 (delete_refs): Ditto.
17533 * c-simplify.c (simplify_array_ref): Ditto.
17534 * simple-break-elim.c: Disable whole file.
17535 * simple-goto-elim.c: Disable whole file.
17537 2002-06-10 Jason Merrill <jason@redhat.com>
17539 * c-simplify.c (simplify_switch_stmt): Let simplify_expr handle
17540 post-effects. Reorder.
17541 (simplify_if_stmt): Likewise. Don't build redundant comparison.
17542 (simplify_do_stmt, simplify_while_stmt): Likewise.
17543 (simplify_for_stmt): Likewise. Remove POST_P parm.
17544 (simplify_stmt): Adjust.
17545 (insert_before_first): #if 0, no longer used.
17547 * c-pretty-print.c (dump_c_node): Print FIX_TRUNC_EXPR, FLOAT_EXPR
17548 et al as casts. Add parens as needed.
17550 * tree-simple.c (is_union_based_ref): New fn.
17551 (is_simple_min_lval): Use it. Rename from is_simple_arraybase.
17552 (is_simple_arrayref): Adjust. Use loop instead of recursion.
17553 (is_simple_compref): Likewise.
17554 (is_simple_compref_lhs): Remove.
17555 * tree-simple.h: Adjust.
17556 * c-simplify.c (simplify_array_ref): Adjust.
17557 (simplify_component_ref): Adjust.
17559 * c-simplify.c (simplify_expr_common): Tweak ordering.
17560 (get_initialized_tmp_var): Let simplify_expr handle post-effects.
17561 * tree-simple.c (is_simple_stmt): Accept an rhs for a return expr.
17563 * c-simplify.c (simplify_boolean_expr): Avoid redundant tests.
17564 Give the temp the appropriate type for a boolean value, and
17565 reconvert at the end.
17567 * c-simplify.c (simplify_self_mod_expr): Don't duplicate side-effects.
17569 * c-simplify.c (simplify_return_stmt): Accept a SIMPLE rhs.
17570 Just hand off to simplify_expr.
17572 * c-simplify.c (get_initialized_tmp_var): New fn.
17573 (simplify_expr_common): Use it. Handle post-effects internally if
17575 (is_simple_tmp_var): Rename from simple_tmp_var_p.
17576 * tree-simple.h: Adjust.
17578 2002-06-09 Diego Novillo <dnovillo@redhat.com>
17580 * c-simplify.c (simplify_return_stmt): Update folding markers.
17581 (build_addr_expr): Ditto.
17582 * langhooks.h (struct langhooks): Document simplify_function_tree
17585 2002-06-09 Jason Merrill <jason@redhat.com>
17587 * c-simplify.c (simplify_expr_common): Handle creating both lvalue
17588 and rvalue temps. Add new parameter to specify which.
17589 (simplify_expr): Now just a wrapper.
17590 (simplify_lvalue_expr): Likewise.
17591 (simplify_expr_either): New wrapper.
17592 (simplify_component_ref): Use it instead of simplify_lvalue_expr.
17594 * c-pretty-print.c (debug_c_tree): Add a trailing newline.
17595 (debug_c_node): Likewise.
17596 * gdbinit.in (pct): New macro, calls debug_c_tree.
17598 2002-06-08 Jason Merrill <jason@redhat.com>
17600 * tree-simple.c (is_simple_unary_expr): Only allow the address of
17602 (is_simple_id): Allow STRING_CST.
17603 * c-simplify.c (simplify_expr_common): Split out from simplify_expr.
17604 Do simplify ADDR_EXPR.
17605 (simplify_lvalue_expr): Use it and build_addr_expr. Take
17607 (simplify_modify_expr): Adjust.
17608 (build_addr_expr): New fn.
17609 (simplify_array_ref): Use simplify_lvalue_expr.
17610 (simplify_component_ref): Likewise.
17612 * tree-simple.c (is_simple_rhs): Remove condexpr rule.
17613 (is_simple_compref_lhs): Remove &ID.idlist rule.
17614 (is_simple_relop): New fn.
17615 (is_simple_binary_expr, is_simple_condexpr): Use it.
17616 * tree-simple.h: Declare it.
17618 * c-simplify.c (create_tmp_var): Refuse to create an array temp.
17619 (simple_tmp_var_p): New fn.
17620 (simplify_lvalue_expr): Use it; make sure we don't return a temp.
17621 * tree-simple.h: Declare it.
17623 * c-pretty-print.c (dump_c_node) [ARRAY_REF]: Wrap array in parens
17625 [COMPONENT_REF]: Likewise.
17626 [POINTER_TYPE]: Fix pointer-to-function handling.
17627 [ARRAY_TYPE]: Don't try to print an unknown dimension.
17629 * tree-simple.c (is_simple_arraybase): New function.
17630 (is_simple_arrayref): Use it to check the array base again.
17631 * tree-simple.h: Add declaration.
17632 * c-simplify.c (simplify_array_ref): Do simplify the base.
17633 * expr.c (expand_expr): First make sure the type has a size.
17635 2002-06-07 Jason Merrill <jason@redhat.com>
17637 * cppexp.c (num_equality_op): Use a temporary variable to work
17638 around gcc 3.0.4 bug.
17640 2002-06-05 Diego Novillo <dnovillo@redhat.com>
17642 * Makefile.in (BOOT_CFLAGS): Remove -ftree-ssa.
17643 * c-decl.c (c_expand_body): Call optimize_function_tree if tree SSA
17645 * c-lang.c (LANG_HOOKS_SIMPLIFY_FUNCTION_TREE): Define.
17646 * c-simplify.c (simplify_tree): Rename to c_simplify_function_tree.
17647 Update all callers.
17648 Dump function body before and after simplification if
17649 -fdump-tree-simple is used.
17650 (simplify_expr): Document FIXME for simplification of BIT_FIELD_REF
17652 * c-tree.h (simplify_tree): Rename to c_simplify_function_tree.
17653 * langhooks-def.h (LANG_HOOKS_SIMPLIFY_FUNCTION_TREE): Define
17654 (LANGHOOKS_INITIALIZER): Add LANG_HOOKS_SIMPLIFY_FUNCTION_TREE.
17655 (lhd_simplify_function_tree): Declare.
17656 * langhooks.c (lhd_simplify_function_tree): New function.
17657 * langhooks.h (lang_hooks): Add simplify_function_tree function
17659 * toplev.c (parse_options_and_default_flags): Set flag_tree_ssa to
17660 1 at optimization levels >= 1.
17661 Revert to default warning when -Wuninitialized is used without -O.
17662 * tree-cfg.c (tree_find_basic_blocks): Rename argument 't' to
17664 * tree-optimize.c: Include langhooks.h.
17665 (optimize_tree): Rename to optimize_function_tree. Update all
17667 Rename argument 't' to 'fndecl'.
17668 Call simplify langhook before building SSA.
17669 (build_tree_ssa): Rename argument 't' to 'fndecl'.
17670 Adjust call to tree_find_basic_blocks to pass body of the function.
17671 * tree-optimize.h (optimize_tree): Rename to
17672 optimize_function_tree.
17673 * tree-simple.c (is_simple_unary_expr): Document FIXME on
17674 BIT_FIELD_REF nodes.
17675 * tree-ssa.c: Add whitespace.
17676 * testsuite/lib/c-torture.exp: Remove -ftree-ssa flag.
17678 2002-06-03 Daniel Berlin <dberlin@dberlin.org>
17680 * tree-cfg.c (insert_before_*): For insertion into FOR_INIT's, if
17681 we have an expression statement, transform into a compound
17683 Pick the right place to insert a statement by iterating until we
17684 have a first_exec_stmt (first_non_decl_stmt) that is really the
17685 first executable non decl statement.
17686 (insert_after_*): Ditto.
17688 2002-06-03 Daniel Berlin <dberlin@dberlin.org>
17690 * tree-ssa-pre.c: Update BB stuff to new basic block structure.
17691 Add some comments throughout (more coming, particularly describing
17692 the algorithm, rather than the implementation).
17693 (free_expr_info): Free refs as well.
17694 (defs_y_dom_x): Handle unary expressions as well.
17695 (insert_euse_in_preorder_dt_order_1): Use block of ref, not block
17697 Don't insert exit blocks if we hit them before hitting an
17698 occurrence (it's pointless).
17699 (rename_2): Return set of phi operands we touched, don't forget to
17700 free VARRAY's we allocated.
17701 (rename_1): Correct downsafety computation. Now get exact same
17703 Correct setting of has_real_use.
17704 (finalize_1): Fix up insertion.
17705 (code_motion): Fix up insertion.
17707 * tree-dfa.c (dump_varref): Improve dumping of expression
17710 2002-06-03 Diego Novillo <dnovillo@redhat.com>
17712 * tree-cfg.c (delete_bb): Rename to tree_delete_bb. Update callers.
17713 (tree_find_basic_blocks): Initializer last_basic_block.
17714 (create_bb): Update last_basic_block after creating a new block.
17715 (tree_cleanup_cfg): Delete unreachable blocks by traversing the
17716 linked list, not the array. Update comments.
17717 (delete_bb): Update comments.
17718 (tree_dump_cfg): Also show last_basic_block.
17719 * tree-ssa.c (tree_build_ssa): Use last_basic_block instead of
17720 n_basic_blocks to allocate dominator arrays.
17721 (insert_phi_terms): Ditto.
17722 (search_fud_chains): User FOR_EACH_BB to look for dominator
17725 2002-05-29 Diego Novillo <dnovillo@redhat.com>
17727 * tree-cfg.c (tree_find_basic_blocks): Set next_bb and prev_bb for
17728 ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR.
17729 (create_bb): Set flag BB_NEW for every newly created block.
17730 Call link_block to add the new block to the linked list.
17731 (tree_split_bb): Traverse basic blocks using FOR_EACH_BB.
17732 (make_goto_stmt_edges): Ditto.
17733 (remove_unreachable_blocks): Add reminder comment to stop
17734 compacting the basic block array every time a block is deleted.
17735 (delete_cfg): Traverse basic blocks using FOR_EACH_BB.
17736 (tree_dump_bb): Ditto.
17737 (tree_dump_cfg): Ditto.
17738 (tree_cfg2dot): Ditto.
17739 * tree-dfa.c (tree_find_varrefs): Ditto.
17740 (create_tree_ann): Ditto.
17741 (get_fcalls): Ditto.
17742 (find_declaration): Ditto.
17743 * tree-ssa.c (tree_build_ssa): Ditto.
17745 2002-05-28 Diego Novillo <dnovillo@redhat.com>
17747 * Makefile.in: Add -ftree-ssa to BOOT_CFLAGS.
17749 2002-05-27 Diego Novillo <dnovillo@redhat.com>
17751 * c-decl.c (c_expand_body): Close dump file before simplifying the
17753 * c-pretty-print.c (dump_c_node): Handle COMPLEX_CST,
17754 BIT_FIELD_REF, COMPLEX_EXPR, CONJ_EXPR, REALPART_EXPR,
17755 IMAGPART_EXPR and VA_ARG_EXPR nodes.
17756 Display all type casts, not just pointer casts.
17757 (op_prio): Handle LROTATE_EXPR, RROTATE_EXPR, REALPART_EXPR and
17759 * c-simplify.c: Include "tree-inline.h"
17760 (dump_file): New local variable.
17761 (dump_flags): New local variable.
17762 (stmt_expr_level): New local variable.
17763 (simplify_tree): Open and close dump file if
17764 -fdump-tree-simple-details is given.
17765 Initialize stmt_expr_level.
17766 (simplify_stmt): Dump statement before and after simplification if
17767 -fdump-tree-simple-detail is given.
17768 Unshare the expression of an EXPR_STMT before simplifying it.
17769 Call simplify_return_stmt to handle RETURN_STMT nodes.
17770 Do not simplify DECL_STMT nodes.
17771 Call stmt_has_effect before re-chaining side effects.
17772 (simplify_for_stmt): Do not return the simplified statement.
17773 Update all callers.
17774 Simplify FOR_BODY after the headers.
17775 Unshare loop header expressions before simplification.
17776 (simplify_while_stmt): Do not return the simplified statement.
17777 Update all callers.
17778 Simplify WHILE_BODY after the headers.
17779 Unshare the loop header expression before simplification.
17780 (simplify_do_stmt): Do not return the simplified statement. Update
17782 Unshare the loop header expression before simplification.
17783 (simplify_if_stmt): Do not return the simplified statement. Update
17785 Simplify the condition expression before the clauses.
17786 Unshare the condition expression before simplification.
17787 (simplify_switch_stmt): Do not return the simplified statement.
17788 Update all callers.
17789 Simplify the switch expression before the body.
17790 Unshare the switch expression before simplification.
17791 (simplify_decl_stmt): Remove.
17792 (simplify_expr): Remove argument 'needs_lvalue'.
17793 Add argument 'stmt'.
17794 Replace first argument 'expr' with a pointer to the
17795 expression 'expr_p'.
17796 Do not return the simplified expression.
17797 Update all callers and uses.
17798 Handle TRUTH_NOT_EXPR nodes. Simplify SAVE_EXPR nodes into a
17799 SIMPLE id and remove the SAVE_EXPR node.
17800 Do not simplify BIT_FIELD_REF nodes.
17801 Remove code that tried to create new lvalues.
17802 (simplify_array_ref): Replace first argument 'expr' with a pointer
17803 to the expression 'expr_p'.
17804 Do not return the simplified expression.
17805 Add argument 'stmt'.
17806 Update all callers and uses.
17807 (simplify_self_mod_expr): Replace first argument 'expr' with a
17808 pointer to the expression 'expr_p'.
17809 Do not return the simplified expression.
17810 Add argument 'stmt'.
17811 Update all callers and uses.
17812 Call simplify_lvalue_expr to simplify a copy of the LHS into an
17813 lvalue for the new assignment.
17814 Simplify the new binary expression.
17815 (simplify_component_ref): Replace first argument 'expr' with a
17816 pointer to the expression 'expr_p'.
17817 Do not return the simplified expression.
17818 Add argument 'stmt'.
17819 Update all callers and uses.
17820 (simplify_call_expr): Ditto.
17821 (simplify_tree_list): Ditto.
17822 (simplify_cond_expr): Ditto.
17823 Build a replacement IF_STMT and call simplify_if_stmt() to process
17824 it. Set the line number of the new statement from the statement
17825 containing the original expression.
17826 (simplify_modify_expr): Replace first argument 'expr' with a
17827 pointer to the expression 'expr_p'.
17828 Do not return the simplified expression.
17829 Add argument 'stmt'.
17830 Update all callers.
17831 Call simplify_lvalue_expr to simplify the LHS of the assignment.
17832 (simplify_boolean_expr): Replace first argument 'expr' with a
17833 pointer to the expression 'expr_p'.
17834 Do not return the simplified expression.
17835 Add argument 'stmt'.
17836 Update all callers.
17837 Build a new IF_STMT and simplify it all at once by calling
17839 (simplify_compound_expr): Replace first argument 'expr' with a
17840 pointer to the expression 'expr_p'.
17841 Do not return the simplified expression.
17842 Add argument 'stmt'.
17843 Update all callers.
17844 (simplify_expr_wfl): Ditto.
17845 (simplify_lvalue_expr): New function.
17846 (add_tree): Create a copy of each expression before adding it to
17848 (deep_copy_node): Call copy_tree_r to copy expression nodes.
17849 (stmt_has_effect): Return nonzero if the statement may be the last
17850 statement of a statement expression body.
17851 (mostly_copy_tree_r): New function.
17852 * tree-dump.c (dump_options): Add 'details'.
17853 * tree-simple.c: Update documentation about ADDRESSOF expressions.
17854 (is_simple_stmt): Test for SIMPLE values when checking return
17856 Accept all DECL_STMT nodes.
17857 (is_simple_compstmt): Return nonzero if T is NULL. Do not test
17859 (is_simple_expr): Return nonzero if T is NULL.
17860 (is_simple_rhs): Ditto.
17861 (is_simple_modify_expr): Ditto.
17862 (is_simple_modify_expr_lhs): Ditto.
17863 (is_simple_binary_expr): Ditto.
17864 (is_simple_cond_expr): Ditto.
17865 (is_simple_unary_expr): Call STRIP_NOPS before testing T.
17866 Always accept ADDR_EXPR nodes.
17867 Always accept BIT_FIELD_REF nodes.
17868 (is_simple_call_expr): Return nonzero if T is NULL.
17869 (is_simple_const): Ditto.
17870 (is_simple_val): Ditto.
17871 (is_simple_compref): Ditto.
17872 (is_simple_compref_lhs): Ditto.
17873 (is_simple_cast): Ditto.
17874 (is_simple_cast_op): Ditto.
17875 (is_simple_id): Return nonzero if T is NULL. Allow identifiers
17876 wrapped inside NON_LVALUE_EXPR and EXPR_WITH_FILE_LOCATION nodes.
17877 Allow real and imaginary parts of a complex variable.
17878 Allow compound literals.
17879 (is_simple_arrayref): Allow arrays of complex types.
17880 * tree.h (TDF_DETAILS): Define.
17881 * cp/pt.c (tsubst_template_parms): Check that 'parms' is non-NULL
17882 before calling TMPL_PARMS_DEPTH.
17883 * doc/invoke.texi: Document -fdump-tree-simple-details.
17885 2002-05-10 Daniel Berlin <dberlin@dberlin.org>
17887 * c-pretty-print.c (dump_c_node): Print "<unnamed whatever>" for
17888 types, variables, etc that have no name, rather than printing
17890 Handle PMF's properly.
17891 Print out structure initializers in a somewhat sensible way.
17892 Print SAVE_EXPR () around SAVE_EXPRs.
17893 (print_call_name): Handle EXPR_WITH_FILE_LOCATION.
17895 2002-05-09 Daniel Berlin <dberlin@dberlin.org>
17897 * tree-dfa.c (dump_varref): Tree inlining generates variables with
17898 no name. Don't crash on dumping varref's of them.
17900 * tree-inline.c (expand_call_inline): Generate a proper STMT_EXPR
17901 (it was missing COMPOUND_STMT).
17903 2002-05-08 Daniel Berlin <dberlin@dberlin.org>
17905 s/varref_type/treeref_type/g
17906 s/create_varref/create_ref/g
17908 * tree-flow.h: Add EXPRPHI, EXPRUSE, EXPRKILL, EXPRINJ.
17909 Add structures and macros for each.
17910 Add tree_perform_ssapre prototype.
17912 * Makefile.in (C_AND_OBJC_OBJS): Add tree-ssa-pre.o
17913 (tree-ssa-pre.o): Add dependencies for tree-ssa-pre.o
17915 * cp/Make-lang.in: Add tree-ssa-pre.o
17917 * flags.h: Add flag_tree_ssa_pre.
17919 * tree-ssa-pre.c: New file, SSA-PRE.
17921 * toplev.c: Add flag_tree_ssa_pre.
17922 (lang_independent_options): Add tree-ssa-pre.
17924 * tree-dump.c (dump_files): Add ssapre dump.
17926 * tree-optimize.c (optimize_tree): Do SSAPRE if requested.
17928 * tree.h (dump_index): Add TDI_ssa_pre.
17930 * tree-dfa.c (create_ref): Add support for creating the EXPR*'s refs.
17931 (dump_varref): Add support for dumping EXPR* refs.
17933 * tree-ssa.c (search_fud_chains): Add BB to VARDEF_PHI_CHAIN_BB.
17935 2002-05-07 Diego Novillo <dnovillo@redhat.com>
17937 * c-pretty-print.c (op_prio): Handle ABS_EXPR.
17938 Don't abort when the operand is not recognized.
17939 (op_symbol): Don't abort when the operand is not recognized.
17940 * c-simplify.c (simplify_expr): Remove 'const' qualifier from first
17942 Do not copy incoming expression.
17943 Exclude handling of MODIFY_EXPR, INIT_EXPR, SAVE_EXPR and binary
17945 (simplify_array_ref): Remove 'const' qualifier from first argument.
17946 Do not copy the incoming expression.
17947 (simplify_self_mod_expr): Ditto.
17948 Do not simplify the first operand twice.
17949 (simplify_component_ref): Remove 'const' qualifier from first
17950 argument. Do not copy the incoming expression.
17951 (simplify_call_expr): Ditto.
17952 (simplify_tree_list): Ditto.
17953 (simplify_cond_expr): Ditto.
17954 (simplify_modify_expr): Ditto.
17955 (simplify_boolean_expr): Ditto.
17956 (simplify_compound_expr): Ditto.
17957 (simplify_save_expr): Ditto.
17958 (simplify_expr_wfl): Ditto.
17959 (tree_build_scope): Re-write. Do nothing if block already contains
17960 a scope. Use chainon to chain the body with the scope closing
17962 (deep_copy_node): Do not check for NULL nodes. Do not deep copy
17963 declarations, types and constants.
17965 2002-05-06 Daniel Berlin <dberlin@dberlin.org>
17967 * c-simplify.c (deep_copy_node): Don't copy DECL_STMT_DECL's.
17969 2002-05-06 Daniel Berlin <dberlin@dberlin.org>
17971 * tree-simple.c (is_simple_compstmt): Don't post-initialize
17972 statics or aggregate initializers.
17974 * c-simplify.c (simplify_decl_stmt): Ditto.
17976 2002-05-06 Sebastian Pop <s.pop@laposte.net>
17978 * Makefile.in (simple-break-elim.o, simple-goto-elim.o, tree-dchain.o):
17980 * c-decl.c: Include tree-dchain.h
17981 (c_expand_body): Add entry point to the goto, break elimination
17982 after the simplification pass.
17983 * simple-break-elim.c: New file.
17984 * simple-goto-elim.c: New file.
17985 * tree-dchain.h: New file.
17986 * tree-dchain.c: New file.
17988 2002-05-02 Diego Novillo <dnovillo@redhat.com>
17990 * c-simplify.c (simplify_expr): Constify first argument.
17991 Always work on a copy of the input expression.
17992 Do not simplify COMPOUND_LITERAL_EXPR nor CONSTRUCTOR nodes.
17993 (simplify_array_ref): Constify first argument. Always work on a
17994 copy of the input expression.
17995 (simplify_self_mod_expr): Ditto.
17996 (simplify_component_ref): Ditto.
17997 (simplify_call_expr): Ditto.
17998 (simplify_tree_list): Ditto.
17999 (simplify_cond_expr): Ditto.
18000 When building the THEN_CLAUSE and ELSE_CLAUSE for the new IF_STMT,
18001 create a scope for them and simplify the scope, not the expression.
18002 (simplify_modify_expr): Constify first argument. Always work on a
18003 copy of the input expression.
18004 (simplify_boolean_expr): Ditto.
18005 (simplify_compound_expr): Ditto.
18006 (simplify_save_expr): Ditto.
18007 (simplify_expr_wfl): Ditto.
18008 * tree-cfg.c (tree_find_basic_blocks): Update comments for
18010 (tree_dump_cfg): Ditto.
18011 * tree-dump.c (dump_files): Rename -fdump-tree-graphviz to
18013 * tree-simple.c (is_simple_unary_expr): Do not handle &CONST
18015 Handle COMPOUND_LITERAL_EXPR and CONSTRUCTOR nodes.
18016 (is_simple_const): Strip NOPS and handle &CONST expressions.
18017 * tree.h (enum tree_dump_index): Remove references to GraphViz.
18018 * doc/invoke.texi: Update documentation for -fdump-tree-dot.
18020 2002-05-02 Sebastian Pop <s.pop@laposte.net>
18022 * c-pretty-print.c (dump_c_node): Don't print declarations
18023 from the SCOPE_STMT_BLOCK, use the DECL_STMT instead.
18025 2002-04-30 Diego Novillo <dnovillo@redhat.com>
18027 * c-pretty-print.c (NIY): Display an error string instead of aborting.
18028 (op_prio): Add support for COMPOUND_EXPR, TRUTH_XOR_EXPR, MIN_EXPR,
18029 MAX_EXPR and NON_LVALUE_EXPR.
18030 For EXPR_WITH_FILE_LOCATION nodes, return the priority of
18032 (op_symbol): Add support for TRUTH_XOR_EXPR.
18033 * c-simplify.c (simplify_stmt): Only remove null statements that
18034 have been nullified by simplification.
18035 Call debug_tree() dump unhandled tree nodes.
18036 (simplify_for_stmt): Always deep-copy PRE_COND_S before adding it
18038 (simplify_expr): When simplifying a MODIFY_EXPR node into an
18039 rvalue, return operand 0.
18040 Handle VA_ARG_EXPR, BIT_FIELD_REF and NON_LVALUE_EXPR nodes.
18041 Treat TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR nodes as
18042 regular binary expressions.
18043 Call debug_tree() to dump an unhandled expression.
18044 (simplify_array_ref): Do not simplify the base of an array.
18045 (simplify_call_expr): Do not simplify calls to builtins.
18046 (simplify_cond_expr): Handle conditional expressions of type void.
18047 (simplify_boolean_expr): Return 'T != 0' instead of 'T'.
18048 (simplify_save_expr): Do not wrap statement trees inside SAVE_EXPR
18050 (tree_last_decl): Ignore FILE_STMT nodes preceding a SCOPE_STMT.
18051 * tree-simple.c: Update grammar to accept any valid C array as the
18053 (is_simple_compstmt): Accept DECL_INITIAL expressions for read-only
18055 (is_simple_expr): Do not abort if the incoming tree is NULL.
18056 (is_simple_modify_expr): Allow SAVE_EXPR, EXPR_WITH_FILE_LOCATION
18057 and NON_LVALUE_EXPR wrappers.
18058 (is_simple_binary_expr): Ditto.
18059 (is_simple_condexpr): Ditto.
18060 Accept TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR.
18061 (is_simple_unary_expr): Do not abort it the incoming tree is NULL.
18062 Allow SAVE_EXPR, EXPR_WITH_FILE_LOCATION and NON_LVALUE_EXPR
18064 Handle BIT_FIELD_REF and VA_ARG_EXPR nodes.
18065 (is_simple_call_expr): Always return 1 for builtin calls.
18066 (is_simple_arrayref): Do not check the array base.
18068 2002-04-30 Daniel Berlin <dberlin@dberlin.org>
18070 * c-simplify.c (simplify_call_expr): Don't try to simplify
18071 call_expr arglist if it's not there.
18073 2002-04-27 Diego Novillo <dnovillo@redhat.com>
18075 * c-decl.c (c_expand_body): Call simplify_tree to simplify a
18076 FUNCTION_DECL node.
18077 * c-simplify.c (simplify_tree): New function.
18078 (simplify_stmt): Remove variable 'new_vars'. Update all called
18080 Remove argument 'scope'. Update all callers.
18081 Do not keep track of new scope statements as they are entered.
18082 Do not call declare_tmp_vars().
18083 (simplify_for_stmt): Remove argument new_vars_p. Update all callers.
18084 (simplify_while_stmt): Ditto.
18085 (simplify_do_stmt): Ditto.
18086 (simplify_if_stmt): Ditto.
18087 (simplify_switch_stmt): Ditto.
18088 (simplify_decl_stmt): Reformat comments.
18089 (simplify_expr): Remove argument new_vars_p. Update all callers.
18090 Call simplify_save_expr() to simplify SAVE_EXPR nodes.
18091 Call simplify_expr_wfl() to simplify EXPR_WITH_FILE_LOCATION nodes.
18092 Do not call is_unop() and is_binop() when checking for unary and
18094 Do not return early after simplify statement-expressions.
18095 Do not call add_modify_stmt() to create assignment expressions.
18096 (simplify_array_ref): Remove argument new_vars_p. Update all callers.
18097 (simplify_self_mod_expr): Ditto.
18098 (simplify_component_ref): Ditto.
18099 (simplify_call_expr): Ditto.
18100 (simplify_tree_list): Ditto.
18101 (simplify_cond_expr): Ditto.
18102 (simplify_modify_expr): Ditto.
18103 (simplify_boolean_expr): Ditto.
18104 (simplify_compound_expr): Ditto.
18105 (simplify_save_expr): New function.
18106 (simplify_expr_wfl): New function.
18107 (tree_build_scope): Reformat.
18108 (add_tree): Call stmt_has_effect() and expr_has_effect() to decide
18109 whether or not to add a new tree to the list.
18110 (add_modify_stmt): Remove.
18111 (create_tmp_var): Remove 'new_vars_p' argument.
18112 Call pushdecl() to insert the newly created variable in the current
18114 (declare_tmp_vars): Do not create a BLOCK_VARS for the scope.
18115 (is_binop): Remove.
18117 (expr_has_effect): New function.
18118 * c-tree.h (simplify_tree): Remove second argument.
18119 * stmt.c (warn_if_unused_value): Check operand 0 of SAVE_EXPR
18121 * tree-dfa.c (find_refs_in_expr): Call find_refs_in_expr() to look
18122 inside an EXPR_WITH_FILE_LOCATION node.
18123 * tree-simple.c (is_simple_stmt): Add a case for SCOPE_STMT nodes.
18124 (is_simple_compstmt): Assume that T is the first tree in the
18125 compound statement's body.
18126 Stop when a scope ending SCOPE_STMT node is found.
18127 (is_simple_binary_expr): Don't call is_simple_binop().
18128 (is_simple_condexpr): Don't call is_simple_relop().
18129 (is_simple_binop): Remove.
18130 (is_simple_relop): Remove.
18131 (is_simple_unary_expr): Accept any operator with tree code class
18132 '1' followed by a simple value.
18133 Accept simple unary expressions wrapped inside SAVE_EXPR,
18134 EXPR_WITH_FILE_LOCATION and NON_LVALUE_EXPR nodes.
18135 (is_simple_id): Accept simple identifiers wrapped inside SAVE_EXPR,
18136 EXPR_WITH_FILE_LOCATION and NON_LVALUE_EXPR nodes.
18137 * tree-simple.h (create_tmp_var): Remove second argument.
18138 (is_simple_binop): Remove.
18139 (is_simple_relop): Remove.
18141 2002-04-22 Diego Novillo <dnovillo@redhat.com>
18143 * c-simplify.c (stmt_has_effect): New function.
18144 (simplify_stmt): Fix example code in comment.
18145 Use EXPR_STMT_EXPR to access the expression in an expression
18147 Call debug_c_node to display unhandled statements.
18148 Call stmt_has_effect to determine whether the statement has been
18149 nullified by the simplification process.
18150 (simplify_for_stmt): Do not simplify the initialization expression
18152 Do not convert post_cond_s into a statement chain.
18153 Do not simplify the expression if it's NULL.
18154 (simplify_switch_stmt): initialize post_cond_s to NULL before
18155 simplifying the expression.
18156 (simplify_expr): Rename argument IS_LHS to NEEDS_LVALUE. Update
18158 When simplifying assignments, return the LHS of the assignment if
18159 the caller wants to use the assignment as an rvalue.
18160 Do not simplify ADDR_EXPR nodes.
18161 Handle NOP_EXPR, CONVERT_EXPR, FIX_TRUNC_EXPR, FIX_CEIL_EXPR,
18162 FIX_ROUND_EXPR, INDIRECT_REF, NEGATE_EXPR, INTEGER_CST, STRING_CST,
18164 Abort if the expression has not been simplified and cannot be used
18165 as an rvalue to assign it to a temporary.
18166 When creating a new temporary to hold an lvalue, if the expression
18167 is an indirect reference, use the address of the referenced object.
18168 When creating an indirect reference, use the pointed-to type as the
18169 type of the reference.
18170 (simplify_self_mod_expr): If the LHS operand needs to be
18171 simplified, simplify twice. Once to produce an lvalue and another
18172 to produce a simple value.
18173 (simplify_modify_expr): Break assignment chains (a = b = c = ...)
18174 into individual assignments.
18175 (simplify_compound_expr):
18176 (create_tmp_var): If the type is an array, use TYPE_POINTER_TO as
18178 (update_line_number): Fix typo in comment.
18180 (convert_to_stmt_chain): Only add statements that comply with
18182 * tree-dfa.c (find_declaration): Fix typo in comment.
18183 (debug_varref): Ditto.
18184 * tree-flow.h: Ditto.
18185 * tree-simple.c (is_simple_stmt): New function.
18186 (is_simple_compstmt): New function.
18187 (is_simple_expr): Fix typo in comment.
18188 (is_simple_rhs): Allow conditional expressions.
18189 (is_simple_modify_expr): Fix typo in comment.
18190 (is_simple_modify_expr_lhs): Ditto.
18191 (is_simple_binary_expr): Ditto.
18192 (is_simple_condexpr): Ditto.
18193 (is_simple_relop): Ditto.
18194 (is_simple_unary_expr): Ditto.
18195 Allow taking the address of a constant (for strings).
18196 (is_simple_call_expr): Fix typo in comment.
18197 Call is_simple_id to determine if the first operand is a SIMPLE
18198 function identifier.
18199 (is_simple_arglist): Fix typo in comment.
18200 (is_simple_varname): Ditto.
18201 (is_simple_const): Don't accept casts of SIMPLE constants.
18202 (is_simple_id): Don't accept casts of SIMPLE identifiers.
18203 (is_simple_val): Fix typo in comment.
18204 (is_simple_arrayref): Ditto.
18205 (is_simple_compref): Ditto.
18206 (is_simple_compref_lhs): Ditto.
18207 (is_simple_cast_op): Ditto.
18208 (is_simple_exprseq): Allow NULL expression sequences.
18209 * tree-simple.h (is_simple_stmt): Declare
18210 (is_simple_compstmt): Declare.
18211 * tree-ssa.c (follow_chain): Fix typo in comment.
18213 2002-04-22 Diego Novillo <dnovillo@redhat.com>
18215 * c-pretty-print.c (dump_c_node): Don't print function
18216 bodies of FUNCTION_DECL nodes.
18218 2002-04-19 Andreas Jaeger <aj@suse.de>
18220 * Makefile.in (c-call-graph.o): New.
18222 2002-04-18 Sebastian Pop <s.pop@laposte.net>
18224 * c-pretty-print.c (PRINT_FUNCTION_NAME): Define.
18225 (dump_c_node): Call pretty_print_string to print string.
18226 Call print_call_name to print function names.
18227 (pretty_print_string): New function.
18228 (print_call_name): New function.
18230 2002-04-17 Diego Novillo <dnovillo@redhat.com>
18232 * c-simplify.c (simplify_do_stmt): Call is_simple_condexpr to test
18233 if the conditional is in SIMPLE form.
18234 (simplify_if_stmt): Ditto.
18236 2002-04-17 Diego Novillo <dnovillo@redhat.com>
18238 * c-pretty-print.c (dump_c_node): Handle escape sequences in strings.
18239 (op_symbol): Handle TRUTH_NOT_EXPR.
18240 * c-simplify.c: Rename 'after' with 'post' and 'before' with 'pre'
18242 Re-group some functions and add comments.
18243 (simplify_stmt): Update calls to simplify_for_stmt,
18244 simplify_while_stmt, simplify_do_stmt and simplify_switch_stmt.
18245 Call simplify_if_stmt.
18246 Do not test if expression is in SIMPLE form before calling
18248 Call convert_to_stmt_chain to emit statement trees for side effects
18249 found while simplifying.
18250 (simplify_for_stmt): Re-implement. Do not change structure of the
18251 statement. Simplify each header expression and emit side effects
18252 at sequence points.
18253 (simplify_while_stmt): Ditto.
18254 (simplify_do_stmt): Ditto.
18255 (simplify_switch_stmt): Ditto.
18256 (new_simplified_if): Rename to simplify_if_stmt.
18257 Call simplify_expr to simplify the conditional.
18258 (simplify_if_stmt): New name for new_simplified_if.
18259 (simplify_expr): Do not default simple_test_f to is_simple_expr.
18260 If simple_test_f is not set, abort.
18261 Handle COMPOUND_EXPR, MODIFY_EXPR, TRUTH_ANDIF_EXPR,
18262 TRUTH_ORIF_EXPR, SAVE_EXPR and EXPR_WITH_FILE_LOCATION.
18263 (simplify_arglist): Rename to simplify_tree_list.
18264 (simplify_tree_list): New name for simplify_arglist.
18265 (simplify_boolean_expr): New function.
18266 (simplify_compound_expr): New function.
18267 (tree_build_scope): Use SCOPE_BEGIN_P instead of TREE_LANG_FLAG_0
18268 to access scope operands. Use COMPOUND_BODY instead of
18269 TREE_OPERAND to access the body of the compound statement.
18270 (add_tree): Use a TREE_LIST container instead of directly chaining the
18272 (add_assignment_tree): Rename to add_modify_stmt. Update all
18274 (add_modify_stmt): New name for add_assignment_tree.
18275 (insert_before_continue_end): Do nothing it the tree to insert is
18277 (copy_stmt_chain): Rename to deep_copy_list. Update all callers.
18278 (deep_copy_list): New name for copy_stmt_chain.
18279 (copy_stmt): Rename to deep_copy_node. Update all callers.
18280 (deep_copy_node): New name for copy_stmt. Handle TREE_LIST
18282 (insert_before_first): New function.
18283 (is_binop): Add COMPOUND_EXPR.
18284 (convert_to_stmt_chain): New function.
18285 * tree-cfg.c (make_for_stmt_blocks): Fix comment.
18286 * tree-simple.c (is_simple_condexpr): New function.
18287 (is_simple_const): Allow casts of SIMPLE constants.
18288 (is_simple_id): Allow casts of SIMPLE identifiers.
18289 (is_simple_cast): Call is_simple_cast_op.
18290 (is_simple_cast_op): New function.
18291 (is_simple_exprseq): New function.
18292 * tree-simple.h (deep_copy_list): Declare.
18293 (deep_copy_node): Declare.
18294 (is_simple_cast_op): Declare.
18295 (is_simple_exprseq): Declare.
18297 2002-04-03 Diego Novillo <dnovillo@redhat.com>
18299 * c-simplify.c (simplify_expr): Add arguments simple_tree_f and
18300 is_lhs. Update all callers.
18301 Call simplify_call_expr, simplify_cond_expr, simplify_arglist and
18302 simplify_modify_expr.
18303 Call is_unop and is_binop to check for unary and binary operators.
18304 (simplify_binary_expr): Remove.
18305 (simplify_call_expr): New function.
18306 (simplify_arglist): New function.
18307 (simplify_cond_expr): New function.
18308 (simplify_modify_expr): New function.
18309 (keep_stmt_p): Remove.
18310 (is_binop): New function.
18311 (is_unop): New function.
18312 (simplify_stmt): Don't call keep_stmt_p.
18313 (simplify_decl_stmt): Call add_assignment_tree.
18314 * tree-simple.c: Include c-tree.h
18315 Add expression-statements to the SIMPLE grammar.
18316 (is_simple_modify_expr_lhs): New function.
18317 (is_simple_modify_expr): Call it.
18318 (is_simple_relop): Update comment.
18319 (is_simple_unary_expr): Allow expression-statements.
18320 (is_simple_arglist): New function.
18321 (is_simple_call_expr): Call it.
18322 (is_simple_id): Accept expressions taking the address of a
18324 * tree-simple.h (is_simple_modify_expr_lhs): Declare.
18325 (is_simple_arglist): Declare.
18327 2002-03-21 Diego Novillo <dnovillo@redhat.com>
18329 * Makefile.in (c-simplify.o): Add dependency on varray.h.
18330 * c-simplify.c: Include varray.h.
18331 Remove comments with SIMPLE grammar.
18332 (simplify_array_ref): New.
18333 (simplify_self_mod_expr): New.
18334 (simplify_component_ref): New.
18335 (add_assignment_tree): New.
18336 (simplify_expr): Call simplify_array_ref to simplify array
18338 Call simplify_self_mod_expr to simplify ++, --, += and -=
18340 Call simplify_component_ref to simplify references to structures.
18341 (simplify_binary_expr): Do not check whether the expression is
18342 already in SIMPLE form.
18343 * tree-simple.c: Document changes from original SIMPLE grammar.
18344 (is_simple_unary_expr): Add check for *ID.
18345 (is_simple_call_expr): Update comments.
18346 (is_simple_const): Ditto.
18347 (is_simple_id): Do not accept *ID expressions.
18348 (is_simple_val): Update comments.
18349 (is_simple_arrayref): Accept any variable name as the base address.
18350 (is_simple_compref_lhs): New.
18351 (is_simple_compref): Call it.
18352 * tree-simple.h (is_simple_compref_lhs): Declare.
18354 2002-03-18 Diego Novillo <dnovillo@redhat.com>
18356 * Makefile.in (C_AND_OBJC_OBJS): Add tree-simple.o
18357 (tree-simple.o): New rule.
18358 * c-simplify.c (simplified_p): Remove.
18359 (simplified_rec_p): Remove.
18360 (simplified_condition_p): Remove.
18361 (simplify_for_stmt): Call is_simple_expr instead of
18362 simplified_condition_p.
18363 (simplify_while_stmt): Ditto.
18364 (simplify_do_stmt): Call is_simple_expr instead of simplified_p.
18365 (new_simplified_if): Call is_simple_expr instead of
18367 (simplify_decl_stmt): Update comment.
18368 (simplify_expr): Return the original expression if it's already
18370 Do not special case most binary and unary expressions.
18371 When simplifying array references, create temporary variables to
18372 hold the base address for the array.
18373 Simplify COMPONENT_REF expressions separately.
18374 Call simplify_binary_expr to handle most binary expressions.
18375 (simplify_binary_expr): New function.
18376 (keep_stmt_p): Call is_simple_unary_expr to determine whether the
18377 statement should be kept or not.
18378 * tree-simple.c: New file.
18379 * tree-simple.h (is_simple_expr): Declare.
18380 (is_simple_rhs): Declare.
18381 (is_simple_modify_expr): Declare.
18382 (is_simple_binary_expr): Declare.
18383 (is_simple_binop): Declare.
18384 (is_simple_relop): Declare.
18385 (is_simple_unary_expr): Declare.
18386 (is_simple_call_expr): Declare.
18387 (is_simple_const): Declare.
18388 (is_simple_id): Declare.
18389 (is_simple_varname): Declare.
18390 (is_simple_val): Declare.
18391 (is_simple_arrayref): Declare.
18392 (is_simple_compref): Declare.
18393 (is_simple_cast): Declare.
18394 * cp/Make-lang.in (CXX_C_OBJS): Add tree-simple.o
18396 2002-03-18 Diego Novillo <dnovillo@redhat.com>
18398 * tree-simple.h: New file.
18399 * Makefile.in (c-simplify.o): Add dependency on tree-simple.h
18400 * c-simplify.c: Reformat some comments.
18401 (tree_last_decl): Declare.
18403 2002-03-18 Sebastian Pop <s.pop@laposte.net>
18405 * c-simplify.c (insert_stmt_chain): Delete.
18406 (simplified_condition_p, insert_after_case_labels): New.
18407 (simplify_stmt, simplify_for_stmt, simplify_while_stmt,
18408 simplify_do_stmt, new_simplified_if, simplify_switch_stmt):
18409 Returns a single node, generate a chain of statements to be executed
18410 before the if, and a list of new variables.
18411 (new_simplified_if): Simplify clauses.
18412 (simplify_expr): Remove unused parameter scope.
18414 2002-03-14 Sebastian Pop <s.pop@laposte.net>
18416 * c-simplify.c (simplify_switch_stmt, simplify_expr): Add scope
18418 (simplify_while_stmt, simplify_do_stmt, simplify_for_stmt): Avoid
18419 negating loop condition during simplification.
18420 (new_simplified_if): Don't simplify the IF_BODY.
18421 (copy_stmt_chain): Use copy_stmt.
18422 (copy_stmt): New function.
18424 2002-02-28 Sebastian Pop <s.pop@laposte.net>
18426 * tree-dfa.c (find_refs_in_stmt): Changed if/else statements in
18429 2002-02-28 Sebastian Pop <s.pop@laposte.net>
18431 * c-simplify.c (simplify_if_stmt): Deleted.
18432 (new_simplified_if): New function.
18433 (make_type_writable): New function.
18434 (insert_before_continue_end): New function.
18435 (insert_before_continue): New function.
18436 (copy_stmt_chain): New function.
18437 (insert_stmt_chain): New function.
18438 (update_line_number): New function.
18439 (simplified_p): New function.
18440 (simplified_rec_p) New function.
18441 (simplify_stmt): Modify the way to call simplification
18442 of COMPOUND_STMT, FOR_STMT, WHILE_STMT, DO_STMT, IF_STMT,
18443 and SCOPE_STMT in order to avoid to execute the code after
18444 the switch. Add FILE_STMT, LABEL_STMT, GOTO_STMT, ASM_STMT cases.
18445 Simplified a little the code after the switch.
18446 (simplify_for_stmt): Change functions parameters.
18447 Add code to simplify the FOR_INIT_STMT, FOR_COND, FOR_EXPR.
18448 (simplify_while_stmt): Change functions parameters.
18449 Add code to simplify the WHILE_COND.
18450 (simplify_do_stmt): Change functions parameters.
18451 Add code to simplify the DO_COND.
18452 (simplify_switch_stmt): Change functions parameters.
18453 (simplify_expr): Remove scope parameter.
18454 Avoid to introduce a new temporary variable for an expression
18455 that is already simplified.
18456 ([ARRAY|COMPONENT]_REF, COND_EXPR): Handle them apart.
18457 (TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR): Avoid to evaluate the second
18458 operand if the value can be deduced from the first one.
18459 (keep_stmt_p): Add some other cases in which we don't need to keep
18460 a statement after its simplification.
18462 2002-02-28 Sebastian Pop <s.pop@laposte.net>
18464 * Makefile.in: Add c-call-graph.o dependence.
18465 * c-call-graph.c: New file.
18466 * c-decl.c (c_expand_body): Add an entry point for call-graph.
18467 * tree-dump.c (dump_files): Add the flag dump-call-graph.
18468 * tree.h (tree_dump_index): Add TDI_xml.
18470 2002-02-28 Sebastian Pop <s.pop@laposte.net>
18472 * c-pretty-print.c (dump_c_tree): Declare it extern.
18473 (dump_c_node): Declare it extern.
18474 (dump_c_scope_vars): Deleted, some code moved in print_declaration ().
18475 (print_declaration): New function.
18476 (print_function_decl): New function.
18477 (print_struct_decl): New function.
18478 (INDENT_PRINT_C_NODE): Deleted.
18479 (INDENT): New macro.
18480 (NIY): Define the macro body in a block.
18481 (dump_c_node): Add dumping for TREE_PURPOSE operand in TREE_LIST.
18482 [VOID|INTEGER|REAL|COMPLEX|VECTOR|ENUMERAL|BOOLEAN|CHAR]_TYPE nodes:
18483 insert some code from print-tree.c:print_node_brief () in order to
18484 stabilise the type printing.
18485 [RECORD|UNION]_TYPE nodes: Don't print their contents by default,
18486 move the existing code in print_struct_decl ().
18487 [POSTDECREMENT|POSTINCREMENT]_EXPR: Print the operand in post postion.
18488 [MIN|MAX|ABS]_EXPR: New code for printing these nodes.
18489 FOR_STMT: Don't print the FOR_BODY if it is not present.
18490 RETURN_STMT: Don't print the return expression for a void function.
18491 ASM_STMT: New code for printing this node.
18492 SCOPE_STMT: Use print_declaration instead of dump_c_scope_vars.
18493 COMPOUND_LITERAL_EXPR: Add the node as not implemented yet.
18494 (op_prio): Fix switch indent.
18495 Add node EXPR_WITH_FILE_LOCATION with priority 16.
18496 (op_symbol): Fix switch indent.
18498 2002-01-25 Diego Novillo <dnovillo@redhat.com>
18500 * Makefile.in (c-pretty-print.o): Add dependency on errors.h.
18501 * c-decl.c (c_expand_body): React to -ftree-dump-simple.
18502 * c-pretty-print.c: Fix typo in header comment.
18503 (NYI): Flush output buffer, dump the tree and abort.
18504 (dump_c_node): Add unparsing code for ERROR_MARK, IDENTIFIER_NODE,
18505 ARRAY_TYPE, UNION_TYPE, STRING_CST, CEIL_DIV_EXPR, FLOOR_DIV_EXPR,
18506 ROUND_DIV_EXPR, TRUNC_MOD_EXPR, FLOOR_MOD_EXPR, ROUND_MOD_EXPR,
18507 RDIV_EXPR, EXACT_DIV_EXPR, LROTATE_EXPR, RROTATE_EXPR,
18508 BIT_ANDTC_EXPR, BIT_NOT_EXPR, UNORDERED_EXPR, SAVE_EXPR and
18509 EXPR_WITH_FILE_LOCATION.
18510 Unify unparsing code for common binary and unary expressions.
18511 Handle indirect references like any other unary expression.
18512 (dump_c_scope_vars): Remove unused variable 'context'.
18513 Call dump_c_node to print the type.
18514 (dump_c_indirect_ref): Remove.
18515 (op_prio): New function.
18516 (op_symbol): New function.
18517 * c-simplify.c (simplify_stmt): Do not simplify a return
18518 expression, only its second operand.
18519 Fix capitalization in error message.
18520 (simplify_expr): Add documentation.
18521 Fix capitalization in error message.
18522 * tree-dump.c (dump_files): Add entry for -fdump-tree-simple.
18523 (dump_options): Add entry for -unparse.
18524 * tree.h (TDI_simple): Define.
18525 (TDF_UNPARSE): Define.
18526 * doc/invoke.texi: Document -fdump-tree-simple.
18528 2002-01-23 Sebastian Pop <s.pop@laposte.net>
18530 * c-pretty-print.c: Clean C++ comments.
18531 (debug_output_buffer): Remove declaration and definition.
18532 * diagnostic.h (debug_output_buffer): Add declaration.
18533 * diagnostic.c (debug_output_buffer): Add definition.
18535 2002-01-21 Diego Novillo <dnovillo@redhat.com>
18537 * tree-dfa.c (find_refs_in_stmt): Fix capitalization in error
18539 (find_refs_in_expr): Ditto.
18541 2002-01-20 Diego Novillo <dnovillo@redhat.com>
18542 Sebastian Pop <s.pop@laposte.net>
18544 * Makefile.in: Add c-simplify.o.
18545 * cp/Make-lang.in: Ditto.
18546 * c-decl.c (c_expand_body): Call simplify_stmt() before
18547 calling optimize_tree().
18548 * c-simplify.c: New file.
18549 * c-tree.h (simplify_stmt): Declare.
18551 * tree-dfa.c (find_refs_in_stmt): Fix error message for unhandled
18554 2002-01-20 Sebastian Pop <s.pop@laposte.net>
18556 * Makefile.in: Add c-pretty-print.o.
18557 * cp/Make-lang.in: Ditto.
18558 * c-pretty-print.c: New file.
18559 * c-tree.h (print_c_tree): Declare.
18560 (print_c_node): Declare.
18561 (debug_c_tree): Declare.
18562 (debug_c_node): Declare.
18564 2001-12-29 Diego Novillo <dnovillo@redhat.com>
18566 * c-lang.c (c_post_options): Move code to enable tree-ssa
18567 if -Wuninitialized is used ...
18568 * c-common.c (c_common_post_options): ... here.
18570 2001-12-29 Diego Novillo <dnovillo@redhat.com>
18572 * Makefile.in (tree-optimize.o): Don't depend on c-common.h
18573 * tree-cfg.c: Don't include c-tree.h. Explain why we need to
18574 include c-common.h.
18575 * tree-dfa.c: Explain why we need to include c-common.h.
18576 * tree-ssa.c: Ditto.
18577 * tree-optimize.c: Don't include c-common.h
18579 2001-12-21 Nathan Sidwell <nathan@codesourcery.com>
18581 Revert my patch of 2001-07-23 for the moment.
18583 2001-10-15 Diego Novillo <dnovillo@redhat.com>
18585 * tree-dfa.c (create_varref): If the new reference is inside a
18586 statement, add it to the list of references for that statement.
18588 2001-10-14 Diego Novillo <dnovillo@redhat.com>
18590 * Merge from mainline:
18592 Tue Sep 11 11:37:52 CEST 2001 Jan Hubicka <jh@suse.cz>
18594 * basic-block.h (cached_make_edge): New.
18595 (make_edge): Remove first parameter.
18596 * flow.c (cached_make_edge): Rename from make_edge; return
18597 newly created edge; use obstack allocation.
18599 (flow_call_edges_add): Updaet make_edge call.
18600 (add_noreturn_fake_exit_edges): Likewise.
18601 (connect_infinite_loops_to_exit): Liekwise.
18602 (make_label_edge, make_edges, find_sub_basic_blocks): Use
18604 * profile.c (branch_prob): Update make_edge call.
18605 * ssa-dce.c (ssa_eliminate_dead_code): Likewise.
18607 2001-10-14 Diego Novillo <dnovillo@redhat.com>
18609 * Makefile.in (tree-ssa.o): Remove dependency on flags.h.
18610 (tree-optimize.o): Add dependency on flags.h.
18611 * bb-reorder.c (fixup_reorder_chain): Update call to make_edge.
18612 * c-lang.c (c_post_options): Set flag_tree_ssa if -Wuninitialized
18614 * ifcvt.c (find_if_case_1): Update call to make_edge.
18615 * toplev.c (toplev_main): Do not warn about -Wuninitialized without
18616 -O if -ftree-ssa is used.
18617 * tree-cfg.c (dot_dump_file): Remove.
18618 (dot_dump_flags): Remove.
18619 (cfg_dump_file): Rename to dump_file.
18620 (cfg_dump_flags): Rename to dump_flags.
18621 (remove_bb_ann): New function.
18622 (tree_find_basic_blocks): Do not open dump files at the beginning
18624 Do not call delete_cfg.
18625 Create annotations for ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR.
18626 (make_for_stmt_blocks): Update FOR_INIT_STMT_BB and FOR_COND_BB
18627 when creating the header blocks.
18628 Create the blocks for the loop body before the expression block.
18629 (make_while_stmt_blocks): Update END_WHILE_BB when creating the
18631 Create the blocks for the loop body before the end-while block.
18632 (make_do_stmt_blocks): Update DO_COND_BB when creating header
18634 Create the blocks for the loop body before the block for DO_COND.
18635 (create_bb): When creating loop header blocks, allocate space for
18636 the header_blocks union.
18637 Call create_bb_ann to create a new annotation.
18638 (remove_bb_ann): New function.
18639 (tree_split_bb): New function.
18640 (make_edges): Remove first argument from call to make_edge,
18641 make_ctrl_stmt_edges, make_exit_edges, make_for_stmt_edges,
18642 make_while_stmt_edges, make_do_stmt_edges, make_if_stmt_edges,
18643 make_goto_stmt_edges, make_break_stmt_edges and
18644 make_continue_stmt_edges.
18645 When creating edges for the default label, remove the fallthru edge
18646 that was created for the associated SWITCH_STMT entry block.
18647 Do not call delete_unreachable_blocks.
18648 Call tree_cleanup_cfg.
18649 (make_ctrl_stmt_edges): Remove first argument.
18650 (make_exit_edges): Remove first argument.
18651 If the last element of the block is an EXPR_STMT, assume that it is
18652 the call to a non-returning function and make an edge to the exit
18654 Do not call make_return_stmt_edges. Call make_edge directly.
18655 (make_for_stmt_edges): Remove first argument.
18656 Simplify the graph for infinite and zero-iteration loops.
18657 (make_while_stmt_edges): Remove first argument.
18658 Simplify the graph for infinite and zero-iteration loops.
18659 (make_do_stmt_edges): Remove first argument.
18660 Simplify the graph for infinite and one-iteration loops.
18661 (make_if_stmt_edges): Remove first argument.
18662 Simplify the graph for always-true and always-false conditionals.
18663 (make_goto_stmt_edges): Remove first argument.
18664 (make_break_stmt_edges): Remove first argument.
18665 (make_continue_stmt_edges): Remove first argument.
18666 (make_return_stmt_edges): Remove.
18667 (tree_cleanup_cfg): New function.
18668 (delete_unreachable_blocks): Do not react to -Wunreachable-code.
18669 Write to dump file blocks that have been removed.
18671 (is_ctrl_altering_stmt): If the statement contains a call to a
18672 non-returning function, return 1.
18673 (delete_cfg): Call remove_bb_ann. Also remove annotations for
18674 ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR.
18675 (latch_block): Use WHILE_COND_BB instead of END_WHILE_BB.
18676 (insert_stmt_tree_before): Use cfg_dump_file instead of dump_file.
18677 (insert_before_ctrl_stmt): Ditto.
18678 (insert_before_normal_stmt): Ditto.
18679 (insert_stmt_tree_after): Ditto.
18680 (insert_after_ctrl_stmt): Ditto.
18681 (insert_after_normal_stmt): Ditto.
18682 (replace_expr_in_tree): Ditto.
18683 (insert_bb_before): Ditto.
18684 * tree-dfa.c (tree_find_varrefs): Call find_refs_in_expr when the
18685 tree is not a statement.
18686 (find_refs_in_stmt): Update comments.
18687 Do not deal with FOR_STMT and DO_STMT trees separately.
18688 When processing VAR_DECLs, call find_refs_in_expr with the
18689 declaration, not its initial value.
18690 (find_refs_in_expr): When processing COMPONENT_REFs and ARRAY_REFs,
18691 recurse using the same reference type that was given by the
18693 (create_varref): Insert new PHI terms at the beginning of the
18694 BB_REFS array, not the end.
18695 * tree-flow.h (struct for_header_blocks): Declare.
18696 (union header_blocks): Declare.
18697 (struct bb_ann_def): Add new field 'loop_hdr'.
18698 (BB_ANN): Re-define so that it can be used as an lvalue.
18699 (BB_PARENT): Ditto.
18701 (BB_PREV_CHAIN): Ditto.
18702 (BB_BINDING_SCOPE): Ditto.
18703 (BB_LOOP_HDR): Define.
18704 (FOR_INIT_STMT_BB): Redefine using BB_LOOP_HDR.
18705 (FOR_COND_BB): Ditto.
18706 (FOR_EXPR_BB): Ditto.
18707 (DO_COND_BB): Ditto.
18708 (END_WHILE_BB): New name for WHILE_COND_BB.
18709 (tree_warn_uninitialized): Declare.
18710 (tree_cleanup_cfg): Declare.
18711 (tree_split_bb): Declare.
18712 * tree-optimize.c: Include flags.h.
18713 (init_tree_flow): New function.
18714 (optimize_tree): Call build_tree_ssa instead of building SSA
18716 (build_tree_ssa): New function.
18717 * tree-optimize.h (build_tree_ssa): Declare.
18718 * tree-ssa.c: Don't include toplev.h
18719 (tree_warn_uninitialized): Define.
18720 (tree_compute_rdefs): Do not call is_upward_exposed. Instead
18721 traverse all the uses of each variable and warn if the use is
18722 reached by the ghost definition.
18724 2001-10-10 Graham Stott <grahams@redhat.com>
18726 * tree-cfg.c (create_bb): Add new binding_scope parameter which allows
18727 the binding scope either to be explicitly specified if non-zero.
18728 (make_blocks): Update call to create_bb.
18729 (make_for_stmt_blocks): Ditto.
18730 (make_while_stmt_blocks): Ditto.
18731 (make_do_stmt_blocks): Ditto.
18732 (make_if_stmt_blocks): Ditto.
18733 (make_switch_stmt_blocks): Ditto.
18734 (create_maximal_bb): Ditto.
18735 (make_edges): If a statement expression is in the last basic
18736 block create an edge to EXIT_BLOCK_PTR and not the next block.
18737 (insert_before_normal_stmt): Pass the appropriate binding scope to
18740 2001-10-01 Graham Stott <grahams@redhat.com>
18741 Diego Novillo <dnovillo@redhat.com>
18743 * tree-optimize.c (optimize_tree): Early return if the program has
18746 2001-09-30 Diego Novillo <dnovillo@redhat.com>
18748 * tree-optimize.c (optimize_tree): Compute reaching definitions
18749 after building SSA.
18751 2001-09-30 Diego Novillo <dnovillo@redhat.com>
18753 * tree-cfg.c (insert_after_ctrl_stmt): Remove unused argument.
18754 (make_blocks): Pop top element from scope binding stack when an end
18755 of scope statement is found.
18756 (create_bb): Remove code for popping top element from scope binding
18758 Do not push basic block 0 to initialize scope binding stack.
18759 (insert_stmt_tree_after): Remove unused argument from call to
18760 insert_after_ctrl_stmt.
18761 (tree_dump_bb): Dump BB_BINDING_SCOPE if defined.
18762 * doc/invoke.texi: Document debugging option -ftree-dump-ssa-rdefs.
18764 2001-09-29 Diego Novillo <dnovillo@redhat.com>
18766 * Makefile.in (tree-ssa.o): Update dependencies.
18767 (tree-cfg.o): Ditto.
18768 (tree-optimize.o): Ditto.
18769 * basic-block.h (BB_CONTROL_EXPR): Define.
18770 (BB_CONTROL_ENTRY): Define.
18771 * c-common.h (TDF_RDEFS): Define.
18772 * c-dump.c (dump_option_value_in): Add entry for TDF_RDEFS.
18773 * tree-cfg.c: Include flags.h and c-tree.h
18774 (binding_stack): New local variable.
18775 (delete_block): Rename to delete_bb.
18776 (tree_find_basic_blocks): Initialize varray 'binding_stack'.
18777 Call make_blocks with an additional argument.
18778 Adjust size of varray 'basic_block_info' after building CFG.
18779 (make_blocks): Add new argument prev_chain_p.
18780 Update all callers and callees.
18781 Create sub-graphs for statement-expressions.
18782 Update prev_chain_p when accessing the next tree in the chain.
18783 (make_for_stmt_blocks): Add new argument prev_chain_p.
18784 Update all callers and callees.
18785 Update flags for control header blocks with BB_CONTROL_ENTRY and/or
18787 (make_while_stmt_blocks): Ditto.
18788 (make_do_stmt_blocks): Ditto.
18789 (make_if_stmt_blocks): Ditto.
18790 (make_switch_stmt_blocks): Ditto.
18791 (create_maximal_bb): Add new argument prev_chain_p.
18792 Update all callers and callees.
18793 (create_bb): Add new argument prev_chain_p.
18794 Push basic block 0 the first time into the binding scope stack.
18795 Associate the new basic block to the binding scope at the top of
18797 Push new binding scopes when a SCOPE_BEGIN statement is found.
18798 Pop the top binding scope when a SCOPE_END statement is found.
18799 (make_edges): Handle statement expressions.
18800 Handle case labels preceded by scope statements in switch
18802 (make_for_stmt_edges): Use FOR_INIT_STMT_BB, FOR_COND_BB and
18803 FOR_EXPR_BB to access the header basic blocks.
18804 (delete_unreachable_blocks): Call delete_bb instead of
18806 (delete_block): Rename to delete_bb.
18807 (block_invalidates_loop): Use data references to find calls to
18808 non-pure functions.
18809 (is_ctrl_stmt): Reformat.
18810 (loop_body): New function.
18811 (set_loop_body): New function.
18812 (stmt_starts_bb_p): Statement expression trees also start a new
18814 (delete_cfg): Call VARRAY_FREE to delete all the references in each
18816 (latch_block): Use FOR_EXPR_BB, WHILE_COND_BB and DO_COND_BB to
18817 find out the latch block for the loop.
18818 (last_exec_stmt): New function.
18819 (is_exec_stmt): Scope statements that begin a scope are also
18820 considered executables.
18821 (is_statement_expression): New function.
18822 (first_non_decl_stmt): New function.
18823 (first_decl_stmt): New function.
18824 (first_non_label_in_bb): New function.
18825 (insert_stmt_tree_before): New function.
18826 (insert_before_ctrl_stmt): New function.
18827 (insert_before_normal_stmt): New function.
18828 (insert_stmt_tree_after): New function.
18829 (insert_after_ctrl_stmt): New function.
18830 (insert_after_normal_stmt): New function.
18831 (insert_after_loop_body): New function.
18832 (replace_expr_in_tree): New function.
18833 (find_expr_in_tree): New function.
18834 (insert_bb_before): New function.
18835 (tree_dump_bb): Display the contents of BB_PREV_CHAIN_P.
18836 * tree-dfa.c (tree_find_varrefs): Use accessor macros for array
18837 'referenced_symbols'.
18838 (find_refs_in_stmt): Do not process error_mark_node trees.
18839 Handle statement-expression nodes as any other statement tree.
18840 Do not call find_refs_in_stmt_expr.
18841 (find_refs_in_stmt_expr): Remove.
18842 (add_ref_to_sym): Remove.
18843 (add_ref_to_bb): Remove.
18844 (find_refs_in_expr): Do not process error_mark_node trees.
18845 ADDR_EXPR trees are not variable references except if used in a
18847 Handle EXPR_WITH_FILE_LOCATION nodes.
18848 (create_varref): Remove variable 'is_new'.
18849 Initialize data-flow arrays VARDEF_IMM_USES, VARDEF_RUSES,
18850 VARDEF_PHI_CHAIN and VARUSE_RDEFS.
18851 Do not call add_ref_to_sym and add_ref_to_bb.
18852 (add_ref_symbol): Use accessor macros for varray
18853 'referenced_symbols'.
18854 (function_may_recurse_p): New function.
18855 (get_fcalls): New function.
18856 (find_declaration): New function.
18857 (dump_varref): Handle NULL values of VARREF_EXPR.
18858 Use VARDEF_PHI_CHAIN instead of VARPHI_CHAIN.
18859 (dump_varref_list): Check if the list is NULL before traversing it.
18860 * tree-flow.h (struct vardef): Add fields 'ruses', 'marked' and
18862 (VARDEF_RUSES): Define.
18863 (VARDEF_MARKED): Define.
18864 (VARDEF_PHI_CHAIN): Define.
18865 (VARPHI_CHAIN): Remove.
18866 (struct varphi): Remove.
18867 (struct varuse): Add field 'rdefs'.
18868 (VARUSE_RDEFS): Define.
18869 (union varref_def): Remove field 'phi'.
18870 (IS_GHOST_DEF): Define.
18871 (IS_ARTIFICIAL_REF): Define.
18872 (struct bb_ann_def): Add fields 'prev_chain_p' and 'binding_scope'.
18873 (BB_PREV_CHAIN_P): Define.
18874 (BB_BINDING_SCOPE): Define.
18875 (FOR_INIT_STMT_BB): Define.
18876 (FOR_COND_BB): Define.
18877 (FOR_EXPR_BB): Define.
18878 (WHILE_COND_BB): Define.
18879 (DO_COND_BB): Define.
18880 (IF_COND_BB): Define.
18881 (CASE_COND_BB): Define.
18882 (NREF_SYMBOLS): Define.
18883 (REF_SYMBOL): Define.
18884 (ADD_REF_SYMBOL): Define.
18885 (FCALL_NON_PURE): Define.
18886 (FCALL_PURE): Define.
18887 (FCALL_BUILT_IN): Define.
18888 (loop_body): Declare.
18889 (set_loop_body): Declare.
18890 (last_exec_stmt): Declare.
18891 (is_statement_expression): Declare.
18892 (first_non_decl_stmt): Declare.
18893 (first_decl_stmt): Declare.
18894 (first_non_label_in_bb): Declare.
18895 (insert_stmt_tree_before): Declare.
18896 (insert_stmt_tree_after): Declare.
18897 (replace_expr_in_tree): Declare.
18898 (find_expr_in_tree): Declare.
18899 (insert_bb_before): Declare.
18900 (function_may_recurse_p): Declare.
18901 (get_fcalls): Declare.
18902 (find_declaration): Declare.
18903 (tree_compute_rdefs): Declare.
18904 (analyze_rdefs): Declare.
18905 (is_upward_exposed): Declare.
18906 * tree-optimize.c (optimize_tree): Update name for varray
18907 referenced_symbols.
18908 Free varray referenced_symbols and call delete_ssa on exit.
18909 * tree-ssa.c: Include flags.h, diagnostic.h and toplev.h.
18910 (tree_build_ssa): Create ghost definitions before building FUD
18912 (insert_phi_terms): Use accessor macros for 'referenced_symbols'.
18913 Ignore ghost definitions when placing PHI terms.
18914 (build_fud_chains): Call get_tree_ann to create an annotation for
18915 the symbol if it doesn't already have one.
18916 (search_fud_chains): Reformat comments.
18917 Do not initialize varray VARDEF_IMM_USES.
18918 If a successor basic block does not have references, continue on to
18919 the next one, do not stop.
18920 Do not initialize varray VARDEF_PHI_CHAIN.
18921 (delete_ssa): New function.
18922 (delete_refs): New function.
18923 (tree_compute_rdefs): New function.
18924 (analyze_rdefs): New function.
18925 (follow_chain): New function.
18926 (is_upward_exposed): New function.
18928 2001-09-14 Diego Novillo <dnovillo@redhat.com>
18930 * tree-cfg.c (tree_find_basic_blocks): Remove call to
18931 mark_critical_edges.
18932 (create_maximal_bb): Do not create annotations for non-executable
18934 (map_stmt_to_bb): Rename basic_block_ann with bb_ann.
18935 (delete_cfg): Ditto.
18936 (is_exec_stmt): Reformat.
18937 (create_bb_ann): New function.
18938 * tree-dfa.c (create_node): Remove.
18939 (ref_symbols_list): Remove.
18940 (create_tree_ann): Declare.
18941 (referenced_symbols): Declare.
18942 (tree_find_varrefs): Replace usage of linked lists with variable
18944 (create_varref): Remove second argument from call to
18947 (add_ref_to_sym): Replace usage of linked lists with variable
18950 (add_ref_to_bb): Ditto.
18951 (add_ref_symbol): Ditto.
18952 (dump_varref_list): Ditto.
18953 (debug_varref_list): Ditto.
18954 (create_varref_list): Remove.
18955 (push_ref): Remove.
18956 (create_node): Remove.
18957 (delete_varref_list): Remove.
18958 (get_tree_ann): Call create_tree_ann if the tree doesn't have an
18959 annotation already.
18960 (create_tree_ann): New function.
18961 * tree-flow.h (varref_list_def): Remove.
18962 (vardef): Change type of field 'imm_uses' to 'varray_type'.
18963 (varphi): Change type of field 'phi_chain' to 'varray_type'.
18964 (varref_node_def): Remove.
18965 (varref_node): Remove.
18966 (VARREF_NODE_ELEM): Remove.
18967 (VARREF_NODE_NEXT): Remove.
18968 (VARREF_NODE_PREV): Remove.
18969 (varref_list_def): Remove.
18970 (varref_list): Remove.
18971 (VARREF_LIST_FIRST): Remove.
18972 (VARREF_LIST_LAST): Remove.
18973 (tree_ann_def): Change type of field 'refs' to 'varray_type'.
18974 (basic_block_ann_def): Rename to 'bb_ann_def'.
18975 Change type of field 'refs' to 'varray_type'.
18976 (basic_block_ann): Rename to 'bb_ann'.
18977 (ref_symbols_list): Remove.
18978 (referenced_symbols): Declare.
18979 (add_ref_to_sym): Remove.
18980 (add_ref_to_bb): Remove.
18981 (add_ref_symbol): Remove.
18982 (remove_ann_from_sym): Remove.
18983 (create_varref_list): Remove.
18984 (push_ref): Remove.
18985 (delete_varref_list): Remove.
18986 (debug_varref_list): Update argument type to be 'varray_type'.
18987 (dump_varref_list): Ditto.
18988 * tree-optimize.c: Include 'basic-block.h'.
18989 (optimize_tree): Replace references to 'ref_symbols_list' with
18990 'referenced_symbols'.
18991 Remove call to delete_varref_list.
18992 * tree-ssa.c (insert_phi_terms): Rename 'work_list' to
18994 Use VARRAY_PUSH and VARRAY_TOP to access 'work_stack' instead of
18995 maintaining the stack pointer in 'work_list_top'.
18996 Remove code to grow 'work_stack'.
18997 Remove references to 'work_list_top'.
18998 Replace references to 'ref_symbols_list' with 'referenced_symbols'.
18999 (build_fud_chains): Replace references to 'ref_symbols_list' with
19000 'referenced_symbols'.
19001 (search_fud_chains): If there are no variable references in the
19002 basic block, return early.
19003 Change usage of linked lists with variable arrays.
19005 2001-09-07 Diego Novillo <dnovillo@redhat.com>
19007 * tree-cfg.c (tree_find_basic_blocks): Document how to traverse
19008 trees inside a basic block.
19009 (make_for_stmt_blocks): Make sure that there is always a block for
19010 FOR_EXPR, even if the loop does not have an expression.
19011 Create a separate block for FOR_INIT_STMT.
19012 (make_while_stmt_blocks): Always create an "end_while" block.
19013 (make_if_stmt_blocks): Do not store IF_COND in the header block of
19015 (make_for_stmt_edges): Create an edge from the block header to the
19016 block for FOR_INIT_STMT.
19017 Determine the first block of the loop body calling BB_FOR_STMT on
19018 the first executable statement in the body.
19019 Remove the special case for missing FOR_EXPR trees.
19020 (make_while_stmt_edges): Create a back edge from the end_while
19021 block to the header block.
19022 Determine the first block of the loop body calling BB_FOR_STMT on
19023 the first executable statement in the body.
19024 (make_do_stmt_edges): Determine the first block of the loop body
19025 calling BB_FOR_STMT on the first executable statement in the body.
19026 (condition_block): Rename to latch_block. Return the latch
19027 block for the given loop header.
19028 (make_continue_stmt_edges): Rename condition_block to
19030 (successor_block): Ditto.
19031 * tree-flow.h (condition_block): Rename to latch_block.
19033 2001-09-06 Diego Novillo <dnovillo@redhat.com>
19035 * tree-dfa.c (tree_find_varrefs): Use TDF_REFS instead of TDF_VARREF.
19036 * tree-flow.h (TDF_VARREF): Remove.
19038 2001-09-04 Nathan Sidwell <nathan@codesourcery.com>
19040 * c-common.h (tree_dump_index): Add more comments.
19041 (TDF_REFS): New dump flag.
19042 * c-dump.c (dump_files): Name flags `tree' rather than `ast'.
19043 (dump_option_value_info): New struct.
19044 (dump_options): New array.
19045 (dump_switch_p): Parse switch options symbolically.
19046 * doc/invoke.texi (-fdump-ast): Rename to ...
19047 (-fdump-tree): ... here. Document options are symbolic, and
19048 not all are applicable. Combine ssa related flags into the other
19051 2001-08-27 Diego Novillo <dnovillo@redhat.com>
19053 * Makefile.in (tree-ssa.o): Update dependencies.
19054 (tree-cfg.o): Ditto.
19055 (tree-dfa.o): Ditto.
19056 (tree-optimize.o): Ditto.
19058 2001-08-26 Diego Novillo <dnovillo@redhat.com>
19060 * Makefile.in (C_AND_OBJC_OBJS): Replace tree-opt.o with
19063 (tree-ssa.o): Ditto.
19064 (tree-cfg.o): Ditto.
19065 (tree-dfa.o): Ditto.
19066 (tree-opt.o): Ditto.
19067 * c-decl.c: Replace tree-opt.h with tree-optimize.h.
19068 (c_expand_body): Remove call to init_tree_opt.
19069 * flow.c (flow_loop_dump): Do not display insn UIDs if this is not
19070 an RTL basic block.
19071 * tree-cfg.c: Replace tree-opt.h with tree-optimize.h.
19072 (block_invalidates_loop): New local function.
19073 (validate_loops): New function.
19074 (tree_dump_bb): Display the loop depth of the block.
19075 * tree-dfa.c: Replace tree-opt.h with tree-optimize.h.
19076 * tree-flow.h (validate_loops): Declare.
19077 * tree-opt.c: Rename to tree-optimize.c.
19078 * tree-opt.h: Rename to tree-optimize.h.
19079 * tree-optimize.c: Rename from tree-opt.c.
19080 * tree-optimize.h: Rename from tree-opt.h.
19081 * tree-ssa.c: Replace tree-opt.h with tree-optimize.h.
19082 (tree_build_ssa): Call tree_dump_bb instead of tree_debug_bb.
19083 * cp/Make-lang.in: Replace tree-opt.h with tree-optimize.h.
19085 2001-08-20 Diego Novillo <dnovillo@redhat.com>
19087 * basic-block.h (basic_block): Remove field 'reachable'.
19088 Add new field 'flags'.
19089 (BB_REACHABLE): Define.
19090 * c-common.h (tree_dump_index): Add TDI_cfg, TDI_dot, TDI_ssa.
19091 * c-decl.c (c_decode_option): Skip '-f' prefix before calling
19093 * c-dump.c (dump_file_info): Add entries for -fdump-tree-cfg,
19094 -fdump-tree-graphviz and -fdump-tree-ssa.
19095 * flow.c (find_unreachable_blocks): Use BB_REACHABLE bit in bb->flags
19096 instead of bb->reachable.
19097 (delete_unreachable_blocks): Ditto.
19098 * tree-cfg.c: Minor formatting changes throughout the file.
19099 (DEBUG_TREE_FLOW): Remove.
19100 (debug_tree_flow): Remove.
19101 (cfg_dump_file): New local variable.
19102 (dot_dump_file): New local variable.
19103 (cfg_dump_flags): New local variable.
19104 (dot_dump_flags): New local variable.
19105 (tree_find_basic_blocks): Remove unused arguments.
19106 Add code to react to -fdump-tree-cfg and -fdump-tree-graphviz.
19107 Remove uses of DEBUG_TREE_FLOW.
19108 (delete_unreachable_blocks): Use BB_REACHABLE bit in bb->flags
19109 instead of bb->reachable.
19110 (tree_dump_cfg): New.
19111 (tree_debug_cfg): Call tree_dump_cfg().
19112 (tree_cfg2dot): Accept a FILE pointer instead of a file name as
19114 Name the graph with the current function name.
19115 * tree-dfa.c: Minor formatting changes throughout the file.
19116 (DEBUG_TREE_DFA): Remove.
19117 (debug_tree_dfa): Remove.
19118 (dump_file): New local variable.
19119 (dump_flags): New local variable.
19120 (tree_find_varrefs): Add code to react to -fdump-tree-ssa.
19121 Remove uses of DEBUG_TREE_DFA.
19122 (find_refs_in_expr): Remove uses of DEBUG_TREE_DFA.
19123 (create_varref): Replace VARREF_BLOCK with VARREF_BB.
19124 * tree-flow.h: Minor formatting changes throughout the file.
19125 (VARREF_BLOCK): Rename to VARREF_BB.
19126 (VARREF_NEXT): Remove.
19127 (VARREF_PREV): Remove.
19128 (TDF_VARREF): Define.
19129 (tree_find_basic_blocks): Remove unused arguments.
19130 (tree_dump_cfg): Declare.
19131 (tree_cfg2dot): Change argument to FILE *.
19132 * tree-opt.c: Minor formatting changes throughout the file.
19133 (optimize_tree): Remove unused arguments in call to
19134 tree_find_basic_blocks().
19135 * tree-opt.h: Ditto.
19136 * tree-ssa.c: Minor formatting changes throughout the file.
19137 (DEBUG_TREE_SSA): Remove.
19138 (debug_tree_ssa): Remove.
19139 (dump_file): New local variable.
19140 (dump_flags): New local variable.
19141 (tree_build_ssa): Add code to react to -fdump-tree-ssa.
19142 Remove uses of DEBUG_TREE_SSA.
19143 (insert_phi_terms): Remove uses of DEBUG_TREE_SSA.
19144 * doc/invoke.texi: Add documentation for -fdump-tree-cfg,
19145 -fdump-tree-graphviz and -fdump-tree-ssa.
19146 Replace existing references to -fdump-tree with -fdump-ast.
19148 2001-08-10 Diego Novillo <dnovillo@redhat.com>
19150 * basic-block.h (basic_block): Add new field 'reachable'.
19151 (expunge_block): Declare.
19152 * flow.c (ENTRY_BLOCK_PTR): Initialize field 'reachable'.
19153 (EXIT_BLOCK_PTR): Ditto.
19154 (expunge_block): Remove static declaration.
19155 (cleanup_cfg): Clear bb->aux on every basic block.
19156 (find_unreachable_blocks): Use field 'reachable' when computing
19158 (delete_unreachable_blocks): Use field 'reachable'.
19160 * tree-cfg.c: Rename all instance of 'node' with 'block.
19161 (get_successor_block): Rename to successor_block.
19162 (make_compound_stmt_edges): Remove.
19163 (make_switch_stmt_edges): Remove.
19164 (delete_unreachable_blocks): New.
19165 (delete_block): New.
19166 (make_blocks): Add new argument 'compound_stmt'. Do not include
19167 COMPOUND_STMT trees in the flowgraph.
19168 (make_for_stmt_blocks): Include FOR_INIT_STMT in the entry block of
19170 If FOR_COND does not exist, create a tree holding the constant 1.
19171 Add new argument 'compound_stmt'.
19172 (make_while_stmt_blocks): Include WHILE_COND in the entry block of
19174 Add new argument 'compound_stmt'.
19175 (make_do_stmt_blocks): Add new argument 'compound_stmt'.
19176 (make_if_stmt_blocks): Add new argument 'compound_stmt'.
19177 Include IF_COND in the IF header block.
19178 (make_switch_stmt_blocks): Add new argument 'compound_stmt'.
19179 Include SWITCH_COND in the SWITCH header block.
19180 (create_maximal_bb): Remove argument 'is_loop_header'.
19181 Add new argument 'compound_stmt'.
19182 Update all callers.
19183 Return the newly created basic block instead of its last statement.
19185 Do not store control flow altering statements in bb->exit_stmt.
19186 Only add executable statements to the block.
19187 Annotate with 'compound_stmt' each tree added to the block.
19188 (create_bb): Do not update annotation 'is_loop_header'.
19189 (make_edges): Remove naive reachability analysis.
19190 When a label node is found, add an edge from the immediately
19191 enclosing switch statement.
19192 Call delete_unreachable_blocks() after adding all the edges.
19193 (make_ctrl_stmt_edges): Do not consider COMPOUND_STMT trees.
19194 Do nothing for SWITCH_STMT trees.
19195 (make_exit_edges): Use bb->end_tree instead of BB_EXIT_STMT.
19196 (make_for_stmt_edges): Remove code that added edges for the block
19197 holding FOR_INIT_STMT.
19199 Do not consider the case where FOR_COND is NULL.
19200 Call first_exec_stmt() to determine if FOR_BODY is empty.
19201 Only create an edge from expr_bb to cond_bb if FOR_EXPR is
19203 (make_while_stmt_edges): Remove code that added edges for the block
19204 holding WHILE_COND.
19206 Call first_exec_stmt() to determine if WHILE_BODY is empty.
19207 (make_do_stmt_edges): Call first_exec_stmt() to determine if
19209 (make_if_stmt_edges): Remove code that added edges for the block
19211 Call first_exec_stmt() to determine if THEN_CLAUSE or ELSE_CLAUSE
19213 (make_switch_stmt_edges): Remove.
19214 (make_goto_stmt_edges): Use bb->end_tree instead of BB_EXIT_STMT.
19215 (make_break_stmt_edges): Use bb->end_tree instead of BB_EXIT_STMT.
19216 Call switch_parent() and loop_parent() to determine if the
19217 statement is inside an appropriate control structure.
19218 (make_continue_stmt_edges): Use bb->end_tree instead of
19220 (make_return_stmt_edges): Ditto.
19221 (get_successor_block): Rename to successor_block.
19222 Call first_exec_stmt() to find the first executable statement in
19224 (is_ctrl_stmt): Do not consider COMPOUND_STMT trees.
19225 (stmt_starts_bb_p): Ditto.
19226 (stmt_ends_bb_p): Reformat comments.
19227 (delete_cfg): Reformat comments.
19228 (find_loop_parent): Rename to loop_parent.
19229 (get_condition_block): Rename to condition_block.
19230 Update to use new index numbers for control structure header
19232 (switch_parent): New.
19233 (first_exec_stmt): New.
19234 (is_exec_stmt): New.
19235 (tree_cfg2dot): Reformat comments.
19236 * tree-dfa.c (find_refs): Remove.
19237 (find_refs_in_stmt): New
19238 (find_refs_in_stmt_expr): New.
19239 (tree_find_varrefs): Look for variables doing a CFG traversal
19240 instead of the trees. Remove both arguments.
19241 (find_refs_in_expr): Add new argument 'bb'.
19242 Update all recursive calls.
19243 (create_varref): Abort if the basic block 'bb' is NULL.
19244 (add_ref_to_sym): Reformat comments.
19245 (add_ref_symbol): Ditto.
19246 (delete_varref_list): Ditto.
19247 * tree-flow.h (struct tree_ann_def): Add 'compound_stmt'.
19248 (TREE_COMPOUND_STMT): New macro.
19249 (struct basic_block_ann_def): Remove 'exit_stmt' and
19251 (BB_EXIT_STMT): Remove.
19252 (BB_IS_LOOP_HEADER): Remove.
19253 * tree-opt.c (optimize_tree): Call tree_find_varrefs() with no
19255 Only build DFA and SSA information if n_basic_blocks is greater
19257 * tree-ssa.c: Rename all instances of 'node' with 'block'.
19258 (tree_build_ssa): Reformat comments.
19259 (insert_phi_terms): Ditto.
19261 2001-08-01 Diego Novillo <dnovillo@redhat.com>
19263 * tree-cfg.c (USE_TREE_IL): Remove.
19264 (make_back_edges): Remove.
19265 (make_fallthru_edge): Remove.
19266 (get_outermost_scope_block): Remove.
19267 (is_last_block_of_loop): Remove.
19268 (tree_find_basic_blocks): Do not return early if 'errorcount' is set.
19269 (make_edges): Do not treat back edges as a separate case.
19270 Do not call make_fallthru_edge to create fall-through edges.
19271 Do not emit a warning for unreachable blocks containing a single
19273 (make_do_stmt_edges): Update comment.
19274 (make_goto_stmt_edges): Do not call get_outermost_scope_block().
19275 (make_break_stmt_edges): Do not call get_outermost_scope_block().
19276 Do not call make_back_edges().
19277 (make_continue_stmt_edges): Call find_loop_parent(). Emit an error
19278 if the 'continue' statement is not inside a loop. Call
19279 get_condition_block() to find the target node.
19280 (make_return_stmt_edges): Do not call get_outermost_scope_block().
19281 (get_successor_block): Return EXIT_BLOCK_PTR if 'bb' is the last
19282 block in the graph.
19283 Return the condition node of the loop if 'bb' doesn't have a
19284 natural successor and its parent is a loop header.
19285 (tree_cfg2dot): Output fake edges with dotted lines.
19286 * tree-dfa.c (USE_TREE_IL): Remove.
19287 * tree-opt.c (USE_TREE_IL): Remove.
19288 * tree-ssa.c (USE_TREE_IL): Remove.
19289 * tree-flow.h (is_last_block_of_loop): Remove.
19291 2001-07-23 Diego Novillo <dnovillo@redhat.com>
19293 * Makefile.in (C_AND_OBJC_OBJS): Add tree-cfg.o, tree-dfa.o,
19294 tree-ssa.o and tree-opt.o.
19295 (c-decl.o): Add dependency on tree-opt.h
19296 (tree-ssa.o): New rule.
19297 (tree-cfg.o): New rule.
19298 (tree-dfa.o): New rule.
19299 (tree-opt.o): New rule.
19300 * c-decl.c: Include tree-opt.h.
19301 (c_expand_body): Call optimize_tree() when the -ftree-ssa flag is
19303 * flags.h (flag_tree_ssa): Declare.
19304 * toplev.c (flag_tree_ssa): Define.
19305 (lang_independent_options): Add -ftree-ssa.
19306 * tree-cfg.c: New file.
19307 * tree-dfa.c: New file.
19308 * tree-flow.h: New file.
19309 * tree-opt.c: New file.
19310 * tree-opt.h: New file.
19311 * tree-ssa.c: New file.
19312 * cp/Make-lang.in (CXX_C_OBJS): Add tree-cfg.o, tree-dfa.o,
19313 tree-opt.o and tree-ssa.o.
19314 * doc/invoke.texi: Add documentation for -ftree-ssa.
19316 2001-07-23 Nathan Sidwell <nathan@codesourcery.com>
19318 * Makefile.in (calls.o): Depend on intl.h.
19319 * calls.c: Include intl.h.
19320 (ECF_NEED_STACK_FRAME, ECF_NEED_ARG_FRAME): New flags.
19321 (special_function_p): Detect when we need a stack or arg
19322 frame. Don't optimize on length.
19323 (setjmp_call_p): Remove.
19324 (uninlinable_call_p): New function.
19325 * tree.h (setjmp_call_p): Remove.
19326 (uninlinable_call_p): Declare.
19328 2001-07-22 Nathan Sidwell <nathan@codesourcery.com>
19330 * params.def (PARAM_MAX_INLINE_AST): New parameter.
19331 (PARAM_ARG_INLINE_AST): New parameter.
19332 * doc/invoke.texi (max-inline-ast, arg-inline-ast): Document
19337 change-log-default-name: "ChangeLog.tree-ssa"
19341 Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
19343 Copying and distribution of this file, with or without modification,
19344 are permitted in any medium without royalty provided the copyright
19345 notice and this notice are preserved.