Commit Graph

113 Commits

Author SHA1 Message Date
Alexandre Oliva b5b8b0ac64 invoke.texi (-fvar-tracking-assignments): New.
gcc/ChangeLog:
* doc/invoke.texi (-fvar-tracking-assignments): New.
(-fvar-tracking-assignments-toggle): New.
(-fdump-final-insns=file): Mark filename as optional.
(--param min-nondebug-insn-uid): New.
(-gdwarf-@{version}): Mention version 4.
* opts.c (common_handle_option): Accept it.
* tree-vrp.c (find_assert_locations_1): Skip debug stmts.
* regrename.c (regrename_optimize): Drop last.  Don't count debug
insns as uses.  Don't reject change because of debug insn.
(do_replace): Reject DEBUG_INSN as chain starter.  Take base_regno
from the chain starter, and check for inexact matches in
DEBUG_INSNS.
(scan_rtx_reg): Accept inexact matches in DEBUG_INSNs.
(build_def_use): Simplify and fix the marking of DEBUG_INSNs.
* sched-ebb.c (schedule_ebbs): Skip boundary debug insns.
* fwprop.c (forward_propagate_and_simplify): ...into debug insns.
* doc/gimple.texi (is_gimple_debug): New.
(gimple_debug_bind_p): New.
(is_gimple_call, gimple_assign_cast_p): End sentence with period.
* doc/install.texi (bootstrap-debug): More details.
(bootstrap-debug-big, bootstrap-debug-lean): Document.
(bootstrap-debug-lib): More details.
(bootstrap-debug-ckovw): Update.
(bootstrap-time): New.
* tree-into-ssa.c (mark_def_sites): Skip debug stmts.
(insert_phi_nodes_for): Insert debug stmts.
(rewrite_stmt): Take iterator.  Insert debug stmts.
(rewrite_enter_block): Adjust.
(maybe_replace_use_in_debug_stmt): New.
(rewrite_update_stmt): Use it.
(mark_use_interesting): Return early for debug stmts.
* tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug
stmts before replacing stmt.
(move_computations_stmt): Likewise.
* ira-conflicts.c (add_copies): Skip debug insns.
* regstat.c (regstat_init_n_sets_and_refs): Discount debug insns.
(regstat_bb_compute_ri): Skip debug insns.
* tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts.
* tree-ssa-loop-manip.c (find_uses_to_rename_stmt,
check_loop_closed_ssa_stmt): Skip debug stmts.
* tree-tailcall.c (find_tail_calls): Likewise.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise.
* tree.h (MAY_HAVE_DEBUG_STMTS): New.
(build_var_debug_value_stat): Declare.
(build_var_debug_value): Define.
(target_for_debug_bind): Declare.
* reload.c (find_equiv_reg): Skip debug insns.
* rtlanal.c (reg_used_between_p): Skip debug insns.
(side_effects_p): Likewise.
(canonicalize_condition): Likewise.
* ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug
insns never depend on debug insns.
(create_ddg_dep_no_link): Likewise.
(add_cross_iteration_register_deps): Use ANTI_DEP for debug insns.
Don't add inter-loop dependencies for debug insns.
(build_intra_loop_deps): Likewise.
(create_ddg): Count debug insns.
* ddg.h (struct ddg::num_debug): New.
(num_backargs): Pair up with previous int field.
* diagnostic.c (diagnostic_report_diagnostic): Skip notes on
-fcompare-debug-second.
* final.c (get_attr_length_1): Skip debug insns.
(rest_of_clean-state): Don't dump CFA_RESTORE_STATE.
* gcc.c (invoke_as): Call compare-debug-dump-opt.
(driver_self_specs): Map -fdump-final-insns to
-fdump-final-insns=..
(get_local_tick): New.
(compare_debug_dump_opt_spec_function): Test for . argument and
compute output name.  Compute temp output spec without flag name.
Compute -frandom-seed.
(OPT): Undef after use.
* cfgloopanal.c (num_loop_insns): Skip debug insns.
(average_num_loop_insns): Likewise.
* params.h (MIN_NONDEBUG_INSN_UID): New.
* gimple.def (GIMPLE_DEBUG): New.
* ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts.
* auto-inc-dec.c (merge_in_block): Skip debug insns.
(merge_in_block): Fix whitespace.
* toplev.c (flag_var_tracking): Update comment.
(flag_var_tracking_assignments): New.
(flag_var_tracking_assignments_toggle): New.
(process_options): Don't open final insns dump file if we're not
going to write to it.  Compute defaults for var_tracking.
* df-scan.c (df_insn_rescan_debug_internal): New.
(df_uses_record): Handle debug insns.
* haifa-sched.c (ready): Initialize n_debug.
(contributes_to_priority): Skip debug insns.
(dep_list_size): New.
(priority): Use it.
(rank_for_schedule): Likewise.  Schedule debug insns as soon as
they're ready.  Disregard previous debug insns to make decisions.
(queue_insn): Never queue debug insns.
(ready_add, ready_remove_first, ready_remove): Count debug insns.
(schedule_insn): Don't reject debug insns because of issue rate.
(get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns.
(queue_to_ready): Skip and discount debug insns.
(choose_ready): Let debug insns through.
(schedule_block): Check boundary debug insns.  Discount debug
insns, schedule them early.  Adjust whitespace.
(set_priorities): Check for boundary debug insns.
(add_jump_dependencies): Use dep_list_size.
(prev_non_location_insn): New.
(check_cfg): Use it.
* tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug
stmts.
(remove_unused_ivs): Reset debug stmts.
* modulo-sched.c (const_iteration_count): Skip debug insns.
(res_MII): Discount debug insns.
(loop_single_full_bb_p): Skip debug insns.
(sms_schedule): Likewise.
(sms_schedule_by_order): Likewise.
(ps_has_conflicts): Likewise.
* caller-save.c (refmarker_fn): New.
(save_call_clobbered_regs): Replace regs with saved mem in
debug insns.
(mark_referenced_regs): Take pointer, mark and arg.  Adjust.
Call refmarker_fn mark for hardregnos.
(mark_reg_as_referenced): New.
(replace_reg_with_saved_mem): New.
* ipa-pure-const.c (check_stmt): Skip debug stmts.
* cse.c (cse_insn): Canonicalize debug insns.  Skip them when
searching back.
(cse_extended_basic_block): Skip debug insns.
(count_reg_usage): Likewise.
(is_dead_reg): New, split out of...
(set_live_p): ... here.
(insn_live_p): Use it for debug insns.
* tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts.
(execute_optimize_stdarg): Likewise.
* tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise.
* tree-ssa-propagate.c (substitute_and_fold): Don't regard
changes in debug stmts as changes.
* sel-sched.c (moving_insn_creates_bookkeeping_block_p): New.
(moveup_expr): Don't move across debug insns.  Don't move
debug insn if it would create a bookkeeping block.
(moveup_expr_cached): Don't use cache for debug insns that
are heads of blocks.
(compute_av_set_inside_bb): Skip debug insns.
(sel_rank_for_schedule): Schedule debug insns first.  Remove
dead code.
(block_valid_for_bookkeeping_p); Support lax searches.
(create_block_for_bookkeeping): Adjust block numbers when
encountering debug-only blocks.
(find_place_for_bookkeeping): Deal with debug-only blocks.
(generate_bookkeeping_insn): Accept no place to insert.
(remove_temp_moveop_nops): New argument full_tidying.
(prepare_place_to_insert): Deal with debug insns.
(advance_state_on_fence): Debug insns don't start cycles.
(update_boundaries): Take fence as argument.  Deal with
debug insns.
(schedule_expr_on_boundary): No full_tidying on debug insns.
(fill_insns): Deal with debug insns.
(track_scheduled_insns_and_blocks): Don't count debug insns.
(need_nop_to_preserve_insn_bb): New, split out of...
(remove_insn_from_stream): ... this.
(fur_orig_expr_not_found): Skip debug insns.
* rtl.def (VALUE): Move up.
(DEBUG_INSN): New.
* tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug
stmts.
(nearest_common_dominator_of_uses): Take debug_stmts argument.
Set it if debug stmts are found.
(statement_sink_location): Skip debug stmts.  Propagate
moving defs into debug stmts.
* ifcvt.c (first_active_insn): Skip debug insns.
(last_active_insns): Likewise.
(cond_exec_process_insns): Likewise.
(noce_process_if_block): Likewise.
(check_cond_move_block): Likewise.
(cond_move_convert_if_block): Likewise.
(block_jumps_and_fallthru_p): Likewise.
(dead_or_predicable): Likewise.
* dwarf2out.c (debug_str_hash_forced): New.
(find_AT_string): Add comment.
(gen_label_for_indirect_string): New.
(get_debug_string_label): New.
(AT_string_form): Use it.
(mem_loc_descriptor): Handle non-TLS symbols.  Handle MINUS , DIV,
MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING.  Accept but
discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and
several operations that cannot be represented with DWARF opcodes.
(loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND.  Require
dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value.
(dwarf2out_var_location): Take during-call mark into account.
(output_indirect_string): Update comment.  Output if there are
label and references.
(prune_indirect_string): New.
(prune_unused_types): Call it if debug_str_hash_forced.
More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>:
(dw_long_long_const): Remove.
(struct dw_val_struct): Change val_long_long type to rtx.
(print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for
val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair.
(output_die): Likewise.  Use HOST_BITS_PER_WIDE_INT size of each
component instead of HOST_BITS_PER_LONG.
(output_loc_operands): Likewise.   For const8* assert
HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64.
(output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT
rather than HOST_BITS_PER_LONG is >= 64.
(add_AT_long_long): Remove val_hi and val_lo arguments, add
val_const_double.
(size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of
HOST_BITS_PER_LONG for dw_val_class_long_long.
(add_const_value_attribute): Adjust add_AT_long_long caller.  Don't
handle TLS SYMBOL_REFs.  If CONST wraps a constant, tail recurse.
(dwarf_stack_op_name): Handle DW_OP_implicit_value and
DW_OP_stack_value.
(size_of_loc_descr, output_loc_operands, output_loc_operands_raw):
Handle DW_OP_implicit_value.
(extract_int): Move prototype earlier.
(mem_loc_descriptor): For SUBREG punt if inner
mode size is wider than DWARF2_ADDR_SIZE.  Handle SIGN_EXTEND
and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}.  Handle
EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN,
UMAX, SIGN_EXTRACT, ZERO_EXTRACT.
(loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE
instead of Pmode size.
(loc_descriptor): Add MODE argument.  Handle CONST_INT, CONST_DOUBLE,
CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode,
attempt to handle other expressions.  Don't handle TLS SYMBOL_REFs.
(concat_loc_descriptor, concatn_loc_descriptor,
loc_descriptor_from_tree_1): Adjust loc_descriptor callers.
(add_location_or_const_value_attribute): Likewise.  For single
location loc_lists attempt to use add_const_value_attribute
for constant decls.  Add DW_AT_const_value even if
NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING
in its expression.
* cfgbuild.c (inside_basic_block_p): Handle debug insns.
(control_flow_insn_p): Likewise.
* tree-parloops.c (eliminate_local_variables_stmt): Handle debug
stmt.
(separate_decls_in_region_debug_bind): New.
(separate_decls_in_region): Process debug bind stmts afterwards.
* recog.c (verify_changes): Handle debug insns.
(extract_insn): Likewise.
(peephole2_optimize): Skip debug insns.
* dse.c (scan_insn): Skip debug insns.
* sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument.
Pass it on.
(setup_id_for_insn): Handle debug insns.
(maybe_tidy_empty_bb): Adjust whitespace.
(tidy_control_flow): Skip debug insns.
(sel_remove_insn): Adjust for debug insns.
(sel_estimate_number_of_insns): Skip debug insns.
(create_insn_rtx_from_pattern): Handle debug insns.
(create_copy_of_insn_rtx): Likewise.
* sel-sched-.h (sel_bb_end): Declare.
(sel_bb_empty_or_nop_p): New.
(get_all_loop_exits): Use it.
(_eligible_successor_edge_p): Likewise.
(return_nop_to_pool): Adjust.
* tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts.
* ira-lives.c (process_bb_node_lives): Skip debug insns.
* gimple-pretty-print.c (dump_gimple_debug): New.
(dump_gimple_stmt): Use it.
(dump_bb_header): Skip gimple debug stmts.
* regmove.c (optimize_reg_copy_1): Discount debug insns.
(fixup_match_2): Likewise.
(regmove_backward_pass): Likewise.  Simplify combined
replacement.  Handle debug insns.
* function.c (instantiate_virtual_regs): Handle debug insns.
* function.h (struct emit_status): Add x_cur_debug_insn_uid.
* print-rtl.h: Include cselib.h.
(print_rtx): Print VALUEs.  Split out and recurse for
VAR_LOCATIONs.
* df.h (df_inns_rescan_debug_internal): Declare.
* gcse.c (alloc_hash_table): Estimate n_insns.
(cprop_insn): Don't regard debug insns as changes.
(bypass_conditional_jumps): Skip debug insns.
(one_pre_gcse_pass): Adjust.
(one_code_hoisting_pass): Likewise.
(compute_ld_motion_mems): Skip debug insns.
(one_cprop_pass): Adjust.
* tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts.
(if_convertible_stmt_p): Handle debug stmts.
* init-regs.c (initialize_uninitialized_regs): Skip debug insns.
* tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts.
* ira-build.c (create_bb_allocnos): Skip debug insns.
* tree-flow-inline.h (has_zero_uses): Discount debug stmts.
(has_single_use): Likewise.
(single_imm_use): Likewise.
(num_imm_uses): Likewise.
* tree-ssa-phiopt.c (empty_block_p): Skip debug stmts.
* tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts.
(create_outofssa_var_map): Likewise.
* lower-subreg.c (adjust_decomposed_uses): New.
(resolve_debug): New.
(decompose_multiword_subregs): Use it.
* tree-dfa.c (find_referenced_vars): Skip debug stmts.
* emit-rtl.c: Include params.h.
(cur_debug_insn_uid): Define.
(set_new_first_and_last_insn): Set cur_debug_insn_uid too.
(copy_rtx_if_shared_1): Handle debug insns.
(reset_used_flags): Likewise.
(set_used_flags): LIkewise.
(get_max_insn_count): New.
(next_nondebug_insn): New.
(prev_nondebug_insn): New.
(make_debug_insn_raw): New.
(emit_insn_before_noloc): Handle debug insns.
(emit_jump_insn_before_noloc): Likewise.
(emit_call_insn_before_noloc): Likewise.
(emit_debug_insn_before_noloc): New.
(emit_insn_after_noloc): Handle debug insns.
(emit_jump_insn_after_noloc): Likewise.
(emit_call_insn_after_noloc): Likewise.
(emit_debug_insn_after_noloc): Likewise.
(emit_insn_after): Take loc from earlier non-debug insn.
(emit_jump_insn_after): Likewise.
(emit_call_insn_after): Likewise.
(emit_debug_insn_after_setloc): New.
(emit_debug_insn_after): New.
(emit_insn_before): Take loc from later non-debug insn.
(emit_jump_insn_before): Likewise.
(emit_call_insn_before): Likewise.
(emit_debug_insn_before_setloc): New.
(emit_debug_insn_before): New.
(emit_insn): Handle debug insns.
(emit_debug_insn): New.
(emit_jump_insn): Handle debug insns.
(emit_call_insn): Likewise.
(emit): Likewise.
(init_emit): Take min-nondebug-insn-uid into account.
Initialize cur_debug_insn_uid.
(emit_copy_of_insn_after): Handle debug insns.
* cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite
location of single rhs in place.
(maybe_dump_rtl_for_gimple_stmt): Dump lineno.
(floor_sdiv_adjust): New.
(cell_sdiv_adjust): New.
(cell_udiv_adjust): New.
(round_sdiv_adjust): New.
(round_udiv_adjust): New.
(wrap_constant): Moved from cselib.
(unwrap_constant): New.
(expand_debug_expr): New.
(expand_debug_locations): New.
(expand_gimple_basic_block): Drop hiding redeclaration.  Expand
debug bind stmts.
(gimple_expand_cfg): Expand debug locations.
* cselib.c: Include tree-pass.h.
(struct expand_value_data): New.
(cselib_record_sets_hook): New.
(PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New.
(cselib_clear_table): Move, and implemnet in terms of...
(cselib_reset_table_with_next_value): ... this.
(cselib_get_next_unknown_value): New.
(discard_useless_locs): Don't discard preserved values.
(cselib_preserve_value): New.
(cselib_preserved_value_p): New.
(cselib_preserve_definitely): New.
(cselib_clear_preserve): New.
(cselib_preserve_only_values): New.
(new_cselib_val): Take rtx argument.  Dump it in details.
(cselib_lookup_mem): Adjust.
(expand_loc): Take regs_active in struct.  Adjust.  Silence
dumps unless details are requested.
(cselib_expand_value_rtx_cb): New.
(cselib_expand_value_rtx): Rename and reimplment in terms of...
(cselib_expand_value_rtx_1): ... this.  Adjust.  Silence dumps
without details.  Copy more subregs.  Try to resolve values
using a callback.  Wrap constants.
(cselib_subst_to_values): Adjust.
(cselib_log_lookup): New.
(cselib_lookup): Call it.
(cselib_invalidate_regno): Don't count preserved values as
useless.
(cselib_invalidate_mem): Likewise.
(cselib_record_set): Likewise.
(struct set): Renamed to cselib_set, moved to cselib.h.
(cselib_record_sets): Adjust.  Call hook.
(cselib_process_insn): Reset table when it would be cleared.
(dump_cselib_val): New.
(dump_cselib_table): New.
* tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts.
(remove_forwarder_block): Support moving debug stmts.
* cselib.h (cselib_record_sets_hook): Declare.
(cselib_expand_callback): New type.
(cselib_expand_value_rtx_cb): Declare.
(cselib_reset_table_with_next_value): Declare.
(cselib_get_next_unknown_value): Declare.
(cselib_preserve_value): Declare.
(cselib_preserved_value_p): Declare.
(cselib_preserve_only_values): Declare.
(dump_cselib_table): Declare.
* cfgcleanup.c (flow_find_cross_jump): Skip debug insns.
(try_crossjump_to_edge): Likewise.
(delete_unreachable_blocks): Remove dominant GIMPLE blocks after
dominated blocks when debug stmts are present.
* simplify-rtx.c (delegitimize_mem_from_attrs): New.
* tree-ssa-live.c (remove_unused_locals): Skip debug stmts.
(set_var_live_on_entry): Likewise.
* loop-invariant.c (find_invariants_bb): Skip debug insns.
* cfglayout.c (curr_location, last_location): Make static.
(set_curr_insn_source_location): Don't avoid bouncing.
(get_curr_insn_source_location): New.
(get_curr_insn_block): New.
(duplicate_insn_chain): Handle debug insns.
* tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate
into debug stmts.
* common.opt (fcompare-debug): Move to sort order.
(fdump-unnumbered-links): Likewise.
(fvar-tracking-assignments): New.
(fvar-tracking-assignments-toggle): New.
* tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks
because of debug stmts.
(mark_stmt_if_obviously_necessary): Mark debug stmts.
(eliminate_unnecessary_stmts): Walk dominated blocks before
dominators.
* tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts.
* ira.c (memref_used_between_p): Skip debug insns.
(update_equiv_regs): Likewise.
* sched-deps.c (sd_lists_size): Accept empty list.
(sd_init_insn): Mark debug insns.
(sd_finish_insn): Unmark them.
(sd_add_dep): Reject non-debug deps on debug insns.
(fixup_sched_groups): Give debug insns group treatment.
Skip debug insns.
(sched_analyze_reg): Don't mark debug insns for sched before call.
(sched_analyze_2): Handle debug insns.
(sched_analyze_insn): Compute next non-debug insn.  Handle debug
insns.
(deps_analyze_insn): Handle debug insns.
(deps_start_bb): Skip debug insns.
(init_deps): Initialize last_debug_insn.
* tree-ssa.c (target_for_debug_bind): New.
(find_released_ssa_name): New.
(propagate_var_def_into_debug_stmts): New.
(propagate_defs_into_debug_stmts): New.
(verify_ssa): Skip debug bind stmts without values.
(warn_uninialized_vars): Skip debug stmts.
* target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default.
* rtl.c (rtx_equal_p_cb): Handle VALUEs.
(rtx_equal_p): Likewise.
* ira-costs.c (scan_one_insn): Skip debug insns.
(process_bb_node_for_hard_reg_moves): Likewise.
* rtl.h (DEBUG_INSN_P): New.
(NONDEBUG_INSN_P): New.
(MAY_HAVE_DEBUG_INSNS): New.
(INSN_P): Accept debug insns.
(RTX_FRAME_RELATED_P): Likewise.
(INSN_DELETED_P): Likewise
(PAT_VAR_LOCATION_DECL): New.
(PAT_VAR_LOCATION_LOC): New.
(PAT_VAR_OCATION_STATUS): New.
(NOTE_VAR_LOCATION_DECL): Reimplement.
(NOTE_VAR_LOCATION_LOC): Likewise.
(NOTE_VAR_LOCATION_STATUS): Likewise.
(INSN_VAR_LOCATION): New.
(INSN_VAR_LOCATION_DECL): New.
(INSN_VAR_LOCATION_LOC): New.
(INSN_VAR_LOCATION_STATUS): New.
(gen_rtx_UNKNOWN_VAR_LOC): New.
(VAR_LOC_UNKNOWN_P): New.
(NOTE_DURING_CALL_P): New.
(SCHED_GROUP_P): Accept debug insns.
(emit_debug_insn_before): Declare.
(emit_debug_insn_before_noloc): Declare.
(emit_debug_insn_beore_setloc): Declare.
(emit_debug_insn_after): Declare.
(emit_debug_insn_after_noloc): Declare.
(emit_debug_insn_after_setloc): Declare.
(emit_debug_insn): Declare.
(make_debug_insn_raw): Declare.
(prev_nondebug_insn): Declare.
(next_nondebug_insn): Declare.
(delegitimize_mem_from_attrs): Declare.
(get_max_insn_count): Declare.
(wrap_constant): Declare.
(unwrap_constant): Declare.
(get_curr_insn_source_location): Declare.
(get_curr_insn_block): Declare.
* tree-inline.c (insert_debug_decl_map): New.
(processing_debug_stmt): New.
(remap_decl): Don't create new mappings in debug stmts.
(remap_gimple_op_r): Don't add references in debug stmts.
(copy_tree_body_r): Likewise.
(remap_gimple_stmt): Handle debug bind stmts.
(copy_bb): Skip debug stmts.
(copy_edges_for_bb): Likewise.
(copy_debug_stmt): New.
(copy_debug_stmts): New.
(copy_body): Copy debug stmts at the end.
(insert_init_debug_bind): New.
(insert_init_stmt): Take id.  Skip and emit debug stmts.
(setup_one_parameter): Remap variable earlier, register debug
mapping.
(estimate_num_insns): Skip debug stmts.
(expand_call_inline): Preserve debug_map.
(optimize_inline_calls): Check for no debug_stmts left-overs.
(unsave_expr_now): Preserve debug_map.
(copy_gimple_seq_and_replace_locals): Likewise.
(tree_function_versioning): Check for no debug_stmts left-overs.
Init and destroy debug_map as needed.  Split edges unconditionally.
(build_duplicate_type): Init and destroy debug_map as needed.
* tree-inline.h: Include gimple.h instead of pointer-set.h.
(struct copy_body_data): Add debug_stmts and debug_map.
* sched-int.h (struct ready_list): Add n_debug.
(struct deps): Add last_debug_insn.
(DEBUG_INSN_SCHED_P): New.
(BOUNDARY_DEBUG_INSN_P): New.
(SCHEDULE_DEBUG_INSN_P): New.
(sd_iterator_cond): Accept empty list.
* combine.c (create_log_links): Skip debug insns.
(combine_instructions): Likewise.
(cleanup_auto_inc_dec): New.  From Jakub Jelinek: Make sure the
return value is always unshared.
(struct rtx_subst_pair): New.
(auto_adjust_pair): New.
(propagate_for_debug_subst): New.
(propagate_for_debug): New.
(try_combine): Skip debug insns.  Propagate removed defs into
debug insns.
(next_nonnote_nondebug_insn): New.
(distribute_notes): Use it.  Skip debug insns.
(distribute_links): Skip debug insns.
* tree-outof-ssa.c (set_location_for_edge): Likewise.
* resource.c (mark_target_live_regs): Likewise.
* var-tracking.c: Include cselib.h and target.h.
(enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and
MO_VAL_SET.
(micro_operation_type_name): New.
(enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN.
(struct micro_operation_def): Update comments.
(decl_or_value): New type.  Use instead of decls.
(struct emit_note_data_def): Add vars.
(struct attrs_def): Use decl_or_value.
(struct variable_tracking_info_def): Add permp, flooded.
(struct location_chain_def): Update comment.
(struct variable_part_def): Use decl_or_value.
(struct variable_def): Make var_part a variable length array.
(valvar_pool): New.
(scratch_regs): New.
(cselib_hook_called): New.
(dv_is_decl_p): New.
(dv_is_value_p): New.
(dv_as_decl): New.
(dv_as_value): New.
(dv_as_opaque): New.
(dv_onepart_p): New.
(dv_pool): New.
(IS_DECL_CODE): New.
(check_value_is_not_decl): New.
(dv_from_decl): New.
(dv_from_value): New.
(dv_htab_hash): New.
(variable_htab_hash): Use it.
(variable_htab_eq): Support values.
(variable_htab_free): Free from the right pool.
(attrs_list_member, attrs_list_insert): Use decl_or_value.
(attrs_list_union): Adjust.
(attrs_list_mpdv_union): New.
(tie_break_pointers): New.
(canon_value_cmp): New.
(unshare_variable): Return possibly-modified slot.
(vars_copy_1): Adjust.
(var_reg_decl_set): Adjust.  Split out of...
(var_reg_set): ... this.
(get_init_value): Adjust.
(var_reg_delete_and_set): Adjust.
(var_reg_delete): Adjust.
(var_regno_delete): Adjust.
(var_mem_decl_set): Split out of...
(var_mem_set): ... this.
(var_mem_delete_and_set): Adjust.
(var_mem_delete): Adjust.
(val_store): New.
(val_reset): New.
(val_resolve): New.
(variable_union): Adjust.  Speed up merge of 1-part vars.
(variable_canonicalize): Use unshared slot.
(VALUED_RECURSED_INTO): New.
(find_loc_in_1pdv): New.
(struct dfset_merge): New.
(insert_into_intersection): New.
(intersect_loc_chains): New.
(loc_cmp): New.
(canonicalize_loc_order_check): New.
(canonicalize_values_mark): New.
(canonicalize_values_star): New.
(variable_merge_over_cur): New.
(variable_merge_over_src): New.
(dataflow_set_merge): New.
(dataflow_set_equiv_regs): New.
(remove_duplicate_values): New.
(struct dfset_post_merge): New.
(variable_post_merge_new_vals): New.
(variable_post_merge_perm_vals): New.
(dataflow_post_merge_adjust): New.
(find_mem_expr_in_1pdv): New.
(dataflow_set_preserve_mem_locs): New.
(dataflow_set_remove_mem_locs): New.
(dataflow_set_clear_at_call): New.
(onepart_variable_different_p): New.
(variable_different_p): Use it.
(dataflow_set_different_1): Adjust.  Make detailed dump
more verbose.
(track_expr_p): Add need_rtl parameter.  Don't generate rtl
if not needed.
(track_loc_p): Pass it true.
(struct count_use_info): New.
(find_use_val): New.
(replace_expr_with_values): New.
(log_op_type): New.
(use_type): New, partially split out of...
(count_uses): ... this.  Count new micro-ops.
(count_uses_1): Adjust.
(count_stores): Adjust.
(count_with_sets): New.
(VAL_NEEDS_RESOLUTION): New.
(VAL_HOLDS_TRACK_EXPR): New.
(VAL_EXPR_IS_COPIED): New.
(VAL_EXPR_IS_CLOBBERED): New.
(add_uses): Adjust.  Generate new micro-ops.
(add_uses_1): Adjust.
(add_stores): Generate new micro-ops.
(add_with_sets): New.
(find_src_status): Adjust.
(find_src_set_src): Adjust.
(compute_bb_dataflow): Use dataflow_set_clear_at_call.
Handle new micro-ops.  Canonicalize value equivalances.
(vt_find_locations): Compute total size of hash tables for
dumping.  Perform merge for var-tracking-assignments.  Don't
disregard single-block loops.
(dump_attrs_list): Handle decl_or_value.
(dump_variable): Take variable.  Deal with decl_or_value.
(dump_variable_slot): New.
(dump_vars): Use it.
(dump_dataflow_sets): Adjust.
(set_slot_part): New, extended to support one-part variables
after splitting out of...
(set_variable_part): ... this.
(clobber_slot_part): New, split out of...
(clobber_variable_part): ... this.
(delete_slot_part): New, split out of...
(delete_variable_part): .... this.
(check_wrap_constant): New.
(vt_expand_loc_callback): New.
(vt_expand_loc): New.
(emit_note_insn_var_location): Adjust.  Handle values.  Handle
EMIT_NOTE_AFTER_CALL_INSN.
(emit_notes_for_differences_1): Adjust.  Handle values.
(emit_notes_for_differences_2): Likewise.
(emit_notes_for_differences): Adjust.
(emit_notes_in_bb): Take pointer to set.  Emit AFTER_CALL_INSN
notes.  Adjust.  Handle new micro-ops.
(vt_add_function_parameters): Adjust.  Create and bind values.
(vt_initialize): Adjust.  Initialize scratch_regs and
valvar_pool, flooded and perm..  Initialize and use cselib.  Log
operations.  Move some code to count_with_sets and add_with_sets.
(delete_debug_insns): New.
(vt_debug_insns_local): New.
(vt_finalize): Release permp, valvar_pool, scratch_regs.  Finish
cselib.
(var_tracking_main): If var-tracking-assignments is enabled
but var-tracking isn't, delete debug insns and leave.  Likewise
if we exceed limits or fail the stack adjustments tests, and
after all var-tracking processing.
More in var-tracking, from Jakub Jelinek <jakub@redhat.com>:
(dataflow_set): Add traversed_vars.
(value_chain, const_value_chain): New typedefs.
(value_chain_pool, value_chains): New variables.
(value_chain_htab_hash, value_chain_htab_eq, add_value_chain,
add_value_chains, add_cselib_value_chains, remove_value_chain,
remove_value_chains, remove_cselib_value_chains): New functions.
(shared_hash_find_slot_unshare_1, shared_hash_find_slot_1,
shared_hash_find_slot_noinsert_1, shared_hash_find_1): New
static inlines.
(shared_hash_find_slot_unshare, shared_hash_find_slot,
shared_hash_find_slot_noinsert, shared_hash_find): Update.
(dst_can_be_shared): New variable.
(unshare_variable): Unshare set->vars if shared, use shared_hash_*.
Clear dst_can_be_shared.  If set->traversed_vars is non-NULL and
different from set->vars, look up slot again instead of using the
passed in slot.
(dataflow_set_init): Initialize traversed_vars.
(variable_union): Use shared_hash_*.  Use initially NO_INSERT
lookup if set->vars is shared.  Don't keep slot cleared before
calling unshare_variable.  Unshare set->vars if needed.  Adjust
unshare_variable callers.  Clear dst_can_be_shared if needed.
Even ->refcount == 1 vars must be unshared if set->vars is shared
and var needs to be modified.
(dataflow_set_union): Set traversed_vars during canonicalization.
(VALUE_CHANGED, DECL_CHANGED): Define.
(set_dv_changed, dv_changed_p): New static inlines.
(track_expr_p): Clear DECL_CHANGED.
(dump_dataflow_sets): Set it.
(variable_was_changed): Call set_dv_changed.
(emit_note_insn_var_location): Likewise.
(changed_variables_stack): New variable.
(check_changed_vars_1, check_changed_vars_2): New functions.
(emit_notes_for_changes): Do nothing if changed_variables is
empty.  Traverse changed_variables with check_changed_vars_1,
call check_changed_vars_2 on each changed_variables_stack entry.
(emit_notes_in_bb): Add SET argument.  Just clear it at the
beginning, use it instead of local &set, don't destroy it at the
end.
(vt_emit_notes): Call dataflow_set_clear early on all
VTI(bb)->out sets, never use them, instead use emit_notes_in_bb
computed set, dataflow_set_clear also VTI(bb)->in when we are
done with the basic block.  Initialize changed_variables_stack,
free it afterwards.  If ENABLE_CHECKING verify that after noting
differences to an empty set value_chains hash table is empty.
(vt_initialize): Initialize value_chains and value_chain_pool.
(vt_finalize): Delete value_chains htab, free value_chain_pool.
(variable_tracking_main): Call dump_dataflow_sets before calling
vt_emit_notes, not after it.
* tree-flow.h (propagate_defs_into_debug_stmts): Declare.
(propagate_var_def_into_debug_stmts): Declare.
* df-problems.c (df_lr_bb_local_compute): Skip debug insns.
(df_set_note): Reject debug insns.
(df_whole_mw_reg_dead_p): Take added_notes_p argument.  Don't
add notes to debug insns.
(df_note_bb_compute): Adjust.  Likewise.
(df_simulate_uses): Skip debug insns.
(df_simulate_initialize_backwards): Likewise.
* reg-stack.c (subst_stack_regs_in_debug_insn): New.
(subst_stack_regs_pat): Reject debug insns.
(convert_regs_1): Handle debug insns.
* Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H.
(print-rtl.o): Depend on cselib.h.
(cselib.o): Depend on TREE_PASS_H.
(var-tracking.o): Depend on cselib.h and TARGET_H.
* sched-rgn.c (rgn_estimate_number_of_insns): Discount
debug insns.
(init_ready_list): Skip boundary debug insns.
(add_branch_dependences): Skip debug insns.
(free_block_dependencies): Check for blocks with only debug
insns.
(compute_priorities): Likewise.
* gimple.c (gss_for_code): Handle GIMPLE_DEBUG.
(gimple_build_with_ops_stat): Take subcode as unsigned.  Adjust
all callers.
(gimple_build_debug_bind_stat): New.
(empty_body_p): Skip debug stmts.
(gimple_has_side_effects): Likewise.
(gimple_rhs_has_side_effects): Likewise.
* gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New.
(gimple_build_debug_bind_stat): Declare.
(gimple_build_debug_bind): Define.
(is_gimple_debug): New.
(gimple_debug_bind_p): New.
(gimple_debug_bind_get_var): New.
(gimple_debug_bind_get_value): New.
(gimple_debug_bind_get_value_ptr): New.
(gimple_debug_bind_set_var): New.
(gimple_debug_bind_set_value): New.
(GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro.
(gimple_debug_bind_reset_value): New.
(gimple_debug_bind_has_value_p): New.
(gsi_next_nondebug): New.
(gsi_prev_nondebug): New.
(gsi_start_nondebug_bb): New.
(gsi_last_nondebug_bb): New.
* sched-vis.c (print_pattern): Handle VAR_LOCATION.
(print_insn): Handle DEBUG_INSN.
* tree-cfg.c (remove_bb): Walk stmts backwards.  Let loc
of first insn prevail.
(first_stmt): Skip debug stmts.
(first_non_label_stmt): Likewise.
(last_stmt): Likewise.
(has_zero_uses_1): New.
(single_imm_use_1): New.
(verify_gimple_debug): New.
(verify_types_in_gimple_stmt): Handle debug stmts.
(verify_stmt): Likewise.
(debug_loop_num): Skip debug stmts.
(remove_edge_and_dominated_blocks): Remove dominators last.
* tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into
debug stmts.
(linearize_expr): Likewise.
* config/i386/i386.c (ix86_delegitimize_address): Call
default implementation.
* config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug
insns.
(group_barrier_needed): Skip debug insns.
(emit_insn_group_barriers): Likewise.
(emit_all_insn_group_barriers): Likewise.
(ia64_variable_issue): Handle debug insns.
(ia64_dfa_new_cycle): Likewise.
(final_emit_insn_group_barriers): Skip debug insns.
(ia64_dwarf2out_def_steady_cfa): Take frame argument.  Don't
def cfa without frame.
(process_set): Likewise.
(process_for_unwind_directive): Pass frame on.
* config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define.
(rs6000_delegitimize_address): New.
(rs6000_debug_adjust_cost): Handle debug insns.
(is_microcoded_insn): Likewise.
(is_cracked_insn): Likewise.
(is_nonpipeline_insn): Likewise.
(insn_must_be_first_in_group): Likewise.
(insn_must_be_last_in_group): Likewise.
(force_new_group): Likewise.
* cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block
contains only debug insns.
(rtl_merge_blocks): Skip debug insns.
(purge_dead_edges): Likewise.
(rtl_block_ends_with_call_p): Skip debug insns.
* dce.c (deletable_insn_p): Handle VAR_LOCATION.
(mark_reg_dependencies): Skip debug insns.
* params.def (PARAM_MIN_NONDEBUG_INSN_UID): New.
* tree-ssanames.c (release_ssa_name): Propagate def into
debug stmts.
* tree-ssa-threadedge.c
(record_temporary_equivalences_from_stmts): Skip debug stmts.
* regcprop.c (replace_oldest_value_addr): Skip debug insns.
(replace_oldest_value_mem): Use ALL_REGS for debug insns.
(copyprop_hardreg_forward_1): Handle debug insns.
* reload1.c (reload): Skip debug insns.  Replace unassigned
pseudos in debug insns with their equivalences.
(eliminate_regs_in_insn): Skip debug insns.
(emit_input_reload_insns): Skip debug insns at first, adjust
them later.
* tree-ssa-operands.c (add_virtual_operand): Reject debug stmts.
(get_indirect_ref_operands): Pass opf_no_vops on.
(get_expr_operands): Likewise.  Skip debug stmts.
(parse_ssa_operands): Scan debug insns with opf_no_vops.
gcc/testsuite/ChangeLog:
* gcc.dg/guality/guality.c: New.
* gcc.dg/guality/guality.h: New.
* gcc.dg/guality/guality.exp: New.
* gcc.dg/guality/example.c: New.
* lib/gcc-dg.exp (cleanup-dump): Remove .gk files.
(cleanup-saved-temps): Likewise, .gkd files too.
gcc/cp/ChangeLog:
* cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
* cp-lang.c (cxx_dwarf_name): Pass it.
* error.c (count_non_default_template_args): Take flags as
argument.  Adjust all callers.  Skip counting of default
arguments if the new flag is given.
ChangeLog:
* Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug.
* Makefile.in: Rebuilt.
contrib/ChangeLog:
* compare-debug: Look for .gkd files and compare them.
config/ChangeLog:
* bootstrap-debug.mk: Add comments.
* bootstrap-debug-big.mk: New.
* bootstrap-debug-lean.mk: New.
* bootstrap-debug-ckovw.mk: Add comments.
* bootstrap-debug-lib.mk: Drop CFLAGS for stages.  Use -g0
for TFLAGS in stage1.  Drop -fvar-tracking-assignments-toggle.

From-SVN: r151312
2009-09-02 02:42:21 +00:00
Dodji Seketeli f9329c35d7 Emit DWARF for template parameters (PR debug/30161)
ChangeLog:
	PR debug/30161
	* include/dwarf2.h (enum dwarf_tag): Added
	DW_TAG_GNU_template_template_param
	(enum dwarf_attribute): Added DW_AT_GNU_template_name.

gcc/ChangeLog:
	PR debug/30161
	* cgraph.h (cgraph_get_node): Declare ...
	* cgraph.c (cgraph_get_node): ... new function.
	* dwarf2out.c (gen_generic_params_dies,
	generic_parameter_die, tree_add_const_value_attribute_for_decl,
	make_ith_pack_parameter_name,
	append_entry_to_tmpl_value_parm_die_table,
	gen_remaining_tmpl_value_param_die_attribute): New functions.
	(gen_subprogram_die): Generate debug info for template parameters
	if debug info level is higher than DINFO_LEVEL_TERSE.
	Use tree_add_const_value_attribute_for_decl instead of
	tree_add_const_value_attribute.
	(gen_const_die): Use tree_add_const_value_attribute_for_decl
	instead of tree_add_const_value_attribute.
	(gen_struct_or_union_type_die): Generate debug
	info for template parameters if debug info level is higher than
	DINFO_LEVEL_TERSE.
	(tree_add_const_value_attribute): Handle integral and pointer
	constants. Update comment.
	(dwarf_tag_name): Support DW_TAG_GNU_template_template_param.
	(dwarf_attr_name): Support DW_AT_GNU_template_name.
	(reference_to_unused): Fix thinko. Remove redundant predicates from
	tests.
	(tree_add_const_value_attribute): Make this work for constant
	expressions only.
	tree_add_const_value_attribute_for_decl is to be used for variable
	DECLs now.
	(add_location_or_const_value_attribute): Use
	tree_add_const_value_attribute_for_decl now.
	(dwarf2out_finish): Emit the DW_AT_const_value attribute of
	DW_TAG_template_value_param DIEs after function DIEs have been
	emitted.
	* langhooks.h (lang_hooks_for_types): Add
	get_argument_pack_elems.
	(lang_hooks_for_decls): Add generic_generic_parameter_decl_p.
	(lang_hooks): Added get_innermost_generic_parms,
	get_innermost_generic_args.
	* langhooks-def.h (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
	LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
	LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
	LANG_HOOKS_GENERIC_GENERIC_PARAMETER_DECL_P): New language hooks.

gcc/cp/ChangeLog:
	PR debug/30161
	* cp-tree.h (get_template_info): Parameter should be const.
	(CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): Fix typo.
	(get_template_argument_pack_elems,
	get_primary_template_innermost_parameters,
	get_template_innermost_arguments, template_template_parameter_p):
	Declare ...
	* pt.c (get_template_argument_pack_elems,
	get_template_innermost_parameters, get_template_innermost_arguments,
	template_template_parameter_p):
	... New C++ front end implementation of new language hooks.
	(primary_template_instantiation_p): New private helper.
	(make_ith_pack_parameter_name): Use snprintf and strnlen instead of
	printf and strlen.
	(get_template_info): Const-ify parameter.
	* cp-lang.c (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
	LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
	LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
	LANG_HOOKS_GENERIC_TYPE_PARAMETER_DECL_P): Initialize these
	interfaces for the C++ front-end.

gcc/testsuite/ChangeLog:
	PR debug/30161
	* g++.dg/debug/dwarf2/template-params-1.C: New test.
	* g++.dg/debug/dwarf2/template-params-2.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-3.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-4.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-5.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-6.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-1.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-2.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-3.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-4.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-5.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-6.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-7.C: Likewise.

From-SVN: r151249
2009-08-31 23:48:04 +02:00
Jakub Jelinek 66647d441f Update Copyright years for files modified in 2008 and/or 2009.
From-SVN: r144324
2009-02-20 16:20:38 +01:00
Ian Lance Taylor c0ed0531e5 tree.h (enum tree_code): Include all-tree.def, not tree.def.
* tree.h (enum tree_code): Include all-tree.def, not tree.def.
	Define END_OF_BASE_TREE_CODES around inclusion.
	* tree.c (tree_code_type): New global array.
	(tree_code_length, tree_code_name): Likewise.
	* Makefile.in (TREE_H): Add all-tree.def, c-common.def, and
	$(lang_tree_files).
	(all-tree.def, s-alltree): New targets.
	(gencheck.h, s-gencheck): Remove.
	(tree.o): Depend upon all-tree.def.
	(build/gencheck.o): Remove gencheck.h dependency.
	(mostlyclean): Don't remove gencheck.h.
	* c-common.h (enum c_tree_code): Remove.
	* c-lang.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.
	* gencheck.c (tree_codes): Include all-tree.def, rather than
	tree.def, c-common.def, and gencheck.h.  Undefined DEFTREECODE
	after it is used.
	* tree-browser.c (tb_tree_codes): Include all-tree.def, rather
	than tree.def.
	* cp/cp-tree.h (enum cplus_tree_code): Remove.
	(operator_name_info): Size to MAX_TREE_CODES.
	(assignment_operator_name_info): Likewise.
	* cp/cp-lang.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.
	* cp/lex.c (operator_name_info): Size to MAX_TREE_CODES.
	(assignment_operator_name_info): Likewise.
	* cp/decl.c (grok_op_properties): Change LAST_CPLUS_TREE_CODE to
	MAX_TREE_CODES.
	* cp/mangle.c (write_expression): Likewise.
	* cp/Make-lang.in (CXX_TREE_H): Remove cp/cp-tree.def.
	* fortran/f95-lang.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.
	* java/java-tree.h (enum java_tree_code): Remove.
	* java/lang.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.
	* java/Make-lang.in (JAVA_TREE_H): Remove java/java-tree.def.
	* objc/objc-act.h (enum objc_tree_code): Remove.
	* objc/objc-lang.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.
	* objcp/objcp-lang.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.
	* ada/ada-tree.h (enum gnat_tree_code): Remove.
	* ada/Make-lang.in (ADA_TREE_H): Remove ada/ada-tre.def.
	* ada/misc.c (tree_code_type): Remove.
	(tree_code_length, tree_code_name): Remove.

From-SVN: r137006
2008-06-21 21:17:40 +00:00
Paolo Bonzini ac5dc795ad expr.c (store_expr): Assume lang_hooks.reduce_bit_field_operations is true.
2008-03-18  Paolo Bonzini  <bonzini@gnu.org>

        * expr.c (store_expr): Assume lang_hooks.reduce_bit_field_operations
        is true.
        (expand_expr_real_1) <REDUCE_BIT_FIELD>: Don't look at ignore.
        (expand_expr_real_1): Assume lang_hooks.reduce_bit_field_operations
        is true.  Add "&& !ignore" condition to reduce_bit_field.  Modify
        target after ignore has been set, and move there also the commputation
        of subtarget and original_target.
        * langhooks-def.h (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
        (LANG_HOOKS_INITIALIZER): Remove it.
        * langhooks.h (struct lang_hooks): Remove reduce_bit_field_operations.

ada:
2008-03-18  Paolo Bonzini  <bonzini@gnu.org>

        * misc.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.

cp:
2008-03-18  Paolo Bonzini  <bonzini@gnu.org>

        * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.

From-SVN: r133316
2008-03-18 17:11:30 +00:00
Richard Guenther 57e2aff267 re PR c++/33887 (Reference to bitfield gets wrong value when optimizing)
2008-01-25  Richard Guenther  <rguenther@suse.de>

	PR c++/33887
	* cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define
	to true.

	* g++.dg/torture/pr33887-1.C: New testcase.
	* g++.dg/torture/pr33887-2.C: Likewise.
	* g++.dg/torture/pr33887-3.C: Likewise.
	* gcc.c-torture/execute/20071211-1.c: Likewise.

From-SVN: r131823
2008-01-25 12:06:31 +00:00
Alexandre Oliva 394d9fe79e re PR debug/7081 (DWARF enhancements for C++)
gcc/ChangeLog:
PR debug/7081
* dwarf2out.c (dwarf_tag_name): Synchronize with dwarf2.h.
(is_type_die): Cover interface types.
(class_or_namespace_scope_p): Cover interface and class types.
(record_type_tag): New.
(gen_inlined_structure_type_die): Use it.
(gen_struct_or_union_type_die): Likewise.
(prune_unused_types_walk): Cover interface types.
* langhooks.h (classify_record): New enum.
(classify_record): New member in struct langhooks_for_types.
* langhooks-def.h (LANG_HOOKS_CLASSIFY_RECORD): New.
(LANGHOOKS_FOR_TYPES_INITIALIZER): Adjust.
gcc/cp/ChangeLog:
PR debug/7081
* cp-lang.c (cp_classify_record): New.
(LANG_HOOKS_CLASSIFY_RECORD): Override.
gcc/java/ChangeLog:
PR debug/7081
* lang.c (java_classify_record): New.
(LANG_HOOKS_CLASSIFY_RECORD): Override.

From-SVN: r130960
2007-12-15 20:19:23 +00:00
Nick Clifton e77f031de8 typeck.c: Change copyright header to refer to version 3 of the GNU General Public...
* typeck.c: Change copyright header to refer to version 3 of the GNU General 
  Public License and to point readers at the COPYING3 file and the FSF's license
  web page.
* optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c, config-lang.in, 
  cp-tree.def, call.c, decl.h, ptree.c, Make-lang.in, method.c, rtti.c, 
  cp-objcp-common.c, g++spec.c, cp-objcp-common.h, except.c, error.c, 
  operators.def, cvt.c, tree.c, mangle.c, cp-tree.h, dump.c, search.c, 
  friend.c, expr.c, cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, 
  pt.c, cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
  name-lookup.h, parser.c: Likewise.

From-SVN: r127154
2007-08-02 10:36:13 +00:00
Lawrence Crowl 39ef65923c invoke.texi (Debugging Options): Add documentation for the -femit-struct-debug options...
./:	* doc/invoke.texi (Debugging Options): Add documentation for the
	-femit-struct-debug options -femit-struct-debug-baseonly,
	-femit-struct-debug-reduced, and
	-femit-struct-debug-detailed[=...].

	* c-opts.c (c_common_handle_option): Add
	OPT_femit_struct_debug_baseonly, OPT_femit_struct_debug_reduced,
	and OPT_femit_struct_debug_detailed_.
	* c.opt: Add specifications for
	-femit-struct-debug-baseonly, -femit-struct-debug-reduced,
	and -femit-struct-debug-detailed[=...].
	* opts.c (set_struct_debug_option): Parse the
	-femit-struct-debug-... options.
	* opts.c (matches_main_base, main_input_basename,
	main_input_baselength, base_of_path, matches_main_base): Add
	variables and functions to compare header base name to compilation
	unit base name.
	* opts.c (should_emit_struct_debug): Add to determine to emit a
	structure based on the option.
	(dump_struct_debug) Also disabled function to debug this
	function.
	* opts.c (handle_options): Save the base name of the
	compilation unit.

	* langhooks-def.h (LANG_HOOKS_GENERIC_TYPE_P): Define.
        (LANG_HOOKS_FOR_TYPES_INITIALIZER): Add.
	This hook indicates if a type is generic.  Set it by default
	to "never generic".
	* langhooks.h (struct lang_hooks_for_types): Add a new hook
	to determine if a struct type is generic or not.
	* cp/cp-tree.h (class_tmpl_impl_spec_p): Declare a C++ hook.
	* cp/tree.c (class_tmpl_impl_spec_p): Implement the C++ hook.
	* cp/cp-lang.c (LANG_HOOKS_GENERIC_TYPE_P): Override null C hook
	with live C++ hook.

	* flags.h (enum debug_info_usage): Add an enumeration to describe
	a program's use of a structure type.
	* dwarf2out.c (gen_struct_or_union_type_die): Add a new parameter
	to indicate the program's usage of the type.  Filter structs based
	on the -femit-struct-debug-... specification.
	(gen_type_die): Split into two routines, gen_type_die and
	gen_type_die_with_usage.  gen_type_die is now a wrapper
	that assumes direct usage.
	(gen_type_die_with_usage): Replace calls to gen_type_die
	with gen_type_die_with_usage adding the program usage of
	the referenced type.
	(dwarf2out_imported_module_or_decl): Suppress struct debug
	information using should_emit_struct_debug when appropriate.
testsuite/:
	* g++.dg/other/fesd-any.C: Test -femit-struct-debug-detailed=any.
	* g++.dg/other/fesd-any.h: Test -femit-struct-debug-detailed=any.
	* g++.dg/other/fesd-baseonly.C: Test -femit-struct-debug-baseonly.
	* g++.dg/other/fesd-baseonly.h: Test -femit-struct-debug-baseonly.
	* g++.dg/other/fesd-none.C: Test -femit-struct-debug-detailed=none.
	* g++.dg/other/fesd-none.h: Test -femit-struct-debug-detailed=none.
	* g++.dg/other/fesd-reduced.C: Test -femit-struct-debug-reduced.
	* g++.dg/other/fesd-reduced.h: Test -femit-struct-debug-reduced.
	* g++.dg/other/fesd-sys.C: Test -femit-struct-debug-detailed=sys.
	* g++.dg/other/fesd-sys.h: Test -femit-struct-debug-detailed=sys.
	* g++.dg/other/fesd.h: Common to -femit-struct-debug-... tests.

	* gcc.dg/fesd-any.c: Test -femit-struct-debug-detailed=any.
	* gcc.dg/fesd-any.h: Test -femit-struct-debug-detailed=any.
	* gcc.dg/fesd-baseonly.c: Test -femit-struct-debug-baseonly.
	* gcc.dg/fesd-baseonly.h: Test -femit-struct-debug-baseonly.
	* gcc.dg/fesd-none.c: Test -femit-struct-debug-detailed=none.
	* gcc.dg/fesd-none.h: Test -femit-struct-debug-detailed=none.
	* gcc.dg/fesd-reduced.c: Test -femit-struct-debug-reduced.
	* gcc.dg/fesd-reduced.h: Test -femit-struct-debug-reduced.
	* gcc.dg/fesd-sys.c: Test -femit-struct-debug-detailed=sys.
	* gcc.dg/fesd-sys.h: Test -femit-struct-debug-detailed=sys.
	* gcc.dg/fesd.h: Common to -femit-struct-debug-... tests.

From-SVN: r123909
2007-04-17 06:19:36 +00:00
Michael Matz a0ad3539f4 dwarf2out.c (add_AT_string): Call ggc_strdup once per string.
* dwarf2out.c (add_AT_string): Call ggc_strdup once per string.
        (type_tag): Use lang_hooks.dwarf_name instead of DECL_NAME.

        * cp-tree.h (TFF_NO_OUTER_SCOPE): New formatting flag.
        * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
        dump_function_decl): Guard emitting outer scopes by new flag.
        * cp-lang.c (cxx_dwarf_name): New function.
        (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
        * pt.c (classtype_mangled_name, mangle_class_name_for_template):
        Remove functions.
        (push_template_decl_real, lookup_template_class): Remove calls
        to above functions.

From-SVN: r122230
2007-02-22 17:03:48 +00:00
Geoffrey Keating e430546039 In gcc/:
* toplev.c (compile_file): Call final_write_globals
	even if there have been errors.
In gcc/cp/:
	* decl2.c (cp_write_global_declarations): Rename from
	cp_finish_file.
	* cp-lang.c (finish_file): Don't call cp_finish_file.
	* cp-tree.h (cp_write_global_declarations): Rename from
	cp_finish_file.
	* cp-objcp-common.h (LANG_HOOKS_WRITE_GLOBALS): Define to
	cp_write_global_declarations.

From-SVN: r118362
2006-11-01 05:16:14 +00:00
Mike Stump 3db45ab592 Fix up whitespacing
From-SVN: r114428
2006-06-06 11:44:09 +00:00
Richard Henderson 9bfa80fb88 dbxout.c: Include expr.h.
* dbxout.c: Include expr.h.
        (dbxout_global_decl): Don't suppress for DECL_RTL unset.
        (dbxout_symbol): Handle DECL_VALUE_EXPR.
        * Makefile.in (dbxout.o): Add EXPR_H.
cp/
        * cp-tree.def (ALIAS_DECL): Remove.
        * cp-lang.c (cp_init_ts): Remove support for it.
        * error.c (dump_decl): Likewise.
        * name-lookup.c (pushdecl): Likewise.
        * semantics.c (finish_id_expression): Likewise.
        * decl2.c (build_anon_union_vars): Use a VAR_DECL with
        DECL_VALUE_EXPR instead.

From-SVN: r104106
2005-09-09 14:00:49 -07:00
Andrew Pinski 3ed8593d45 cp-lang.c (shadowed_var_for_decl, [...]): Move over to cp-objcp-common.c.
2005-07-09  Andrew Pinski  <pinskia@physics.uc.edu>

        * cp-lang.c (shadowed_var_for_decl, decl_shadowed_for_var_lookup,
        decl_shadowed_for_var_insert): Move over to cp-objcp-common.c.
        (cp_init_ts): Call init_shadowed_var_for_decl.
        Remove include of gt-cp-cp-lang.h.
        * cp-objcp-common.c (shadowed_var_for_decl,
        decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Moved from
        cp-lang.c.
        (init_shadowed_var_for_decl): New function to initialize
        shadowed_var_for_decl.
        Include gt-cp-cp-objcp-common.h.
        * Make-lang.in (gt-cp-lang.h): Remove.
        (gt-cp-cp-objcp-common.h): Add.
        (cp/cp-lang.o): Remove dependancy on gt-cp-lang.h.
        (cp/cp-objcp-common.o): Add dependancy on gt-cp-cp-objcp-common.h.
        * config-lang.in (gtfiles): Remove cp-lang.c and Add cp-objcp-common.c.
        * cp-tree (init_shadowed_var_for_decl): Add prototype.

2005-07-09  Andrew Pinski  <pinskia@physics.uc.edu>

        * config-lang.in (gtfiles): Add cp-objcp-common.c.
        * objcp-lang.c (objcxx_init_ts): New function.
        (LANG_HOOKS_INIT_TS): Define.

From-SVN: r101830
2005-07-09 08:45:09 -07:00
Daniel Berlin 820cc88fbd Makefile.in (TREE_H): Add treestruct.def.
2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* Makefile.in (TREE_H): Add treestruct.def.
	(c-decl.o): Add pointer-set.h
	* c-decl.c (diagnose_mismatched_decls): Don't attempt to look at
	visibility on regular DECL's.
	(merge_decls): Fix the copying of decl nodes of various types for
	the new structures.  Don't update RTL, section name, weak status,
	etc, on DECL's without RTL.
	(grokdeclarator): DECL_ARG_TYPE_AS_WRITTEN is gone.
	Don't check volatile on non-variable types.
	(store_parm_decls_oldstyle): Use pointer_set instead of DECL_WEAK
	to check whether we have seen arguments.
	* c-objc-common.c (c_tree_printer): Reverse order of tests so that
	flag is checked before field (flag is common, field is not).
	* dwarf2out.c (decl_ultimate_origin):  Only DECL's with
	TS_DECL_COMMON could have an origin.
	(add_location_or_const_value_attribute): Don't check section name
	on non-var/function decls.
	(dwarf2out_var_location): Reverse order of tests.
	* emit-rtl.c (set_reg_attrs_for_parm): DECL_CHECK is dead, replace
	with DECL_WRTL_CHECK.
	* expmed.c (make_tree): rtl is now in decl_with_rtl.
	* fold-const.c (fold_binary): Don't check weakness on
	non-var/function decls.
	(tree_expr_nonzero_p): Ditto.
	(fold_checksum_tree): Use tree_decl_extra as sizeof
	buffer.
	* ggc-page.c (extra_order_size_table): Add sizes for
	tree_decl_non_common, tree_parm_decl,  tree_var_decl, and
	tree_field_decl.
	* gimplify.c (gimplify_bind_expr): Only set
	DECL_SEEN_IN_BIND_EXPR_P on VAR_DECL.
	* integrate.c (copy_decl_for_inlining): Don't set RTL on decl's
	without RTL.
	* langhooks-def.h (LANG_HOOK_INIT_TS): New.
	* langhooks.h (init_ts). New langhook.
	* passes.c (rest_of_decl_compilation): Reverse order of tests.
	* print-tree.c (print_node): Update to only print fields that
	exist in the structures the passed decl has.
	* toplev.c (wrapup_global_declarations): Don't reset
	DECL_DEFER_OUTPUT on DECL's that don't contain it.
	* tree-browser.c (browse_tree): DECL_ARG_TYPE_AS_WRITTEN removed.
	* tree-inline.c (remap_decl): Ditto.
	* tree-outof-ssa.c (create_temp): Reverse order of tests.
	* tree-pretty-print.c (print_declaration): Don't print
	DECL_REGISTER on things that don't contain it.
	* tree-vrp.c (expr_computes_nonzero): Don't check weakness on
	non-var/function decls.
	* tree.c (tree_contains_struct): New structure.
	(init_priority_for_decl): New hashtable.
	(tree_int_map): New structure.
	(tree_int_map_eq): New function.
	(tree_int_map_marked_p): Ditto.
	(tree_int_map_hash): Ditto.
	(tree_map): Move to tree.h.
	(tree_map_eq): Externalize.
	(tree_map_hash): Ditto.
	(tree_map_marked_p): Ditto.
	(init_ttree): Set up tree_contains_struct and call langhook.
	(decl_assembler_name): Use DECL_NON_COMMON_CHECK..
	(tree_code_size): Update for new structures.
	(tree_node_structure): Update for new structures.
	(make_node_stat): Don't try to set DECL_IN_SYSTEM_HEADER on decls
	without the field.
	(copy_node_stat):  Copy init priority.
	(build_decl_stat): Ditto for visibility.
	(ts_enum_names): New.
	(tree_contains_struct_check_failed): New function.
	(decl_init_priority_lookup): Ditto.
	(decl_init_priority_insert): Ditto.
	* treestruct.def: New file.
	* tree.h (CODE_CONTAINS_STRUCT): New macro.
	(CONTAINS_STRUCT_CHECK): Ditto.
	(tree_contains_struct_check_failed): New prototype.
	(DECL_CHECK): Removed.
	(DECL_MINIMAL_CHECK): New.
	(DECL_COMMON_CHECK): Ditto.
	(DECL_WRTL_CHECK): Ditto.
	(DECL_NON_COMMON_CHECK): Ditto.
	(DECL_WITH_VIS_CHECK): Ditto.
	(VAR_OR_FUNCTION_DECL_P): Ditto
	(struct tree_decl_minimal): New structure.
	(struct tree_decl_common): Ditto.
	(struct tree_decl_with_rtl): Ditto.
	(struct tree_decl_with_vis): Ditto.
	(struct tree_decl_non_common): Ditto.
	(struct tree_field_decl): Ditto.
	(struct tree_parm_decl): Ditto.
	(struct tree_var_decl): Ditto.
	(struct tree_function_decl): Ditto.
	(struct tree_const_decl): Ditto.
	(struct tree_result_decl): Ditto.
	(union tree_node): Add new structures.
	* var-tracking.c (track_expr_p): Reverse order of tests.

	* doc/c-tree.texi: Add documentation on DECL node internal structure.


2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* utils.c (create_param_decl): DECL_ARG_TYPE_AS_WRITTEN is
	removed.

2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* Make-lang.in: Add gt-cp-lang.h.
	(cp-lang.o): Ditto.
	* class.c (create_vtable_ptr): Stop setting DECL_ASSEMBLER_NAME on
	the field.
	* config-lang.in: Add cp-lang.c to gtfiles.
	* cp-lang.c: Include hashtab.h.
	(cp_init_ts): New function.
	(LANG_HOOK_INIT_TS): Use macro.
	(decl_shadowed_for_var_lookup): New function.
	(decl_shadowed_for_var_insert): Ditto.
	* cp-tree.h (THUNK_FUNCTION_CHECK): Use decl_common.
	(NON_THUNK_FUNCTION_CHECK): Ditto.
	(DECL_NAMESPACE_ASSOCIATIONS): Use decl_non_common.
	(DECL_INIT_PRIORITY): Ditto.
	(DECL_HAS_SHADOWED_FOR_VAR_P): Ditto.
	(DECL_SHADOWED_FOR_VAR): Use hashtable.
	(SET_DECL_SHADOWED_FOR_VAR): Ditto.
	* decl.c (duplicate_decls): Update for new/updated structures.
	(poplevel): Use SET_DECL_SHADOWED_FOR_VAR.
	* decl2.c (start_static_initialization_or_destruction): Deal with
	priority.
	* pt.c (tsubst_decl): Check TS_DECL_WRTL before doing
	SET_DECL_RTL.
	* tree.c (handle_init_priority_attribute): Handle priority.

2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* objc-act.c (objc_push_parm): DECL_ARG_TYPE_AS_WRITTEN is
	removed.
	* objc-act.h (KEYWORD_ARG_NAME): Use decl_non_common.
	(KEYWORD_KEY_NAME): Use decl_minimal.
	(METHOD_SEL_NAME): Ditto..
	(METHOD_SEL_ARGS): Use decl_non_common.
	(METHOD_ADD_ARGS): Ditto.
	(METHOD_ADD_ARGS_ELLIPSIS_P): Use decl_common.
	(METHOD_DEFINITION): Ditto.
	(METHOD_ENCODING): Ditto.
	* objc-lang.c: (objc_init_ts): New function.

2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* trans-decl.c (create_function_arglist): DECL_ARG_TYPE_AS_WRITTEN
	is removed.

From-SVN: r101799
2005-07-08 23:37:11 +00:00
Zack Weinberg 39ce81c9c5 pretty-print.h (PP_NL_ARGMAX): New.
gcc:
	* pretty-print.h (PP_NL_ARGMAX): New.
	(text_info): Add locus.
	(struct chunk_info): New.
	(output_buffer): Add formatted_obstack, chunk_obstack, and
	cur_chunk_array. Change obstack to a pointer.
	(pp_wrapping_mode_t, pp_wrapping_mode, pp_set_verbatim_wrapping): New.
	(struct pretty_print_info): Replace ideal_maximum_length and
	prefixing_rule with wrapping.
	(pp_line_cutoff, pp_prefixing_rule): Update to match.
	Update prototypes and wrapper macros throughout.
	* pretty-print.c (pp_formatted_text_data, pp_append_r)
	(pp_base_clear_output_area, pp_construct, pp_base_formatted_text)
	(pp_base_last_position_in_text, pp_base_newline, pp_base_character):
	Update for changes to pp structure.
	(pp_base_prepare_to_format, pp_base_format_text): Delete.
	(pp_base_format, pp_base_output_formatted_text): New functions.
	(pp_base_format_verbatim): Use pp_set_verbatim_wrapping.
	(pp_verbatim): Clear text.locus.
	(pp_printf): Likewise.  Use pp_format and pp_output_formatted_text.
	* c-objc-common.c (c_tree_printer): Update function signature.
	* diagnostic.c (diagnostic_initialize): Update for changes to
	pp structure.
	(diagnostic_report_diagnostic): Call pp_format and then
	pp_output_formatted_text.
	(verbatim): Clear text.locus.
	* diagnostic.h (diagnostic_prefixing_rule, diagnostic_line_cutoff):
	Update for changes to pp structure.

	* c-lang.c: No need to include c-pretty-print.h.
	* Makefile.in: Remove bogus line containing only a tab.
	(c-lang.o): Update dependencies.
	* toplev.c (announce_function): Don't use verbatim.
	(default_tree_printer): Update signature.

	* objc/objc-lang.c: No need to include c-pretty-print.h.
	* objc/Make-lang.in: Update dependencies.

gcc/cp:
	* cp-lang.c: No need to include cxx-pretty-print.h.
	* error.c (cp_printer): Update signature.  No need to process
	flags.
	(print_instantiation_partial_context): Output last newline
	with pp_base_newline.
	* Make-lang.in: Update dependencies.

gcc/objcp:
	* objcp-lang.c: No need to include cxx-pretty-print.h.
	* Make-lang.in: Update dependencies.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r101481
2005-06-30 23:09:06 +00:00
Kelley Cook 1788952fea Update FSF address.
From-SVN: r101312
2005-06-25 00:59:41 +00:00
Ziemowit Laski 65958285a0 c-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Remove.
[gcc/ChangeLog]
2004-11-02  Ziemowit Laski  <zlaski@apple.com>

	* c-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Remove.
	(c_types_compatible_p): Move function definition...
	* c-objc-common.c (c_types_compatible_p): ...here.
	* c-objc-common.h (LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from
	c-lang.c.

[gcc/cp/ChangeLog]
2004-11-02  Ziemowit Laski  <zlaski@apple.com>

	* cp-lang.c (cxx_types_compatible_p): Remove prototype and definition.
	(LANG_HOOKS_TYPES_COMPATIBLE_P): Move to cp-objcp-common.h.
	* cp-objcp-common.c (cxx_types_compatible_p): Moved definition here
	from cp-lang.c.
	* cp-objcp-common.h (cxx_types_compatible_p): Moved prototype here
	from cp-lang.c.
	(LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from cp-lang.c.

From-SVN: r89997
2004-11-02 20:29:21 +00:00
Ziemowit Laski c3002ae940 cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from cp-objcp-common.h.
[gcc/cp/ChangeLog]
2004-09-21  Ziemowit Laski  <zlaski@apple.com>

        * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from
        cp-objcp-common.h.
        (objcp_tsubst_copy_and_build): Reformat function signature.
        * cp-objcp-common.h (objcp_tsubst_copy_and_build): Likewise.
        (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved to cp-lang.c.

From-SVN: r87846
2004-09-22 06:11:20 +00:00
Jeffrey D. Oldham 6615c44615 alias.c (find_base_decl): Remove unreachable case '3' block.
2004-09-17  Jeffrey D. Oldham  <oldham@codesourcery.com>
	    Zack Weinberg  <zack@codesourcery.com>

	* alias.c (find_base_decl): Remove unreachable case '3' block.
	* expr.c (safe_from_p): Abort if passed a type.
	* tree-gimple.c (recalculate_side_effects): Abort if passed
	anything other than an expression.
	* tree-ssa-pre.c (phi_translate): Return expr immediately if
	is_gimple_min_invariant is true for it.  Reorder cases for clarity.
	Abort on un-handled tree classes.
	(valid_in_set): Likewise.
	* tree.c (tree_code_class_strings): New static data.

	* tree.h (enum tree_code_class): New.
	(tree_code_class_strings): Declare.
	(TREE_CODE_CLASS_STRING, EXCEPTIONAL_CLASS_P, CONSTANT_CLASS_P)
	(REFERENCE_CLASS_P, COMPARISON_CLASS_P, UNARY_CLASS_P, BINARY_CLASS_P)
	(STATEMENT_CLASS_P, EXPRESSION_CLASS_P, IS_TYPE_OR_DECL_P): New macros.
	(TYPE_P, DECL_P, IS_NON_TYPE_CODE_CLASS, IS_EXPR_CODE_CLASS)
	(checking macros, EXPR_LOCATION, SET_EXPR_LOCATION, EXPR_LOCUS): Update.

	* tree.def, c-common.def, objc/objc-tree.def: Use
	tree_code_class enumeration constants instead of code letters.

	* alias.c, builtins.c, c-common.c, c-format.c, c-lang.c, c-pragma.c
	* c-typeck.c, cgraphunit.c, convert.c, dbxout.c, dwarf2out.c
	* emit-rtl.c expr.c, fold-const.c, gimplify.c, lambda-code.c
	* langhooks.c, langhooks.h, predict.c, print-tree.c, reload1.c, stmt.c
	* tree-browser.c, tree-cfg.c, tree-chrec.c, tree-complex.c, tree-dfa.c
	* tree-dump.c, tree-eh.c, tree-gimple.c, tree-inline.c, tree-nested.c
	* tree-outof-ssa.c, tree-pretty-print.c, tree-sra.c, tree-ssa-ccp.c
	* tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-forwprop.c, tree-ssa-live.c
	* tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-operands.c
	* tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-propagate.c
	* tree-ssa.c, tree-ssanames.c, tree-tailcall.c, tree.c, varasm.c
	* config/sol2-c.c, config/arm/arm.c, config/i386/winnt.c
	* config/pa/pa.c, config/pa/pa.h, config/sh/sh.c, objc/objc-lang.c
	Update to match.

	* LANGUAGES: Add note about change.

ada:
	* ada-tree.def: Use tree_code_class enumeration constants
	instead of code letters.
	* ada-tree.h, decl.c, misc.c, trans.c, utils.c, utils2.c:
	Update for new tree-class enumeration constants.

cp:
	* cp-tree.def: Use tree_code_class enumeration constants
	instead of code letters.
	* call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c
	* mangle.c, pt.c, semantics.c, tree.c, typeck.c:
	Update for new tree-class enumeration constants.

fortran:
	* f95-lang.c, trans-expr.c, trans.c: Update for new tree-class
	enumeration constants.

java:
	* java-tree.def: Use tree_code_class enumeration constants
	instead of code letters.
	* java-gimplify.c, jcf-write.c, lang.c, parse.y: Update for
	new tree-class enumeration constants.

treelang:
	* treetree.c: Update for new tree-class enumeration constants.

From-SVN: r87675
2004-09-17 21:55:02 +00:00
Ziemowit Laski 11bb4b2798 Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
2004-08-31  Ziemowit Laski  <zlaski@apple.com>

        * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
        (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
        (cp/cp-decl.c): Do not depend on gtype-cp.h.
        (cp/cp-objcp-common.o): New target.
        * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
        (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
        cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
        prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
        respectively.
        (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
        LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
        LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
        LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
        LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
        LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
        LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
        LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
        LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
        LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
        LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
        LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
        LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
        LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
        LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
        LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
        LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
        LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
        LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
        LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
        LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
        LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
        LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
        LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
        LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
        LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
        LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
        LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
        LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
        LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
        LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
        hooks to cp-objcp-common.h.
        (finish_file): New function.
        * cp-objcp-common.c: New file.
        * cp-objcp-common.h: New file.
        * cp-tree.h (cp_finish_file): New prototype.
        * decl.c: Do not include gtype-cp.h.
        * decl2.c (finish_file): Rename to cp_finish_file.

From-SVN: r86837
2004-08-31 18:51:08 +00:00
Nathan Sidwell 8dc2b10365 call.c (check_dtor_name): Replace abort with gcc_assert or gcc_unreachable.
* call.c (check_dtor_name): Replace abort with gcc_assert or
	gcc_unreachable.
	(build_call, add_builtin_candidate, build_new_op,
	convert_like_real, build_over_call, in_charge_arg_for_name,
	source_type, joust): Likewise.
	* class.c (build_simple_base_path, get_vcall_index,
	finish_struct_1, instantiate_type, get_enclosing_class,
	add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
	* cp-gimplify.c (cp_genericize): Likewise.
	* cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
	* cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
	* decl.c (poplevel, make_unbound_class_template, reshape_init,
	check_special_function_return_type, grokdeclarator,
	grok_op_properties, tag_name, xref_tag, start_preparsed_function,
	finish_function): Likewise.
	* decl2.c (grokfield, maybe_emit_vtables):Likewise.
	* error.c (dump_global_iord, dump_decl, dump_template_decl,
	language_to_string): Likewise.
	* except.c (choose_personality_routine): Likewise.
	* friend.c (do_friend): Likewise.
	* g++spec.c (lang_specific_driver): Likewise.
	* init.c (build_zero_init, expand_default_init, build_new_1,
	build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
	* lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
	* mangle.c (add_substitution, write_unscoped_name,
	write_template_prefix, write_identifier,
	write_special_name_destructor, write_type, write_builtin_type,
	write_expression, write_template_param,
	write_java_integer_type_codes): Likewise.
	* method.c (implicitly_declare_fn): Likewise.

From-SVN: r86778
2004-08-30 15:28:48 +00:00
Eric Christopher 9f63daea37 c-common.c (c_common_unsafe_for_reeval): Delete.
2004-07-28  Eric Christopher  <echristo@redhat.com>

	* c-common.c (c_common_unsafe_for_reeval): Delete.
	* c-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete use.
	* c-pretty-print.c (pp_c_expression): Delete UNSAVE_EXPR case.
	* calls.c (fix_unsafe_tree): Delete.
	(expand_call): Delete code which used above.
	* dojump.c (do_jump): Delete UNSAVE_EXPR case.
	* expr.c (expand_expr_real_1): Ditto.
	* fold-const.c (non_lvalue): Ditto.
	* langhooks-def.h (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
	(lhd_unsafe_for_reeval): Ditto.
	* langhooks.c (lhd_unsafe_for_reeval): Ditto.
	* langhooks.h (unsafe_for_reeval): Ditto.
	(unsave_expr_now): Adjust comment.
	* tree-inline.c (copy_body_r): Delete UNSAVE_EXPR bits.
	(estimate_num_insns_1): Ditto.
	* tree-pretty-print.c (dump_generic_node): Ditto.
	* tree.c (expr_align): Ditto.
	(unsave_expr): Delete.
	(unsafe_for_reeval): Ditto.
	* tree.h (unsafe_for_reeval, unsave_expr): Ditto.
	* tree.def (UNSAVE_EXPR): Delete.
	* objc/objc-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.

2004-07-28  Eric Christopher  <echristo@redhat.com>

	* cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.

2004-07-28  Eric Christopher  <echristo@redhat.com>

	* lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
	(java_unsafe_for_reeval): Ditto.

From-SVN: r85276
2004-07-28 23:44:56 +00:00
Steven Bosscher 406d77a4bb cp-tree.def (TINST_LEVEL): Make it an 'x' node.
* cp-tree.def (TINST_LEVEL): Make it an 'x' node.
	* cp-tree.h (tinst_level_t): New tree type.
	(union lang_tree_node): Handle it.
	(TINST_LOCATION): New accessor macro.
	(make_tinst_level): New prototype.
	* cp-lang.c (cp_tree_size): Handle TINST_LEVEL.
	* decl.c (cp_tree_node_structure): Likewise.
	* error.c (print_instantiation_full_context): Use TINST_LOCATION.
	(print_instantiation_partial_context): Likewise.
	* pt.c (pop_tinst_level): Likewise.
	 (push_tinst_level): Use make_tinst_level.
	* tree.c (make_tinst_level): New function.
	(cp_walk_subtrees): Walk TINST_DECL for a TINST_LEVEL node.

From-SVN: r84977
2004-07-20 23:20:08 +00:00
Richard Henderson 7740f00d54 langhooks-def.h (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING, [...]): Remove.
* langhooks-def.h (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING,
        lhd_tree_inlining_copy_res_decl_for_inlining): Remove.
        * langhooks.c (lhd_tree_inlining_copy_res_decl_for_inlining): Remove.
        * langhooks.h (struct lang_hooks_for_tree_inlining): Remove
        copy_res_decl_for_inlining.

        * tree-inline.c (declare_return_variable): New modify_dest argument.
        Use it as the return value, when possible or manditory.  Handle
        TREE_ADDRESSABLE types.
        (expand_call_inline): Extract MODIFY_EXPR lhs for call.  Simplify
        replacement of CALL_EXPR.

cp/
        * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die.
        * cp-tree.h (cp_copy_res_decl_for_inlining): Remove.
        * tree.c (cp_copy_res_decl_for_inlining): Remove.

From-SVN: r84831
2004-07-16 13:51:31 -07:00
Jason Merrill 27f1984e92 undo reversion
From-SVN: r84822
2004-07-16 13:11:06 -04:00
Jason Merrill 043fdfc83e revert: cp-lang.c (cxx_types_compatible_p): To the middle-end, references and pointers are compatible.
revert:
        * cp-lang.c (cxx_types_compatible_p): To the middle-end,
        references and pointers are compatible.

From-SVN: r84820
2004-07-16 13:06:56 -04:00
Jason Merrill e4f78bd4af re PR middle-end/15885 (wrong va_start warning (and code))
* cp-lang.c (cxx_types_compatible_p): To the middle-end,
        references and pointers are compatible.

        PR middle-end/15885
        * gimplify.c (gimplify_arg): New fn, split out from...
        (gimplify_call_expr): Here.  Special-case BUILT_IN_VA_START.

From-SVN: r84782
2004-07-15 17:50:51 -04:00
Joseph Myers 9dcf6e7366 langhooks.h (estimate_num_insns, [...]): Remove hooks.
* langhooks.h (estimate_num_insns, pushlevel, poplevel, set_block,
	maybe_build_cleanup, update_decl_after_saving): Remove hooks.
	* langhooks.c (lhd_clear_binding_stack): Remove.
	* langhooks-def.h (lhd_clear_binding_stack,
	LANG_HOOKS_MAYBE_BUILD_CLEANUP,
	LANG_HOOKS_UPDATE_DECL_AFTER_SAVING,
	LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS, LANG_HOOKS_PUSHLEVEL,
	LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK): Remove.
	(LANG_HOOKS_CLEAR_BINDING_STACK): Define to lhd_do_nothing.
	* system.h (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS,
	LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_SET_BLOCK,
	LANG_HOOKS_MAYBE_BUILD_CLEANUP,
	LANG_HOOKS_UPDATE_DECL_AFTER_SAVING, LANG_HOOKS_POPLEVEL): Poison.
	* tree.h (poplevel): Don't declare.
	* c-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_PUSHLEVEL,
	LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK): Remove.
	* objc/objc-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK,
	LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK):
	Remove.

ada:
	* misc.c (LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_PUSHLEVEL,
	LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK): Remove.

cp:
	* cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL,
	LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove.
	* cp-tree.h (poplevel): Declare.
	(set_block): Remove.
	* decl.c (set_block): Remove.

fortran:
	* f95-lang.c (set_block): Remove.
	(gfc_clear_binding_stack): New.
	(LANG_HOOKS_CLEAR_BINDING_STACK): Define.
	(struct binding_level): Remove block_created_by_back_end.
	(clear_binding_level): Likewise.
	(poplevel): Don't handle block_created_by_back_end.

java:
	* java-tree.h (set_block): Remove.
	* lang.c (java_clear_binding_stack): New.
	(LANG_HOOKS_CLEAR_BINDING_STACK): Define.
	* decl.c (struct binding_level): Remove this_block.
	(clear_binding_level): Likewise.
	(poplevel): Don't handle this_block.
	(set_block): Remove.

treelang:
	* treetree.c (set_block): Remove.
	(struct binding_level): Remove block_created_by_back_end.
	(clear_binding_level): Likewise.
	(tree_code_create_function_initial,
	tree_code_create_function_wrapup): Call pushlevel and poplevel
	directly rather than through hooks.
	(poplevel): Don't handle block_created_by_back_end.

From-SVN: r84499
2004-07-11 10:53:06 +01:00
Richard Kenner 5377d5ba39 langhooks-def.h (LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P): Extra arg.
* langhooks-def.h (LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P): Extra arg.
	* langhooks.h (var_mod_type_p): Likewise.
	* c-decl.c (finish_decl): Add extra arg to variably_modified_type_p.
	* expr.c (count_type_elements): Properly handle return from
	array_type_nelts and properly test for overflow.
	* gimplify.c (gimplify_init_constructor): Properly handle return
	from array_type_nelts.
	(gimplify_addr_expr): Remove redundant clear of TREE_SIDE_EFFECTS.
	* integrate.c (copy_decl_for_inlining): Correct comments.
	* tree-inline.c (remap_decl): Update comments, remove dead code,
	and copy DECL_FIELD_OFFSET and DECL_QUALIFIER, if they exist.
	(remap_type): Only remap if variably modified by vars in function
	being inlined.
	(copy_body_r): Use compatible_type langhooks to see when can fold.
	(setup_one_parameter): Don't remap type.
	(inline_forbidden_p_1): Add arg to variably_modified_type_p.
	* tree.c (recompute_tree_invarant_for_addr_expr): Properly
	compute TREE_INVARIANT for decl case.
	(find_var_from_fn): New function.
	(variably_modified_type_p): Add arg and call new function.
	* tree.h (variably_modified_type_p): Add extra arg.

	* cp/cp-lang.c (cp_var_mod_type_p): Add extra arg.
	* cp/decl.c (grokdeclarator): Extra arg to variably_modified_type_p.
	* cp/pt.c (check_instantiated_args, unify): Likewise.

From-SVN: r84144
2004-07-05 22:20:16 -04:00
Richard Kenner 350fae6628 c-common.c (c_safe_from_p, [...]): Deleted.
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-26 17:11:23 -04:00
Richard Henderson 0f59171d71 tree.def (VTABLE_REF): Remove.
* tree.def (VTABLE_REF): Remove.
        (OBJ_TYPE_REF): New.
        (TRY_CATCH_EXPR, TRY_FINALLY_EXPR): Set type 's'.
        * expr.c (expand_expr_real_1): Replace VTABLE_REF with OBJ_TYPE_REF.
        * fold-const.c (non_lvalue): Likewise.
        * gimplify.c (gimplify_expr): Likewise.
        (gimplify_call_expr): Use is_gimple_call_addr.
        * langhooks-def.h (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
        * langhooks.h (fold_obj_type_ref): New.
        * tree-gimple.c (is_gimple_call_addr): New.
        * tree-gimple.h (is_gimple_call_addr): Declare.
        * tree-inline.c (inlinable_function_p): Fix merge error.
        (estimate_num_insns_1): Replace VTABLE_REF with OBJ_TYPE_REF.
        * tree-pretty-print.c (dump_generic_node): Likewise.
        (print_call_name): Handle OBJ_TYPE_REF.
        * tree-ssa-ccp.c (fold_stmt): Fold OBJ_TYPE_REF.
        * tree-ssa-operands.c (get_expr_operands): Handle OBJ_TYPE_REF.
        * tree.h (OBJ_TYPE_REF_EXPR): New.
        (OBJ_TYPE_REF_OBJECT, OBJ_TYPE_REF_TOKEN): New.
        * doc/c-tree.texi (VTABLE_REF): Remove.
        * objc/objc-act.c (build_objc_method_call): Build an OBJ_TYPE_REF.
cp/
        * class.c (build_vfn_ref): Take a pointer not object.  Build
        an OBJ_TYPE_REF.
        (cp_fold_obj_type_ref): New.
        * call.c (build_over_call): Update build_vfn_ref call.
        * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
        * cp-tree.h (cp_fold_obj_type_ref): Declare.
testsuite/
        * g++.dg/opt/devirt1.C: New.

From-SVN: r83531
2004-06-22 17:26:04 -07:00
Zack Weinberg 84b8b0e04d c-common.h (has_c_linkage): New interface.
* c-common.h (has_c_linkage): New interface.
	* c-cppbuiltin.c: Include target.h.
	(c_cpp_builtins): Define __PRAGMA_REDEFINE_EXTNAME and
	__PRAGMA_EXTERN_PREFIX when appropriate.
	* c-pragma.c: Include target.h.
	Document clarified semantics of symbol-renaming #pragmas.
	(handle_pragma_redefine_extname, handle_pragma_extern_prefix)
	(maybe_apply_renaming_pragma): Rewrite according to clarified
	semantics.  Always recognize, but do not necessarily execute.
	(init_pragma): Unconditionally register symbol-renaming pragmas.
	* system.h: Poison HANDLE_PRAGMA_REDEFINE_EXTNAME
	and HANDLE_PRAGMA_EXTERN_PREFIX.
	* target.h (struct gcc_target): Add handle_pragma_redefine_extname
	and handle_pragma_extern_prefix flags.
	* target-def.h: Add defaults for TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME
	and TARGET_HANDLE_PRAGMA_EXTERN_PREFIX.
	* Makefile.in (c-pragma.o, c-cppbuiltin.o): Update dependencies.
	* config/sol2.h: Define TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME,
	not HANDLE_PRAGMA_REDEFINE_EXTNAME.
	(TARGET_OS_CPP_BUILTINS): No need to define __PRAGMA_REDEFINE_EXTNAME.
	(TRANSFER_FROM_TRAMPOLINE): Prototype mprotect.
	* config/alpha/osf.h: Define TARGET_HANDLE_PRAGMA_EXTERN_PREFIX,
	not HANDLE_PRAGMA_EXTERN_PREFIX.
	(TARGET_OS_CPP_BUILTINS): No need to define __PRAGMA_EXTERN_PREFIX.
	* doc/extend.texi (Solaris Pragmas, Tru64 Pragmas): Combine
	into one section "Symbol-Renaming Pragmas"; clarify; document
	adjusted semantics.

	* builtins.c (expand_builtin): Do not issue error for a builtin
	with no special case code and no DECL_ASSEMBLER_NAME; just do the
	library call.
	* c-decl.c (builtin_function): Don't call make_decl_rtl.
	* c-objc-common.c (has_c_linkage): Stub implementation.
	* cgraphunit.c (cgraph_expand_function)
	(cgraph_remove_unreachable_nodes): Don't clear DECL_ARGUMENTS.

cp:
	* cp-lang.c (has_c_linkage): Implement.

	* cp-tree.h (set_mangled_name_for_decl): Don't prototype.
	* decl.c (duplicate_decls): Use COPY_DECL_RTL.
	(builtin_function_1): Don't call make_decl_rtl.
	(build_cp_library_fn): Don't call set_mangled_name_for_decl.
	(grokvardecl): Don't call mangle_decl.
	* except.c (nothrow_libfn_p): Look at DECL_NAME, not
	DECL_ASSEMBLER_NAME.
	* method.c (set_mangled_name_for_decl): Delete.
	* name-lookup.c (pushdecl): When a local extern shadows a
	file-scope declaration of the same object, give both DECLs the
	same DECL_UID.
	* typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE
	on DECL_ASSEMBLER_NAME.

testsuite:
	* g++.dg/expr/enum1.C, g++.dg/opt/const3.C: Declare abort with
	extern "C".
	* g++.dg/other/pragma-re-1.C: Add comments.

From-SVN: r83405
2004-06-20 08:34:54 +00:00
Richard Henderson 325c369115 c-common.c (lang_gimplify_stmt): Remove next_p argument.
* 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-15 18:21:38 -07:00
Andrew Pinski 3c79fa86db c-decl.c (c_expand_body_1): Remove and fold back into ...
ChangeLog:
	* c-decl.c (c_expand_body_1): Remove and fold back into ...
	(c_expand_body): here.
	(c_expand_decl): Move to ...
	* c-common.c (c_expand_decl): Here and remove check for nested
	functions.
	* c-common.h (c_expand_decl): Add prototype.
	* c-tree.h (c_expand_decl): Remove.

cp/ChangeLog:
	* cp-lang.c (cp_expand_decl): Remove.
	(LANG_HOOKS_EXPAND_DECL): Use c_expand_decl.

From-SVN: r82469
2004-05-30 16:53:32 -07:00
Diego Novillo 6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00
Jason Merrill 00bfffa4c0 Refer to base members using COMPONENT_REFs where possible.
* class.c (build_simple_base_path): New fn.
        (build_base_path): Use it for non-virtual base references.
        (layout_class_type): Change base fields to their real type
        after layout is done.
        * cp-tree.h (IS_FAKE_BASE_TYPE): New macro.
        * cp-lang.c (cxx_get_alias_set): Use it.

From-SVN: r81349
2004-04-30 13:25:42 -04:00
Jan Hubicka 18c6ada9b2 cgraph.c: Add overall comment.
* cgraph.c: Add overall comment.
	(cgraph_inline_hash): New global variable.
	(cgraph_create_node): Break out from ...
	(cgraph_node): ... here.
	(cgraph_edge): New function.
	(cgraph_create_edge): New CALL_EXPR argument; some sanity checking.
	(cgraph_remove_edge): Accept edge, intead of source and destination.
	(cgraph_redirect_edge_callee): New.
	(cgraph_remove_node): Update all new datastructures.
	(cgraph_record_call, cgraph_remove_call): Kill.
	(dump_cgraph_node): Break out from ... ; dump new datastructures.
	(dump_cgraph): ... here.
	(cgraph_function_possibly_inlined_p): Use new hashtable.
	(cgraph_clone_edge, cgraph_clone_node): New.
	* cgraph.h: Include hashtab.h
	(struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output
	fields, add inlined_to pointer.
	(cgraph_node): Add pointer to next_clone.
	(cgraph_remove_edge, cgraph_create_edge): Update prototype.
	(cgraph_remove_call, cgraph_record_call): Kill.
	(cgraph_inline_hash): Declare.
	(dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node,
	cgraph_redirect_edge_callee): Declare.
	(cgraph_create_edges, cgraph_inline_p): Update prorotype.
	(cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node,
	cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare.
	* cgraphunit.c: Add overall comment.
	(cgraph_optimize_function): Kill.
	(cgraph_assemble_pending_functions): Do not assemble inline clones.
	(cgraph_finalize_function): Update call of cgraph_remove_node
	(record_call_1): Record call sites.
	(cgraph_create_edges): Accept node instead of decl argument.
	(error_found): New static variable.
	(verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions.
	(cgraph_analyze_function): Update for new datastructures.
	(cgraph_finalize_compilation_unit): Plug memory leak.
	(cgraph_optimize_function): Kill.
	(cgraph_expand_function): Do not use cgraph_optimize_function.
	(INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into,
	cgraph_inlined_callees): Kill.
	(cgraph_remove_unreachable_nodes): Verify cgraph; update handling of
	clones.
	(estimate_growth): Simplify.
	(cgraph_clone_inlined_nodes): New function.
	(cgraph_mark_inline_edge): Re-implement.
	(cgraph_mark_inline): Likewise.
	(cgraph_check_inline_limits): Simplify.
	(cgraph_recursive_inlining_p): New.
	(update_callee_keys): Break out from ...
	(cgraph_decide_inlining_of_small_functions): ... here; simplify.
	(cgraph_decide_inlining, cgraph_decide_inlining_incrementally):
	Likewise.
	(cgraph_expand_all_functions):  Remove inline clones from the ordered
	list.
	(cgraph_preserve_function_body_p): New predicate.
	(cgraph_optimize): Verify cgraph.
	* function.h (struct function): Add fields saved_tree/saved_args.
	* timevar.def (TV_CGRAPH_VERIFY): Use verifier.
	* toplev.c (rest_of_compilation): Do not free cfun.
	* tree-inline.c: Include function.h
	(struct inline_data): Add saving_p field; replace decl/current_decl by
	node/current_node.
	(insert_decl_map): New function.
	(copy_body_r): Handle saving; update cgraph datastructure.
	(copy_body): Handle recursive inlining.
	(initialize_inlined_parameters): Likewise.
	(expand_call_inline): Propagate node attributes; update cgraph.
	(optimize_inline_calls): Verify that datastructure still match.
	(save_body): New function.
	* tree-inline.h (save_body): New.
	* tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining.
	* langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New.
	* langhooks.c (lang_hooks): Add update_decl_after_saving.

	* cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
	* cp-tree.h (cp_update_decl_after_saving): Declare.
	* tree.c (cp_update_decl_after_saving): Define.

	* Make-lang.in (com.o): Add dependnecy on function.h
	* com.c: Include function.h
	(finish_function): Clear DECL_STRUCT_FUNCTION.

	* utils.c: Include function.h
	(end_subprog_body): Clear DECL_STRUCT_FUNCTION.

From-SVN: r80334
2004-04-01 23:28:15 +00:00
Zack Weinberg f75fbaf754 PR 12267, 12391, 12560, 13129, 14114, 14113
* c-tree.h: Forward declare struct c_binding.  Declare
	c_override_bindings_to_false.  Update prototypes.
	(struct lang_identifier): Update comments.  Change fields to be
	struct c_binding *.
	(IDENTIFIER_SYMBOL_VALUE, IDENTIFIER_TAG_VALUE)
	(IDENTIFIER_LABEL_VALUE, C_DECL_INVISIBLE)
	(KEEP_NO, KEEP_YES, KEEP_MAYBE): Delete.
	(C_DECL_IN_EXTERNAL_SCOPE, C_DECL_DECLARED_BUILTIN): New.
	* c-common.h: Update prototypes.
	* c-decl.c (struct c_scope): Update commentary.  Remove names,
	names_last, parms, parms_last, tags, and shadowed fields.  Add
	bindings and depth fields.
	(scope_freelist): Move to more appropriate location.
	(c_print_identifier): Update for changes to struct lang_identifier.
	(objc_mark_locals_volatile): Update for new bindings structures.
	(global_bindings_p): Honor c_override_global_bindings_to_false.
	(pushlevel): Rename to push_scope; take no arguments; use the
	scope_freelist; initialize scope->depth and check for overflow.
	(poplevel): Rename to pop_scope; totally rewritten for new bindings
	structures.
	(diagnose_mismatched_decls): Use C_DECL_DECLARED_BUILTIN, not
	C_DECL_INVISIBLE, for certain decisions.  Adjust some diagnostics.
	Improve some commentary.  Adjust handling of forward parm decls.
	(merge_decls): Set C_DECL_DECLARED_BUILTIN when appropriate.
	Preserve C_DECL_IN_EXTERNAL_SCOPE.
	(warn_if_shadowing): Correct indentation.  Improve diagnostics.
	(pushdecl): Remove unnecessary assertion.  Short-circuit anonymous
	decls.  Rewrite for new bindings structures.  Improve commentary.
	Eliminate the copy_node call.
	(implicit_decl_warning): Use the "diag" idiom (as seen in
	locate_old_decl) to reduce code duplication; call locate_old_decl
	if appropriate.  Relocate to remove need for forward declaration.
	(implicitly_declare): Adjust for new bindings structures.  Kludge
	around Objective-C not-really-builtin functions.
	(undeclared_variable): Improve diagnostics.  If current_function_decl
	is nonnull but current_function_scope is null, use current_scope.
	Use bind.
	(lookup_tag): Adjust for new bindings structures.  Kludge around
	Objective-C's tag declarations that wind up in the external scope.
	(lookup_name): Adjust for new bindings structures.  Kludge around
	c-common.c's pseudo-typedefs that wind up in the external scope.
	(lookup_name_current_level): Rename lookup_name_in_scope; take a
	second argument indicating the scope to examine; rewrite for
	new bindings structures.
	(c_init_decl_processing): Adjust for renamed functions.  Do not
	initialize current_file_decl, first_builtin_decl, last_builtin_decl.
	First scope pushed is the external scope, not the global scope.
	(builtin_function): Use bind, not pushdecl.  Adjust other bits
	for new data structures.  Keep track of builtins that should be
	made visible automatically.
	(start_decl): Adjust diagnostics.  Remove unnecessary call to
	expand_decl.
	(grokparms): Return 0 if arg_types is error_mark_node.
	(get_parm_info): Rename "void_at_end" argument to "ellipsis", with
	reversed sense.  Rewrite for new bindings structures.  Do not
	leave any decls in the scope, to prevent pop_scope from doing
	contradictory things with them.
	(finish_struct, finish_enum): Remove redundant diagnostics.
	(build_enumerator): Don't cascade diagnostics for error_mark_node.
	Mark location where -pedantic changes the meaning of the program.
	(store_parm_decls_newstyle, store_parm_decls_oldstyle): Load the
	parameter decls into the function's scope structure using bind.
	Warn here about function definitions in the wrong style.
	Adjust diagnostics.
	(store_parm_decls): Correct the determination of whether a
	function was defined with a prototype.
	(c_write_global_declarations): Operate on all file decls and on
	the external scope.  Split body of the loop to...
	(c_write_global_declarations_1): ... this new function, to avoid
	code duplication.
	(truly_local_externals, first_builtin_decl, last_builtin_decl)
	(make_scope, pop_scope, in_parm_level_p, set_block)
	(any_external_decl, record_external_decl, bind_label, getdecls)
	(link_hash_hash, link_hash_eq, merge_translation_unit_decls)
	(c_reset_state): Delete.
	(visible_builtins, c_override_global_bindings_to_false)
	(c_binding, I_SYMBOL_BINDING, I_SYMBOL_DECL, I_TAG_BINDING)
	(I_TAG_DECL, I_LABEL_BINDING, I_LABEL_DECL, file_scope)
	(external_scope, binding_freelist, bind, free_binding_and_advance)
	(push_file_scope, pop_file_scope): New.
	(pushtag, pushdecl_top_level, lookup_label, declare_label)
	(define_label, c_make_fname_decl, finish_decl)
	(mark_forward_parm_decls, build_compound_literal)
	(grokdeclarator, start_function, check_for_loop_decls)
	(identifier_global_value, record_builtin_type): Minor adjustments
	for new bindings structures.  Improve diagnostics and commentary.
	* c-objc-common.c (start_cdtor, finish_cdtor): Adjust calls to
	pushlevel/poplevel respectively.
	(c_objc_common_finish_file): Don't call merge_translation_unit_decls.
	* c-opts.c (c_common_parse_file): Remove spurious ATTRIBUTE_UNUSED.
	Warn about YYDEBUG not being defined only if -dy.  Remove no-longer-
	correct loop over multiple translation units; call fatal_error if
	requested to compile more than one file at once.  (This disables
	IMA temporarily - an up-front error being preferable to a crash.)
	* c-parse.in (pushlevel, poplevel rules): Rename push_scope, pop_scope.
	(all actions): Adjust calls to pushlevel/poplevel.
	(parsing_iso_function_signature): Delete.
	(extdef_1): Fold into extdef.
	(old_style_parm_decls_1): Fold into old_style_parm_decls.  Don't
	warn here about function definitions in the wrong style.
	(after_tyle_declarator, parm_declarator_starttypename)
	(parm_declarator_nostarttypename, notype_declarator): Remove
	commented-out productions.
	(parmlist_1, parmlist_2): Use make_node, not tree_cons, to create
	an empty TREE_LIST node.  Adjust calls to get_parm_info.
	(parmlist_2 : ELLIPSIS): Tag the arg-info block with error_mark_node
	to suppress -Wold-style-definition after this error.
	(c_parse_file): Don't clear the binding stack or call
	finish_fname_decls here.  Correct comment.
	* c-typeck.c (same_translation_unit_p): Export.
	(common_type): Use c_override_global_bindings_to_false, not
	pushlevel/poplevel/declare_parm_level.
	* c-lang.c: Override LANG_HOOKS_CLEAR_BINDING_STACK,
	LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK,
	and LANG_HOOKS_GETDECLS with do-nothing stubs.
	* objc/objc-lang.c: Likewise.
	* objc/objc-act.c: Adjust all calls to pushlevel, poplevel,
	get_parm_info.
	(OBJC_VOID_AT_END): Delete; replace all uses
	with void_list_node.
	(generate_forward_declaration_to_string_table): Delete.
	* objc/objc-act.h (OCTI_STRG_DECL, UOBJC_STRINGS_decl): Delete.

	* coverage.c (create_coverage): Don't pushdecl anything.
	* langhooks.c (lhd_clear_binding_stack): Call
	lang_hooks.decls.poplevel, not poplevel.
	* tree.c (list_length): If ENABLE_TREE_CHECKING, abort on a
	circular list rather than going into an infinite loop.

cp:
	* cp-lang.c (c_reset_state): Delete.
	(push_file_scope, pop_file_scope): New stubs.
	* parser.c (c_parse_file): Call sorry() here if called more than once.

testsuite:
	* gcc.dg/Wold-style-definition-1.c, gcc.dg/builtins-30.c
	* gcc.dg/unused-4.c, gcc.dg/noncompile/label-1.c
	* gcc.dg/noncompile/label-lineno-1.c, objc.dg/naming-1.m:
	Adjust error regexps.
	* gcc.dg/Wshadow-2.c, gcc.dg/noncompile/incomplete-3.c
	* gcc.dg/noncompile/undeclared-1.c: New test cases.
	* gcc.dg/decl-5.c, gcc.dg/redecl-1.c: Remove XFAIL.
	* gcc.dg/local1.c: Add explanatory comment.

From-SVN: r79883
2004-03-23 23:47:53 +00:00
Kazu Hirata ca2b05bae5 c-incpath.c, [...]: Update copyright.
gcc/
	* c-incpath.c, c-incpath.h, c-pch.c, c.opt, cppexp.c,
	et-forest.h, genattr.c, ggc-none.c, hosthooks-def.h,
	hosthooks.h, params.h, ra-colorize.c, web.c,
	config/darwin-c.c, config/alpha/freebsd.h, config/arm/pe.c,
	config/avr/avr-protos.h, config/avr/avr.md,
	config/fr30/fr30-protos.h, config/fr30/fr30.md,
	config/h8300/fixunssfsi.c, config/i386/darwin.h,
	config/i386/freebsd.h, config/i386/freebsd64.h,
	config/ia64/hpux.h, config/ia64/unwind-ia64.c,
	config/ip2k/libgcc.S, config/m32r/xm-m32r.h,
	config/mmix/mmix-modes.def, config/ns32k/netbsd.h,
	config/ns32k/ns32k.md, config/pa/pa64-hpux.h,
	config/pa/pa64-regs.h, config/rs6000/aix41.h,
	config/rs6000/aix43.h, config/rs6000/host-darwin.c,
	config/sparc/aout.h, config/sparc/freebsd.h,
	config/sparc/litecoff.h, config/vax/vax-protos.h,
	doc/hostconfig.texi, doc/include/gcc-common.texi: Update
	copyright.

gcc/cp/
	* cp-lang.c, ptree.c: Update copyright.

From-SVN: r79506
2004-03-15 18:20:51 +00:00
Mark Mitchell 5bd61841e4 call.c (conversion_kind): New type.
* call.c (conversion_kind): New type.
	(conversion_rank): Likewise.
	(conversion): Likewise.
	(CONVERSION_RANK): New macro.
	(conversion_obstack): New variable.
	(obstack_initialized): Likewise.
	(z_candidate): Change type of convs and second_conv.
	(candidate_warning): New type.
	(IDENTITY_RANK): Remove.
	(EXACT_RANK): Likewise.
	(PROMO_RANK): Likewise.
	(STD_RANK): Likewise.
	(PBOOL_RANK): Likewise.
	(USER_RANK): Likewise.
	(ELLIPSIS_RANK): Likewise.
	(BAD_RANK): Likewise.
	(ICS_RANK): Likewise.
	(ICS_STD_RANK): Likewise.
	(ICS_USER_FLAG): Likewise.
	(ICS_ELLIPSIS_FLAG): Likewise.
	(ICS_THIS_FLAG): Likewise.
	(ICS_BAD_FLAG): Likewise.
	(NEED_TEMPORARY_P): Likewise.
	(CHECK_COPY_CONSTRUCTOR_P): Likewise.
	(USER_CONV_CAND): Likewise.
	(USER_CONV_FN): Likewise.
	(conversion_obstack_alloc): New function.
	(alloc_conversion): Likewise.
	(validate_conversion_obstack): Likewise.
	(alloc_conversions): Likewise.
	(build_conv): Adjust to deal with new conversion data structures.
	(build_identity_conv): New function.
	(build_ambiguous_conv): Likewise.
	(standard_conversion): Adjust to deal with new conversion data
	structures.
	(convert_class_to_reference): Likewise.
	(direct_reference_binding): Likewise.
	(reference_binding): Likewise.
	(implicit_conversion): Likewise.
	(add_candidate): Likewise.
	(add_function_candidate): Likewise.
	(add_conv_candidate): Likewise.
	(build_builtin_candidate): Likewise.
	(print_z_candidate): Likewise.
	(merge_conversion_sequences): Likewise.
	(build_user_type_conversion_1): Likewise.
	(build_user_type_conversion): Likewise.
	(build_new_function_call): Likewise.
	(build_object_call): Likewise.
	(conditional_conversion): Likewise.
	(build_conditional_expr): Likewise.
	(build_new_op): Likewise.
	(build_op_delete_call): Likewise.
	(convert_like_real): Likewise.
	(build_over_call): Likewise.
	(build_new_method_call): Likewise.
	(is_subseq): Likewise.
	(maybe_handle_implicit_object): Likewise.
	(maybe_handle_ref_bind): Likewise.
	(compare_ics): Likewise.
	(source_type): Likewise.
	(add_warning): Likewise.
	(joust): Likewise.
	(can_convert_arg): Likewise.
	(can_convert_arg_bad): Likewise.
	(perform_implicit_conversion): Likewise.
	(perform_direct_initialization_if_possible): Likewise.
	(initialize_reference): Likewise.
	* cp-lang.c (cp_tree_size): Do not handle WRAPPER.
	* cp-tree.def (WRAPPER): Likewise.
	(IDENTITY_CONV): Remove.
	(LVALUE_CONV): Likewise.
	(QUAL_CONV): Likewise.
	(STD_CONV): Likewise.
	(PTR_CONV): Likewise.
	(PMEM_CONV): Likewise.
	(BASE_CONV): Likewise.
	(REF_BIND): Likewise.
	(USER_CONV): Likewise.
	(AMBIG_CONV): Likewise.
	(RVALUE_CONV): Likewise.
	* cp-tree.h (tree_wrapper): Remove.
	(WRAPPER_ZC): Remove.
	(lang_tree_node): Remove wrapper.
	(LOOKUP_SPECULATIVELY): Remove.
	(build_op_delete_call): Adjust prototype.
	(validate_conversion_obstack): Declare.
	(build_zc_wrapper): Remove.
	* cvt.c (convert_to_reference): Remove dead code.
	(ocp_convert): Likewise.
	* decl.c (redeclaration_error_message): Correct handling of
	templates.
	(finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
	(cp_tree_node_structure): Remove WRAPPER case.
	* decl2.c (finish_file): Call validate_conversion_obstack.
	* init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
	(build_op_delete_call): Likewise.
	(build_x_delete): Likewise.
	(build_delete): Adjust call to build_op_delete_call.
	* pt.c (tsubst_friend_declaration): Adjust code to determine
	whether or not a friend template is a definition.
	(tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
	* tree.c (build_zc_wrapper): Remove.

From-SVN: r77752
2004-02-13 07:19:25 +00:00
Zack Weinberg 21d13d8372 debug.h (struct gcc_debug_hooks): Add type_decl field.
* debug.h (struct gcc_debug_hooks): Add type_decl field.
	(debug_nothing_tree_int): Prototype.
	(dwarf_debug_hooks): Delete, unused.
	* debug.c (do_nothing_debug_hooks): Update.
	(debug_nothing_tree_int): New function.
	* langhooks.h (struct lang_hooks_for_decls):
	Remove builtin_type_decls field.
	* langhooks-def.h (LANG_HOOKS_BUILTIN_TYPE_DECLS): Delete.
	(LANG_HOOKS_DECLS): Update.
	* toplev.c (rest_of_decl_compilation, rest_of_type_compilation):
	Use debug_hooks->type_decl.
	* dbxout.c (preinit_symbols): New static.
	(dbx_debug_hooks, xcoff_debug_hooks): Update.
	(dbxout_init): Don't call DBX_OUTPUT_STANDARD_TYPES or
	lang_hooks.decls.builtin_type_decls.  Do scan preinit_symbols
	for symbols to output.
	(dbxout_type_decl): New function.
	(dbxout_symbol): If called before dbxout_init has run, queue
	the symbol for later.  Apply DBX_ASSIGN_FUNDAMENTAL_TYPE_NUMBER
	to TYPE_DECLs before emitting them.
	* xcoffout.c (assign_type_number): Delete.
	(xcoff_type_numbers): New static table.
	(xcoff_assign_fundamental_type_number): New function.
	* xcoffout.h: Define DBX_ASSIGN_FUNDAMENTAL_TYPE_NUMBER, not
	DBX_OUTPUT_STANDARD_TYPES.  Remove unnecessary #ifdefs.
	* sdbout.c: Include varray.h.
	(deferred_global_decls): New static.
	(sdb_debug_hooks): Update.
	(sdbout_global_decl): If we can't emit something right now,
	remember it in deferred_global_decls.
	(sdbout_finish): Just scan deferred_global_decls; don't call getdecls.
	(sdbout_init): Initialize deferred_global_decls.
	* Makefile.in: Update dependencies of sdbout.o.
	* dwarf2out.c (dwarf2out_type_decl): New function.
	(dwarf2_debug_hooks): Update.
	* vmsdbgout.c (vmsdbg_debug_hooks): Update.
	* c-decl.c (getdecls): Just return 0.
	(check_for_loop_decls): Don't use getdecls.
	(record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
	* c-objc-common.c (c_objc_common_finish_file): Don't use getdecls.
cp:
	* cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
	* cp-tree.h: Don't declare cxx_builtin_type_decls.
	* decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
	(record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.

From-SVN: r77730
2004-02-12 21:42:28 +00:00
Mark Mitchell 57702a80e8 c-common.c (flag_abi_version): Default to 2.
* c-common.c (flag_abi_version): Default to 2.
	* c-cppbuiltin.c (c_cpp_builtins): Define __GXX_ABI_VERSION
	uniformly for versions above 2.
	* doc/invoke.texi: Update documentation for -fabi-version.

	* cp-lang.c (cp_expr_size): Return zero for empty classes.

	* cp-tree.h (warn_if_uknown_interface): Remove unused function.
	* decl2.c (warn_if_unknown_interface): Likewise.

	* g++.dg/abi/macro0.C: New test.
	* g++.dg/abi/macro1.C: Likewise.
	* g++.dg/abi/macro2.C: Likewise.

	* g++.dg/abi/bitfield5.C: Add explicit -fabi-version=1 option.
	* g++.dg/abi/bitfield7.C: Likewise.
	* g++.dg/abi/dtor2.C: Likewise.
	* g++.dg/abi/mangle11.C: Likewise.
	* g++.dg/abi/mangle12.C: Likewise.
	* g++.dg/abi/mangle14.C: Likewise.
	* g++.dg/abi/mangle17.C: Likewise.
	* g++.dg/abi/vbase10.C: Likewise.
	* g++.dg/abi/vbase14.C: Likewise.
	* g++.dg/template/qualttp17.C: Likewise.

From-SVN: r74973
2003-12-23 16:53:53 +00:00
Nathan Sidwell 5d027e7b03 re PR c++/13387 (assignment to base class corrupts subclass)
PR c++/13387
	* cp-lang.c (cxx_get_alias_set): Correct logic for a base type.

From-SVN: r74968
2003-12-23 09:02:12 +00:00
Andrew Pinski 92a12fbcc4 re PR c++/5050 (template instantiation depth exceeds/maybe recursion problem)
2003-12-22  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/5050
        * tree.c (cp_start_inlining): Remove.
        (cp_end_inlining): Remove.
        * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Do not define.
        (LANG_HOOKS_TREE_INLINING_END_INLINING): Do not define.
        * cp-tree.h (cp_start_inlining): Do not declare.
        (cp_end_inlining): Do not declare.

        PR c++/5050
	* g++.dg/template/recurse1.C: New test.

From-SVN: r74947
2003-12-22 12:42:58 -08:00
Nathan Sidwell a0c6873702 re PR c++/13387 (assignment to base class corrupts subclass)
cp:
	PR c++/13387
	* class.c (finish_struct_1): Compute mode and alias set for
	CLASSTYPE_AS_BASE.
	* call.c (build_over_call): Use CLASSTYPE_AS_BASE for trivial
	assignment of a class, as necessary.
	* cp-lang.c (cxx_get_alias_set): The alias set as a base is the
	same as for the complete type.
testsuite:
	PR c++/13387
	* g++.dg/expr/assign1.C: New test.

From-SVN: r74683
2003-12-16 10:08:43 +00:00
Mark Mitchell 47aa0df475 re PR debug/12066 (g++ generates stabs for "char *" that gdb cannot read)
PR debug/12066
	* dbxout.c (dbxout_init): Use a langhook to find builtin types.
	* langhooks-def.h (lhd_return_null_tree_v): New function.
	(LANG_HOOKS_BUILTIN_TYPE_DECLS): New macro.
	(LANG_HOOKS_DECLS): Add it to the intializer.
	* langhooks.c (lhd_return_null_tree_v): New function.
	* langhooks.h (lang_hooks_for_decls): Add builtin_type_decls.


	PR debug/12066
	* cp-lang.c (LANG_HOOKS_BUILTIN_TYPE_DECLS): Define.
	* cp-tree.h (cxx_builtin_type_decls): Declare.
	* decl.c (builtin_type_decls): New variables.
	(cxx_builtin_type_decls): New function.
	(record_builtin_type): Add to builtin_type_decls.

From-SVN: r71478
2003-09-17 20:52:41 +00:00
Mark Mitchell a7e8c268ed re PR c++/3907 (nested template parm collides with member name)
* coverage.c (create_coverage): Do not call pushlevel/poplevel.
	* langhooks-def.h (lhd_do_nothing_iii_return_null_tree): New
	function.
	* langhooks.c (lhd_do_nothing_iii_return_null_tree): Define it.

	PR c++/3907
	* class.c (maybe_note_name_used_in_class): Refine test for whether
	or not we are in a class scope.

	* cp-tree.h (language_function): Remove x_expanding_p.
	(expanding_p): Remove.
	(doing_semantic_analysis_p): Remove.
	(scope_kind): Add sk_function_parms, sk_class,
	sk_namespace.
	(innermost_scope_kind): New method.
	* call.c (cxx_type_promotes_to): Use type_decays_to.
	* cp-lang.c (LANG_HOOKS_PUSHLEVEL): Redefine.
	(LANG_HOOKS_POPLEVEL): Likewise.
	* decl.c (cp_binding_level): Remove parm_flag, template_parms_p,
	template_spec_p, namespace_p, is_for_scope, is_try_scope, and
	is_catch_scope.  Add kind and explicit_spec_p.
	(cxx_scope_descriptor): Use a lookup table.
	(find_class_binding_level): Use "kind" field in binding_level, not
	the various flags.
	(pop_binding_level): Likewise.
	(innermost_nonclass_level): Likewise.
	(toplevel_bindings_p): Likewise.
	(namespace_bindings_p): Likewise.
	(template_parm_scope_p): Likewise.
	(innermost_scope_kind): New method.
	(current_tmpl_spec_kind): Use "kind" field in binding_level, not
	the various flags.
	(pushlevel): Remove check for doing_semantic_analysis_p.
	(begin_scope): Simplify.
	(add_decl_to_level): Use "kind" field in binding_level, not
	the various flags.
	(push_local_binding): Likewise.
	(pop_label): Remove check for doing_semantic_analysis_p.
	(poplevel): Use "kind" field in binding_level, not
	the various flags.
	(set_block): Remove check for doing_semantic_analysis_p.
	(pushlevel_class): Use "kind" field in binding_level, not
	the various flags.
	(poplevel_class): Likewise.
	(initial_push_namespace_scope): Likewise.
	(maybe_push_to_top_level): Likewise.
	(set_identifier_type_value_with_scope): Likewise.
	(pop_everything): Likewise.
	(maybe_process_template_type_declaration): Likewise.
	(pushtag): Likewise.
	(pushdecl): Likewise.
	(pushdecl_with_scope): Likewise.
	(check_previous_goto_1): Likewise.
	(define_label): Likewise.
	(finish_case_label): Likewise.
	(lookup_tag): Likewise.
	(unqualified_namespace_lookup): Likewise.
	(lookup_name_real): Likewise.
	(lookup_name_current_level): Likewise.
	(lookup_type_current_level): Likewise.
	(record_builtin_type): Likewise.
	(cp_make_fname_decl): Likewise.
	(maybe_inject_for_scope_var): Likewise.
	(cp_finish_decl): Remove check for doing_semantic_analysis_p.
	(start_function): Use begin_scope, not pushlevel.
	(finish_function): Use "kind" field in binding_level, not
	the various flags.
	(start_method): Use begin_scope, not pushlevel.
	(make_label_decl): Do not check expanding_p.
	(save_function-data): Do not set expanding_p.
	(cxx_push_function_context): Do not clear expanding_p.
	* semantics.c (cxx_expand_function_start): Do not set expanding_p.

	PR c++/3907
	* g++.dg/parse/template12.C: New test.

	* g++.dg/abi/bitfield11.C: New test.
	* g++.dg/abi/bitfield12.C: Likewise.

From-SVN: r71393
2003-09-15 00:59:28 +00:00
Richard Henderson 25c84396dd cgraph.h (struct cgraph_node): Rename lowered to analyzed.
* cgraph.h (struct cgraph_node): Rename lowered to analyzed.
        * cgraphunit.c: Update to match.
        (record_call_1): Rearrange.  Call lang hook for language nodes.
        (cgraph_analyze_function): Don't call lower_function.
        * langhooks.h (struct lang_hooks_for_callgraph): Replace
        lower_function with analyze_expr.
        * langhooks-def.h: Update to match.
        * langhooks.c (lhd_callgraph_analyze_expr): New.

        * decl2.c (cxx_callgraph_analyze_expr): New, from corpse of
        mark_member_pointers.
        (lower_function): Remove.
        * cp-tree.h: Update to match.
        * cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): New.
        (LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION): Remove.

From-SVN: r71277
2003-09-10 12:16:20 -07:00
Mark Mitchell 9649812aae langhooks-def.h (lhd_register_builtin_type): New function.
* langhooks-def.h (lhd_register_builtin_type): New function.
	(LANG_HOOKS_REGISTER_BUILTIN_TYPE): New macro.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Update.
	* langhooks.h (lang_hooks_for_types): Add register_builtin_type.
	* langhooks.c (lhd_register_builtin_type): New function.
	* c-common.h (c_register_builtin_type): Declare.
	* c-common.c (c_register_builtin_type): New function.
	* c-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to
	c_register_builtin_type.
	* config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Remove __fpreg,
	__float80, and __float128 macros.
	* config/ia64/ia64.c (ia64_init_builtins): Create __fpreg,
	__float80, and __float128 types.

	* cp-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to
	c_register_builtin_type.

	* gcc.dg/ia64-types1.c: New test.
	* gcc.dg/ia64-types2.c: Likewise.

From-SVN: r71227
2003-09-09 03:35:31 +00:00