aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-gimplify.c
AgeCommit message (Collapse)AuthorFilesLines
2007-07-26Change copyright header to refer to version 3 of the GNU General Public ↵Nick Clifton1-5/+4
License and to point readers at the COPYING3 file and the FSF's license web page. From-SVN: r126948
2007-04-21re PR c/30265 (Compound literal can cause invalid gimple)Andrew Pinski1-0/+14
2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C/30265 * c-gimplifier.c (gimplify_compound_literal_expr): Mark the decl as addressable if the compound literal was marked as addressable. Mark the decl as a gimple register if it is a complex or vector decl and does not live in memory. 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C/30265 * gcc.c-torture/compile/compound-literal-2.c: New testcase. * gcc.c-torture/compile/compound-literal-3.c: New testcase. From-SVN: r124024
2006-08-25[multiple changes]Joseph Myers1-1/+1
2006-08-25 Fariborz Jahanian <fjahanian@apple.com> PR c/28418 * c-gimplify.c (gimplify_compound_literal_expr): Don't add variable again if DECL_SEEN_IN_BIND_EXPR_P. 2006-08-25 Joseph S. Myers <joseph@codesourcery.com> * gcc.c-torture/compile/compound-literal-1.c: New test. From-SVN: r116436
2006-05-18Whitespace fixupsMike Stump1-1/+1
From-SVN: r113893
2006-02-06tree-vrp.c (execute_vrp): Do not pass dump argument to.Zdenek Dvorak1-11/+11
* tree-vrp.c (execute_vrp): Do not pass dump argument to. loop_optimizer_init and loop_optimizer_finalize * tree-ssa-sink.c (execute_sink_code): Ditto. * tree-ssa-loop-ch.c (copy_loop_headers): Ditto. * tree-ssa-loop.c (tree_loop_optimizer_init, tree_ssa_loop_init, tree_ssa_loop_done): Ditto. * tree-ssa-pre.c (init_pre, fini_pre): Ditto. * sched-ebb.c: Include output.h. (schedule_ebbs): Do not use dump argument. * value-prof.h (struct profile_hooks): Remove profile_dump_file. * loop.c (loop_dump_stream): Removed. (loop_optimize, rest_of_handle_loop_optimize): Do not use dump argument. (scan_loop, move_movables, find_and_verify_loops, mark_loop_jump, emit_prefetch_instructions, loop_bivs_find, loop_bivs_check, final_biv_value, loop_biv_eliminable_p, loop_givs_rescan, loop_iterations, strength_reduce, record_biv, record_giv, final_giv_value, check_final_value, check_ext_dependent_givs, combine_givs, check_dbra_loop, maybe_eliminate_biv, load_mems, try_copy_prop, loop_delete_insns, try_swap_copy_prop): Use dump_file instead of loop_dump_stream. * ddg.c (print_ddg_edge, print_ddg, vcg_print_ddg): Do not call argument dump_file. * reorg.c (dbr_schedule, rest_of_handle_delay_slots): Do not use dump argument. * flow.c (life_analysis, rest_of_handle_life): Ditto. * haifa-sched.c: Include output.h (schedule_insns, sched_init): Do not use dump argument. * mode-switching.c (optimize_mode_switching): Ditto. * modulo-sched.c (stats_file): Removed. (print_node_sched_params): Do not call argument dump_file. (sms_schedule_by_order, loop_canon_p, sms_schedule, rest_of_handle_sms): Do not use dump argument. Use dump_file instead of stats_file. * cse.c (cse_main, rest_of_handle_cse, rest_of_handle_cse2): Do not use dump argument. * loop-init.c (loop_optimizer_init, loop_optimizer_finalize, rtl_loop_init, rtl_loop_done): Ditto. * global.c (global_alloc, rest_of_handle_global_alloc): Ditto. * predict.c (combine_predictions_for_bb, tree_estimate_probability): Ditto. * recog.c (peephole2_optimize, rest_of_handle_peephole2): Ditto. * lcm.c (pre_edge_lcm, pre_edge_rev_lcm): Ditto. * regmove.c (fixup_match_1, fixup_match_2, regmove_optimize, rest_of_handle_regmove, rest_of_handle_stack_adjustments): Ditto. * emit-rtl.c (renumber_insns): Ditto. * cfgexpand.c (add_reg_br_prob_note, expand_gimple_cond_expr, expand_gimple_basic_block, tree_expand_cfg): Ditto. * regclass.c (regclass): Ditto. * tree-outof-ssa.c (analyze_edges_for_bb, perform_edge_inserts, remove_ssa_form, rewrite_out_of_ssa): Ditto. * reg-stack.c (compensate_edge, compensate_edges, convert_regs_1, convert_regs_2, convert_regs, reg_to_stack, rest_of_handle_stack_regs): Ditto. * sched-rgn.c (schedule_insns, rest_of_handle_sched): Ditto. * local-alloc.c (rest_of_handle_local_alloc): Do not pass dump_file to regclass. * gcse.c (gcse_file, debug_stderr): Removed. (gcse_main, bypass_jumps, rest_of_handle_jump_bypass, rest_of_handle_gcse): Do not use dump argument. (cprop_jump, cprop_insn, do_local_cprop, cprop, find_implicit_sets, one_cprop_pass, bypass_block, compute_pre_data, insert_insn_end_bb, pre_edge_insert, pre_insert_copy_insn, pre_delete, one_pre_gcse_pass, compute_code_hoist_vbeinout, compute_code_hoist_data, one_code_hoisting_pass, trim_ld_motion_mems, update_ld_motion_stores, compute_store_table, build_store_vectors, insert_insn_start_bb, insert_store, remove_reachable_equiv_notes, replace_store_insn, store_motion): Use dump_file instead of gcse_file. * ipa-type-escape.c (type_escape_execute): Remove debugging comments. * profile.c (profile_dump_file): Removed. (branch_prob): Use dump_file instead of profile_dump_file. * ipa.c (cgraph_remove_unreachable_nodes): Do not call argument dump_file. * tree-ssa-copy.c (dump_copy_of): Ditto. * rtl-factoring.c (rtl_seqabstr, rest_of_rtl_seqabstr): Do not pass dump file to life_analysis. * bt-load.c (branch_target_load_optimize): Ditto. * cfgcleanup.c (rest_of_handle_jump2): Do not pass dump_file to renumber_insns. * rtl.h (cse_main, renumber_insns, schedule_insns, schedule_ebbs, regclass, dbr_schedule): Declaration changed. * sched-int.h (sched_init): Declaration changed. * tree-profile.c (tree_profile_dump_file): Removed. (tree_profile_hooks): Removed profile_dump_file hook. * rtl-profile (rtl_profile_dump_file): Removed. (rtl_profile_hooks): emoved profile_dump_file hook. * cfgloop.h (loop_optimizer_init, loop_optimizer_finalize): Declaration changed. * c-gimplify.c (c_genericize): Do not call local variable dump_file. * tree-cfg.c (build_tree_cfg): Ditto. * Makefile.in (haifa-sched.o, sched-ebb.o): Add output.h dependency. * basic-block.h (life_analysis, pre_edge_lcm, pre_edge_rev_lcm): Declaration changed. * config/sh/sh.c (sh_output_mi_thunk): Do not pass dump_file to life_analysis and schedule_insns. * config/m68hc11/m68hc11.c (m68hc11_reorg): Do not pass dump_file to life_analysis. * config/mt/mt.c (mt_machine_reorg): Do not pass dump_file to dbr_schedule. * config/mips/mips.c (mips_reorg): Ditto. * config/ia64/ia64.c (ia64_reorg): Do not pass dump_file to schedule_ebbs. From-SVN: r110656
2005-06-25Update FSF address.Kelley Cook1-2/+2
From-SVN: r101317
2005-06-01basic-block.h, [...]: Don't include errors.h and include toplev.h if necessary.Kaveh R. Ghazi1-1/+0
* basic-block.h, bb-reorder.c, c-gimplify.c, config/darwin.c, config/rs6000/rs6000-c.c, dominance.c, gimple-low.c, gimplify.c, lambda-code.c, lambda-trans.c, tree-browser.c, tree-cfg.c, tree-chrec.c, tree-data-ref.c, tree-dfa.c, tree-eh.c, tree-if-conv.c, tree-into-ssa.c, tree-loop-linear.c, tree-mudflap.c, tree-nomudflap.c, tree-outof-ssa.c, tree-pretty-print.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-live.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-propagate.c, tree-ssa-sink.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa.c, tree-vect-analyze.c, tree-vect-transform.c, tree-vectorizer.c, vec.c: Don't include errors.h and include toplev.h if necessary. * rtl.c, varray.c: If we're compiling as a GENERATOR_FILE, include errors.h otherwise include toplev.h. * Makefile.in: Update dependencies. ada: * misc.c: Don't include errors.h. fortran: * fortran/trans-decl.c: Don't include errors.h. * fortran/Make-lang.in: Updates dependencies. java: * java/verify-glue.c: Don't include errors.h and include toplev.h. * java/Make-lang.in: Updates dependencies. treelang: * treelang/lex.l, treelang/parse.y: Don't include errors.h and include toplev.h. * treelang/Make-lang.in: Updates dependencies. From-SVN: r100420
2005-04-25c-common.def (EXPR_STMT): Remove, moved to C++ frontend.Ian Lance Taylor1-51/+3
./ * c-common.def (EXPR_STMT): Remove, moved to C++ frontend. * c-common.h (EXPR_STMT_EXPR): Don't define. (c_common_stmt_codes): Don't define. * c-dump.c (c_dump_tree): Remove EXPR_STMT case. * c-gimplify.c (gimplify_expr_stmt): Remove. (c_gimplify_expr): Remove EXPR_STMT case. * c-objc-common.c (c_objc_common_init): Remove stmt_codes and call to INIT_STATEMENT_CODES. * c-pretty-print.c (pp_c_statement): Just call dump_generic_node. cp/ * cp-tree.def: Add EXPR_STMT. * cp-tree.h (cp_stmt_codes): Add EXPR_STMT. (EXPR_STMT_EXPR): Define. * cp-gimplify.c: Include "flags.h". (gimplify_expr_stmt): New static function. (cp_gimplify_expr): Handle EXPR_STMT. * cxx-pretty-print.c (pp_cxx_statement): Use pp_cxx_expression rather than pp_expression. (pp_cxx_statement): Handle EXPR_STMT. * dump.c (cp_dump_tree): Handle EXPR_STMT. * lex.c (cxx_init): Don't use c_common_stmt_codes in stmt_codes initializer. From-SVN: r98731
2005-04-23diagnostic.c (warning): Accept parameter to classify warning option.DJ Delorie1-1/+1
* diagnostic.c (warning): Accept parameter to classify warning option. (warning0): New, for when a pointer to an error() like function is needed. * errors.c (warning): Likewise. * errors.h (warning, warning0): Adjust prototypes. * toplev.h (warning, warning0): Likewise. * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, fold-const.c, fortran/trans-decl.c, function.c, gcse.c, genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/aix52.h, config/rs6000/darwin.h, config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sh/symbian.c, config/sol2-c.c, config/sol2.c, config/stormy16/stormy16.c, config/v850/v850-c.c, config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() callers. * ada/misc.c: Adjust warning() callers. * cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c, cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c, cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c, cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers. * fortran/trans-decl.c: Adjust warning() callers. * java/class.c, java/decl.c, java/expr.c, java/jcf-io.c, java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning() callers. * objc/objc-act.c: Adjust warning() callers. * treelang/parse.y: Adjust warning() callers. From-SVN: r98633
2005-04-09c-common.def: Move FOR_STMT...Ian Lance Taylor1-269/+0
./ * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. (DO_COND, DO_BODY): Likewise. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. (build_continue_stmt, build_break_stmt): Don't declare. (c_do_switch_warnings): Update declaration. * c-gimplify.c (enum bc_t): Remove. (struct c_gimplify_ctx, ctxp): Remove. (push_context, pop_context): Remove static functions. (c_genericize): Don't call push_context or pop_context. (begin_bc_block, finish_bc_block): Remove static functions. (build_bc_goto): Likewise. (gimplify_c_loop): Likewise. (gimplify_for_stmt, gimplify_while_stmt): Likewise. (gimplify_do_stmt, gimplify_switch_stmt): Likewise. (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. * c-common.c (c_do_switch_warnings): Rename from c_do_switch_warnings_1. (c_do_switch_warnings) [old version]: Remove. (c_do_switch_expr_warnings): Remove. * c-typeck.c (c_finish_case): Call new c_do_switch_warnings function instead of c_do_switch_expr_warnings. * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. cp/ * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. (WHILE_COND, WHILE_BODY): Define. (DO_COND, DO_BODY): Define. (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. * cp-gimplify.c (enum bc_t): Define. (struct cp_gimplify_ctx, ctxp): Define. (push_context, pop_context): New static functions. (begin_bc_block, finish_bc_block): New static functions. (build_bc_goto): New static function. (gimplify_cp_loop, gimplify_for_stmt): New static functions. (gimplify_while_stmt, gimplify_do_stmt): Likewise. (gimplify_switch_stmt): Likewise. (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. (cp_genericize): Call push_context and pop_context. * semantics.c (finish_break_stmt): Just call build_stmt (BREAK_STMT) rather than build_break_stmt. (finish_continue_stmt): Corresponding change. * decl.c (pop_switch): Update call to c_do_switch_warnings for new parameters. * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. * dump.c (cp_dump_tree): Likewise. From-SVN: r97885
2005-01-27c-common.def, [...]: Update copyright.Kazu Hirata1-1/+1
* c-common.def, c-dump.c, c-gimplify.c, c-objc-common.c, cfgexpand.c, dbxout.c, function.h, opts.c, tree-flow-inline.h, tree-ssa-operands.h, tree-ssa-threadupdate.c, tree-tailcall.c, config/avr/avr.md, config/cris/aout.h, config/cris/cris.h, config/mips/iris6.h, config/sh/sh.c: Update copyright. From-SVN: r94328
2005-01-27tree.h (SWITCH_COND, [...]): Add tree checks.Steven Bosscher1-3/+3
* tree.h (SWITCH_COND, SWITCH_BODY, SWITCH_LABELS, CASE_LOW, CASE_HIGH, CASE_LABEL, ASM_STRING, ASM_OUTPUTS, ASM_INPUTS, ASM_CLOBBERS): Add tree checks. * c-common.h (SWITCH_TYPE): Rename to SWITCH_STMT_TYPE. (SWITCH_STMT_COND, SWITCH_STMT_BODY): New. * c-common.def (SWITCH_STMT): Update to match. * c-common.c (c_do_switch_warnings): Use SWITCH_STMT accessor macros instead of SWITCH_EXPR ones. * c-dump.c (c_dump_tree): Likewise. * c-gimplify.c (gimplify_switch_stmt): Likewise. * c-typeck.c (c_start_case, do_case, c_finish_case): Likewise. cp/ * decl.c (finish_case_label): Use SWITCH_STMT accessor macros instead of SWITCH_EXPR ones. * pt.c (tsubst_expr): Likewise. * semantics.c (begin_switch_stmt, finish_switch_cond, finish_switch_stmt): Likewise. doc/ * c-tree.texi (SWITCH_STMT): Update accessor macro names. From-SVN: r94315
2004-12-06c-gimplify.c (gimplify_c_loop): Improve initial implementations for loops ↵Roger Sayle1-24/+29
whose conditions are known at... * c-gimplify.c (gimplify_c_loop): Improve initial implementations for loops whose conditions are known at compile-time. * gimplify.c (append_to_statement_list_1): Remove side_effects parameter, this function should never be called if its false. (append_to_statement_list): Only call append_to_statement_list_1 if t is non-NULL tree with side-effects. (append_to_statement_list_force): Likewise, if t is not NULL. From-SVN: r91784
2004-09-07c-aux-info.c (gen_type): Use gcc_assert or gcc_unreachable.Nathan Sidwell1-6/+3
* c-aux-info.c (gen_type): Use gcc_assert or gcc_unreachable. * c-common.c (c_type_hash, c_common_nodes_and_builtins, c_expand_expr, boolean_increment, nonnull_check_p, check_function_arguments_recurse, fold_offsetof_1): Likewise. * c-cppbuiltin.c (define__GNUC__, builtin_define_stdint_macros, builtin_define_type_max): Likewise. * c-decl.c (bind, pop_scope, merge_decls, pushdecl_top_level, implicit_decl_warning, builtin_function, build_compound_literal, complete_array_type, grokdeclarator, get_parm_info, start_function, store_parm_decls_oldstyle, c_write_global_declarations): Likewise. * c-format.c (get_constant, decode_format_attr, maybe_read_dollar_number, get_flag_spec, check_format_arg, check_format_types, format_type_warning, find_char_info_specifier_index, init_dynamic_asm_fprintf_info, init_dynamic_diag_info, handle_format_attribute): Likewise. * c-gimplify.c (push_context, pop_context, finish_bc_block): * c-lex.c (c_lex_with_flags, lex_string): Likewise. * c-objc-common.c (c_tree_printer): Likewise. * c-pch.c (pch_init): Likewise. * c-pragma.c (maybe_apply_pragma_weak): Likewise. * c-pretty-print.c (pp_c_tree_decl_identifier): Likewise. * c-typeck.c (c_incomplete_type_error, composite_type, common_pointer_type, common_type, same_translation_unit_p, tagged_types_tu_compatible_p, finish_init, pop_init_level, set_designator, set_nonincremental_init_from_string, process_init_element, c_finish_if_stmt): Likewise. * caller-save.c (init_caller_save, save_call_clobbered_regs, insert_restore, insert_save, insert_one_insn): Likewise. * calls.c (emit_call_1, compute_argument_block_size, precompute_arguments, expand_call, emit_library_call_value_1, store_one_arg): Likewise. From-SVN: r87140
2004-08-15c-common.c (shorten_compare, [...]): Replace calls to build with calls to ↵Roger Sayle1-4/+4
buildN. * c-common.c (shorten_compare, pointer_int_sum, c_common_truthvalue_conversion, boolean_increment): Replace calls to build with calls to buildN. * c-decl.c (complete_array_type, grokdeclarator): Likewise. * c-gimplify.c (c_build_bind_expr, gimplify_c_loop, gimplify_switch_stmt): Likewise. * c-typeck.c (default_function_array_conversion, build_component_ref, build_array_ref, build_function_call, pointer_diff, build_unary_op, build_conditional_expr, build_compound_expr, build_modify_expr, c_finish_goto_label, c_finish_goto_ptr, c_finish_return, c_finish_loop, c_finish_bc_stmt, c_finish_stmt_expr, c_end_compound_stmt, build_binary_op): Likewise. From-SVN: r86018
2004-06-30Conditionally compile support for --enable-mapped_location.Per Bothner1-1/+1
* basic-block.h (struct edge_def): Use new source_locus typedef. * c-common.c (fname_decl): Update save/clear/store of input_location. (c_do_switch_warnings): Update for USE_MAPPED_LOCATION case. * c-decl.c: Likewise. * c-dump.c (dump_stmt): Likewise. * c-gimplify.c (c-gimplify.c): Generalize using SET_EXPR_LOCATION. * c-lex.c (cb_line_change): If USE_MAPPED_LOCATION use token's src_loc to set input_location direction, rather than using linemap_lookup. (fe_file_change, cb_def_pragma): Again use source_location directly. * c-opts.c (saved_lineno): Remove static variable. (c_common_post_options, c_common_init): Don't bothner to save, clear and restore input_Location - now handled by lang_dependent_init. * function.c (init_function_start): Use new DECL_IS_BUILTIN macro. * xcoffout.c (xcoff_assign_fundamental_type_number): Likewise. From-SVN: r83919
2004-06-26c-common.c (c_safe_from_p, [...]): Deleted.Richard Kenner1-80/+16
2004-06-26 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * c-common.c (c_safe_from_p, c_walk_subtrees): Deleted. * c-common.def (DECL_STMT): Remove. * c-common.h (DECL_STMT_DECL): Deleted. (COMPOUNT_LITERAL_EXPR_DECL): Use DECL_EXPR_DECL. (c_safe_from_p, c_walk_subtrees): Deleted. * c-decl.c, c-parse.in, c-pretty-print.c: DECL_STMT now DECL_EXPR. * c-dump.c (c_dump_tree, case DECL_STMT): Deleted. * c-gimplify.c (gimplify_decl_stmt): Deleted. (gimplify_compound_literal_expr): Use DECL_EXPR_DECL and gimplify_and_add. (c_gimplify_expr, case DECL_EXPR): New case. (c_gimplify_expr, case DECL_STMT): Deleted. * c-lang.c (LANG_HOOKS_SAFE_FROM_P): Likewise. (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Likewise. * expr.c (safe_from_p, case 's'): New case. * gimplify.c (gimplify_decl_expr): New function. (gimplify_expr, case DECL_EXPR): New case. * tree-inline.c (walk_tree): Walk into all fields of a type and decl only if they are in a DECL_EXPR. (mark_local_for_remap_r): Minor code cleanup. * tree-outof-ssa.c (discover_nonconstant_array_refs_r): Add else. * tree.c (has_cleanups, case DECL_EXPR): New case. * tree.def (DECL_EXPR): New code. * tree.h (DECL_EXPR_DECL): New macro. * objc/objc-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted. From-SVN: r83721
2004-06-24c-gimplify.c (gimplify_for_stmt): Use gimplify_and_add.Richard Kenner1-4/+2
* c-gimplify.c (gimplify_for_stmt): Use gimplify_and_add. * gimplify.c (internal_get_tmp_var, gimplify_return_expr): Likewise. (gimplify_loop_expr, gimplify_init_constructor): Likewise. (gimplify_self_mod_expr, gimplify_cond_expr): Likewise. From-SVN: r83634
2004-06-23c-gimplify.c (gimplify_decl_stmt): Push gimplify_one_sizepos inside ↵Richard Henderson1-12/+12
non-constant size check. * c-gimplify.c (gimplify_decl_stmt): Push gimplify_one_sizepos inside non-constant size check. Gimplify the type too. Tidy building BUILT_IN_STACK_ALLOC call From-SVN: r83582
2004-06-23c-gimplify.c (gimplify_decl_stmt): Update gimplify_type_sizes call.Richard Henderson1-13/+7
* c-gimplify.c (gimplify_decl_stmt): Update gimplify_type_sizes call. Use gimplify_and_add. * c-typeck.c (c_finish_if_stmt): Use NULL instead of empty stmt. * gimplify.c (build_and_jump, gimplify_exit_expr, gimplify_init_constructor, gimplify_save_expr, gimple_push_cleanup, gimplify_stmt, gimplify_expr): Likewise. (shortcut_cond_expr): Handle NULL arms of COND_EXPR. (gimplify_statement_list): Remove NULL entries. (gimplify_to_stmt_list): Handle NULL results. (gimplify_type_sizes): Add list_p argument. (gimplify_one_sizepos): Don't use internal pre/post queue. * tree-gimple.h (gimplify_type_sizes): Update. ada/ * trans.c (gnat_gimplify_stmt): Update gimplify_type_sizes call. From-SVN: r83539
2004-06-21alias.c (adjust_offset_for_component_ref): Use component_ref_field_offset.Richard Kenner1-36/+30
* alias.c (adjust_offset_for_component_ref): Use component_ref_field_offset. * c-decl.c (build_array_declarator): Add news args for ARRAY_REF. * c-gimplify.c (gimplify_expr_stmt): Use alloc_stmt_list. (gimplify_decl_stmt): Call gimplify_type_sizes for type. For decl, call gimplify_one_sizepos and use statement list. (gimplify_compound_literal_expr): New arg PRE_P. Add statement to PRE_P list and return DECL. (c_gimplify_expr, case COMPOUND_LITERAL_EXPR): Add arg to gimplify_compound_literal_expr. * c-tree.h (getdecls): Deleted. * c-typeck.c (build_component_ref): Add operand for COMPONENT_REF. (build_array_ref): Add two operands for ARRAY_REF. (build_unary_op): Set TREE_INVARIANT and TREE_CONSTANT for COMPOUND_LITERAL_EXPR. * coverage.c (tree_coverage_counter_ref): Add new operands for ARRAY_REF. * emit-rtl.c (component_ref_for_mem_expr): Add new operand for COMPONENT_REF. (set_mem_attributes_minus_bitpos): Use array_ref_low_bound and array_ref_element_size. (widen_memory_access):Use component_ref_field_offset. * explow.c (update_nonlocal_goto_save_area): Add two operands for ARRAY_REF. * expr.c (array_ref_element_size, array_ref_low_bound): New functions. (component_ref_field_offset): Likewise. (get_inner_reference): Use them. (expand_expr_real_1, case ARRAY_REF): Use array_ref_low_bound. * fold-const.c (fold, case EQ_EXPR): Properly handle DECL_SIZE. (fold_read_from_constant_string): Use array_ref_low_bound. Verify that result is a character type. (build_fold_indirect_ref): Add two operands for ARRAY_REF. * function.c (expand_function_start): Likewise. * gimple-low.c (expand_var_p): Delete duplicated line. * gimplify.c: Add static decls for local functions. (cgraph.h): Now included. (create_tmp_var): Remove check for ARRAY_TYPE. (copy_if_shared_r): Look at bounds and sizes of types. (build_and_jump): Return alloc_stmt_list instead of build_empty_stmt. (gimplify_exit_expr, shortcut_cond_expr): Likewise. (gimplify_save_expr, gimple_push_cleanup): Likewise. (gimplify_init_constructor): Likewise. WANT_VALUE now bool. If empty list with no result wanted, return GS_UNHANDLED. Add additional operands for ARRAY_REF and COMPONENT_REF. (canonicalize_component_ref): Convert to &array[L]. (gimplify_array_ref_to_plus): Use array_ref_element_size and array_ref_lower_bound. (build_addr_expr_with_type, build_addr_expr): New functions. (gimplify_compound_lval): WANT_LVALUE now bool. Major rework to allow handle_component_p and initialize and gimplify new operands for ARRAY_REF, ARRAY_RANGE_REF, and COMPONENT_REF. (gimplify_array_ref): Deleted. (gimplify_self_mod_expr): WANT_VALUE now bool. (gimplify_modify_expr): Gimplify to_p and from_p later. Factor out code into gimplify_modify_expr_rhs and call twice. Move variable-size code earlier and handle PLACEHOLDER_EXPR. (gimplify_modify_expr_rhs, gimplify_variable_sized_compare): New fns. (gimplify_addr_expr, case VIEW_CONVERT_EXPR): New case. (gimplify_expr, case ARRAY_REF): Delete special case. Instead handle like COMPONENT_REF; also do ARRAY_RANGE_REF, IMAGPART, and REALPART the same way. (gimplify_expr, case VIEW_CONVERT_EXPR): New case. (gimplify_expr): Call gimplify_variable_sized_compare if applicable. Call alloc_stmt_list instead of build_empty_stmt. Deal with _REF that's volatile. (gimplify_type_sizes, gimplify_one_sizepos): New functions. (unshare_body, unvisit_body): New functions. (gimplify_body): Call them. * stmt.c (expand_stack_alloc): Don't expand TYPE_MAX_VALUE. * stor-layout.c (get_pending_sizes): Don't change SAVE_EXPR_CONTEXT. * tree-alias-common.c (get_alias_var): Also skip ARRAY_RANGE_REF. * tree-cfg.c (tree_node_can_be_shared): Treat ARRAY_RANGE_REF like ARRAY_REF. (verify_expr, case ADDR_EXPR): Use handled_component_p. * tree-dfa.c (get_virtual_var): Likewise. * tree-dump.c (dequeue_and_dump, case COMPONENT_REF, ARRAY_REF): New cases to dump new operands; likewise for ARRAY_RANGE_REF. * tree-eh.c (tree_could_trap, case ARRAY_RANGE_REF): Like ARRAY_REF. * tree-gimple.c (is_gimple_addr_expr_arg): Add ARRAY_RANGE_REF and INDIRECT_REF. (get_base_address): Use handled_component_p. * tree-gimple.h (gimplify_type_sizes, gimplify_one_sizepos): New. * tree-line.c (walk_tree): Walk more things for types and decls. * tree-mudflap.c (mf_build_check_statement_for): Add new operands for ARRAY_REF and COMPONENT_REF. (mx_xform_derefs_1): Clean up usage of decl sizes. * tree-nested.c (build_addr): Use handled_component_p. (walk_stmts, case CATCH_EXPR): Add missing "break". (get_static_chain, get_frame_field): Add new operand for COMPONENT_REF. (finalize_nesting_tree_1): Likewise. (convert_nonlocal_reference, case ARRAY_RANGE_REF): Like ARRAY_REF and process additional operands. (convert_local_reference): Likewise. * tree-outof-ssa.c (discover_nonconstant_array_refs_r): Treat ARRAY_RANGE_REF similarly to ARRAY_REF. * tree-pretty-print.c (dump_generic_node, case QUAL_UNION_TYPE): Handle like RECORD_TYPE. (dump_generic_node, case COMPONENT_REF): Print offset operand. (dump_generic_node, case ARRAY_RANGE_REF): Treat like ARRAY_REF and print lower bound and element size for both. (op_prio, case ARRAY_RANGE_REF): Like ARRAY_REF. * tree-sra.c (csc_build_component_ref): Add new operand. (scalarize_call_expr): Use get_base_address. * tree-ssa-ccp.c (widen_bitfield): Clean up size handling. (maybe_fold_offset_to_array_ref): Rework to handle input having an ARRAY_REF, refine handling of lower bound, and add new operands for ARRAY_REF. (maybe_fold_to_component_ref): Add new operand for COMPONENT_REF. (maybe_fold_stmt_indirect): Only fold *&B to B if types match. (maybe_fold_stmt_addition): Only handle constant lower bound. * tree-ssa-operands.c (get_expr_operands): Minor rearrangements. Treat ARRAY_REF and ARRAY_RANGE_REF the same; look at extra operands. Look at new offset operand of COMPONENT_REF. * tree-ssa.c (set_is_used): Use handled_component_p. * tree.c (substitute_in_expr, case COMPONENT_REF): Add new operand. (stabilize_reference, case COMPONENT_REF): Likewise. (stabilize_reference, case ARRAY_RANGE_REF, ARRAY_REF): Similarly. (recompute_tree_invariant_for_addr_expr): Completely rework to be more precise. Also set TREE_SIDE_EFFECTS. (build1_stat, case ARRAY_EXPR): Don't handle TREE_SIDE_EFFECTS here. (build2_stat, build3_stat, build4_stat): For references, propagate TREE_THIS_VOLATILE. (get_unwidened): Add new operand for COMPONENT_REF. (get_narrower): Likewise; use host_integerp for DECL_SIZE. * tree.def (COMPONENT_REF): Add new operand. (ARRAY_REF, ARRAY_RANGE_REF): Add two new operands. * tree.h (array_ref_element_size, array_ref_low_bound): New decls. (component_ref_field_offset): Likewise. * config/alpha/alpha.c (alpha_va_start): Add new op for COMPONENT_REF. (alpha_gimplify_va_arg): Likewise. * config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise. * config/i860/i860.c (i860_va_start, i860_va_arg): Likewise. * config/iq2000/iq2000.c (iq2000_va_arg): Likewise. * config/mips/mips.c (mips_va_start, mips_va_arg): Likewise. * config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg): Likewise. * config/s390/s390.c (s390_va_start, s390_gimplify_va_arg): Likewise. * config/sh/sh.c (sh_va_start, sh_va_arg): Likewise. * config/stormy16/stormy16.c (xstormy1_expand_builin_va_start): Likewise. (xstormy16_expand_builtin_va_arg): Likewise. * config/xtensa/xtensa.c (xtensa_va_start, xtensa_va_arg): Likewise. * cp/call.c (build_vfield_ref): Add new operand for COMPONENT_REF. (build_new_method_call): Likewise. * cp/decl.c (local_variable_p_walkfn): Don't walk into types. * cp/decl2.c (grok_array_decl): Add new operands for ARRAY_REF. (build_anon_union_vars): Add new operand for COMPONENT_REF. * cp/init.c (buld_new): Add new operand for ARRAY_REF. * cp/method.c (do_build_copy_constructor): New op for COMPONENT_REF. (do_build_assign_ref): Likewise. * cp/parser.c (cp_parser_direct_new_declarator): Add new operands for ARRAY_REF. (cp_parser_direct_declarator): Likewise. * cp/pt.c (tsubst): Likewise. (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand for COMPONENT_REF. * cp/semantics.c (finish_non_static_data_member): Add new operand for COMPONENT_REF. * cp/typeck.c (build_class_member_access_expr): Likewise. (build_class_member_access_expr, finish_class_member_access_expr): Likewise. (build_ptrmemfunc_access_expr): Likewise. (build_array_ref): Add new operands for ARRAY_REF. * cp/typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too. * cp/tree.c (count_trees_r, no_linkage_helper): Don't walk in types. * fortran/f95-lang.c (LANG_HOOKS_GIMPLE_BEFORE_INLINING): Deleted. * fortran/trans-array.c (gfc_conv_descriptor_data): Add operand for COMPONENT_REF. (gfc_conv_descriptor_offset, gfc_conv_descriptor_dtype): Likewise. (gfc_conv_descriptor_dimension, gfc_conv_descriptor_stride): Likewise. (gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound): Likewise. * fortran/trans-common.c (create_common): Likewise. * fortran/trans-expr.c (gfc_conv_component_ref): Likewise. * fortran/trans-io.c (set_parameter_value): Likewise. (set_parameter_ref, set_string, set_flag, io_result): Likewise. (transfer_expr): Likewise. * fortran/trans-decl.c (gfc_trans_auto_character_variable): Set up to get DECL_SIZE and DECL_SIZE_UNIT gimplified. (gfc_simplify_function): New function. (gfc_generate_function-code): Properly handle nested functions. * fortran/trans.c (gfc_build_array_ref): Add two new operands for ARRAY_REF. * java/class.c (build_class_ref): Add new operand for COMPONENT_REF. (build_static_field_ref): Likewise and add new operands for ARRAY_REF. * java/constants.c (build_ref_from_constant_pool): Likewise. * java/expr.c (build_java_array_length_access): Likewise. (build_get_class, build_field_ref, build_known_method_ref): Likewise. (invoke_build_dtable, build_invokevirtual): Likewise. (build_invokeinterface, java_expand_expr): Likewise. (emit_init_test_initialization): Likewise. * java/java-gimplify.c (java_gimplify_new_array_init): Likewise. * java/parse.y (make_qualifed_name, build_array_ref): Likewise. * objc/ojbc-act.c (generate_static_references): Add additional operands to ARRAY_REF. (generate_strings, build_method_prototype_list_template): Likewise. (generate_protocol_list): Likewise. From-SVN: r83474
2004-06-21c-common.def (RETURN_STMT): Remove.Richard Henderson1-15/+1
* c-common.def (RETURN_STMT): Remove. * c-common.h (RETURN_STMT_EXPR): Remove. (c_expand_return, build_return_stmt): Remove. (c_common_stmt_codes): Remove RETURN_STMT. * c-dump.c (dump_next_stmt): Remove. (c_dump_tree): Remove RETURN_STMT. * c-decl.c (finish_function): Use c_finish_return. * c-parse.in (stmt): Likewise. * c-gimplify.c (gimplify_return_stmt): Remove. (c_gimplify_expr): Remove RETURN_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_return_stmt): Remove. * c-tree.h (c_finish_return): Declare. * c-typeck.c (c_finish_return): Rename from c_expand_return. Return void. Build RETURN_EXPR directly. * tree-dump.h (dump_next_stmt): Remove. cp/ * dump.c (cp_dump_tree): Don't use dump_next_stmt. * parser.c (cp_parser_jump_statement): Update commentary. * pt.c (tsubst_expr): Use RETURN_EXPR. * semantics.c (finish_return_stmt): Likewise. (finalize_nrv_r): Likewise. * typeck.c, typeck2.c: Update file start commentary. From-SVN: r83461
2004-06-20stmt.c (warn_if_unused_value): Add locus argument.Richard Henderson1-6/+1
* stmt.c (warn_if_unused_value): Add locus argument. * tree.h (warn_if_unused_value): Update decl. * c-typeck.c (internal_build_compound_expr): Update call. * c-gimplify.c (gimplify_expr_stmt): Likewise. From-SVN: r83416
2004-06-20c-common.h (add_decl_stmt): Move to cp-tree.h.Richard Henderson1-8/+0
* c-common.h (add_decl_stmt): Move to cp-tree.h. * c-decl.c (finish_decl): Don't use add_decl_stmt. * c-parse.in: Likewise. * c-gimplify.c (gimplify_expr_stmt): Don't build CLEANUP_POINT_EXPR. (gimplify_c_loop, gimplify_return_stmt, gimplify_decl_stmt): Likewise. * c-semantics.c (add_decl_stmt): Move to cp/semantics.c. cp/ * cp-tree.h (add_decl_stmt): Declare. * pt.c (tsubst_copy): Abort for CLEANUP_POINT_EXPR. * semantics.c (maybe_cleanup_point_expr): New. (add_decl_stmt, finish_expr_stmt, finish_return_stmt, finish_for_expr, finish_switch_cond): Use it. (finalize_nrv_r): Don't build an EXPR_STMT. Don't frob TREE_CHAIN. From-SVN: r83409
2004-06-20c-common.def (IF_STMT, [...]): Move to cp-tree.def.Richard Henderson1-52/+0
* c-common.def (IF_STMT, CLEANUP_STMT): Move to cp-tree.def. * c-common.h (IF_COND, THEN_CLAUSE, ELSE_CLAUSE, CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move to cp-tree.h. (c_common_stmt_codes): Remove IF_STMT, CLEANUP_STMT. * c-dump.c (c_dump_tree): Move IF_STMT, CLEANUP_STMT to cp_dump_tree. * c-pretty-print.c (pp_c_statement): Similarly. * c-gimplify.c (gimplify_cleanup_stmt, gimplify_cleanup_stmts, gimplify_if_stmt): Move to cp-gimplify.c. (c_genericize, c_gimplify_expr): Don't call them. * c-semantics.c (push_cleanup): Move to cp/semantics.c. * c-typeck.c (push_cleanup): New. (c_begin_if_stmt, c_finish_if_cond, c_finish_then, c_finish_else, c_finish_if_stmt): Use COND_EXPR. * tree.h (CLEANUP_EH_ONLY): Update documentation. cp/ * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def. * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c. (cp_gimplify_expr): Call it. (gimplify_cleanup_stmt): Move from c-gimplify.c. (cp_genericize): New. * decl.c (finish_function): Call it. * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT. (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h. (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise. (cp_genericize): Declare. * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT. * dump.c (cp_dump_tree): Likewise. * semantics.c (push_cleanup): Move from c-semantics.c. From-SVN: r83407
2004-06-19c-common.c, c-common.h (lang_gimplify_stmt): Remove.Richard Henderson1-137/+33
* c-common.c, c-common.h (lang_gimplify_stmt): Remove. * c-gimplify.c: Remove unnecessary prototypes. (c_gimplify_stmt): Merge into ... (c_gimplify_expr): ... here. Don't play with prep_stmt. * c-semantics.c (prep_stmt): Remove. * gimplify.c (annotate_one_with_locus): Break out from ... (annotate_all_with_locus): ... here. (gimplify_expr): Add locus to expressions even if pre/post queues are not present. cp/ * cp-gimplify.c: Remove unnecessary prototypes. (cp_gimplify_stmt): Merge into ... (cp_gimplify_expr): ... here. Move to end of file. Handle stmts_are_full_exprs_p frobbing. * cp-tree.h (cp_gimplify_stmt): Remove. * pt.c (tsubst_expr): Merge prep_stmt and unify. * tree.c (init_tree): Don't set lang_gimplify_stmt. From-SVN: r83397
2004-06-18re PR c++/16034 (dtor called prematurely for while-loop scoped variable)Richard Henderson1-22/+0
PR c++/16034 * c-gimplify.c (gimplify_condition): Remove. (gimplify_c_loop, gimplify_if_stmt, gimplify_switch_stmt): Don't call it. cp/ * semantics.c (begin_cond): New. (finish_cond): Rewrite to handle template DECL_STMTs specially. Assume that non-template decls go land before the conditional. (simplify_loop_decl_cond): Likewise. (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt, finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond, begin_switch_stmt, finish_switch_cond): Update to match. From-SVN: r83368
2004-06-16c-common.def (COMPOUND_STMT): Remove.Richard Henderson1-5/+0
* c-common.def (COMPOUND_STMT): Remove. * c-common.c (finish_fname_decls): Don't look through it. * c-typeck.c (c_tree_expr_nonnegative_p): Likewise. * c-common.h (COMPOUND_BODY): Remove. (c_common_stmt_codes): Remove COMPOUND_STMT. * c-dump.c (c_dump_tree): Likewise. * c-gimplify.c (c_gimplify_stmt): Likewise. * c-pretty-print.c (pp_c_statement): Likewise. * tree.h (DECL_SAVED_TREE): Update commentary. * doc/c-tree.texi (ASM_EXPR): Rename from ASM_STMT. (CASE_LABEL_EXPR): Rename from CASE_LABEL. (GOTO_EXPR): Rename from GOTO_STMT. (GOTO_FAKE_P): Remove. (COMPOUND_STMT): Remove. (HANDLER): Update wrt COMPOUND_STMT. (STMT_EXPR): Likewise. (LABEL_EXPR): Rename from LABEL_STMT. (SCOPE_STMT): Remove. * objc/objc-act.c (objc_build_try_catch_finally_stmt): Don't look through COMPOUND_STMT. cp/ * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill. (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New. * cxx-pretty-print.c (pp_cxx_function_definition): Move handling of CTOR_INITIALIZER ... (pp_cxx_statement): ... here. * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK. (finish_function): Use alloc_stmt_list to zap entire function. * parser.c (cp_parser_compound_statement): Update commentary. * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT. * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise. (finish_stmt_expr): Don't look through COMPOUND_STMT. From-SVN: r83281
2004-06-16c-common.def (CASE_LABEL): Remove.Richard Henderson1-9/+0
* c-common.def (CASE_LABEL): Remove. * c-common.c (c_add_case_label): Use CASE_LABEL, not CASE_LABEL_DECL. (match_case_to_enum_1): Likewise. * c-common.h (c_common_stmt_codes): Remove CASE_LABEL. * c-dump.c (c_dump_tree): Likewise. * c-gimplify.c (c_gimplify_stmt): Likewise. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_case_label): Use CASE_LABEL_EXPR. * tree.h (CASE_LOW): Update commentary. cp/ * parser.c (cp_parser_labeled_statement): Update commentary. * pt.c (tsubst_expr): Use CASE_LABEL_EXPR. * tree.c (mark_local_for_remap_r): Likewise. From-SVN: r83261
2004-06-16c-common.def (ASM_STMT): Remove.Richard Henderson1-12/+0
* c-common.def (ASM_STMT): Remove. * c-common.h (c_common_stmt_codes): Remove ASM_STMT. * c-dump.c (c_dump_tree): Likewise. * c-gimplify.c (c_gimplify_stmt): Likewise. * c-pretty-print.c (pp_c_statement): Likewise. * c-typeck.c (build_asm_expr): Use ASM_EXPR. * tree.h: Fix commentary. cp/ * parser.c (cp_parser_asm_definition): Update commentary. * pt.c (tsubst_expr): Use ASM_EXPR. * semantics.c (finish_asm_stmt): Likewise. From-SVN: r83260
2004-06-16c-common.def (GOTO_STMT, LABEL_STMT): Remove.Richard Henderson1-10/+0
* c-common.def (GOTO_STMT, LABEL_STMT): Remove. * c-common.c (c_add_case_label): Use LABEL_EXPR. * c-common.h (GOTO_FAKE_P, LABEL_STMT_LABEL): Remove. (c_common_stmt_codes): Remove GOTO_STMT, LABEL_STMT. * c-dump.c (c_dump_tree): Likewise. * c-gimplify.c (c_gimplify_stmt): Likewise. * c-pretty-print.c (pp_c_statement): Likewise. * c-parse.in (stmt): Use GOTO_EXPR. (label): Use LABEL_EXPR. * c-semantics.c (build_stmt): Set TREE_TYPE to void. * tree-inline.c (copy_body_r): Don't build empty BLOCKs. cp/ * decl.c (finish_destructor_body): Use LABEL_EXPR. * parser.c (cp_parser_statement): Update commentary. * pt.c (tsubst_expr): Use LABEL_EXPR, GOTO_EXPR. * semantics.c (finish_goto_stmt, finish_label_stmt): Likewise. * tree.c (mark_local_for_remap_r): Likewise. From-SVN: r83255
2004-06-15c-common.c (lang_gimplify_stmt): Remove next_p argument.Richard Henderson1-372/+144
* c-common.c (lang_gimplify_stmt): Remove next_p argument. (if_elt, if_stack, if_stack_space, c_expand_start_cond, c_finish_then, c_expand_end_cond, c_expand_start_else, c_finish_else, c_begin_if_stmt, c_begin_while_stmt, c_finish_while_stmt_cond): Move to c-typeck.c. (finish_fname_decls, fname_decl): Use statement_lists. (c_expand_expr_stmt): Don't set last_expr_type. (c_type_hash): Fix indentation. (c_safe_from_p): Don't follow TREE_CHAIN. (c_tree_chain_matters_p): Remove. * c-common.def (SCOPE_STMT): Remove. (CLEANUP_STMT): Redefine to contain its own body. * c-common.h (struct stmt_tree_s): Remove x_last_stmt, x_last_expr_type, x_last_expr_filename, x_scope_stmt_stack. Add x_cur_stmt_list. (last_tree, last_expr_type, last_expr_filename, RECHAIN_STMTS): Remove. (cur_stmt_list): New. (STATEMENT_LIST_STMT_EXPR): New. (SCOPE_BEGIN_P, SCOPE_END_P, SCOPE_STMT_BLOCK, SCOPE_NULLIFIED_P, SCOPE_NO_CLEANUPS_P, SCOPE_PARTIAL_P, NEW_FOR_SCOPE_P): Remove. (CLEANUP_BODY): New. (CLEANUP_DECL): Move to operand 2. (c_common_stmt_codes): Remove SCOPE_STMT. (COMPOUND_STMT_NO_SCOPE, COMPOUND_STMT_BODY_BLOCK): Remove. * c-decl.c (c_scope_stmt_stack, current_scope_stmt_stack): Remove. (c_push_function_context, c_pop_function_context): Don't save it. (finish_decl): Set TREE_USED on the decl for a cleanup. Use push_cleanup. (store_parm_decls): Use statement lists. (finish_function): Remove compstmt rule workaround. Use statement lists. Call finish_fname_decls after finalizing the body. (c_begin_compound_stmt): Move to c-typeck.c. * c-dump.c (c_dump_tree): Remove SCOPE_STMT. * c-gimplify.c (gimplify_cleanup_stmt, gimplify_cleanup_stmts): New. (c_genericize): Invoke them. (c_gimplify_stmt): Don't look through TREE_CHAIN. Kill SCOPE_STMT. (c_build_bind_expr): Export. (gimplify_block, gimplify_cleanup): Remove. (gimplify_condition): Use gimplify_stmt. (gimplify_for_stmt): Remove FOR_INIT_STMT chaining hack. (gimplify_if_stmt): Remove recursion hack. (c_gimplify_expr): Remove STMT_EXPR handling. (stmt_expr_last_stmt, gimplify_stmt_expr): Remove. (is_last_stmt_of_scope): Remove. * c-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove. * c-mudflap.c (mflang_flush_calls): Use c_begin_compound_stmt, c_end_compound_stmt. * c-objc-common.c (build_cdtor): Likewise. * c-parse.in (primary): Use c_finish_stmt_expr. (push_scope, pop_scope): Remove. (c99_block_start, compstmt_start): Use c_begin_compound_stmt. (c99_block_end, compstmt): Use c_end_compound_stmt. (c99_block_lineno_labeled_stmt): Likewise. (compstmt_primary_start): Use c_begin_stmt_expr. (simple_if, select_or_iter_stmt): Update calls to stmt builders. (do_stmt_start): Fill in body directly. (lineno_stmt): Avoid setting lineno on constants. * c-pretty-print.c (pp_c_statement): Handle STATEMENT_LIST. Remove SCOPE_STMT. * c-semantics.c (begin_stmt_tree): Remove. (push_stmt_list, re_push_stmt_list, pop_stmt_list): New. (add_stmt): Use statement lists. (add_scope_stmt, finish_stmt_tree): Remove. (push_cleanup): New. * c-tree.h: Move some decls from c-common.h. * c-typeck.c (c_tree_expr_nonnegative_p): Simplify for statement lists. (do_case, c_finish_case): Likewise. (c_finish_then): Take body for then as argument. (c_finish_else): Similarly. (c_begin_for_stmt, c_finish_for_stmt_init, c_finish_for_stmt_cond, c_finish_for_stmt_incr, c_finish_for_stmt): New. (c_begin_stmt_expr, c_finish_stmt_expr): New. (c_begin_compound_stmt): Do scope management. (c_end_compound_stmt): New. * fold-const.c (tree_expr_nonnegative_p): Fix BIND_EXPR. * gimplify.c (voidify_wrapper_expr): Accept temporary argument. Look through exception handling constructs. (gimplify_bind_expr): Accept temporary argument. (gimplify_target_expr): Special case BIND_EXPR bodies. (gimplify_expr): Handle fallback == fb_none like a statement. * langhooks-def.h (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Kill. * langhooks.c (lhd_tree_inlining_tree_chain_matters_p): Remove. * langhooks.h (tree_chain_matters_p): Remove. * stub-objc.c (objc_clear_super_receiver): New. * tree-gimple.h (voidify_wrapper_expr): Update decl. (append_to_statement_list, append_to_statement_list_force): Move to tree-iterator.h. * tree-inline.c (expand_call_inline): Update call. (clone_body): Use statement lists. (walk_tree): Don't check tree_chain_matters_p. (copy_tree_r): Likewise. * tree-iterator.c (alloc_stmt_list): Clear lang bits. (tsi_link_before, tsi_link_after): Set TREE_SIDE_EFFECTS properly. * tree-iterator.h (append_to_statement_list, append_to_statement_list_force): Moved from tree-gimple.h. * tree-pretty-print.c (dump_generic_node): Clean up TARGET_EXPR dump. * objc/objc-act.c (build_module_descriptor): Use c_begin_compound_stmt. (objc_enter_block): Likewise. (objc_exit_block): Use c_end_compound_stmt. (objc_build_try_enter_fragment): Add #error and comment for rewriting for OBJCPLUS. (objc_build_extract_fragment, objc_build_try_epilogue, objc_build_catch_stmt, objc_build_finally_prologue, objc_build_finally_epilogue): Update for C statement builders. * objc/objc-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove. cp/ * call.c (initialize_reference): Don't build CLEANUP_STMT here. * cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument. (genericize_try_block): Use gimplify_stmt. (genericize_catch_block, genericize_eh_spec_block): Likewise. (cp_gimplify_init_expr): Remove STMT_EXPR special case. (gimplify_must_not_throw_expr): Update voidify_wrapper_expr call. * cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove. (cp_tree_chain_matters_p): Remove. * cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New. (COMPOUND_STMT_BODY_BLOCK): New. (STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New. (EXPR_STMT_STMT_EXPR_RESULT): New. (building_stmt_tree): Check cur_stmt_list. (tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove. (BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New. * decl.c (poplevel): Use pop_stmt_list for minding cleanups. (cp_finish_decl): Use push_cleanup. (start_function, finish_function): Use statement lists. (finish_stmt): Do nothing. * except.c (begin_eh_spec_block): Use statement lists. (check_handlers_1, check_handlers): Likewise. * init.c (construct_virtual_base): Don't add extra compound stmts. (build_vec_init): Likewise. * name-lookup.c (maybe_push_cleanup_level): Use statement lists. * name-lookup.h (struct cp_binding_level): Add statement_list. * parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool. (cp_parser_labeled_statement, cp_parser_expression_statement, cp_parser_statement_seq_opt): Likewise. (cp_parser_compound_statement): Likewise. Take bool for try block. (cp_parser_selection_statement): Tidy if processing. (cp_parser_already_scoped_statement): Rewrite to do what it says. * pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr. (tsubst_expr): Rewrite STMT_EXPR processing. Handle STATEMENT_LIST. Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT. * semantics.c (do_poplevel, do_pushlevel): Use statement lists. (finish_cond): New, rewritten from FINISH_COND. (simplify_loop_decl_cond): New. (finish_expr_stmt): Avoid nested EXPR_STMTs. (begin_if_stmt, finish_if_stmt_cond, finish_then_clause, begin_else_clause, finish_else_clause, finish_if_stmt, begin_while_stmt, finish_while_stmt_cond, finish_while_stmt, begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt, finish_for_cond, finish_for_stmt, begin_switch_stmt, finish_switch_cond, finish_switch_stmt, begin_try_block, finish_try_block, finish_cleanup_try_block, finish_function_try_block, finish_handler_sequence, finish_function_handler_sequence, begin_handler, finish_handler_parms, finish_handler, begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite using statement lists. (begin_compound_stmt): Replace has_no_scope argument with flags. Update all callers. Use statement lists. (finish_compound_stmt): Likewise. (finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup. (current_scope_stmt_stack): Remove. (simplify_aggr_init_expr): Don't muck with TREE_CHAIN. * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): Rewrite with statement lists. testsuite/ * g++.dg/ext/stmtexpr1.C: XFAIL. * gcc.dg/20030612-1.c: XFAIL. From-SVN: r83221
2004-06-10clean up obsolete commentJason Merrill1-15/+2
From-SVN: r82885
2004-05-30bb-reorder.c, [...]: Fix comment formatting.Kazu Hirata1-1/+1
* bb-reorder.c, builtins.c, c-common.c, c-gimplify.c, c-incpath.c, cgraphunit.c, ddg.c, defaults.h, dwarf2out.c, expmed.c, flags.h, gcc.c, gensupport.c, gimplify.c, global.c, passes.c, reg-stack.c, target.h, toplev.c, tree-alias-ander.c, tree-alias-common.c, tree-cfg.c, tree-complex.c, tree-dfa.c, tree-eh.c, tree-mudflap.c, tree-mudflap.h, tree-outof-ssa.c, tree-phinodes.c, tree-pretty-print.c, tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-live.c, tree-ssa-live.h, tree-ssa-pre.c, tree.h, value-prof.h, varasm.c: Fix comment formatting. From-SVN: r82463
2004-05-15c-gimplify.c (c_genericize): Replace calls via (*lang_hooks.foo) with ↵Steven Bosscher1-1/+1
lang_hooks.foo. * c-gimplify.c (c_genericize): Replace calls via (*lang_hooks.foo) with lang_hooks.foo. * c-parse.in <expr_no_commas>: Likewise. <if_prefix>: Likewise. <select_or_iter_stmt>: Likewise. * expr.c (expand_var, expand_expr_real_1): Likewise. * expr.h (expand_expr): Make it a static inline function. Move prototype for expand_expr_real up before this. * fold-const.c (fold_relational_hi_lo, fold_relational_const): Likewise. * gimplify.c (gimple_boolify, gimplify_addr_expr, gimplify_asm_expr, gimplify_expr): Likewise. * tree-cfg.c (dump_tree_cfg, dump_cfg_stats, tree_cfg2vcg, dump_function_to_file): Likewise. * tree-dfa.c (dump_immediate_uses, dump_dfa_stats): Likewise. * tree-inline.c (remap_block, save_body, walk_tree): Likewise. * tree-into-ssa.c (dump_tree_ssa): Likewise. * tree-mudflap.c (mf_varname_tree, mf_file_function_line_tree): Likewise. * tree-optimize.c (execute_one_pass): Likewise. * tree-pretty-print.c (dump_generic_bb_buff): Likewise. * tree-ssa-alias.c (dump_alias_stats, dump_alias_info): Likewise. objc/ * objc-act.c (objc_build_try_enter_fragment, objc_build_try_epilogue, objc_build_catch_stmt, objc_build_finally_prologue): Replace calls via (*lang_hooks.foo) with lang_hooks.foo (). From-SVN: r81907
2004-05-13tree-gimple.c: Rename from tree-simple.c.Diego Novillo1-0/+1102
* tree-gimple.c: Rename from tree-simple.c. * tree-gimple.h: Rename from tree-simple.h. * c-gimplify.c: Rename from c-simplify.c * Makefile.in, c-decl.c, gimple-low.c, gimplify.c, langhooks.c, tree-alias-ander.c, tree-alias-common.c, tree-complex.c, tree-dfa.c, tree-flow.h, tree-inline.c, tree-into-ssa.c, tree-iterator.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-outof-ssa.c, tree-sra.c, tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-live.c, tree-ssa-pre.c, tree-ssa.c: Update. cp/ChangeLog * cp-gimplify.c: Rename from cp-simplify.c. * Make-lang.in, optimize.c: Update. fortran/ChangeLog * Make-lang.in, f95-lang.c, trans-array.c, trans-decl.c, trans-expr.c, trans-intrinsic.c, trans-io.c, trans-stmt.c, trans.c: Rename tree-simple.[ch] to tree-gimple.[ch]. java/ChangeLog * Make-lang.in, expr.c, java-gimplify.c: Rename tree-simple.[ch] to tree-gimple.[ch]. From-SVN: r81829