diff options
423 files changed, 5356 insertions, 2421 deletions
diff --git a/ChangeLog b/ChangeLog index a83aa408504..f04ae63c501 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-09-18 Steve Ellcey <sje@cup.hp.com> + + * MAINTAINERS: Add myself as ia64 maintainer. + 2008-09-04 Gerald Pfeifer <gerald@pfeifer.com> * MAINTAINERS: Remove John Carr, Steve Chamberlain, Michael Chastain, diff --git a/ChangeLog.melt b/ChangeLog.melt index 07f1ea4f05e..fe654381e3b 100644 --- a/ChangeLog.melt +++ b/ChangeLog.melt @@ -1,3 +1,6 @@ +2008-09-18 Basile Starynkevitch <basile@starynkevitch.net> + MELT branch merged with trunk r140490 + 2008-09-17 Basile Starynkevitch <basile@starynkevitch.net> MELT branch merged with trunk r140415 diff --git a/MAINTAINERS b/MAINTAINERS index bbee6e644f4..111f17cc6c6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -55,6 +55,7 @@ i386 port Richard Henderson rth@redhat.com i386 port Jan Hubicka jh@suse.cz i386 port Uros Bizjak ubizjak@gmail.com ia64 port Jim Wilson wilson@tuliptree.org +ia64 port Steve Ellcey sje@cup.hp.com iq2000 port Nick Clifton nickc@redhat.com m32c port DJ Delorie dj@redhat.com m32r port Nick Clifton nickc@redhat.com diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1207e7f5e4a..ac957740e4c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,282 @@ +2008-09-18 Bob Wilson <bob.wilson@acm.org> + + * configure.ac: Add HAVE_AS_TLS check for Xtensa. + * config/xtensa/predicates.md (tls_symbol_operand): New. + * config/xtensa/xtensa.c (TARGET_HAVE_TLS): Define. + (TARGET_CANNOT_FORCE_MEM): Define. + (xtensa_tls_symbol_p): New. + (xtensa_emit_move_sequence): Check for and legitimize TLS addresses. + (xtensa_legitimate_address_p): Disallow constant pool TLS references. + (xtensa_tls_module_base): New. + (xtensa_call_tls_desc): New. + (xtensa_legitimize_tls_address): New. + (xtensa_legitimize_address): Handle TLS symbols. + (xtensa_tls_referenced_p_1): New. + (xtensa_tls_referenced_p): New. + (xtensa_output_addr_const_extra): Handle UNSPEC_TPOFF and UNSPEC_DTPOFF. + (XTENSA_BUILTIN_THREAD_POINTER): New. + (XTENSA_BUILTIN_SET_THREAD_POINTER): New. + (xtensa_init_builtins): Set NOTHROW and READONLY for umulsidi3 builtin. + Add declarations for __builtin_thread_pointer and + __builtin_set_thread_pointer. + (xtensa_fold_builtin): Recognize new builtins. + (xtensa_expand_builtin): Expand new builtins. + * config/xtensa/xtensa.h (XCHAL_HAVE_THREADPTR): Define default value. + (TARGET_THREADPTR): Define. + (HAVE_AS_TLS): Define default value. + (LEGITIMATE_CONSTANT_P): Disallow TLS references. + * config/xtensa/xtensa.md (UNSPEC_TPOFF, UNSPEC_DTPOFF): New. + (UNSPEC_TLS_FUNC, UNSPEC_TLS_ARG, UNSPEC_TLS_CALL, UNSPEC_TP): New. + (UNSPECV_SET_TP): New. + (sym_TPOFF, sym_DTPOFF): New. + (load_tp, set_tp, tls_func, tls_arg, tls_call): New. + * config/xtensa/xtensa-protos.h (xtensa_tls_referenced_p): Declare. + * configure: Regenerated. + +2008-09-18 H.J. Lu <hongjiu.lu@intel.com> + + PR target/37394 + * config/ia64/ia64.c (ia64_optimization_options): Move + checking and setting flag_schedule_insns_after_reload and + ia64_flag_schedule_insns2 back to ... + (ia64_override_options): Here. + +2008-09-18 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR rtl-opt/37451 + * loop-doloop.c (doloop_modify): New argument zero_extend_p and + zero extend count after the correction to it is done. + (doloop_optimize): Update call to doloop_modify, don't zero extend + count before call. + +2008-09-18 Martin Jambor <mjambor@suse.cz> + + * ipa-cp.c (ipcp_estimate_growth): Return 0 instead of false. + + * ipa-prop.c: Correct comments. + * ipa-prop.h: Likewise. + +2008-09-18 Jan Hubicka <jh@suse.cz> + + PR middle-end/37448 + * ipa-reference.c (ipa_reference_local_vars_info_d, + ipa_reference_global_vars_info_d, + ipa_reference_local_vars_info_t, ipa_reference_global_vars_info_t, + ipa_reference_vars_info_t): Move here from ipa-reference.h + (node_duplication_hook_holder, node_removal_hook_holder): New. + (get_reference_vars_info_from_cgraph): Rename to ... + (get_reference_vars_info): ... this one, use cgraph uids. + (get_local_reference_vars_info, get_global_reference_vars_info): + Use cgraph instead of decl. + (ipa_reference_get_read_local, ipa_reference_get_written_local): Remove. + (ipa_reference_get_read_global, ipa_reference_get_not_read_global + ipa_reference_get_written_global, ipa_reference_get_not_written_global): Use + cgraph argument. + (check_call): Simplify avail check. + (scan_stmt_for_static_refs): Update. + (propagate_bits): Update. + (merge_callee_local_info): Remove. + (init_function_info): Use cgraph nodes. + (clean_function_local_data): Break out from ... + (clean_function): ... here. + (copy_local_bitmap, copy_global_bitmap): New functions. + (duplicate_node_data, remove_node_data): New functions. + (generate_summary): Register hooks; use visibility instead of + master clones. + (propafate): Use cgraph nodes; copy bitmap to each node in cycle. + * ipa-reference.h (ipa_reference_local_vars_info_d, + ipa_reference_global_vars_info_d, + ipa_reference_local_vars_info_t, ipa_reference_global_vars_info_t, + ipa_reference_vars_info_t): Move to ipa-reference.c + (ipa_reference_get_read_local, ipa_reference_get_written_local): + Remove. + (ipa_reference_get_read_global, ipa_reference_get_written_global, + ipa_reference_get_not_read_global, ipa_reference_get_not_written_global): + Update prototype. + * ipa-pure-const.c (funct_state_vec): Turn into VECtor. + (init_state): Remove. + (node_duplication_hook_holder, node_removal_hook_holder): New. + (get_function_state, set_function_state): Use VECtor. + (analyze_function): Check body availability. + (add_new_function): Likewise. + (duplicate_node_data, remove_node_data): New. + (generate_summary): Register hooks; do not care about clones. + (propafate): Do not care about clones; recursive functions are not looping. + * ipa-utils.c (searchc, ipa_utils_reduced_inorder): Do not skip clones. + * ipa-prop.c (edge_removal_hook_holder, node_removal_hook_holder, + * edge_duplication_hook_holder, node_duplication_hook_holder): Make + static. + * tree-flow.h (function_ann_d): Remove reference_vars_info. + * tree-ssa-opreands.c (add_call_clobber_ops, add_call_read_ops): Update call of + ipa-reference accesors. + +2008-09-18 Simon Baldwin <simonb@google.com> + + * c-opts.c (c_common_handle_option): Add handling for + -Wbuiltin-macro-redefined command line option. + * c.opt: Added builtin-macro-redefined option. + * doc/invoke.texi (Warning Options): Add -Wbuiltin-macro-redefined + documentation. + +2008-09-18 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/37258 + * tree-ssa-sccvn.c (vn_phi_compute_hash): Include the precision + and signedness for integral types. + (vn_phi_eq): Require compatible types. + +2008-09-18 Jakub Jelinek <jakub@redhat.com> + + PR debug/34037 + * gimplify.c (gimplify_type_sizes): When not optimizing, ensure + TYPE_MIN_VALUE and TYPE_MAX_VALUE is not is not DECL_IGNORED_P + VAR_DECL. + * cfgexpand.c (expand_used_vars): Keep DECL_ARTIFICIAL + !DECL_IGNORED_P vars in local_decls list for instantiate_decls, + ggc_free other TREE_LIST nodes from that chain. + * function.c (instantiate_decls): Instantiate also DECL_RTL + of vars in cfun->local_decls, free that list afterwards. + +2008-09-18 Eric Botcazou <ebotcazou@adacore.com> + + * config/sparc/sol2.h (WIDEST_HARDWARE_FP_SIZE): Move to... + * config/sparc/sparc.h (WIDEST_HARDWARE_FP_SIZE): ...here. + +2008-09-18 Andrew MacLeod <amacleod@redhat.com> + + * tree-outof-ssa.c (eliminate_useless_phis): Fix formatting. + * tree-flow-.h (struct immediate_use_iterator_d): Fix comment. + +2008-09-18 Andrew MacLeod <amacleod@redhat.com> + + PR tree-optimization/37102 + * tree-outof-ssa.c (remove_gimple_phi_args): Remove all the PHI args + from a node. Check to see if another PHI is dead. + (eliminate_useless_phis): Rename from eliminate_virtual_phis and + remove real PHIs which have no uses. + (rewrite_out_of_ssa): Call eliminate_useless_phis. + +2008-09-18 Richard Guenther <rguenther@suse.de> + + PR middle-end/37284 + * tree-cfg.c (remove_useless_stmts_1): Remove + GIMPLE_CHANGE_DYNAMIC_TYPE if not optimizing. + +2008-09-18 Nick Clifton <nickc@redhat.com> + + * config/frv/frv.h (IRA_COVER_CLASSES): Define. + (SECONDARY_INPUT_RELOAD_CLASS): Omit unused argument in call + to frv_secondary_reload_class. + (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. + * config/frv/frv.c (TARGET_SECONDARY_RELOAD): Define. + (frv_secondary_reload_class): Omit unused parameter. + (frv_secondary_reload): New function. Handle the case when + secondary_reload_class() is called before the reload_(in|out) + _optabs have been initialised. + * config/frv/frv-protos.h (frv_secondary_reload_class): Omit + unused parameter. + * config/frv/frv.md: Define an exclusion set between fr550_m0 + and fr550_f0. + +2008-09-18 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/37456 + * tree-ssa-reassoc.c (build_and_add_sum): If the stmt we + want to insert after ends a BB insert on the single fallthru + outgoing edge. + +2008-09-18 Andreas Krebbel <krebbel1@de.ibm.com> + + * doc/invoke.texi: Document -mhard-dfp, -mno-hard-dfp. + Mention -march=z9-109, z9-ec and z10. + +2008-09-18 Uros Bizjak <ubizjak@gmail.com> + + PR rtl-optimization/37544 + * regrename.c (maybe_mode_change): Exit early when copy_mode + is narrower than orig_mode and narrower than new_mode. + +2008-09-18 Alexander Monakov <amonakov@ispras.ru> + + PR middle-end/37499 + * sched-int.h (struct _haifa_insn_data): Remove unused field + ref_count. + + * sched-rgn.c (ref_counts): Remove. + (insn_referenced): New static variable. + (INSN_REF_COUNT): Remove. + (sched_run_compute_dependencies): Use insn_referenced instead of + INSN_REF_COUNT. + (add_branch_dependences): Likewise. Delete dead assignment. + +2008-09-17 Adam Nemet <anemet@caviumnetworks.com> + + * haifa-sched.c (dep_cost_1): Recognize the producer even if the + consumer is an asm. Add comment why this is important. + (choose_ready): Add comment to the "INSN_CODE (insn) >= 0 || + recog_memoized (insn) < 0" assert. Put ENABLE_CHECKING around + it. + +2008-09-17 Joseph Myers <joseph@codesourcery.com> + + * expr.c (emit_group_store): Do not shift before moving via a + stack slot. + +2008-09-17 Eric Botcazou <ebotcazou@adacore.com> + + * varasm.c (initializer_constant_valid_p): Forbid view-conversions + from aggregate to non-aggregate type if the bit pattern is not fully + preserved afterwards. + +2008-09-17 Richard Guenther <rguenther@suse.de> + + * tree-cfg.c (verify_types_in_gimple_assign): Rename to ... + (verify_gimple_assign): ... this. Split into ... + (verify_gimple_assign_unary): ... this, + (verify_gimple_assign_binary): ... that, + (verify_gimple_assign_single): ... and this. + (verify_types_in_gimple_stmt): Call verify_gimple_assign. + Fix GIMPLE_CHANGE_DYNAMIC_TYPE handling. + (verify_types_in_gimple_min_lval): Handle TARGET_MEM_REF. + (verify_types_in_gimple_reference): Be forgiving with + VIEW_CONVERT_EXPRs. + (verify_gimple_phi): Deal with virtual operands. + + * tree.def (PREDICT_EXPR): Change to tcc_expression. + +2008-09-17 Andrew Pinski <andrew_pinski@playstation.sony.com> + + * tree.c (get_callee_fndecl): Don't call the language hook. + * langhooks.h (lang_hooks): Remove lang_get_callee_fndecl. + * langhooks-def.h (LANG_HOOKS_GET_CALLEE_FNDECL): Kill. + (LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_GET_CALLEE_FNDECL. + +2008-09-17 Jakub Jelinek <jakub@redhat.com> + + * tree.c (protected_set_expr_location): Don't unnecessarily + check for error_mark_node. + +2008-09-17 Art Haas <ahaas@impactweather.com> + + * ipa-reference.c (analyze_function): Declare step only if + ENABLE_CHECKING is defined. + +2008-09-17 Jan Hubicka <jh@suse.cz> + + PR c++/18071 + * tree.h (DECL_INLINE): remove. + (DECL_DECLARED_INLINE_P): Update docs. + (DECL_NO_INLINE_WARNING_P): new. + (tree_function_decl): Replace inline_flag by no_inline_warning_flag. + * tree-inline.c (inlinable_function_p): Set DECL_NO_INLINE_WARNING_P. + +2008-09-17 Jakub Jelinek <jakub@redhat.com> + Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> + + PR bootstrap/37441 + * dwarf2out.c (dwarf2out_do_cfi_asm) [MIPS_DEBUGGING_INFO]: Return + false. + 2008-09-17 Jan Hubicka <jh@suse.cz> * ipa-reference.c (ipa_obstack): Remove. @@ -153,8 +432,8 @@ 2008-09-13 Jan Hubicka <jh@suse.cz> - * i386.c (ix86_expand_movmem, ix86_expand_movstr): Avoid processing too - many bytes on misalligned blocks. + * i386.c (ix86_expand_movmem, ix86_expand_movstr): Avoid processing + too many bytes on misalligned blocks. 2008-09-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> @@ -235,7 +514,8 @@ 2008-09-12 Sebastian Pop <sebastian.pop@amd.com> - * tree-scalar-evolution.c (set_instantiated_value): Set instantiated_below. + * tree-scalar-evolution.c (set_instantiated_value): Set + instantiated_below. 2008-09-12 Vladimir Makarov <vmakarov@redhat.com> @@ -378,7 +658,8 @@ TRUTH_AND_EXPR for boolean (1-bit precision) expressions. (do_jump) [BIT_IOR_EXPR]: Compile as TRUTH_OR_EXPR. - * tree-flow.h (simplify_stmt_using_ranges): Accept a GSI, return a bool. + * tree-flow.h (simplify_stmt_using_ranges): Accept a GSI, return + a bool. * tree-ssa-propagate.c (substitute_and_fold): Pass a GSI to VRP's simplify_stmt_using_ranges. Do simplify_stmt_using_ranges before finalizing the changes. @@ -399,8 +680,8 @@ 2008-09-11 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_release_function_body): Plug memory leak on - ipa_transforms_to_apply and CFG; ggc_free gimple df and struct function - so we are sure we do not dangle it forever. + ipa_transforms_to_apply and CFG; ggc_free gimple df and struct + function so we are sure we do not dangle it forever. * function.c (outer_function_chain, find_function_data): Remove. (function_context_stack): New. (push_function_context, pop_function_context): Update. @@ -457,7 +738,8 @@ register_overhead, free_overhead, vec_heap_free): New functions. (vec_gc_o_reserve_1): ggc_free when resizing to 0. (vec_heap_o_reserve_1): free when resizing to 0; add statistics. - (cmp_statistic, add_statistics, dump_vec_loc_statistics): New functions. + (cmp_statistic, add_statistics, dump_vec_loc_statistics): + New functions. 2008-09-11 Ira Rosen <irar@il.ibm.com> @@ -611,8 +893,8 @@ calls. PR target/37438 - * config/i386/i386.md (zero_extendqihi2_movzbl): Enable when optimizing - for size, not speed. + * config/i386/i386.md (zero_extendqihi2_movzbl): Enable when + optimizing for size, not speed. PR rtl-optimization/37408 * function.c (assign_parm_find_stack_rtl): Set correct MEM_SIZE @@ -621,18 +903,20 @@ 2008-09-09 Sebastian Pop <sebastian.pop@amd.com> PR tree-optimization/37375 - * tree-scalar-evolution.c (scev_info_str): Add field instantiated_below. + * tree-scalar-evolution.c (scev_info_str): Add field + instantiated_below. (new_scev_info_str, eq_scev_info, find_var_scev_info, set_scalar_evolution, get_scalar_evolution, get_instantiated_value, set_instantiated_value): Pass instantiated_below. - (analyze_scalar_evolution_1, analyze_scalar_evolution): Update calls to - above functions. + (analyze_scalar_evolution_1, analyze_scalar_evolution): Update calls + to above functions. (instantiate_scev_1, instantiate_scev): Pass a basic block above which the definitions are not instantiated. * tree-scalar-evolution.h (instantiate_scev): Update declaration. (block_before_loop): New. - * tree-data-ref.c (dr_analyze_indices): Update uses of instantiate_scev. + * tree-data-ref.c (dr_analyze_indices): Update uses of + instantiate_scev. * graphite.c (block_before_scop): New. (loop_affine_expr, stmt_simple_for_scop_p, harmful_stmt_in_bb): Pass a basic block, not a loop for determining the parameters. @@ -1590,8 +1874,8 @@ openmp applications. * pa-hpux11.h (LIB_SPEC): Likewise. - * ira.c (setup_eliminable_regset): Only declare i if ELIMINABLE_REGS is - defined. + * ira.c (setup_eliminable_regset): Only declare i if ELIMINABLE_REGS + is defined. 2008-09-01 Jan Hubicka <jh@suse.cz> @@ -1701,8 +1985,7 @@ * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c, sel-sched-dump.c, sel-sched-ir.c: New files. - * Makefile.in (OBJS-common): Add selective scheduling object - files. + * Makefile.in (OBJS-common): Add selective scheduling object files. (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries. (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries. (sched-vis.o): Add dependency on $(INSN_ATTR_H). @@ -1824,8 +2107,7 @@ (setup_sched_dump): New function. (haifa_init_only_bb): New static function. (haifa_speculate_insn): New static function. - (try_ready): Use haifa_* instead of speculate_insn and - change_pattern. + (try_ready): Use haifa_* instead of speculate_insn and change_pattern. (extend_ready, extend_all): Remove. (sched_extend_ready_list, sched_finish_ready_list): New functions. (create_check_block_twin, add_to_speculative_block): Use @@ -1855,8 +2137,7 @@ (current_sched_info_var): Remove. (move_block_after_check): Use common_sched_info. (haifa_luid_for_non_insn): New static function. - (init_before_recovery): Use haifa_init_only_bb instead of - add_block. + (init_before_recovery): Use haifa_init_only_bb instead of add_block. (increase_insn_priority): New. * modulo-sched.c: (issue_rate): Remove static declaration. (sms_sched_info): Change type to haifa_sched_info. @@ -2270,7 +2551,8 @@ (noce_try_cmove_arith): Likewise. (noce_try_sign_mask): LIkewise. * expr.c (compress_float_constant): Update rtx_cost calls. - * tree-ssa-address.c (most_expensive_mult_to_index): Add speed argument. + * tree-ssa-address.c (most_expensive_mult_to_index): Add speed + argument. (addr_to_parts): Likewise. (create_mem_ref): Likewise. * dse.c (find_shift_sequence): Add speed argument. @@ -2289,7 +2571,8 @@ (expand_mult_highpart): Use profile. (expand_smod_pow2): Use profile. (expand_divmod): Use profile. - * simplify-rtx.c (simplify_binary_operation_1): Update call of rtx_cost. + * simplify-rtx.c (simplify_binary_operation_1): Update call of + rtx_cost. * loop-invariant.c (create_new_invariant): Use profile. (gain_for_invariant): Add speed parameter. (best_gain_for_invariant): Likewise. @@ -2557,7 +2840,8 @@ * config/sparc/sparc.h (BRANCH_COST): Update. * config/m32r/m32r.h (BRANCH_COST): Update. * config/i386/i386.h (BRANCH_COST): Update. - * config/i386/i386.c (ix86_expand_int_movcc): Update use of BRANCH_COST. + * config/i386/i386.c (ix86_expand_int_movcc): Update use of + BRANCH_COST. * config/sh/sh.h (BRANCH_COST): Update. * config/pdp11/pdp11.h (BRANCH_COST): Update. * config/avr/avr.h (BRANCH_COST): Update. @@ -2607,7 +2891,8 @@ * tree-ssa-pre.c (do_pre): Use optimize_function_for_speed_p. * tree-predcom.c (tree_predictive_commoning): Use optimize_loop_for_speed_p. - * varasm.c (assemble_start_function): Use optimize_function_for_speed_p. + * varasm.c (assemble_start_function): Use + optimize_function_for_speed_p. * bb-reorder.c (rest_of_handle_reorder_blocks): Likewise. * predict.c (optimize_loop_for_speed_p): Fix walk. @@ -2828,16 +3113,17 @@ 2008-08-29 Jan Hubicka <jh@suse.cz> - * tree.c (build_function_type_skip_args, build_function_decl_skip_args): - New functions. - * tree.h (build_function_type_skip_args, build_function_decl_skip_args): - Declare. + * tree.c (build_function_type_skip_args, + build_function_decl_skip_args): New functions. + * tree.h (build_function_type_skip_args, + build_function_decl_skip_args): Declare. * gimple.c (giple_copy_call_skip_args): New function. (giple_copy_call_skip_args): Declare. * cgraph.h (cgraph_function_versioning): Add skip_args arugmnet * ipa-cp.c (ipcp_node_not_modifiable_p): Rename to ... - (ipcp_node_modifiable_p): ... this one; use tree_versionable_function_p. + (ipcp_node_modifiable_p): ... this one; use + tree_versionable_function_p. (ipcp_create_replace_map): Improve debug output. (ipcp_need_redirect_p): Return false when not clonning. (ipcp_update_callgraph): Skip args. @@ -2846,13 +3132,15 @@ * cgraphunit.c (cgraph_function_versioning): Add skip_args argument. (save_inline_function_body): Update call of tree_function_versioning. * ipa-prop.c (ipa_edge_removal_hook): Do not ICE on unanalyzed nodes. - * tree-inline.c (copy_arguments_for_versioning): Add skip_args argument. + * tree-inline.c (copy_arguments_for_versioning): Add skip_args + argument. (tree_function_versioning): Likewise. * tree-inline.h (tree_function_versioning): Update prototype. 2008-08-29 Jan Hubicka <jh@suse.cz> - * loop-unswitch.c (unswitch_single_loop): Use optimize_loop_for_speed_p. + * loop-unswitch.c (unswitch_single_loop): Use + optimize_loop_for_speed_p. * tree-ssa-threadupdate.c (mark_threaded_blocks): Use optimize_function_for_size_p. * tracer.c (ignore_bb_p): Use optimize_bb_for_size_p. @@ -2866,7 +3154,8 @@ * builtins.c (fold_builtin_cabs): Use optimize_function_for_speed_p. (fold_builtin_strcpy, fold_builtin_fputs): Use optimize_function_for_size_p. - * fold-const.c (tree_swap_operands_p): Use optimize_function_for_size_p. + * fold-const.c (tree_swap_operands_p): Use + optimize_function_for_size_p. * recog.c (relax_delay_slots): Likewise. * tree-ssa-math-opts.c (replace_reciprocal): Use optimize_bb_for_speed_p. @@ -2882,11 +3171,12 @@ work it out from profile. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Use optimize_loop_for_speed_p. - * predict.c (optimize_bb_for_size_p, optimize_bb_for_speed_p): Constify - argument. + * predict.c (optimize_bb_for_size_p, optimize_bb_for_speed_p): + Constify argument. (optimize_loop_nest_for_size_p, optimize_loop_nest_for_speed_p): New. * tree-parloops.c (parallelize_loops): Use optimize_loop_for_size_p. - * tree-eh.c (decide_copy_try_finally): Use optimize_function_for_size_p. + * tree-eh.c (decide_copy_try_finally): Use + optimize_function_for_size_p. * local-alloc.c (block_alloc): Pass BB pointer. (find_free_reg): Add BB pointer, use optimize_bb_for_size_p. * gcse.c (gcse_main): Use optimize_function_for_size_p. @@ -4284,8 +4574,8 @@ (update_call_notes_after_inlining): Expect ADDR_EXPR in operand. * ipa-prop.h (jump_func_type): Remove IPA_CONST_REF. (jump_func_type): Remove IPA_CONST_VALUE_REF. - * tree-inline.c (tree_function_versioning): Add variables referenced by - replacing trees. + * tree-inline.c (tree_function_versioning): Add variables referenced + by replacing trees. 2008-08-23 Jan Hubicka <jh@suse.cz> @@ -4685,9 +4975,9 @@ (vect_get_and_check_slp_defs): Detect patterns. (vect_build_slp_tree): Add an argument, don't fail in case of multiple types. - (vect_analyze_slp_instance): Don't fail in case of multiple types. Call - vect_build_slp_tree with correct arguments. Calculate unrolling factor - according to the smallest type in the loop. + (vect_analyze_slp_instance): Don't fail in case of multiple types. + Call vect_build_slp_tree with correct arguments. Calculate unrolling + factor according to the smallest type in the loop. (vect_detect_hybrid_slp_stmts): Include statements from patterns. * tree-vect-patterns.c (vect_recog_widen_mult_pattern): Call supportable_widening_operation with correct arguments. @@ -5500,7 +5790,8 @@ 2008-08-09 Richard Sandiford <rdsandiford@googlemail.com> - * config/mips/mips.c (mips_unspec_address_offset): Move earlier in file. + * config/mips/mips.c (mips_unspec_address_offset): Move earlier + in file. (mips_unspec_address, mips_unspec_offset_high): Likewise. (mips_ok_for_lazy_binding_p, mips_load_call_address): Likewise. (mips16_cfun_returns_in_fpr_p): Likewise. @@ -6069,7 +6360,8 @@ * configure.ac (HAVE_GAS_CFI_DIRECTIVE): New. * config.in, configure: Rebuild. * dwarf2asm.c (dw2_asm_output_data_raw): New. - (dw2_asm_output_data_uleb128_raw, dw2_asm_output_data_sleb128_raw): New. + (dw2_asm_output_data_uleb128_raw, dw2_asm_output_data_sleb128_raw): + New. (dw2_force_const_mem): Externalize. * dwarf2asm.h: Update. * dwarf2out.c (dwarf2out_cfi_label): If flag_dwarf2_cfi_asm, don't @@ -6104,8 +6396,10 @@ (MFC_MIN_DMA_LIST_ELEMENTS): New define. (MFC_MAX_DMA_LIST_ELEMENTS): Likewise. - (MFC_MIN_DMA_LIST_SIZE): Redefine in terms of MFC_MIN_DMA_LIST_ELEMENTS. - (MFC_MAX_DMA_LIST_SIZE): Redefine in terms of MFC_MAX_DMA_LIST_ELEMENTS. + (MFC_MIN_DMA_LIST_SIZE): Redefine in terms of + MFC_MIN_DMA_LIST_ELEMENTS. + (MFC_MAX_DMA_LIST_SIZE): Redefine in terms of + MFC_MAX_DMA_LIST_ELEMENTS. (MFC_START_ENABLE): Remove PPU-only define. (MFC_PUTS_CMD, MFC_PUTFS_CMD, MFC_PUTBS_CMD): Likewise. @@ -6780,7 +7074,8 @@ * configure.ac: Use the m4_do macro to concatenate the warnings into one string in ACX_PROG_CC_WARNING_OPTS, - ACX_PROG_CC_WARNING_ALMOST_PEDANTIC and ACX_PROG_CC_WARNINGS_ARE_ERRORS. + ACX_PROG_CC_WARNING_ALMOST_PEDANTIC and + ACX_PROG_CC_WARNINGS_ARE_ERRORS. * configure: Regenerate. 2008-07-28 Richard Guenther <rguenther@suse.de> @@ -7282,7 +7577,8 @@ (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. - (ipa_node_duplication_hook): Also duplicate the param_calls linked list. + (ipa_node_duplication_hook): Also duplicate the param_calls + linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. @@ -7831,15 +8127,16 @@ not optimizing so unused user vars remains visible. * common.opt (flag_tree_ter): Always enable by default. * tree-ssa-ter.c: Include flags.h - (is_replaceable_p): Check that locations match; when aliasing is missing - be conservative about loads. + (is_replaceable_p): Check that locations match; when aliasing + is missing be conservative about loads. * tree-optimize.c (gate_init_datastructures): Remove. (pass_init_datastructures): New. * passes.c: Reorder passes so we always go into SSA. 2008-07-19 Jan Hubicka <jh@suse.cz> - * doc/extend.texi (flatten attribute): Remove note about unit-at-a-time + * doc/extend.texi (flatten attribute): Remove note about + unit-at-a-time. * doc/invoke.texi (--combine): Likewise. (-finline-functions-called-once): Update levels when enabled. (-funit-at-a-time): Document new behaviour. diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 703aaf3b5a0..7b605fab072 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20080917 +20080919 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8513a58f3bf..5d6ecc80329 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2008-09-18 Jan Hubicka <jh@suse.cz> + + * gcc-interface/utils.c (create_subprog_decl): Use DECL_DECLARED_INLINE_P. + (end_subprog_body): Do not set DECL_INLINE. + 2008-09-17 Pascal Rigaux <pixel@mandriva.com> PR ada/21327 diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index dcf0558ec9d..608f6ecd865 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -1976,7 +1976,7 @@ create_subprog_decl (tree subprog_name, tree asm_name, /* If this is a function nested inside an inlined external function, it means we aren't going to compile the outer function unless it is actually inlined, so do the same for us. */ - if (current_function_decl && DECL_INLINE (current_function_decl) + if (current_function_decl && DECL_DECLARED_INLINE_P (current_function_decl) && DECL_EXTERNAL (current_function_decl)) extern_flag = true; @@ -2232,10 +2232,6 @@ end_subprog_body (tree body, bool elab_p) DECL_INITIAL (fndecl) = current_binding_level->block; gnat_poplevel (); - /* Deal with inline. If declared inline or we should default to inline, - set the flag in the decl. */ - DECL_INLINE (fndecl) = 1; - /* We handle pending sizes via the elaboration of types, so we don't need to save them. */ get_pending_sizes (); diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 164ca4a0cdd..589b05be389 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -426,6 +426,10 @@ c_common_handle_option (size_t scode, const char *arg, int value) warn_pointer_sign = 1; break; + case OPT_Wbuiltin_macro_redefined: + cpp_opts->warn_builtin_macro_redefined = value; + break; + case OPT_Wcomment: case OPT_Wcomments: cpp_opts->warn_comments = value; diff --git a/gcc/c.opt b/gcc/c.opt index d33fa46e8a7..94d6047a5a3 100644 --- a/gcc/c.opt +++ b/gcc/c.opt @@ -131,6 +131,10 @@ Wbad-function-cast C ObjC Var(warn_bad_function_cast) Warning Warn about casting functions to incompatible types +Wbuiltin-macro-redefined +C ObjC C++ ObjC++ Warning +Warn when a built-in preprocessor macro is undefined or redefined + Wc++-compat C ObjC Var(warn_cxx_compat) Warning Warn about C constructs that are not in the common subset of C and C++ diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index d9e9835643b..06111cc85df 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1440,7 +1440,7 @@ estimated_stack_frame_size (void) static void expand_used_vars (void) { - tree t, outer_block = DECL_INITIAL (current_function_decl); + tree t, next, outer_block = DECL_INITIAL (current_function_decl); /* Compute the phase of the stack frame for this function. */ { @@ -1453,11 +1453,15 @@ expand_used_vars (void) /* At this point all variables on the local_decls with TREE_USED set are not associated with any block scope. Lay them out. */ - for (t = cfun->local_decls; t; t = TREE_CHAIN (t)) + t = cfun->local_decls; + cfun->local_decls = NULL_TREE; + for (; t; t = next) { tree var = TREE_VALUE (t); bool expand_now = false; + next = TREE_CHAIN (t); + /* We didn't set a block for static or extern because it's hard to tell the difference between a global variable (re)declared in a local scope, and one that's really declared there to @@ -1484,9 +1488,25 @@ expand_used_vars (void) TREE_USED (var) = 1; if (expand_now) - expand_one_var (var, true, true); + { + expand_one_var (var, true, true); + if (DECL_ARTIFICIAL (var) && !DECL_IGNORED_P (var)) + { + rtx rtl = DECL_RTL_IF_SET (var); + + /* Keep artificial non-ignored vars in cfun->local_decls + chain until instantiate_decls. */ + if (rtl && (MEM_P (rtl) || GET_CODE (rtl) == CONCAT)) + { + TREE_CHAIN (t) = cfun->local_decls; + cfun->local_decls = t; + continue; + } + } + } + + ggc_free (t); } - cfun->local_decls = NULL_TREE; /* At this point, all variables within the block tree with TREE_USED set are actually used by the optimized function. Lay them out. */ diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h index 8d6b29bc7cf..418ac9ac069 100644 --- a/gcc/config/frv/frv-protos.h +++ b/gcc/config/frv/frv-protos.h @@ -104,9 +104,8 @@ extern void frv_ifcvt_modify_cancel (ce_if_block_t *); extern int frv_trampoline_size (void); extern void frv_initialize_trampoline (rtx, rtx, rtx); extern enum reg_class frv_secondary_reload_class - (enum reg_class rclass, - enum machine_mode mode, - rtx x, int); + (enum reg_class, + enum machine_mode, rtx); extern int frv_class_likely_spilled_p (enum reg_class rclass); extern int frv_hard_regno_mode_ok (int, enum machine_mode); extern int frv_hard_regno_nregs (int, enum machine_mode); diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 1d0174cf757..88041982607 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -381,6 +381,9 @@ static int frv_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); static void frv_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; +static bool frv_secondary_reload (bool, rtx, enum reg_class, + enum machine_mode, + secondary_reload_info *); /* Allow us to easily change the default for -malloc-cc. */ #ifndef DEFAULT_NO_ALLOC_CC @@ -462,6 +465,9 @@ static void frv_output_dwarf_dtprel (FILE *, int, rtx) #define TARGET_ASM_OUTPUT_DWARF_DTPREL frv_output_dwarf_dtprel #endif +#undef TARGET_SECONDARY_RELOAD +#define TARGET_SECONDARY_RELOAD frv_secondary_reload + struct gcc_target targetm = TARGET_INITIALIZER; #define FRV_SYMBOL_REF_TLS_P(RTX) \ @@ -6343,8 +6349,7 @@ frv_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain) enum reg_class frv_secondary_reload_class (enum reg_class rclass, enum machine_mode mode ATTRIBUTE_UNUSED, - rtx x, - int in_p ATTRIBUTE_UNUSED) + rtx x) { enum reg_class ret; @@ -6391,7 +6396,7 @@ frv_secondary_reload_class (enum reg_class rclass, ret = GPR_REGS; break; - /* The accumulators need fpr registers */ + /* The accumulators need fpr registers. */ case ACC_REGS: case EVEN_ACC_REGS: case QUAD_ACC_REGS: @@ -6403,6 +6408,42 @@ frv_secondary_reload_class (enum reg_class rclass, return ret; } +/* This hook exists to catch the case where secondary_reload_class() is + called from init_reg_autoinc() in regclass.c - before the reload optabs + have been initialised. */ + +static bool +frv_secondary_reload (bool in_p, rtx x, enum reg_class reload_class, + enum machine_mode reload_mode, + secondary_reload_info * sri) +{ + enum reg_class rclass = NO_REGS; + + if (sri->prev_sri && sri->prev_sri->t_icode != CODE_FOR_nothing) + { + sri->icode = sri->prev_sri->t_icode; + return NO_REGS; + } + + rclass = frv_secondary_reload_class (reload_class, reload_mode, x); + + if (rclass != NO_REGS) + { + enum insn_code icode = (in_p ? reload_in_optab[(int) reload_mode] + : reload_out_optab[(int) reload_mode]); + if (icode == 0) + { + /* This happens when then the reload_[in|out]_optabs have + not been initialised. */ + sri->t_icode = CODE_FOR_nothing; + return rclass; + } + } + + /* Fall back to the default secondary reload handler. */ + return default_secondary_reload (in_p, x, reload_class, reload_mode, sri); + +} /* A C expression whose value is nonzero if pseudos that have been assigned to registers of class RCLASS would likely be spilled because registers of RCLASS diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h index 8a71337fcc1..2ef459e27ff 100644 --- a/gcc/config/frv/frv.h +++ b/gcc/config/frv/frv.h @@ -1,5 +1,5 @@ /* Target macros for the FRV port of GCC. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Contributed by Red Hat Inc. @@ -1153,6 +1153,21 @@ enum reg_class { 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0x1fff}, /* ALL_REGS */\ } +/* The following macro defines cover classes for Integrated Register + Allocator. Cover classes is a set of non-intersected register + classes covering all hard registers used for register allocation + purpose. Any move between two registers of a cover class should be + cheaper than load or store of the registers. The macro value is + array of register classes with LIM_REG_CLASSES used as the end + marker. */ + +#define IRA_COVER_CLASSES \ +{ \ + GPR_REGS, FPR_REGS, ACC_REGS, ICR_REGS, FCR_REGS, ICC_REGS, FCC_REGS, \ + ACCG_REGS, SPR_REGS, \ + LIM_REG_CLASSES \ +} + /* A C expression whose value is a register class containing hard register REGNO. In general there is more than one such class; choose a class which is "minimal", meaning that no smaller class also contains the register. */ @@ -1235,10 +1250,10 @@ extern enum reg_class reg_class_from_letter[]; #define PREFERRED_RELOAD_CLASS(X, CLASS) CLASS #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \ - frv_secondary_reload_class (CLASS, MODE, X, TRUE) + frv_secondary_reload_class (CLASS, MODE, X) #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \ - frv_secondary_reload_class (CLASS, MODE, X, FALSE) + frv_secondary_reload_class (CLASS, MODE, X) /* A C expression whose value is nonzero if pseudos that have been assigned to registers of class CLASS would likely be spilled because registers of CLASS diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md index f8451747b9a..aadf02c4fbd 100644 --- a/gcc/config/frv/frv.md +++ b/gcc/config/frv/frv.md @@ -1,5 +1,5 @@ ;; Frv Machine Description -;; Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2007 +;; Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008 ;; Free Software Foundation, Inc. ;; Contributed by Red Hat, Inc. @@ -1179,6 +1179,18 @@ (define_cpu_unit "fr550_f0,fr550_f1,fr550_f2,fr550_f3" "fr550_float_media") (define_cpu_unit "fr550_m0,fr550_m1,fr550_m2,fr550_m3" "fr550_float_media") (exclusion_set "fr550_f1,fr550_f2,fr550_f3" "fr550_m1,fr550_m2,fr550_m3") +(exclusion_set "fr550_m0" "fr550_f1,fr550_f2,fr550_f3") +;; FIXME: This next exclusion set should be defined as well, so that we do +;; not get a packet containing multiple media instructions plus a single +;; floating point instruction. At the moment we can get away with not +;; defining it because gcc does not seem to generate such packets. +;; +;; If we do enable the exclusion however the insertion of fnop insns into +;; a packet containing media instructions will stop working, because the +;; fnop insn counts as a floating point instruction. The correct solution +;; is to fix the reservation for the fnop insn so that it does not have the +;; same restrictions as ordinary floating point insns. +;;(exclusion_set "fr550_f0" "fr550_m1,fr550_m2,fr550_m3") (define_reservation "fr550_float" "fr550_f0|fr550_f1|fr550_f2|fr550_f3") (define_reservation "fr550_media" "fr550_m0|fr550_m1|fr550_m2|fr550_m3") @@ -2092,8 +2104,8 @@ } else { - operands[4] = GEN_INT ((((unsigned HOST_WIDE_INT)INTVAL (op1) >> 16) - >> 16) ^ ((unsigned HOST_WIDE_INT)1 << 31) + operands[4] = GEN_INT (((((unsigned HOST_WIDE_INT)INTVAL (op1) >> 16) + >> 16) ^ ((unsigned HOST_WIDE_INT)1 << 31)) - ((unsigned HOST_WIDE_INT)1 << 31)); operands[5] = GEN_INT (trunc_int_for_mode (INTVAL (op1), SImode)); } diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 28abf27d1bf..81767bbf7c5 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -5233,6 +5233,9 @@ ia64_override_options (void) TARGET_INLINE_SQRT = INL_MAX_THR; } + ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload; + flag_schedule_insns_after_reload = 0; + ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE; init_machine_status = ia64_init_machine_status; @@ -9922,13 +9925,6 @@ void ia64_optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED) { - /* Disable the second machine independent scheduling pass and use one for the - IA-64. This needs to be here instead of in OVERRIDE_OPTIONS because this - is done whenever the optimization is changed via #pragma GCC optimize or - attribute((optimize(...))). */ - ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload; - flag_schedule_insns_after_reload = 0; - /* Let the scheduler form additional regions. */ set_param_value ("max-sched-extend-regions-iters", 2); diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h index 8e760b8e928..a31a2e33ad8 100644 --- a/gcc/config/sparc/sol2.h +++ b/gcc/config/sparc/sol2.h @@ -138,9 +138,6 @@ along with GCC; see the file COPYING3. If not see SPARC ABI says that long double is 4 words. */ #define LONG_DOUBLE_TYPE_SIZE 128 -/* But indicate that it isn't supported by the hardware. */ -#define WIDEST_HARDWARE_FP_SIZE 64 - /* Solaris's _Qp_* library routine implementation clobbers the output memory before the inputs are fully consumed. */ diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 2e39082e1f6..191d6e807be 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -616,10 +616,14 @@ extern struct sparc_cpu_select sparc_select[]; #define LONG_LONG_TYPE_SIZE 64 #define FLOAT_TYPE_SIZE 32 #define DOUBLE_TYPE_SIZE 64 + /* LONG_DOUBLE_TYPE_SIZE is defined per OS even though the SPARC ABI says that it is 128-bit wide. */ /* #define LONG_DOUBLE_TYPE_SIZE 128 */ +/* The widest floating-point format really supported by the hardware. */ +#define WIDEST_HARDWARE_FP_SIZE 64 + /* Width in bits of a pointer. See also the macro `Pmode' defined below. */ #define POINTER_SIZE (TARGET_PTR64 ? 64 : 32) diff --git a/gcc/config/xtensa/predicates.md b/gcc/config/xtensa/predicates.md index c96f63730c4..2cb2a7d1757 100644 --- a/gcc/config/xtensa/predicates.md +++ b/gcc/config/xtensa/predicates.md @@ -166,3 +166,7 @@ (define_predicate "boolean_operator" (match_code "eq,ne")) + +(define_predicate "tls_symbol_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_TLS_MODEL (op) != 0"))) diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h index 7ecde9baf21..0447fae0a2e 100644 --- a/gcc/config/xtensa/xtensa-protos.h +++ b/gcc/config/xtensa/xtensa-protos.h @@ -56,6 +56,7 @@ extern char *xtensa_emit_movcc (bool, bool, bool, rtx *); extern char *xtensa_emit_call (int, rtx *); extern bool xtensa_legitimate_address_p (enum machine_mode, rtx, bool); extern rtx xtensa_legitimize_address (rtx, rtx, enum machine_mode); +extern bool xtensa_tls_referenced_p (rtx); #ifdef TREE_CODE extern void init_cumulative_args (CUMULATIVE_ARGS *, int); diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 1af9cbab450..4e7edef75a2 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -131,6 +131,7 @@ static rtx gen_float_relational (enum rtx_code, rtx, rtx); static rtx gen_conditional_move (rtx); static rtx fixup_subreg_mem (rtx); static struct machine_function * xtensa_init_machine_status (void); +static rtx xtensa_legitimize_tls_address (rtx); static bool xtensa_return_in_msb (const_tree); static void printx (FILE *, signed int); static void xtensa_function_epilogue (FILE *, HOST_WIDE_INT); @@ -219,6 +220,12 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] = #undef TARGET_SECONDARY_RELOAD #define TARGET_SECONDARY_RELOAD xtensa_secondary_reload +#undef TARGET_HAVE_TLS +#define TARGET_HAVE_TLS (TARGET_THREADPTR && HAVE_AS_TLS) + +#undef TARGET_CANNOT_FORCE_CONST_MEM +#define TARGET_CANNOT_FORCE_CONST_MEM xtensa_tls_referenced_p + struct gcc_target targetm = TARGET_INITIALIZER; @@ -469,6 +476,18 @@ constantpool_mem_p (rtx op) } +/* Return TRUE if X is a thread-local symbol. */ + +static bool +xtensa_tls_symbol_p (rtx x) +{ + if (! TARGET_HAVE_TLS) + return false; + + return GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0; +} + + void xtensa_extend_reg (rtx dst, rtx src) { @@ -910,12 +929,38 @@ xtensa_split_operand_pair (rtx operands[4], enum machine_mode mode) int xtensa_emit_move_sequence (rtx *operands, enum machine_mode mode) { - if (CONSTANT_P (operands[1]) - && (GET_CODE (operands[1]) != CONST_INT - || !xtensa_simm12b (INTVAL (operands[1])))) + rtx src = operands[1]; + + if (CONSTANT_P (src) + && (GET_CODE (src) != CONST_INT || ! xtensa_simm12b (INTVAL (src)))) { - if (!TARGET_CONST16) - operands[1] = force_const_mem (SImode, operands[1]); + rtx dst = operands[0]; + + if (xtensa_tls_referenced_p (src)) + { + rtx addend = NULL; + + if (GET_CODE (src) == CONST && GET_CODE (XEXP (src, 0)) == PLUS) + { + addend = XEXP (XEXP (src, 0), 1); + src = XEXP (XEXP (src, 0), 0); + } + + src = xtensa_legitimize_tls_address (src); + if (addend) + { + src = gen_rtx_PLUS (mode, src, addend); + src = force_operand (src, dst); + } + emit_move_insn (dst, src); + return 1; + } + + if (! TARGET_CONST16) + { + src = force_const_mem (SImode, src); + operands[1] = src; + } /* PC-relative loads are always SImode, and CONST16 is only supported in the movsi pattern, so add a SUBREG for any other @@ -923,16 +968,16 @@ xtensa_emit_move_sequence (rtx *operands, enum machine_mode mode) if (mode != SImode) { - if (register_operand (operands[0], mode)) + if (register_operand (dst, mode)) { - operands[0] = simplify_gen_subreg (SImode, operands[0], mode, 0); - emit_move_insn (operands[0], operands[1]); + emit_move_insn (simplify_gen_subreg (SImode, dst, mode, 0), src); return 1; } else { - operands[1] = force_reg (SImode, operands[1]); - operands[1] = gen_lowpart_SUBREG (mode, operands[1]); + src = force_reg (SImode, src); + src = gen_lowpart_SUBREG (mode, src); + operands[1] = src; } } } @@ -1664,7 +1709,8 @@ xtensa_legitimate_address_p (enum machine_mode mode, rtx addr, bool strict) { /* Allow constant pool addresses. */ if (mode != BLKmode && GET_MODE_SIZE (mode) >= UNITS_PER_WORD - && ! TARGET_CONST16 && constantpool_address_p (addr)) + && ! TARGET_CONST16 && constantpool_address_p (addr) + && ! xtensa_tls_referenced_p (addr)) return true; while (GET_CODE (addr) == SUBREG) @@ -1709,11 +1755,97 @@ xtensa_legitimate_address_p (enum machine_mode mode, rtx addr, bool strict) } +/* Construct the SYMBOL_REF for the _TLS_MODULE_BASE_ symbol. */ + +static GTY(()) rtx xtensa_tls_module_base_symbol; + +static rtx +xtensa_tls_module_base (void) +{ + if (! xtensa_tls_module_base_symbol) + { + xtensa_tls_module_base_symbol = + gen_rtx_SYMBOL_REF (Pmode, "_TLS_MODULE_BASE_"); + SYMBOL_REF_FLAGS (xtensa_tls_module_base_symbol) + |= TLS_MODEL_GLOBAL_DYNAMIC << SYMBOL_FLAG_TLS_SHIFT; + } + + return xtensa_tls_module_base_symbol; +} + + +static rtx +xtensa_call_tls_desc (rtx sym, rtx *retp) +{ + rtx fn, arg, a10, call_insn, insns; + + start_sequence (); + fn = gen_reg_rtx (Pmode); + arg = gen_reg_rtx (Pmode); + a10 = gen_rtx_REG (Pmode, 10); + + emit_insn (gen_tls_func (fn, sym)); + emit_insn (gen_tls_arg (arg, sym)); + emit_move_insn (a10, arg); + call_insn = emit_call_insn (gen_tls_call (a10, fn, sym, const1_rtx)); + CALL_INSN_FUNCTION_USAGE (call_insn) + = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_USE (VOIDmode, a10), + CALL_INSN_FUNCTION_USAGE (call_insn)); + insns = get_insns (); + end_sequence (); + + *retp = a10; + return insns; +} + + +static rtx +xtensa_legitimize_tls_address (rtx x) +{ + unsigned int model = SYMBOL_REF_TLS_MODEL (x); + rtx dest, tp, ret, modbase, base, addend, insns; + + dest = gen_reg_rtx (Pmode); + switch (model) + { + case TLS_MODEL_GLOBAL_DYNAMIC: + insns = xtensa_call_tls_desc (x, &ret); + emit_libcall_block (insns, dest, ret, x); + break; + + case TLS_MODEL_LOCAL_DYNAMIC: + base = gen_reg_rtx (Pmode); + modbase = xtensa_tls_module_base (); + insns = xtensa_call_tls_desc (modbase, &ret); + emit_libcall_block (insns, base, ret, modbase); + addend = force_reg (SImode, gen_sym_DTPOFF (x)); + emit_insn (gen_addsi3 (dest, base, addend)); + break; + + case TLS_MODEL_INITIAL_EXEC: + case TLS_MODEL_LOCAL_EXEC: + tp = gen_reg_rtx (SImode); + emit_insn (gen_load_tp (tp)); + addend = force_reg (SImode, gen_sym_TPOFF (x)); + emit_insn (gen_addsi3 (dest, tp, addend)); + break; + + default: + gcc_unreachable (); + } + + return dest; +} + + rtx xtensa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) { + if (xtensa_tls_symbol_p (x)) + return xtensa_legitimize_tls_address (x); + if (GET_CODE (x) == PLUS) { rtx plus0 = XEXP (x, 0); @@ -1745,6 +1877,46 @@ xtensa_legitimize_address (rtx x, } +/* Helper for xtensa_tls_referenced_p. */ + +static int +xtensa_tls_referenced_p_1 (rtx *x, void *data ATTRIBUTE_UNUSED) +{ + if (GET_CODE (*x) == SYMBOL_REF) + return SYMBOL_REF_TLS_MODEL (*x) != 0; + + /* Ignore TLS references that have already been legitimized. */ + if (GET_CODE (*x) == UNSPEC) + { + switch (XINT (*x, 1)) + { + case UNSPEC_TPOFF: + case UNSPEC_DTPOFF: + case UNSPEC_TLS_FUNC: + case UNSPEC_TLS_ARG: + case UNSPEC_TLS_CALL: + return -1; + default: + break; + } + } + + return 0; +} + + +/* Return TRUE if X contains any TLS symbol references. */ + +bool +xtensa_tls_referenced_p (rtx x) +{ + if (! TARGET_HAVE_TLS) + return false; + + return for_each_rtx (&x, xtensa_tls_referenced_p_1, NULL); +} + + /* Return the debugger register number to use for 'regno'. */ int @@ -2204,6 +2376,14 @@ xtensa_output_addr_const_extra (FILE *fp, rtx x) { switch (XINT (x, 1)) { + case UNSPEC_TPOFF: + output_addr_const (fp, XVECEXP (x, 0, 0)); + fputs ("@TPOFF", fp); + return true; + case UNSPEC_DTPOFF: + output_addr_const (fp, XVECEXP (x, 0, 0)); + fputs ("@DTPOFF", fp); + return true; case UNSPEC_PLT: if (flag_pic) { @@ -2760,6 +2940,8 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, enum xtensa_builtin { XTENSA_BUILTIN_UMULSIDI3, + XTENSA_BUILTIN_THREAD_POINTER, + XTENSA_BUILTIN_SET_THREAD_POINTER, XTENSA_BUILTIN_max }; @@ -2767,15 +2949,34 @@ enum xtensa_builtin static void xtensa_init_builtins (void) { - tree ftype; + tree ftype, decl; ftype = build_function_type_list (unsigned_intDI_type_node, unsigned_intSI_type_node, unsigned_intSI_type_node, NULL_TREE); - add_builtin_function ("__builtin_umulsidi3", ftype, - XTENSA_BUILTIN_UMULSIDI3, BUILT_IN_MD, - "__umulsidi3", NULL_TREE); + decl = add_builtin_function ("__builtin_umulsidi3", ftype, + XTENSA_BUILTIN_UMULSIDI3, BUILT_IN_MD, + "__umulsidi3", NULL_TREE); + TREE_NOTHROW (decl) = 1; + TREE_READONLY (decl) = 1; + + if (TARGET_THREADPTR) + { + ftype = build_function_type (ptr_type_node, void_list_node); + decl = add_builtin_function ("__builtin_thread_pointer", ftype, + XTENSA_BUILTIN_THREAD_POINTER, BUILT_IN_MD, + NULL, NULL_TREE); + TREE_READONLY (decl) = 1; + TREE_NOTHROW (decl) = 1; + + ftype = build_function_type_list (void_type_node, ptr_type_node, + NULL_TREE); + decl = add_builtin_function ("__builtin_set_thread_pointer", ftype, + XTENSA_BUILTIN_SET_THREAD_POINTER, + BUILT_IN_MD, NULL, NULL_TREE); + TREE_NOTHROW (decl) = 1; + } } @@ -2785,8 +2986,9 @@ xtensa_fold_builtin (tree fndecl, tree arglist, bool ignore ATTRIBUTE_UNUSED) unsigned int fcode = DECL_FUNCTION_CODE (fndecl); tree arg0, arg1; - if (fcode == XTENSA_BUILTIN_UMULSIDI3) + switch (fcode) { + case XTENSA_BUILTIN_UMULSIDI3: arg0 = TREE_VALUE (arglist); arg1 = TREE_VALUE (TREE_CHAIN (arglist)); if ((TREE_CODE (arg0) == INTEGER_CST && TREE_CODE (arg1) == INTEGER_CST) @@ -2794,11 +2996,17 @@ xtensa_fold_builtin (tree fndecl, tree arglist, bool ignore ATTRIBUTE_UNUSED) return fold_build2 (MULT_EXPR, unsigned_intDI_type_node, fold_convert (unsigned_intDI_type_node, arg0), fold_convert (unsigned_intDI_type_node, arg1)); - else - return NULL; + break; + + case XTENSA_BUILTIN_THREAD_POINTER: + case XTENSA_BUILTIN_SET_THREAD_POINTER: + break; + + default: + internal_error ("bad builtin code"); + break; } - internal_error ("bad builtin code"); return NULL; } @@ -2811,14 +3019,32 @@ xtensa_expand_builtin (tree exp, rtx target, { tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0); unsigned int fcode = DECL_FUNCTION_CODE (fndecl); + rtx arg; + + switch (fcode) + { + case XTENSA_BUILTIN_UMULSIDI3: + /* The umulsidi3 builtin is just a mechanism to avoid calling the real + __umulsidi3 function when the Xtensa configuration can directly + implement it. If not, just call the function. */ + return expand_call (exp, target, ignore); - /* The umulsidi3 builtin is just a mechanism to avoid calling the real - __umulsidi3 function when the Xtensa configuration can directly - implement it. If not, just call the function. */ - if (fcode == XTENSA_BUILTIN_UMULSIDI3) - return expand_call (exp, target, ignore); + case XTENSA_BUILTIN_THREAD_POINTER: + if (!target || !register_operand (target, Pmode)) + target = gen_reg_rtx (Pmode); + emit_insn (gen_load_tp (target)); + return target; - internal_error ("bad builtin code"); + case XTENSA_BUILTIN_SET_THREAD_POINTER: + arg = expand_normal (CALL_EXPR_ARG (exp, 0)); + if (!register_operand (arg, Pmode)) + arg = copy_to_mode_reg (Pmode, arg); + emit_insn (gen_set_tp (arg)); + return const0_rtx; + + default: + internal_error ("bad builtin code"); + } return NULL_RTX; } diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index ab3b648ffa4..1427fd0e3da 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -51,6 +51,9 @@ extern unsigned xtensa_current_frame_size; #ifndef XCHAL_HAVE_S32C1I #define XCHAL_HAVE_S32C1I 0 #endif +#ifndef XCHAL_HAVE_THREADPTR +#define XCHAL_HAVE_THREADPTR 0 +#endif #define TARGET_BIG_ENDIAN XCHAL_HAVE_BE #define TARGET_DENSITY XCHAL_HAVE_DENSITY #define TARGET_MAC16 XCHAL_HAVE_MAC16 @@ -72,11 +75,16 @@ extern unsigned xtensa_current_frame_size; #define TARGET_RELEASE_SYNC XCHAL_HAVE_RELEASE_SYNC #define TARGET_S32C1I XCHAL_HAVE_S32C1I #define TARGET_ABSOLUTE_LITERALS XSHAL_USE_ABSOLUTE_LITERALS +#define TARGET_THREADPTR XCHAL_HAVE_THREADPTR #define TARGET_DEFAULT \ ((XCHAL_HAVE_L32R ? 0 : MASK_CONST16) | \ MASK_SERIALIZE_VOLATILE) +#ifndef HAVE_AS_TLS +#define HAVE_AS_TLS 0 +#endif + #define OVERRIDE_OPTIONS override_options () /* Reordering blocks for Xtensa is not a good idea unless the compiler @@ -791,7 +799,7 @@ typedef struct xtensa_args /* Nonzero if the constant value X is a legitimate general operand. It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ -#define LEGITIMATE_CONSTANT_P(X) 1 +#define LEGITIMATE_CONSTANT_P(X) (! xtensa_tls_referenced_p (X)) /* A C expression that is nonzero if X is a legitimate immediate operand on the target machine when generating position independent diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index 4f831d3f22c..29119ed16bb 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -29,6 +29,12 @@ (UNSPEC_NOP 2) (UNSPEC_PLT 3) (UNSPEC_RET_ADDR 4) + (UNSPEC_TPOFF 5) + (UNSPEC_DTPOFF 6) + (UNSPEC_TLS_FUNC 7) + (UNSPEC_TLS_ARG 8) + (UNSPEC_TLS_CALL 9) + (UNSPEC_TP 10) (UNSPECV_SET_FP 1) (UNSPECV_ENTRY 2) @@ -36,6 +42,7 @@ (UNSPECV_S32RI 4) (UNSPECV_S32C1I 5) (UNSPECV_EH_RETURN 6) + (UNSPECV_SET_TP 7) ]) ;; This code iterator allows signed and unsigned widening multiplications @@ -1560,9 +1567,9 @@ }) (define_insn "call_value_internal" - [(set (match_operand 0 "register_operand" "=a") - (call (mem (match_operand:SI 1 "call_insn_operand" "nir")) - (match_operand 2 "" "i")))] + [(set (match_operand 0 "register_operand" "=a") + (call (mem (match_operand:SI 1 "call_insn_operand" "nir")) + (match_operand 2 "" "i")))] "" { return xtensa_emit_call (1, operands); @@ -1698,6 +1705,69 @@ (set_attr "length" "0")]) +;; TLS support + +(define_expand "sym_TPOFF" + [(const (unspec [(match_operand:SI 0 "" "")] UNSPEC_TPOFF))] + "" + "") + +(define_expand "sym_DTPOFF" + [(const (unspec [(match_operand:SI 0 "" "")] UNSPEC_DTPOFF))] + "" + "") + +(define_insn "load_tp" + [(set (match_operand:SI 0 "register_operand" "=a") + (unspec:SI [(const_int 0)] UNSPEC_TP))] + "TARGET_THREADPTR" + "rur\t%0, THREADPTR" + [(set_attr "type" "rsr") + (set_attr "mode" "SI") + (set_attr "length" "3")]) + +(define_insn "set_tp" + [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")] + UNSPECV_SET_TP)] + "TARGET_THREADPTR" + "wur\t%0, THREADPTR" + [(set_attr "type" "wsr") + (set_attr "mode" "SI") + (set_attr "length" "3")]) + +(define_insn "tls_func" + [(set (match_operand:SI 0 "register_operand" "=a") + (unspec:SI [(match_operand:SI 1 "tls_symbol_operand" "")] + UNSPEC_TLS_FUNC))] + "TARGET_THREADPTR && HAVE_AS_TLS" + "movi\t%0, %1@TLSFUNC" + [(set_attr "type" "load") + (set_attr "mode" "SI") + (set_attr "length" "3")]) + +(define_insn "tls_arg" + [(set (match_operand:SI 0 "register_operand" "=a") + (unspec:SI [(match_operand:SI 1 "tls_symbol_operand" "")] + UNSPEC_TLS_ARG))] + "TARGET_THREADPTR && HAVE_AS_TLS" + "movi\t%0, %1@TLSARG" + [(set_attr "type" "load") + (set_attr "mode" "SI") + (set_attr "length" "3")]) + +(define_insn "tls_call" + [(set (match_operand:SI 0 "register_operand" "=a") + (call (mem:SI (unspec:SI [(match_operand:SI 1 "register_operand" "r") + (match_operand:SI 2 "tls_symbol_operand" "")] + UNSPEC_TLS_CALL)) + (match_operand 3 "" "i")))] + "TARGET_THREADPTR && HAVE_AS_TLS" + "callx8.tls %1, %2@TLSCALL" + [(set_attr "type" "call") + (set_attr "mode" "none") + (set_attr "length" "3")]) + + ;; Instructions for the Xtensa "boolean" option. (define_insn "*booltrue" diff --git a/gcc/configure b/gcc/configure index 9514f8860c7..f2d8bdb9c44 100755 --- a/gcc/configure +++ b/gcc/configure @@ -21841,7 +21841,7 @@ cat >>confdefs.h <<_ACEOF _ACEOF -# Thread-local storage - the check is heavily parametrized. +# Thread-local storage - the check is heavily parameterized. conftest_s= tls_first_major= tls_first_minor= @@ -22173,6 +22173,17 @@ foo: .long 25 tls_as_opt="-32 --fatal-warnings" fi ;; + xtensa*-*-*) + conftest_s=' + .section ".tdata","awT",@progbits +foo: .long 25 + .text + movi a8, foo@TLSFUNC + movi a10, foo@TLSARG + callx8.tls a8, foo@TLSCALL' + tls_first_major=2 + tls_first_minor=19 + ;; esac set_have_as_tls=no if test "x$enable_tls" = xno ; then diff --git a/gcc/configure.ac b/gcc/configure.ac index d02f8e7a8e2..991a9042183 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -2629,7 +2629,7 @@ AC_DEFINE_UNQUOTED(HAVE_COMDAT_GROUP, [`if test $gcc_cv_as_comdat_group = yes || test $gcc_cv_as_comdat_group_percent = yes; then echo 1; else echo 0; fi`], [Define 0/1 if your assembler and linker support COMDAT groups.]) -# Thread-local storage - the check is heavily parametrized. +# Thread-local storage - the check is heavily parameterized. conftest_s= tls_first_major= tls_first_minor= @@ -2962,6 +2962,17 @@ foo: .long 25 tls_as_opt="-32 --fatal-warnings" fi ;; + xtensa*-*-*) + conftest_s=' + .section ".tdata","awT",@progbits +foo: .long 25 + .text + movi a8, foo@TLSFUNC + movi a10, foo@TLSARG + callx8.tls a8, foo@TLSCALL' + tls_first_major=2 + tls_first_minor=19 + ;; changequote([,])dnl esac set_have_as_tls=no diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a78e5f460be..ebab140a9f5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,31 @@ +2008-09-17 Richard Guenther <rguenther@suse.de> + + PR c++/22374 + * rtti.c (build_dynamic_cast_1): Convert the COND_EXPR + result to the correct type. + +2008-09-17 H.J. Lu <hongjiu.lu@intel.com> + + PR c++/37450 + * name-lookup.c (pushdecl_maybe_friend): Don't return the old + parameter for duplicate. + +2008-09-17 Jason Merrill <jason@redhat.com> + + PR c++/37588 + * name-lookup.c (lookup_type_scope): Look through sk_function_parms. + +2008-09-17 Jakub Jelinek <jakub@redhat.com> + + PR c++/37552 + * typeck.c (build_array_ref): Use protected_set_expr_location instead + of SET_EXPR_LOCATION when ret might not be an expression. + +2008-09-17 Jan Hubicka <jh@suse.cz> + + PR c++/18071 + * cp/decl.c (start_method): Set DECL_NO_INLINE_WARNING_P. + 2008-09-16 Jakub Jelinek <jakub@redhat.com> PR c++/37531 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d699f89be32..f57ca871254 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -12332,6 +12332,7 @@ start_method (cp_decl_specifier_seq *declspecs, check_template_shadow (fndecl); DECL_DECLARED_INLINE_P (fndecl) = 1; + DECL_NO_INLINE_WARNING_P (fndecl) = 1; /* We process method specializations in finish_struct_1. */ if (processing_template_decl && !DECL_TEMPLATE_SPECIALIZATION (fndecl)) diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 743f02365ee..946b321fadd 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -720,8 +720,9 @@ pushdecl_maybe_friend (tree x, bool is_friend) else if (TREE_CODE (t) == PARM_DECL) { /* Check for duplicate params. */ - if (duplicate_decls (x, t, is_friend)) - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); + tree d = duplicate_decls (x, t, is_friend); + if (d) + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, d); } else if ((DECL_EXTERN_C_FUNCTION_P (x) || DECL_FUNCTION_TEMPLATE_P (x)) @@ -4282,7 +4283,8 @@ lookup_type_scope (tree name, tag_scope scope) if (iter->scope == b) POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, val); - if (b->kind == sk_cleanup || b->kind == sk_template_parms) + if (b->kind == sk_cleanup || b->kind == sk_template_parms + || b->kind == sk_function_parms) b = b->level_chain; else if (b->kind == sk_class && scope == ts_within_enclosing_non_class) diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index e3e5349f5ca..1c67832a7fd 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -722,7 +722,9 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain) result = save_expr (result); neq = c_common_truthvalue_conversion (result); - return build3 (COND_EXPR, type, neq, result, bad); + return cp_convert (type, + build3 (COND_EXPR, TREE_TYPE (result), + neq, result, bad)); } /* Now back to the type we want from a void*. */ diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 9de51c53c16..cfa33ae691f 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -2544,7 +2544,7 @@ build_array_ref (tree array, tree idx, location_t loc) build_array_ref (TREE_OPERAND (array, 1), idx, loc), build_array_ref (TREE_OPERAND (array, 2), idx, loc), tf_warning_or_error); - SET_EXPR_LOCATION (ret, loc); + protected_set_expr_location (ret, loc); return ret; default: @@ -2623,7 +2623,7 @@ build_array_ref (tree array, tree idx, location_t loc) TREE_THIS_VOLATILE (rval) |= (CP_TYPE_VOLATILE_P (type) | TREE_THIS_VOLATILE (array)); ret = require_complete_type (fold_if_not_in_template (rval)); - SET_EXPR_LOCATION (ret, loc); + protected_set_expr_location (ret, loc); return ret; } diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 10e72d1d5a4..c13f2a2638d 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -228,7 +228,8 @@ Objective-C and Objective-C++ Dialects}. @xref{Warning Options,,Options to Request or Suppress Warnings}. @gccoptlist{-fsyntax-only -pedantic -pedantic-errors @gol -w -Wextra -Wall -Waddress -Waggregate-return -Warray-bounds @gol --Wno-attributes -Wc++-compat -Wc++0x-compat -Wcast-align -Wcast-qual @gol +-Wno-attributes -Wno-builtin-macro-redefined @gol +-Wc++-compat -Wc++0x-compat -Wcast-align -Wcast-qual @gol -Wchar-subscripts -Wclobbered -Wcomment @gol -Wconversion -Wcoverage-mismatch -Wno-deprecated @gol -Wno-deprecated-declarations -Wdisabled-optimization @gol @@ -742,7 +743,8 @@ See RS/6000 and PowerPC Options. @emph{S/390 and zSeries Options} @gccoptlist{-mtune=@var{cpu-type} -march=@var{cpu-type} @gol --mhard-float -msoft-float -mlong-double-64 -mlong-double-128 @gol +-mhard-float -msoft-float -mhard-dfp -mno-hard-dfp @gol +-mlong-double-64 -mlong-double-128 @gol -mbackchain -mno-backchain -mpacked-stack -mno-packed-stack @gol -msmall-exec -mno-small-exec -mmvcle -mno-mvcle @gol -m64 -m31 -mdebug -mno-debug -mesa -mzarch @gol @@ -3735,6 +3737,13 @@ unrecognized attributes, function attributes applied to variables, etc. This will not stop errors for incorrect use of supported attributes. +@item -Wno-builtin-macro-redefined +@opindex Wno-builtin-macro-redefined +@opindex Wbuiltin-macro-redefined +Do not warn if certain built-in macros are redefined. This suppresses +warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__}, +@code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}. + @item -Wstrict-prototypes @r{(C and Objective-C only)} @opindex Wstrict-prototypes @opindex Wno-strict-prototypes @@ -14054,6 +14063,17 @@ functions in @file{libgcc.a} will be used to perform floating-point operations. When @option{-mhard-float} is specified, the compiler generates IEEE floating-point instructions. This is the default. +@item -mhard-dfp +@itemx -mno-hard-dfp +@opindex mhard-dfp +@opindex mno-hard-dfp +Use (do not use) the hardware decimal-floating-point instructions for +decimal-floating-point operations. When @option{-mno-hard-dfp} is +specified, functions in @file{libgcc.a} will be used to perform +decimal-floating-point operations. When @option{-mhard-dfp} is +specified, the compiler generates decimal-floating-point hardware +instructions. This is the default for @option{-march=z9-ec} or higher. + @item -mlong-double-64 @itemx -mlong-double-128 @opindex mlong-double-64 @@ -14164,7 +14184,8 @@ The default is to not print debug information. @opindex march Generate code that will run on @var{cpu-type}, which is the name of a system representing a certain processor type. Possible values for -@var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}. +@var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990}, +@samp{z9-109}, @samp{z9-ec} and @samp{z10}. When generating code using the instructions available on z/Architecture, the default is @option{-march=z900}. Otherwise, the default is @option{-march=g5}. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index ab68a00af6a..27b2ca1960c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -137,6 +137,9 @@ dwarf2out_do_cfi_asm (void) { int enc; +#ifdef MIPS_DEBUGGING_INFO + return false; +#endif if (!flag_dwarf2_cfi_asm || !dwarf2out_do_frame ()) return false; if (!eh_personality_libfunc) diff --git a/gcc/expr.c b/gcc/expr.c index f2e9c79abf2..ae0daf0b251 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -2039,33 +2039,17 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize) HOST_WIDE_INT bytepos = INTVAL (XEXP (XVECEXP (src, 0, i), 1)); enum machine_mode mode = GET_MODE (tmps[i]); unsigned int bytelen = GET_MODE_SIZE (mode); + unsigned int adj_bytelen = bytelen; rtx dest = dst; /* Handle trailing fragments that run over the size of the struct. */ if (ssize >= 0 && bytepos + (HOST_WIDE_INT) bytelen > ssize) - { - /* store_bit_field always takes its value from the lsb. - Move the fragment to the lsb if it's not already there. */ - if ( -#ifdef BLOCK_REG_PADDING - BLOCK_REG_PADDING (GET_MODE (orig_dst), type, i == start) - == (BYTES_BIG_ENDIAN ? upward : downward) -#else - BYTES_BIG_ENDIAN -#endif - ) - { - int shift = (bytelen - (ssize - bytepos)) * BITS_PER_UNIT; - tmps[i] = expand_shift (RSHIFT_EXPR, mode, tmps[i], - build_int_cst (NULL_TREE, shift), - tmps[i], 0); - } - bytelen = ssize - bytepos; - } + adj_bytelen = ssize - bytepos; if (GET_CODE (dst) == CONCAT) { - if (bytepos + bytelen <= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0)))) + if (bytepos + adj_bytelen + <= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0)))) dest = XEXP (dst, 0); else if (bytepos >= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0)))) { @@ -2103,6 +2087,27 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize) } } + if (ssize >= 0 && bytepos + (HOST_WIDE_INT) bytelen > ssize) + { + /* store_bit_field always takes its value from the lsb. + Move the fragment to the lsb if it's not already there. */ + if ( +#ifdef BLOCK_REG_PADDING + BLOCK_REG_PADDING (GET_MODE (orig_dst), type, i == start) + == (BYTES_BIG_ENDIAN ? upward : downward) +#else + BYTES_BIG_ENDIAN +#endif + ) + { + int shift = (bytelen - (ssize - bytepos)) * BITS_PER_UNIT; + tmps[i] = expand_shift (RSHIFT_EXPR, mode, tmps[i], + build_int_cst (NULL_TREE, shift), + tmps[i], 0); + } + bytelen = adj_bytelen; + } + /* Optimize the access just a bit. */ if (MEM_P (dest) && (! SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (dest)) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4d4752a251b..c972097a67b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,68 @@ +2008-09-18 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/35945 + * resolve.c (resolve_fl_variable_derived): Remove derived type + comparison for use associated derived types. Host association + of a derived type will not arise if there is a local derived type + whose use name is the same. + + PR fortran/36700 + * match.c (gfc_match_call): Use the existing symbol even if + it is a function. + +2008-09-18 Daniel Kraft <d@domob.eu> + + PR fortran/37507 + * trans.h (gfc_trans_runtime_error): New method. + (gfc_trans_runtime_error_vararg): New method. + (gfc_allocate_array_with_status): New argument `expr' for locus/varname. + (gfc_deallocate_array_with_status): Ditto. + * trans-array.h (gfc_array_deallocate): Ditto. + * trans.c (gfc_trans_runtime_error): New method. + (gfc_trans_runtime_error_vararg): New method, moved parts of the code + from gfc_trans_runtime_check here. + (gfc_trans_runtime_error_check): Moved code partly to new method. + (gfc_call_malloc): Fix tab-indentation. + (gfc_allocate_array_with_status): New argument `expr' and call + gfc_trans_runtime_error for error reporting to include locus. + (gfc_deallocate_with_status): Ditto. + * trans-stmt.c (gfc_trans_deallocate): Pass expr as new argument. + * trans-array.c (gfc_array_allocate): Ditto. + (gfc_array_deallocate): New argument `expr', passed on. + (gfc_trans_dealloc_allocated): Pass NULL for expr. + * trans-openmp.c (gfc_omp_clause_default): Ditto. + +2008-09-18 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/37274 + PR fortran/36374 + * module.c (check_for_ambiguous): New function to test loaded + symbol for ambiguity with fixup symbol. + (read_module): Call check_for_ambiguous. + (write_symtree): Do not write the symtree for symbols coming + from an interface body. + + PR fortran/36374 + * resolve.c (count_specific_procs ): New function to count the + number of specific procedures with the same name as the generic + and emit appropriate errors for and actual argument reference. + (resolve_assumed_size_actual): Add new argument no_formal_args. + Correct logic around passing generic procedures as arguments. + Call count_specific_procs from two locations. + (resolve_function): Evaluate and pass no_formal_args. + (resolve call): The same and clean up a bit by using csym more + widely. + + PR fortran/36454 + * symbol.c (gfc_add_access): Access can be updated if use + associated and not private. + +2008-09-17 Jakub Jelinek <jakub@redhat.com> + + PR fortran/37536 + * trans-stmt.c (gfc_trans_do): Optimize integer type non-simple + do loop initialization. + 2008-09-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> Tobias Burnus <burnus@net.b.de> diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 3b9d3d21d71..f7ff9bbdc3b 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -2589,9 +2589,12 @@ gfc_match_call (void) if (sym->attr.flavor != FL_PROCEDURE && sym->ts.type == BT_DERIVED) return match_typebound_call (st); - /* If it does not seem to be callable... */ + /* If it does not seem to be callable (include functions so that the + right association is made. They are thrown out in resolution.) + ... */ if (!sym->attr.generic - && !sym->attr.subroutine) + && !sym->attr.subroutine + && !sym->attr.function) { if (!(sym->attr.external && !sym->attr.referenced)) { diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 907002bc93a..762114c2b75 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -3944,6 +3944,48 @@ read_cleanup (pointer_info *p) } +/* It is not quite enough to check for ambiguity in the symbols by + the loaded symbol and the new symbol not being identical. */ +static bool +check_for_ambiguous (gfc_symbol *st_sym, pointer_info *info) +{ + gfc_symbol *rsym; + module_locus locus; + symbol_attribute attr; + + rsym = info->u.rsym.sym; + if (st_sym == rsym) + return false; + + /* Identical derived types are not ambiguous and will be rolled up + later. */ + if (st_sym->attr.flavor == FL_DERIVED + && rsym->attr.flavor == FL_DERIVED + && gfc_compare_derived_types (st_sym, rsym)) + return false; + + /* If the existing symbol is generic from a different module and + the new symbol is generic there can be no ambiguity. */ + if (st_sym->attr.generic + && st_sym->module + && strcmp (st_sym->module, module_name)) + { + /* The new symbol's attributes have not yet been read. Since + we need attr.generic, read it directly. */ + get_module_locus (&locus); + set_module_locus (&info->u.rsym.where); + mio_lparen (); + attr.generic = 0; + mio_symbol_attribute (&attr); + set_module_locus (&locus); + if (attr.generic) + return false; + } + + return true; +} + + /* Read a module file. */ static void @@ -4085,7 +4127,7 @@ read_module (void) if (st != NULL) { /* Check for ambiguous symbols. */ - if (st->n.sym != info->u.rsym.sym) + if (check_for_ambiguous (st->n.sym, info)) st->ambiguous = 1; info->u.rsym.symtree = st; } @@ -4579,6 +4621,14 @@ write_symtree (gfc_symtree *st) pointer_info *p; sym = st->n.sym; + + /* A symbol in an interface body must not be visible in the + module file. */ + if (sym->ns != gfc_current_ns + && sym->ns->proc_name + && sym->ns->proc_name->attr.if_source == IFSRC_IFBODY) + return; + if (!gfc_check_access (sym->attr.access, sym->ns->default_access) || (sym->attr.flavor == FL_PROCEDURE && sym->attr.generic && !sym->attr.subroutine && !sym->attr.function)) diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 69245f2ce35..f8f2df972cc 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -1040,6 +1040,38 @@ resolve_assumed_size_actual (gfc_expr *e) } +/* Check a generic procedure, passed as an actual argument, to see if + there is a matching specific name. If none, it is an error, and if + more than one, the reference is ambiguous. */ +static int +count_specific_procs (gfc_expr *e) +{ + int n; + gfc_interface *p; + gfc_symbol *sym; + + n = 0; + sym = e->symtree->n.sym; + + for (p = sym->generic; p; p = p->next) + if (strcmp (sym->name, p->sym->name) == 0) + { + e->symtree = gfc_find_symtree (p->sym->ns->sym_root, + sym->name); + n++; + } + + if (n > 1) + gfc_error ("'%s' at %L is ambiguous", e->symtree->n.sym->name, + &e->where); + + if (n == 0) + gfc_error ("GENERIC procedure '%s' is not allowed as an actual " + "argument at %L", sym->name, &e->where); + + return n; +} + /* Resolve an actual argument list. Most of the time, this is just resolving the expressions in the list. The exception is that we sometimes have to decide whether arguments @@ -1047,13 +1079,14 @@ resolve_assumed_size_actual (gfc_expr *e) references. */ static gfc_try -resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype) +resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype, + bool no_formal_args) { gfc_symbol *sym; gfc_symtree *parent_st; gfc_expr *e; int save_need_full_assumed_size; - + for (; arg; arg = arg->next) { e = arg->expr; @@ -1072,12 +1105,11 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype) continue; } - if (e->expr_type == EXPR_VARIABLE && e->symtree->ambiguous) - { - gfc_error ("'%s' at %L is ambiguous", e->symtree->n.sym->name, - &e->where); - return FAILURE; - } + if (e->expr_type == FL_VARIABLE + && e->symtree->n.sym->attr.generic + && no_formal_args + && count_specific_procs (e) != 1) + return FAILURE; if (e->ts.type != BT_PROCEDURE) { @@ -1138,23 +1170,11 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype) /* Check if a generic interface has a specific procedure with the same name before emitting an error. */ - if (sym->attr.generic) - { - gfc_interface *p; - for (p = sym->generic; p; p = p->next) - if (strcmp (sym->name, p->sym->name) == 0) - { - e->symtree = gfc_find_symtree - (p->sym->ns->sym_root, sym->name); - sym = p->sym; - break; - } - - if (p == NULL || e->symtree == NULL) - gfc_error ("GENERIC procedure '%s' is not " - "allowed as an actual argument at %L", sym->name, - &e->where); - } + if (sym->attr.generic && count_specific_procs (e) != 1) + return FAILURE; + + /* Just in case a specific was found for the expression. */ + sym = e->symtree->n.sym; /* If the symbol is the function that names the current (or parent) scope, then we really have a variable reference. */ @@ -2199,6 +2219,7 @@ resolve_function (gfc_expr *expr) gfc_try t; int temp; procedure_type p = PROC_INTRINSIC; + bool no_formal_args; sym = NULL; if (expr->symtree) @@ -2238,7 +2259,9 @@ resolve_function (gfc_expr *expr) if (expr->symtree && expr->symtree->n.sym) p = expr->symtree->n.sym->attr.proc; - if (resolve_actual_arglist (expr->value.function.actual, p) == FAILURE) + no_formal_args = sym && is_external_proc (sym) && sym->formal == NULL; + if (resolve_actual_arglist (expr->value.function.actual, + p, no_formal_args) == FAILURE) return FAILURE; /* Need to setup the call to the correct c_associated, depending on @@ -2817,26 +2840,27 @@ resolve_call (gfc_code *c) { gfc_try t; procedure_type ptype = PROC_INTRINSIC; + gfc_symbol *csym; + bool no_formal_args; + + csym = c->symtree ? c->symtree->n.sym : NULL; - if (c->symtree && c->symtree->n.sym - && c->symtree->n.sym->ts.type != BT_UNKNOWN) + if (csym && csym->ts.type != BT_UNKNOWN) { gfc_error ("'%s' at %L has a type, which is not consistent with " - "the CALL at %L", c->symtree->n.sym->name, - &c->symtree->n.sym->declared_at, &c->loc); + "the CALL at %L", csym->name, &csym->declared_at, &c->loc); return FAILURE; } /* If external, check for usage. */ - if (c->symtree && is_external_proc (c->symtree->n.sym)) - resolve_global_procedure (c->symtree->n.sym, &c->loc, 1); + if (csym && is_external_proc (csym)) + resolve_global_procedure (csym, &c->loc, 1); /* Subroutines without the RECURSIVE attribution are not allowed to * call themselves. */ - if (c->symtree && c->symtree->n.sym && !c->symtree->n.sym->attr.recursive) + if (csym && !csym->attr.recursive) { - gfc_symbol *csym, *proc; - csym = c->symtree->n.sym; + gfc_symbol *proc; proc = gfc_current_ns->proc_name; if (csym == proc) { @@ -2859,10 +2883,12 @@ resolve_call (gfc_code *c) of procedure, once the procedure itself is resolved. */ need_full_assumed_size++; - if (c->symtree && c->symtree->n.sym) - ptype = c->symtree->n.sym->attr.proc; + if (csym) + ptype = csym->attr.proc; - if (resolve_actual_arglist (c->ext.actual, ptype) == FAILURE) + no_formal_args = csym && is_external_proc (csym) && csym->formal == NULL; + if (resolve_actual_arglist (c->ext.actual, ptype, + no_formal_args) == FAILURE) return FAILURE; /* Resume assumed_size checking. */ @@ -2870,7 +2896,7 @@ resolve_call (gfc_code *c) t = SUCCESS; if (c->resolved_sym == NULL) - switch (procedure_kind (c->symtree->n.sym)) + switch (procedure_kind (csym)) { case PTYPE_GENERIC: t = resolve_generic_s (c); @@ -7345,8 +7371,7 @@ resolve_fl_variable_derived (gfc_symbol *sym, int no_init_flag) { gfc_symbol *s; gfc_find_symbol (sym->ts.derived->name, sym->ns, 0, &s); - if (s && (s->attr.flavor != FL_DERIVED - || !gfc_compare_derived_types (s, sym->ts.derived))) + if (s && s->attr.flavor != FL_DERIVED) { gfc_error ("The type '%s' cannot be host associated at %L " "because it is blocked by an incompatible object " diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 905b243a225..37f07dfaa84 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -1446,7 +1446,8 @@ gfc_add_access (symbol_attribute *attr, gfc_access access, const char *name, locus *where) { - if (attr->access == ACCESS_UNKNOWN) + if (attr->access == ACCESS_UNKNOWN + || (attr->use_assoc && attr->access != ACCESS_PRIVATE)) { attr->access = access; return check_conflict (attr, name, where); diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 1ab58e1d7eb..f4af4f25da1 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -3796,7 +3796,7 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree pstat) /* The allocate_array variants take the old pointer as first argument. */ if (allocatable_array) - tmp = gfc_allocate_array_with_status (&se->pre, pointer, size, pstat); + tmp = gfc_allocate_array_with_status (&se->pre, pointer, size, pstat, expr); else tmp = gfc_allocate_with_status (&se->pre, size, pstat); tmp = fold_build2 (MODIFY_EXPR, void_type_node, pointer, tmp); @@ -3822,7 +3822,7 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree pstat) /*GCC ARRAYS*/ tree -gfc_array_deallocate (tree descriptor, tree pstat) +gfc_array_deallocate (tree descriptor, tree pstat, gfc_expr* expr) { tree var; tree tmp; @@ -3834,7 +3834,7 @@ gfc_array_deallocate (tree descriptor, tree pstat) STRIP_NOPS (var); /* Parameter is the address of the data component. */ - tmp = gfc_deallocate_with_status (var, pstat, false); + tmp = gfc_deallocate_with_status (var, pstat, false, expr); gfc_add_expr_to_block (&block, tmp); /* Zero the data pointer. */ @@ -5341,7 +5341,7 @@ gfc_trans_dealloc_allocated (tree descriptor) /* Call array_deallocate with an int * present in the second argument. Although it is ignored here, it's presence ensures that arrays that are already deallocated are ignored. */ - tmp = gfc_deallocate_with_status (var, NULL_TREE, true); + tmp = gfc_deallocate_with_status (var, NULL_TREE, true, NULL); gfc_add_expr_to_block (&block, tmp); /* Zero the data pointer. */ diff --git a/gcc/fortran/trans-array.h b/gcc/fortran/trans-array.h index 18de51c8437..2cc9d5caf28 100644 --- a/gcc/fortran/trans-array.h +++ b/gcc/fortran/trans-array.h @@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ /* Generate code to free an array. */ -tree gfc_array_deallocate (tree, tree); +tree gfc_array_deallocate (tree, tree, gfc_expr*); /* Generate code to initialize an allocate an array. Statements are added to se, which should contain an expression for the array descriptor. */ diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 11a1f40dfac..04ec4d4c12c 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -163,7 +163,7 @@ gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer) size = gfc_evaluate_now (fold_convert (size_type_node, size), &cond_block); ptr = gfc_allocate_array_with_status (&cond_block, build_int_cst (pvoid_type_node, 0), - size, NULL); + size, NULL, NULL); gfc_conv_descriptor_data_set (&cond_block, decl, ptr); then_b = gfc_finish_block (&cond_block); @@ -215,7 +215,7 @@ gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src) size = gfc_evaluate_now (fold_convert (size_type_node, size), &block); ptr = gfc_allocate_array_with_status (&block, build_int_cst (pvoid_type_node, 0), - size, NULL); + size, NULL, NULL); gfc_conv_descriptor_data_set (&block, dest, ptr); call = build_call_expr (built_in_decls[BUILT_IN_MEMCPY], 3, ptr, fold_convert (pvoid_type_node, @@ -619,7 +619,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where) size = gfc_evaluate_now (fold_convert (size_type_node, size), &block); ptr = gfc_allocate_array_with_status (&block, build_int_cst (pvoid_type_node, 0), - size, NULL); + size, NULL, NULL); gfc_conv_descriptor_data_set (&block, decl, ptr); gfc_add_expr_to_block (&block, gfc_trans_assignment (e1, e2, false)); stmt = gfc_finish_block (&block); diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 11882d793d9..da227523e72 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -834,7 +834,6 @@ gfc_trans_do (gfc_code * code) tree from; tree to; tree step; - tree empty; tree countm1; tree type; tree utype; @@ -875,56 +874,88 @@ gfc_trans_do (gfc_code * code) && (integer_onep (step) || tree_int_cst_equal (step, integer_minus_one_node))) return gfc_trans_simple_do (code, &block, dovar, from, to, step); - - /* We need a special check for empty loops: - empty = (step > 0 ? to < from : to > from); */ + pos_step = fold_build2 (GT_EXPR, boolean_type_node, step, fold_convert (type, integer_zero_node)); - empty = fold_build3 (COND_EXPR, boolean_type_node, pos_step, - fold_build2 (LT_EXPR, boolean_type_node, to, from), - fold_build2 (GT_EXPR, boolean_type_node, to, from)); - /* Initialize loop count. This code is executed before we enter the - loop body. We generate: countm1 = abs(to - from) / abs(step). */ if (TREE_CODE (type) == INTEGER_TYPE) - { - tree ustep; + utype = unsigned_type_for (type); + else + utype = unsigned_type_for (gfc_array_index_type); + countm1 = gfc_create_var (utype, "countm1"); + + /* Cycle and exit statements are implemented with gotos. */ + cycle_label = gfc_build_label_decl (NULL_TREE); + exit_label = gfc_build_label_decl (NULL_TREE); + TREE_USED (exit_label) = 1; + + /* Initialize the DO variable: dovar = from. */ + gfc_add_modify (&block, dovar, from); - utype = unsigned_type_for (type); + /* Initialize loop count and jump to exit label if the loop is empty. + This code is executed before we enter the loop body. We generate: + if (step > 0) + { + if (to < from) goto exit_label; + countm1 = (to - from) / step; + } + else + { + if (to > from) goto exit_label; + countm1 = (from - to) / -step; + } */ + if (TREE_CODE (type) == INTEGER_TYPE) + { + tree pos, neg; - /* tmp = abs(to - from) / abs(step) */ - ustep = fold_convert (utype, fold_build1 (ABS_EXPR, type, step)); - tmp = fold_build3 (COND_EXPR, type, pos_step, - fold_build2 (MINUS_EXPR, type, to, from), - fold_build2 (MINUS_EXPR, type, from, to)); - tmp = fold_build2 (TRUNC_DIV_EXPR, utype, fold_convert (utype, tmp), - ustep); + tmp = fold_build2 (LT_EXPR, boolean_type_node, to, from); + pos = fold_build3 (COND_EXPR, void_type_node, tmp, + build1_v (GOTO_EXPR, exit_label), + build_empty_stmt ()); + tmp = fold_build2 (MINUS_EXPR, type, to, from); + tmp = fold_convert (utype, tmp); + tmp = fold_build2 (TRUNC_DIV_EXPR, utype, tmp, + fold_convert (utype, step)); + tmp = build2 (MODIFY_EXPR, void_type_node, countm1, tmp); + pos = build2 (COMPOUND_EXPR, void_type_node, pos, tmp); + + tmp = fold_build2 (GT_EXPR, boolean_type_node, to, from); + neg = fold_build3 (COND_EXPR, void_type_node, tmp, + build1_v (GOTO_EXPR, exit_label), + build_empty_stmt ()); + tmp = fold_build2 (MINUS_EXPR, type, from, to); + tmp = fold_convert (utype, tmp); + tmp = fold_build2 (TRUNC_DIV_EXPR, utype, tmp, + fold_convert (utype, fold_build1 (NEGATE_EXPR, + type, step))); + tmp = build2 (MODIFY_EXPR, void_type_node, countm1, tmp); + neg = build2 (COMPOUND_EXPR, void_type_node, neg, tmp); + + tmp = fold_build3 (COND_EXPR, void_type_node, pos_step, pos, neg); + gfc_add_expr_to_block (&block, tmp); } else { /* TODO: We could use the same width as the real type. This would probably cause more problems that it solves when we implement "long double" types. */ - utype = unsigned_type_for (gfc_array_index_type); + tmp = fold_build2 (MINUS_EXPR, type, to, from); tmp = fold_build2 (RDIV_EXPR, type, tmp, step); tmp = fold_build1 (FIX_TRUNC_EXPR, utype, tmp); + gfc_add_modify (&block, countm1, tmp); + + /* We need a special check for empty loops: + empty = (step > 0 ? to < from : to > from); */ + tmp = fold_build3 (COND_EXPR, boolean_type_node, pos_step, + fold_build2 (LT_EXPR, boolean_type_node, to, from), + fold_build2 (GT_EXPR, boolean_type_node, to, from)); + /* If the loop is empty, go directly to the exit label. */ + tmp = fold_build3 (COND_EXPR, void_type_node, tmp, + build1_v (GOTO_EXPR, exit_label), + build_empty_stmt ()); + gfc_add_expr_to_block (&block, tmp); } - countm1 = gfc_create_var (utype, "countm1"); - gfc_add_modify (&block, countm1, tmp); - - /* Cycle and exit statements are implemented with gotos. */ - cycle_label = gfc_build_label_decl (NULL_TREE); - exit_label = gfc_build_label_decl (NULL_TREE); - TREE_USED (exit_label) = 1; - - /* Initialize the DO variable: dovar = from. */ - gfc_add_modify (&block, dovar, from); - - /* If the loop is empty, go directly to the exit label. */ - tmp = fold_build3 (COND_EXPR, void_type_node, empty, - build1_v (GOTO_EXPR, exit_label), build_empty_stmt ()); - gfc_add_expr_to_block (&block, tmp); /* Loop body. */ gfc_start_block (&body); @@ -3974,16 +4005,16 @@ gfc_trans_deallocate (gfc_code * code) && !(!last && expr->symtree->n.sym->attr.pointer)) { tmp = gfc_deallocate_alloc_comp (expr->ts.derived, se.expr, - expr->rank); + expr->rank); gfc_add_expr_to_block (&se.pre, tmp); } } if (expr->rank) - tmp = gfc_array_deallocate (se.expr, pstat); + tmp = gfc_array_deallocate (se.expr, pstat, expr); else { - tmp = gfc_deallocate_with_status (se.expr, pstat, false); + tmp = gfc_deallocate_with_status (se.expr, pstat, false, expr); gfc_add_expr_to_block (&se.pre, tmp); tmp = fold_build2 (MODIFY_EXPR, void_type_node, diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 1b115f435fc..b8f0d2dd35b 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -347,17 +347,24 @@ gfc_build_array_ref (tree base, tree offset, tree decl) } -/* Generate a runtime error if COND is true. */ +/* Generate a call to print a runtime error possibly including multiple + arguments and a locus. */ -void -gfc_trans_runtime_check (bool error, bool once, tree cond, stmtblock_t * pblock, - locus * where, const char * msgid, ...) +tree +gfc_trans_runtime_error (bool error, locus* where, const char* msgid, ...) { va_list ap; + + va_start (ap, msgid); + return gfc_trans_runtime_error_vararg (error, where, msgid, ap); +} + +tree +gfc_trans_runtime_error_vararg (bool error, locus* where, const char* msgid, + va_list ap) +{ stmtblock_t block; - tree body; tree tmp; - tree tmpvar = NULL; tree arg, arg2; tree *argarray; tree fntype; @@ -365,9 +372,6 @@ gfc_trans_runtime_check (bool error, bool once, tree cond, stmtblock_t * pblock, const char *p; int line, nargs, i; - if (integer_zerop (cond)) - return; - /* Compute the number of extra arguments from the format string. */ for (p = msgid, nargs = 0; *p; p++) if (*p == '%') @@ -377,14 +381,6 @@ gfc_trans_runtime_check (bool error, bool once, tree cond, stmtblock_t * pblock, nargs++; } - if (once) - { - tmpvar = gfc_create_var (boolean_type_node, "print_warning"); - TREE_STATIC (tmpvar) = 1; - DECL_INITIAL (tmpvar) = boolean_true_node; - gfc_add_expr_to_block (pblock, tmpvar); - } - /* The code to generate the error. */ gfc_start_block (&block); @@ -411,9 +407,8 @@ gfc_trans_runtime_check (bool error, bool once, tree cond, stmtblock_t * pblock, argarray = (tree *) alloca (sizeof (tree) * (nargs + 2)); argarray[0] = arg; argarray[1] = arg2; - va_start (ap, msgid); for (i = 0; i < nargs; i++) - argarray[2+i] = va_arg (ap, tree); + argarray[2 + i] = va_arg (ap, tree); va_end (ap); /* Build the function call to runtime_(warning,error)_at; because of the @@ -432,6 +427,41 @@ gfc_trans_runtime_check (bool error, bool once, tree cond, stmtblock_t * pblock, nargs + 2, argarray); gfc_add_expr_to_block (&block, tmp); + return gfc_finish_block (&block); +} + + +/* Generate a runtime error if COND is true. */ + +void +gfc_trans_runtime_check (bool error, bool once, tree cond, stmtblock_t * pblock, + locus * where, const char * msgid, ...) +{ + va_list ap; + stmtblock_t block; + tree body; + tree tmp; + tree tmpvar = NULL; + + if (integer_zerop (cond)) + return; + + if (once) + { + tmpvar = gfc_create_var (boolean_type_node, "print_warning"); + TREE_STATIC (tmpvar) = 1; + DECL_INITIAL (tmpvar) = boolean_true_node; + gfc_add_expr_to_block (pblock, tmpvar); + } + + gfc_start_block (&block); + + /* The code to generate the error. */ + va_start (ap, msgid); + gfc_add_expr_to_block (&block, + gfc_trans_runtime_error_vararg (error, where, + msgid, ap)); + if (once) gfc_add_modify (&block, tmpvar, boolean_false_node); @@ -524,30 +554,30 @@ gfc_call_malloc (stmtblock_t * block, tree type, tree size) void *newmem; if (stat) - *stat = 0; + *stat = 0; // The only time this can happen is the size wraps around. if (size < 0) { - if (stat) - { - *stat = LIBERROR_ALLOCATION; - newmem = NULL; - } - else - runtime_error ("Attempt to allocate negative amount of memory. " - "Possible integer overflow"); + if (stat) + { + *stat = LIBERROR_ALLOCATION; + newmem = NULL; + } + else + runtime_error ("Attempt to allocate negative amount of memory. " + "Possible integer overflow"); } else { - newmem = malloc (MAX (size, 1)); - if (newmem == NULL) - { - if (stat) - *stat = LIBERROR_ALLOCATION; - else - runtime_error ("Out of memory"); - } + newmem = malloc (MAX (size, 1)); + if (newmem == NULL) + { + if (stat) + *stat = LIBERROR_ALLOCATION; + else + runtime_error ("Out of memory"); + } } return newmem; @@ -668,13 +698,16 @@ gfc_allocate_with_status (stmtblock_t * block, tree size, tree status) } else runtime_error ("Attempting to allocate already allocated array"); - } */ + } + + expr must be set to the original expression being allocated for its locus + and variable name in case a runtime error has to be printed. */ tree gfc_allocate_array_with_status (stmtblock_t * block, tree mem, tree size, - tree status) + tree status, gfc_expr* expr) { stmtblock_t alloc_block; - tree res, tmp, null_mem, alloc, error, msg; + tree res, tmp, null_mem, alloc, error; tree type = TREE_TYPE (mem); if (TREE_TYPE (size) != TREE_TYPE (size_type_node)) @@ -692,9 +725,23 @@ gfc_allocate_array_with_status (stmtblock_t * block, tree mem, tree size, alloc = gfc_finish_block (&alloc_block); /* Otherwise, we issue a runtime error or set the status variable. */ - msg = gfc_build_addr_expr (pchar_type_node, gfc_build_localized_cstring_const - ("Attempting to allocate already allocated array")); - error = build_call_expr (gfor_fndecl_runtime_error, 1, msg); + if (expr) + { + tree varname; + + gcc_assert (expr->expr_type == EXPR_VARIABLE && expr->symtree); + varname = gfc_build_cstring_const (expr->symtree->name); + varname = gfc_build_addr_expr (pchar_type_node, varname); + + error = gfc_trans_runtime_error (true, &expr->where, + "Attempting to allocate already" + " allocated array '%s'", + varname); + } + else + error = gfc_trans_runtime_error (true, NULL, + "Attempting to allocate already allocated" + "array"); if (status != NULL_TREE && !integer_zerop (status)) { @@ -775,12 +822,16 @@ gfc_call_free (tree var) Moreover, if CAN_FAIL is true, then we will not emit a runtime error, even when no status variable is passed to us (this is used for unconditional deallocation generated by the front-end at end of - each procedure). */ + each procedure). + + If a runtime-message is possible, `expr' must point to the original + expression being deallocated for its locus and variable name. */ tree -gfc_deallocate_with_status (tree pointer, tree status, bool can_fail) +gfc_deallocate_with_status (tree pointer, tree status, bool can_fail, + gfc_expr* expr) { stmtblock_t null, non_null; - tree cond, tmp, error, msg; + tree cond, tmp, error; cond = fold_build2 (EQ_EXPR, boolean_type_node, pointer, build_int_cst (TREE_TYPE (pointer), 0)); @@ -790,10 +841,16 @@ gfc_deallocate_with_status (tree pointer, tree status, bool can_fail) gfc_start_block (&null); if (!can_fail) { - msg = gfc_build_addr_expr (pchar_type_node, - gfc_build_localized_cstring_const - ("Attempt to DEALLOCATE unallocated memory.")); - error = build_call_expr (gfor_fndecl_runtime_error, 1, msg); + tree varname; + + gcc_assert (expr && expr->expr_type == EXPR_VARIABLE && expr->symtree); + + varname = gfc_build_cstring_const (expr->symtree->name); + varname = gfc_build_addr_expr (pchar_type_node, varname); + + error = gfc_trans_runtime_error (true, &expr->where, + "Attempt to DEALLOCATE unallocated '%s'", + varname); } else error = build_empty_stmt (); diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index 5d729eaab83..36553ea255b 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -450,6 +450,10 @@ void gfc_generate_constructors (void); /* Get the string length of an array constructor. */ bool get_array_ctor_strlen (stmtblock_t *, gfc_constructor *, tree *); +/* Generate a runtime error call. */ +tree gfc_trans_runtime_error (bool, locus*, const char*, ...); +tree gfc_trans_runtime_error_vararg (bool, locus*, const char*, va_list); + /* Generate a runtime warning/error check. */ void gfc_trans_runtime_check (bool, bool, tree, stmtblock_t *, locus *, const char *, ...); @@ -461,13 +465,13 @@ tree gfc_call_free (tree); tree gfc_call_malloc (stmtblock_t *, tree, tree); /* Allocate memory for arrays, with optional status variable. */ -tree gfc_allocate_array_with_status (stmtblock_t *, tree, tree, tree); +tree gfc_allocate_array_with_status (stmtblock_t*, tree, tree, tree, gfc_expr*); /* Allocate memory, with optional status variable. */ tree gfc_allocate_with_status (stmtblock_t *, tree, tree); /* Generate code to deallocate an array. */ -tree gfc_deallocate_with_status (tree, tree, bool); +tree gfc_deallocate_with_status (tree, tree, bool, gfc_expr*); /* Generate code to call realloc(). */ tree gfc_call_realloc (stmtblock_t *, tree, tree); diff --git a/gcc/function.c b/gcc/function.c index 41c5a46a621..08dc95a697c 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1634,7 +1634,7 @@ instantiate_decls_1 (tree let) static void instantiate_decls (tree fndecl) { - tree decl; + tree decl, t, next; /* Process all parameters of the function. */ for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl)) @@ -1650,6 +1650,17 @@ instantiate_decls (tree fndecl) /* Now process all variables defined in the function or its subblocks. */ instantiate_decls_1 (DECL_INITIAL (fndecl)); + + t = cfun->local_decls; + cfun->local_decls = NULL_TREE; + for (; t; t = next) + { + next = TREE_CHAIN (t); + decl = TREE_VALUE (t); + if (DECL_RTL_SET_P (decl)) + instantiate_decl_rtl (DECL_RTL (decl)); + ggc_free (t); + } } /* Pass through the INSNS of function FNDECL and convert virtual register diff --git a/gcc/gimplify.c b/gcc/gimplify.c index bb38ba398f6..d723d9f16a9 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -7117,6 +7117,18 @@ gimplify_type_sizes (tree type, gimple_seq *list_p) /* These types may not have declarations, so handle them here. */ gimplify_type_sizes (TREE_TYPE (type), list_p); gimplify_type_sizes (TYPE_DOMAIN (type), list_p); + /* When not optimizing, ensure VLA bounds aren't removed. */ + if (!optimize + && TYPE_DOMAIN (type) + && INTEGRAL_TYPE_P (TYPE_DOMAIN (type))) + { + t = TYPE_MIN_VALUE (TYPE_DOMAIN (type)); + if (t && TREE_CODE (t) == VAR_DECL && DECL_ARTIFICIAL (t)) + DECL_IGNORED_P (t) = 0; + t = TYPE_MAX_VALUE (TYPE_DOMAIN (type)); + if (t && TREE_CODE (t) == VAR_DECL && DECL_ARTIFICIAL (t)) + DECL_IGNORED_P (t) = 0; + } break; case RECORD_TYPE: diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index ba604371745..46640c4a645 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -646,10 +646,12 @@ insn_cost (rtx insn) /* Compute cost of dependence LINK. This is the number of cycles between instruction issue and - instruction results. */ + instruction results. + ??? We also use this function to call recog_memoized on all insns. */ int dep_cost_1 (dep_t link, dw_t dw) { + rtx insn = DEP_PRO (link); rtx used = DEP_CON (link); int cost; @@ -657,10 +659,12 @@ dep_cost_1 (dep_t link, dw_t dw) This allows the computation of a function's result and parameter values to overlap the return and call. */ if (recog_memoized (used) < 0) - cost = 0; + { + cost = 0; + recog_memoized (insn); + } else { - rtx insn = DEP_PRO (link); enum reg_note dep_type = DEP_TYPE (link); cost = insn_cost (insn); @@ -2312,8 +2316,14 @@ choose_ready (struct ready_list *ready, rtx *insn_ptr) { insn = ready_element (ready, i); +#ifdef ENABLE_CHECKING + /* If this insn is recognizable we should have already + recognized it earlier. + ??? Not very clear where this is supposed to be done. + See dep_cost_1. */ gcc_assert (INSN_CODE (insn) >= 0 || recog_memoized (insn) < 0); +#endif ready_try [i] = (/* INSN_CODE check can be omitted here as it is also done later diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 8dbc9f87f99..455ba91ec35 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1058,7 +1058,7 @@ ipcp_estimate_growth (struct cgraph_node *node) /* If we will be able to fully replace orignal node, we never increase program size. */ if (!need_original) - return false; + return 0; info = IPA_NODE_REF (node); count = ipa_get_param_count (info); diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 90b0333e783..e741feb833e 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -40,12 +40,13 @@ VEC (ipa_node_params_t, heap) *ipa_node_params_vector; VEC (ipa_edge_args_t, heap) *ipa_edge_args_vector; /* Holders of ipa cgraph hooks: */ -struct cgraph_edge_hook_list *edge_removal_hook_holder; -struct cgraph_node_hook_list *node_removal_hook_holder; -struct cgraph_2edge_hook_list *edge_duplication_hook_holder; -struct cgraph_2node_hook_list *node_duplication_hook_holder; +static struct cgraph_edge_hook_list *edge_removal_hook_holder; +static struct cgraph_node_hook_list *node_removal_hook_holder; +static struct cgraph_2edge_hook_list *edge_duplication_hook_holder; +static struct cgraph_2node_hook_list *node_duplication_hook_holder; /* Initialize worklist to contain all functions. */ + struct ipa_func_list * ipa_init_func_list (void) { @@ -67,6 +68,7 @@ ipa_init_func_list (void) /* Add cgraph node MT to the worklist. Set worklist element WL to point to MT. */ + void ipa_push_func_to_list (struct ipa_func_list **wl, struct cgraph_node *mt) { @@ -80,6 +82,7 @@ ipa_push_func_to_list (struct ipa_func_list **wl, struct cgraph_node *mt) /* Remove a function from the worklist. WL points to the first element in the list, which is removed. */ + struct cgraph_node * ipa_pop_func_from_list (struct ipa_func_list ** wl) { @@ -93,8 +96,9 @@ ipa_pop_func_from_list (struct ipa_func_list ** wl) return return_func; } -/* Return index of the formal whose tree is ptree in function which corresponds - to info. */ +/* Return index of the formal whose tree is PTREE in function which corresponds + to INFO. */ + static int ipa_get_param_decl_index (struct ipa_node_params *info, tree ptree) { @@ -110,6 +114,7 @@ ipa_get_param_decl_index (struct ipa_node_params *info, tree ptree) /* Populate the param_decl field in parameter descriptors of INFO that corresponds to NODE. */ + static void ipa_populate_param_decls (struct cgraph_node *node, struct ipa_node_params *info) @@ -131,6 +136,7 @@ ipa_populate_param_decls (struct cgraph_node *node, /* Count number of formal parameters in NOTE. Store the result to the appropriate field of INFO. */ + static void ipa_count_formal_params (struct cgraph_node *node, struct ipa_node_params *info) @@ -151,6 +157,7 @@ ipa_count_formal_params (struct cgraph_node *node, /* Initialize the ipa_node_params structure associated with NODE by counting the function parameters, creating the descriptors and populating their param_decls. */ + void ipa_initialize_node_params (struct cgraph_node *node) { @@ -170,6 +177,7 @@ ipa_initialize_node_params (struct cgraph_node *node) Directly means that this function does not check for modifications through pointers or escaping addresses because all TREE_ADDRESSABLE parameters are considered modified anyway. */ + static void ipa_check_stmt_modifications (struct ipa_node_params *info, gimple stmt) { @@ -206,6 +214,7 @@ ipa_check_stmt_modifications (struct ipa_node_params *info, gimple stmt) modified. Parameters may be modified in NODE if they are TREE_ADDRESSABLE, if they appear on the left hand side of an assignment or if there is an ASM_EXPR in the function. */ + void ipa_detect_param_modifications (struct cgraph_node *node) { @@ -238,8 +247,9 @@ ipa_detect_param_modifications (struct cgraph_node *node) info->modification_analysis_done = 1; } -/* Count number of arguments callsite CS has and store it in +/* Count number of arguments callsite CS has and store it in ipa_edge_args structure corresponding to this callsite. */ + void ipa_count_arguments (struct cgraph_edge *cs) { @@ -256,8 +266,9 @@ ipa_count_arguments (struct cgraph_edge *cs) ipa_set_cs_argument_count (IPA_EDGE_REF (cs), arg_num); } -/* The following function prints the jump functions of all arguments on all - call graph edges going from NODE to file F. */ +/* Print the jump functions of all arguments on all call graph edges going from + NODE to file F. */ + void ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node) { @@ -309,6 +320,7 @@ ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node) } /* Print ipa_jump_func data structures of all nodes in the call graph to F. */ + void ipa_print_all_jump_functions (FILE *f) { @@ -321,11 +333,12 @@ ipa_print_all_jump_functions (FILE *f) } } -/* The following function determines the jump functions of scalar arguments. - Scalar means SSA names and constants of a number of selected types. INFO is - the ipa_node_params structure associated with the caller, FUNCTIONS is a - pointer to an array of jump function structures associated with CALL which - is the call statement being examined.*/ +/* Determine the jump functions of scalar arguments. Scalar means SSA names + and constants of a number of selected types. INFO is the ipa_node_params + structure associated with the caller, FUNCTIONS is a pointer to an array of + jump function structures associated with CALL which is the call statement + being examined.*/ + static void compute_scalar_jump_functions (struct ipa_node_params *info, struct ipa_jump_func *functions, @@ -356,10 +369,11 @@ compute_scalar_jump_functions (struct ipa_node_params *info, } } -/* This function inspects the given TYPE and returns true iff it has the same - structure (the same number of fields of the same types) as a C++ member - pointer. If METHOD_PTR and DELTA are non-NULL, the trees representing the - corresponding fields are stored there. */ +/* Inspect the given TYPE and return true iff it has the same structure (the + same number of fields of the same types) as a C++ member pointer. If + METHOD_PTR and DELTA are non-NULL, store the trees representing the + corresponding fields there. */ + static bool type_like_member_ptr_p (tree type, tree *method_ptr, tree *delta) { @@ -388,11 +402,12 @@ type_like_member_ptr_p (tree type, tree *method_ptr, tree *delta) return true; } -/* This function goes through arguments of the CALL and for every one that - looks like a member pointer, it checks whether it can be safely declared - pass-through and if so, marks that to the corresponding item of jum - FUNCTIONS . It returns true iff there were non-pass-through member pointers - within the arguments. INFO describes formal parameters of the caller. */ +/* Go through arguments of the CALL and for every one that looks like a member + pointer, check whether it can be safely declared pass-through and if so, + mark that to the corresponding item of jump FUNCTIONS. Return true iff + there are non-pass-through member pointers within the arguments. INFO + describes formal parameters of the caller. */ + static bool compute_pass_through_member_ptrs (struct ipa_node_params *info, struct ipa_jump_func *functions, @@ -431,6 +446,7 @@ compute_pass_through_member_ptrs (struct ipa_node_params *info, /* Simple function filling in a member pointer constant jump function (with PFN and DELTA as the constant value) into JFUNC. */ + static void fill_member_ptr_cst_jump_function (struct ipa_jump_func *jfunc, tree pfn, tree delta) @@ -449,6 +465,7 @@ fill_member_ptr_cst_jump_function (struct ipa_jump_func *jfunc, D.2515.__pfn ={v} printStuff; D.2515.__delta ={v} 0; i_1 = doprinting (D.2515); */ + static void determine_cst_member_ptr (gimple call, tree arg, tree method_field, tree delta_field, struct ipa_jump_func *jfunc) @@ -516,6 +533,7 @@ determine_cst_member_ptr (gimple call, tree arg, tree method_field, tries determine whether it is a constant. If it is, create a corresponding constant jump function in FUNCTIONS which is an array of jump functions associated with the call. */ + static void compute_cst_member_ptr_arguments (struct ipa_jump_func *functions, gimple call) @@ -538,6 +556,7 @@ compute_cst_member_ptr_arguments (struct ipa_jump_func *functions, /* Compute jump function for all arguments of callsite CS and insert the information in the jump_functions array in the ipa_edge_args corresponding to this callsite. */ + void ipa_compute_jump_functions (struct cgraph_edge *cs) { @@ -561,13 +580,14 @@ ipa_compute_jump_functions (struct cgraph_edge *cs) if (!compute_pass_through_member_ptrs (info, arguments->jump_functions, call)) return; - /* Finally, let's check whether we actually pass a new constant membeer + /* Finally, let's check whether we actually pass a new constant member pointer here... */ compute_cst_member_ptr_arguments (arguments->jump_functions, call); } /* If RHS looks like a rhs of a statement loading pfn from a member pointer formal parameter, return the parameter, otherwise return NULL. */ + static tree ipa_get_member_ptr_load_param (tree rhs) { @@ -590,7 +610,8 @@ ipa_get_member_ptr_load_param (tree rhs) } /* If STMT looks like a statement loading a value from a member pointer formal - parameter, this function retuns that parameter. */ + parameter, this function returns that parameter. */ + static tree ipa_get_stmt_member_ptr_load_param (gimple stmt) { @@ -604,6 +625,7 @@ ipa_get_stmt_member_ptr_load_param (gimple stmt) } /* Returns true iff T is an SSA_NAME defined by a statement. */ + static bool ipa_is_ssa_with_stmt_def (tree t) { @@ -617,6 +639,7 @@ ipa_is_ssa_with_stmt_def (tree t) /* Creates a new note describing a call to a parameter number FORMAL_ID and attaches it to the linked list of INFO. It also sets the called flag of the parameter. STMT is the corresponding call statement. */ + static void ipa_note_param_call (struct ipa_node_params *info, int formal_id, gimple stmt) @@ -808,6 +831,7 @@ ipa_analyze_call_uses (struct ipa_node_params *info, gimple call) /* Analyze the statement STMT with respect to formal parameters (described in INFO) and their uses. Currently it only checks whether formal parameters are called. */ + static void ipa_analyze_stmt_uses (struct ipa_node_params *info, gimple stmt) { @@ -818,6 +842,7 @@ ipa_analyze_stmt_uses (struct ipa_node_params *info, gimple stmt) /* Scan the function body of NODE and inspect the uses of formal parameters. Store the findings in various structures of the associated ipa_node_params structure, such as parameter flags, notes etc. */ + void ipa_analyze_params_uses (struct cgraph_node *node) { @@ -843,9 +868,10 @@ ipa_analyze_params_uses (struct cgraph_node *node) info->uses_analysis_done = 1; } -/* Update the jump functions assocated with call graph edge E when the call +/* Update the jump functions associated with call graph edge E when the call graph edge CS is being inlined, assuming that E->caller is already (possibly indirectly) inlined into CS->callee and that E has not been inlined. */ + static void update_jump_functions_after_inlining (struct cgraph_edge *cs, struct cgraph_edge *e) @@ -875,8 +901,9 @@ update_jump_functions_after_inlining (struct cgraph_edge *cs, } /* Print out a debug message to file F that we have discovered that an indirect - call descibed by NT is in fact a call of a known constant function descibed + call described by NT is in fact a call of a known constant function described by JFUNC. NODE is the node where the call is. */ + static void print_edge_addition_message (FILE *f, struct ipa_param_call_note *nt, struct ipa_jump_func *jfunc, @@ -900,6 +927,7 @@ print_edge_addition_message (FILE *f, struct ipa_param_call_note *nt, Moreover, if the callee is discovered to be constant, create a new cgraph edge for it. Newly discovered indirect edges will be added to *NEW_EDGES, unless NEW_EDGES is NULL. Return true iff a new edge(s) were created. */ + static bool update_call_notes_after_inlining (struct cgraph_edge *cs, struct cgraph_node *node, @@ -973,6 +1001,7 @@ update_call_notes_after_inlining (struct cgraph_edge *cs, of this subtree. Newly discovered indirect edges will be added to *NEW_EDGES, unless NEW_EDGES is NULL. Return true iff a new edge(s) were created. */ + static bool propagate_info_to_inlined_callees (struct cgraph_edge *cs, struct cgraph_node *node, @@ -997,6 +1026,7 @@ propagate_info_to_inlined_callees (struct cgraph_edge *cs, cgraph_clone_inline_nodes. Newly discovered indirect edges will be added to *NEW_EDGES, unless NEW_EDGES is NULL. Return true iff a new edge(s) were + created. */ + bool ipa_propagate_indirect_call_infos (struct cgraph_edge *cs, VEC (cgraph_edge_p, heap) **new_edges) @@ -1012,6 +1042,7 @@ ipa_propagate_indirect_call_infos (struct cgraph_edge *cs, /* Frees all dynamically allocated structures that the argument info points to. */ + void ipa_free_edge_args_substructures (struct ipa_edge_args *args) { @@ -1022,6 +1053,7 @@ ipa_free_edge_args_substructures (struct ipa_edge_args *args) } /* Free all ipa_edge structures. */ + void ipa_free_all_edge_args (void) { @@ -1039,6 +1071,7 @@ ipa_free_all_edge_args (void) /* Frees all dynamically allocated structures that the param info points to. */ + void ipa_free_node_params_substructures (struct ipa_node_params *info) { @@ -1056,6 +1089,7 @@ ipa_free_node_params_substructures (struct ipa_node_params *info) } /* Free all ipa_node_params structures. */ + void ipa_free_all_node_params (void) { @@ -1072,6 +1106,7 @@ ipa_free_all_node_params (void) } /* Hook that is called by cgraph.c when an edge is removed. */ + static void ipa_edge_removal_hook (struct cgraph_edge *cs, void *data __attribute__ ((unused))) @@ -1084,6 +1119,7 @@ ipa_edge_removal_hook (struct cgraph_edge *cs, } /* Hook that is called by cgraph.c when a node is removed. */ + static void ipa_node_removal_hook (struct cgraph_node *node, void *data __attribute__ ((unused))) @@ -1093,6 +1129,7 @@ ipa_node_removal_hook (struct cgraph_node *node, /* Helper function to duplicate an array of size N that is at SRC and store a pointer to it to DST. Nothing is done if SRC is NULL. */ + static void * duplicate_array (void *src, size_t n) { @@ -1107,6 +1144,7 @@ duplicate_array (void *src, size_t n) } /* Hook that is called by cgraph.c when a node is duplicated. */ + static void ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst, __attribute__((unused)) void *data) @@ -1127,6 +1165,7 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst, } /* Hook that is called by cgraph.c when a node is duplicated. */ + static void ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst, __attribute__((unused)) void *data) @@ -1160,6 +1199,7 @@ ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst, } /* Register our cgraph hooks if they are not already there. */ + void ipa_register_cgraph_hooks (void) { @@ -1178,6 +1218,7 @@ ipa_register_cgraph_hooks (void) } /* Unregister our cgraph hooks if they are not already there. */ + static void ipa_unregister_cgraph_hooks (void) { @@ -1193,6 +1234,7 @@ ipa_unregister_cgraph_hooks (void) /* Free all ipa_node_params and all ipa_edge_args structures if they are no longer needed after ipa-cp. */ + void free_all_ipa_structures_after_ipa_cp (void) { @@ -1206,6 +1248,7 @@ free_all_ipa_structures_after_ipa_cp (void) /* Free all ipa_node_params and all ipa_edge_args structures if they are no longer needed after indirect inlining. */ + void free_all_ipa_structures_after_iinln (void) { @@ -1216,6 +1259,7 @@ free_all_ipa_structures_after_iinln (void) /* Print ipa_tree_map data structures of all functions in the callgraph to F. */ + void ipa_print_node_params (FILE * f, struct cgraph_node *node) { @@ -1244,6 +1288,7 @@ ipa_print_node_params (FILE * f, struct cgraph_node *node) /* Print ipa_tree_map data structures of all functions in the callgraph to F. */ + void ipa_print_all_params (FILE * f) { diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h index 47010e1ab59..aca7bf8ef25 100644 --- a/gcc/ipa-prop.h +++ b/gcc/ipa-prop.h @@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see /* The following definitions and interfaces are used by interprocedural analyses. */ -/* A jump function for a callsite represents the values passed as actual +/* A jump function for a callsite represents the values passed as actual arguments of the callsite. There are three main types of values : Formal - the caller's formal parameter is passed as an actual argument. Constant - a constant is passed as an actual argument. @@ -78,8 +78,8 @@ union jump_func_value struct ipa_member_ptr_cst member_cst; }; -/* A jump function for a callsite represents the values passed as actual - arguments of the callsite. See enum jump_func_type for the various +/* A jump function for a callsite represents the values passed as actual + arguments of the callsite. See enum jump_func_type for the various types of jump functions supported. */ struct ipa_jump_func { @@ -87,7 +87,7 @@ struct ipa_jump_func union jump_func_value value; }; -/* All formal parameters in the program have a cval computed by +/* All formal parameters in the program have a cval computed by the interprocedural stage of IPCP. See enum ipa_lattice_type for the various types of lattices supported */ struct ipcp_lattice @@ -102,7 +102,7 @@ struct ipa_replace_map { /* The tree that will be replaced. */ tree old_tree; - /* The new (replacing) tree. */ + /* The new (replacing) tree. */ tree new_tree; /* True when a substitution should be done, false otherwise. */ bool replace_p; @@ -165,8 +165,8 @@ struct ipa_node_params it points to the node that IPA cp cloned from. */ struct cgraph_node *ipcp_orig_node; /* Meaningful only for original functions. Expresses the - ratio between the direct calls and sum of all invocations of - this function (given by profiling info). It is used to calculate + ratio between the direct calls and sum of all invocations of + this function (given by profiling info). It is used to calculate the profiling information of the original function and the versioned one. */ gcov_type count_scale; @@ -184,6 +184,7 @@ struct ipa_node_params are or will be shared among various passes. */ /* Set the number of formal parameters. */ + static inline void ipa_set_param_count (struct ipa_node_params *info, int count) { @@ -191,6 +192,7 @@ ipa_set_param_count (struct ipa_node_params *info, int count) } /* Return the number of formal parameters. */ + static inline int ipa_get_param_count (struct ipa_node_params *info) { @@ -200,6 +202,7 @@ ipa_get_param_count (struct ipa_node_params *info) /* Return the declaration of Ith formal parameter of the function corresponding to INFO. Note there is no setter function as this array is built just once using ipa_initialize_node_params. */ + static inline tree ipa_get_param (struct ipa_node_params *info, int i) { @@ -210,6 +213,7 @@ ipa_get_param (struct ipa_node_params *info, int i) the function associated with INFO. Note that there is no setter method as the goal is to set all flags when building the array in ipa_detect_param_modifications. */ + static inline bool ipa_is_param_modified (struct ipa_node_params *info, int i) { @@ -220,6 +224,7 @@ ipa_is_param_modified (struct ipa_node_params *info, int i) function associated with INFO. Note that there is no setter method as the goal is to set all flags when building the array in ipa_detect_called_params. */ + static inline bool ipa_is_param_called (struct ipa_node_params *info, int i) { @@ -227,6 +232,7 @@ ipa_is_param_called (struct ipa_node_params *info, int i) } /* Flag this node as having callers with variable number of arguments. */ + static inline void ipa_set_called_with_variable_arg (struct ipa_node_params *info) { @@ -234,6 +240,7 @@ ipa_set_called_with_variable_arg (struct ipa_node_params *info) } /* Have we detected this node was called with variable number of arguments? */ + static inline bool ipa_is_called_with_var_arguments (struct ipa_node_params *info) { @@ -259,6 +266,7 @@ struct ipa_edge_args are or will be shared among various passes. */ /* Set the number of actual arguments. */ + static inline void ipa_set_cs_argument_count (struct ipa_edge_args *args, int count) { @@ -266,6 +274,7 @@ ipa_set_cs_argument_count (struct ipa_edge_args *args, int count) } /* Return the number of actual arguments. */ + static inline int ipa_get_cs_argument_count (struct ipa_edge_args *args) { @@ -275,6 +284,7 @@ ipa_get_cs_argument_count (struct ipa_edge_args *args) /* Returns a pointer to the jump function for the ith argument. Please note there is no setter function as jump functions are all set up in ipa_compute_jump_functions. */ + static inline struct ipa_jump_func * ipa_get_ith_jump_func (struct ipa_edge_args *args, int i) { @@ -285,7 +295,7 @@ ipa_get_ith_jump_func (struct ipa_edge_args *args, int i) typedef struct ipa_node_params ipa_node_params_t; typedef struct ipa_edge_args ipa_edge_args_t; -/* Types of vectors hodling the infos. */ +/* Types of vectors holding the infos. */ DEF_VEC_O (ipa_node_params_t); DEF_VEC_ALLOC_O (ipa_node_params_t, heap); DEF_VEC_O (ipa_edge_args_t); @@ -318,7 +328,8 @@ void free_all_ipa_structures_after_iinln (void); void ipa_register_cgraph_hooks (void); /* This function ensures the array of node param infos is big enough to - accomdate a structure for all nodes and realloacates it if not. */ + accommodate a structure for all nodes and reallocates it if not. */ + static inline void ipa_check_create_node_params (void) { @@ -332,8 +343,9 @@ ipa_check_create_node_params (void) ipa_node_params_vector, cgraph_max_uid + 1); } -/* This function ensures the array of adge arguments infos is big enough to - accomdate a structure for all edges and realloacates it if not. */ +/* This function ensures the array of edge arguments infos is big enough to + accommodate a structure for all edges and reallocates it if not. */ + static inline void ipa_check_create_edge_args (void) { @@ -347,9 +359,10 @@ ipa_check_create_edge_args (void) cgraph_edge_max_uid + 1); } -/* Returns true if the array of edge infos is large enough to accomodate an +/* Returns true if the array of edge infos is large enough to accommodate an info for EDGE. The main purpose of this function is that debug dumping function can check info availability without causing reallocations. */ + static inline bool ipa_edge_args_info_available_for_edge_p (struct cgraph_edge *edge) { diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 20abdf3f477..f21638f383e 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -94,19 +94,14 @@ typedef struct funct_state_d * funct_state; /* Array, indexed by cgraph node uid, of function states. */ -static funct_state *funct_state_vec; +DEF_VEC_P (funct_state); +DEF_VEC_ALLOC_P (funct_state, heap); +static VEC (funct_state, heap) *funct_state_vec; /* Holders of ipa cgraph hooks: */ static struct cgraph_node_hook_list *function_insertion_hook_holder; - -/* Init the function state. */ - -static void -init_state (void) -{ - funct_state_vec = XCNEWVEC (funct_state, cgraph_max_uid); -} - +static struct cgraph_2node_hook_list *node_duplication_hook_holder; +static struct cgraph_node_hook_list *node_removal_hook_holder; /* Init the function state. */ @@ -122,7 +117,10 @@ finish_state (void) static inline funct_state get_function_state (struct cgraph_node *node) { - return funct_state_vec[node->uid]; + if (!funct_state_vec + || VEC_length (funct_state, funct_state_vec) <= (unsigned int)node->uid) + return NULL; + return VEC_index (funct_state, funct_state_vec, node->uid); } /* Set the function state S for NODE. */ @@ -130,7 +128,10 @@ get_function_state (struct cgraph_node *node) static inline void set_function_state (struct cgraph_node *node, funct_state s) { - funct_state_vec[node->uid] = s; + if (!funct_state_vec + || VEC_length (funct_state, funct_state_vec) <= (unsigned int)node->uid) + VEC_safe_grow_cleared (funct_state, heap, funct_state_vec, node->uid + 1); + VEC_replace (funct_state, funct_state_vec, node->uid, s); } /* Check to see if the use (or definition when CHECKING_WRITE is true) @@ -585,6 +586,9 @@ analyze_function (struct cgraph_node *fn) tree decl = fn->decl; funct_state l = XCNEW (struct funct_state_d); + if (cgraph_function_body_availability (fn) <= AVAIL_OVERWRITABLE) + return; + set_function_state (fn, l); l->pure_const_state = IPA_CONST; @@ -683,7 +687,8 @@ end: static void add_new_function (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED) { - funct_state_vec = XRESIZEVEC (funct_state, funct_state_vec, cgraph_max_uid); + if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE) + return; /* There are some shared nodes, in particular the initializers on static declarations. We do not need to scan them more than once since all we would be interested in are the addressof @@ -694,6 +699,33 @@ add_new_function (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED) visited_nodes = NULL; } +/* Called when new clone is inserted to callgraph late. */ + +static void +duplicate_node_data (struct cgraph_node *src, struct cgraph_node *dst, + void *data ATTRIBUTE_UNUSED) +{ + if (get_function_state (src)) + { + funct_state l = XNEW (struct funct_state_d); + gcc_assert (!get_function_state (dst)); + memcpy (l, get_function_state (src), sizeof (*l)); + set_function_state (dst, l); + } +} + +/* Called when new clone is inserted to callgraph late. */ + +static void +remove_node_data (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED) +{ + if (get_function_state (node)) + { + free (get_function_state (node)); + set_function_state (node, NULL); + } +} + /* Analyze each function in the cgraph to see if it is locally PURE or CONST. */ @@ -703,9 +735,12 @@ generate_summary (void) { struct cgraph_node *node; + node_removal_hook_holder = + cgraph_add_node_removal_hook (&remove_node_data, NULL); + node_duplication_hook_holder = + cgraph_add_node_duplication_hook (&duplicate_node_data, NULL); function_insertion_hook_holder = cgraph_add_function_insertion_hook (&add_new_function, NULL); - init_state (); /* There are some shared nodes, in particular the initializers on static declarations. We do not need to scan them more than once since all we would be interested in are the addressof @@ -714,14 +749,12 @@ generate_summary (void) /* Process all of the functions. - We do not want to process any of the clones so we check that this - is a master clone. However, we do NOT process any - AVAIL_OVERWRITABLE functions (these are never clones) we cannot + We do NOT process any AVAIL_OVERWRITABLE functions, we cannot guarantee that what we learn about the one we see will be true for the one that overrides it. */ for (node = cgraph_nodes; node; node = node->next) - if (node->analyzed && cgraph_is_master_clone (node)) + if (cgraph_function_body_availability (node) > AVAIL_OVERWRITABLE) analyze_function (node); pointer_set_destroy (visited_nodes); @@ -745,6 +778,8 @@ propagate (void) struct ipa_dfs_info * w_info; cgraph_remove_function_insertion_hook (function_insertion_hook_holder); + cgraph_remove_node_duplication_hook (node_duplication_hook_holder); + cgraph_remove_node_removal_hook (node_removal_hook_holder); order_pos = ipa_utils_reduced_inorder (order, true, false); if (dump_file) { @@ -788,12 +823,8 @@ propagate (void) for (e = w->callees; e; e = e->next_callee) { struct cgraph_node *y = e->callee; - /* Only look at the master nodes and skip external nodes. */ - y = cgraph_master_clone (y); - if (w == y) - looping = true; - if (y) + if (cgraph_function_body_availability (y) > AVAIL_OVERWRITABLE) { funct_state y_l = get_function_state (y); if (pure_const_state < y_l->pure_const_state) @@ -861,11 +892,12 @@ propagate (void) free (node->aux); node->aux = NULL; } - if (node->analyzed && cgraph_is_master_clone (node)) + if (cgraph_function_body_availability (node) > AVAIL_OVERWRITABLE) free (get_function_state (node)); } free (order); + VEC_free (funct_state, heap, funct_state_vec); finish_state (); return 0; } @@ -873,7 +905,7 @@ propagate (void) static bool gate_pure_const (void) { - return (flag_ipa_pure_const + return (flag_ipa_pure_const /* Don't bother doing anything if the program has errors. */ && !(errorcount || sorrycount)); } diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index 861b1536232..a9afd457a73 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -69,6 +69,52 @@ along with GCC; see the file COPYING3. If not see #include "diagnostic.h" #include "langhooks.h" +/* The static variables defined within the compilation unit that are + loaded or stored directly by function that owns this structure. */ + +struct ipa_reference_local_vars_info_d +{ + bitmap statics_read; + bitmap statics_written; + + /* Set when this function calls another function external to the + compilation unit or if the function has a asm clobber of memory. + In general, such calls are modeled as reading and writing all + variables (both bits on) but sometime there are attributes on the + called function so we can do better. */ + bool calls_read_all; + bool calls_write_all; +}; + +/* Statics that are read and written by some set of functions. The + local ones are based on the loads and stores local to the function. + The global ones are based on the local info as well as the + transitive closure of the functions that are called. The + structures are separated to allow the global structures to be + shared between several functions since every function within a + strongly connected component will have the same information. This + sharing saves both time and space in the computation of the vectors + as well as their translation from decl_uid form to ann_uid + form. */ + +struct ipa_reference_global_vars_info_d +{ + bitmap statics_read; + bitmap statics_written; + bitmap statics_not_read; + bitmap statics_not_written; +}; + +typedef struct ipa_reference_local_vars_info_d *ipa_reference_local_vars_info_t; +typedef struct ipa_reference_global_vars_info_d *ipa_reference_global_vars_info_t; +struct ipa_reference_vars_info_d +{ + ipa_reference_local_vars_info_t local; + ipa_reference_global_vars_info_t global; +}; + +typedef struct ipa_reference_vars_info_d *ipa_reference_vars_info_t; + /* This splay tree contains all of the static variables that are being considered by the compilation level alias analysis. For module_at_a_time compilation, this is the set of static but not @@ -101,6 +147,8 @@ static bitmap_obstack global_info_obstack; /* Holders of ipa cgraph hooks: */ static struct cgraph_node_hook_list *function_insertion_hook_holder; +static struct cgraph_2node_hook_list *node_duplication_hook_holder; +static struct cgraph_node_hook_list *node_removal_hook_holder; enum initialization_status_t { @@ -111,19 +159,37 @@ enum initialization_status_t tree memory_identifier_string; +/* Vector where the reference var infos are actually stored. */ +DEF_VEC_P (ipa_reference_vars_info_t); +DEF_VEC_ALLOC_P (ipa_reference_vars_info_t, heap); +static VEC (ipa_reference_vars_info_t, heap) *ipa_reference_vars_vector; + /* Return the ipa_reference_vars structure starting from the cgraph NODE. */ static inline ipa_reference_vars_info_t -get_reference_vars_info_from_cgraph (struct cgraph_node * node) +get_reference_vars_info (struct cgraph_node *node) { - return get_function_ann (node->decl)->reference_vars_info; + if (!ipa_reference_vars_vector + || VEC_length (ipa_reference_vars_info_t, ipa_reference_vars_vector) <= (unsigned int)node->uid) + return NULL; + return VEC_index (ipa_reference_vars_info_t, ipa_reference_vars_vector, node->uid); +} + +/* Return the ipa_reference_vars structure starting from the cgraph NODE. */ +static inline void +set_reference_vars_info (struct cgraph_node *node, ipa_reference_vars_info_t info) +{ + if (!ipa_reference_vars_vector + || VEC_length (ipa_reference_vars_info_t, ipa_reference_vars_vector) <= (unsigned int)node->uid) + VEC_safe_grow_cleared (ipa_reference_vars_info_t, heap, ipa_reference_vars_vector, node->uid + 1); + VEC_replace (ipa_reference_vars_info_t, ipa_reference_vars_vector, node->uid, info); } /* Get a bitmap that contains all of the locally referenced static variables for function FN. */ static ipa_reference_local_vars_info_t -get_local_reference_vars_info (tree fn) +get_local_reference_vars_info (struct cgraph_node *fn) { - ipa_reference_vars_info_t info = get_function_ann (fn)->reference_vars_info; + ipa_reference_vars_info_t info = get_reference_vars_info (fn); if (info) return info->local; @@ -136,9 +202,9 @@ get_local_reference_vars_info (tree fn) variables for function FN. */ static ipa_reference_global_vars_info_t -get_global_reference_vars_info (tree fn) +get_global_reference_vars_info (struct cgraph_node *fn) { - ipa_reference_vars_info_t info = get_function_ann (fn)->reference_vars_info; + ipa_reference_vars_info_t info = get_reference_vars_info (fn); if (info) return info->global; @@ -148,39 +214,11 @@ get_global_reference_vars_info (tree fn) } /* Return a bitmap indexed by VAR_DECL uid for the static variables - that may be read locally by the execution of the function fn. - Returns NULL if no data is available. */ - -bitmap -ipa_reference_get_read_local (tree fn) -{ - ipa_reference_local_vars_info_t l = get_local_reference_vars_info (fn); - if (l) - return l->statics_read; - else - return NULL; -} - -/* Return a bitmap indexed by VAR_DECL uid for the static variables - that may be written locally by the execution of the function fn. - Returns NULL if no data is available. */ - -bitmap -ipa_reference_get_written_local (tree fn) -{ - ipa_reference_local_vars_info_t l = get_local_reference_vars_info (fn); - if (l) - return l->statics_written; - else - return NULL; -} - -/* Return a bitmap indexed by VAR_DECL uid for the static variables that are read during the execution of the function FN. Returns NULL if no data is available. */ bitmap -ipa_reference_get_read_global (tree fn) +ipa_reference_get_read_global (struct cgraph_node *fn) { ipa_reference_global_vars_info_t g = get_global_reference_vars_info (fn); if (g) @@ -195,7 +233,7 @@ ipa_reference_get_read_global (tree fn) call. Returns NULL if no data is available. */ bitmap -ipa_reference_get_written_global (tree fn) +ipa_reference_get_written_global (struct cgraph_node *fn) { ipa_reference_global_vars_info_t g = get_global_reference_vars_info (fn); if (g) @@ -209,7 +247,7 @@ ipa_reference_get_written_global (tree fn) NULL if no data is available. */ bitmap -ipa_reference_get_not_read_global (tree fn) +ipa_reference_get_not_read_global (struct cgraph_node *fn) { ipa_reference_global_vars_info_t g = get_global_reference_vars_info (fn); if (g) @@ -224,7 +262,7 @@ ipa_reference_get_not_read_global (tree fn) call. Returns NULL if no data is available. */ bitmap -ipa_reference_get_not_written_global (tree fn) +ipa_reference_get_not_written_global (struct cgraph_node *fn) { ipa_reference_global_vars_info_t g = get_global_reference_vars_info (fn); if (g) @@ -360,7 +398,7 @@ check_call (ipa_reference_local_vars_info_t local, gimple stmt) avail = cgraph_function_body_availability (callee); } - if (avail == AVAIL_NOT_AVAILABLE || avail == AVAIL_OVERWRITABLE) + if (avail <= AVAIL_OVERWRITABLE) if (local) { if (flags & ECF_CONST) @@ -393,7 +431,7 @@ scan_stmt_for_static_refs (gimple_stmt_iterator *gsip, bitmap_iterator bi; if (fn) - local = get_reference_vars_info_from_cgraph (fn)->local; + local = get_reference_vars_info (fn)->local; if (gimple_loaded_syms (stmt)) EXECUTE_IF_SET_IN_BITMAP (gimple_loaded_syms (stmt), 0, i, bi) @@ -472,30 +510,30 @@ get_static_name (int index) return NULL; } -/* Or in all of the bits from every callee into X, the caller's, bit - vector. There are several cases to check to avoid the sparse +/* Or in all of the bits from every callee of X into X_GLOBAL, the caller's cycle, + bit vector. There are several cases to check to avoid the sparse bitmap oring. */ static void -propagate_bits (struct cgraph_node *x) +propagate_bits (ipa_reference_global_vars_info_t x_global, struct cgraph_node *x) { - ipa_reference_vars_info_t x_info = get_reference_vars_info_from_cgraph (x); - ipa_reference_global_vars_info_t x_global = x_info->global; - struct cgraph_edge *e; for (e = x->callees; e; e = e->next_callee) { struct cgraph_node *y = e->callee; /* Only look at the master nodes and skip external nodes. */ - y = cgraph_master_clone (y); - if (y) + if (cgraph_function_body_availability (e->callee) > AVAIL_OVERWRITABLE) { - if (get_reference_vars_info_from_cgraph (y)) + if (get_reference_vars_info (y)) { ipa_reference_vars_info_t y_info - = get_reference_vars_info_from_cgraph (y); + = get_reference_vars_info (y); ipa_reference_global_vars_info_t y_global = y_info->global; + + /* Calls in current cycle do not have global computed yet. */ + if (!y_info->global) + continue; if (x_global->statics_read != all_module_statics) @@ -539,70 +577,6 @@ propagate_bits (struct cgraph_node *x) } } -/* Look at all of the callees of X to see which ones represent inlined - calls. For each of these callees, merge their local info into - TARGET and check their children recursively. - - This function goes away when Jan changes the inliner and IPA - analysis so that this is not run between the time when inlining - decisions are made and when the inlining actually occurs. */ - -static void -merge_callee_local_info (struct cgraph_node *target, - struct cgraph_node *x) -{ - struct cgraph_edge *e; - ipa_reference_local_vars_info_t x_l = - get_reference_vars_info_from_cgraph (target)->local; - - /* Make the world safe for tail recursion. */ - struct ipa_dfs_info *node_info = (struct ipa_dfs_info *) x->aux; - - if (node_info->aux) - return; - - node_info->aux = x; - - for (e = x->callees; e; e = e->next_callee) - { - struct cgraph_node *y = e->callee; - if (y->global.inlined_to) - { - ipa_reference_vars_info_t y_info; - ipa_reference_local_vars_info_t y_l; - struct cgraph_node* orig_y = y; - - y = cgraph_master_clone (y); - if (y) - { - y_info = get_reference_vars_info_from_cgraph (y); - y_l = y_info->local; - if (x_l != y_l) - { - bitmap_ior_into (x_l->statics_read, - y_l->statics_read); - bitmap_ior_into (x_l->statics_written, - y_l->statics_written); - } - x_l->calls_read_all |= y_l->calls_read_all; - x_l->calls_write_all |= y_l->calls_write_all; - merge_callee_local_info (target, y); - } - else - { - fprintf(stderr, "suspect inlining of "); - dump_cgraph_node (stderr, orig_y); - fprintf(stderr, "\ninto "); - dump_cgraph_node (stderr, target); - dump_cgraph (stderr); - gcc_assert(false); - } - } - } - - node_info->aux = NULL; -} - /* The init routine for analyzing global static variable usage. See comments at top for description. */ static void @@ -653,10 +627,9 @@ init_function_info (struct cgraph_node *fn) = XCNEW (struct ipa_reference_vars_info_d); ipa_reference_local_vars_info_t l = XCNEW (struct ipa_reference_local_vars_info_d); - tree decl = fn->decl; /* Add the info to the tree's annotation. */ - get_function_ann (decl)->reference_vars_info = info; + set_reference_vars_info (fn, info); info->local = l; l->statics_read = BITMAP_ALLOC (&local_info_obstack); @@ -674,7 +647,9 @@ analyze_function (struct cgraph_node *fn) tree decl = fn->decl; struct function *this_cfun = DECL_STRUCT_FUNCTION (decl); basic_block this_block; +#ifdef ENABLE_CHECKING tree step; +#endif if (dump_file) fprintf (dump_file, "\n local analysis of %s\n", cgraph_node_name (fn)); @@ -726,18 +701,12 @@ analyze_function (struct cgraph_node *fn) current_function_decl = NULL; } -/* If FN is avail == AVAIL_OVERWRITABLE, replace the effects bit - vectors with worst case bit vectors. We had to analyze it above to - find out if it took the address of any statics. However, now that - we know that, we can get rid of all of the other side effects. */ - +/* Remove local data associated with function FN. */ static void -clean_function (struct cgraph_node *fn) +clean_function_local_data (struct cgraph_node *fn) { - ipa_reference_vars_info_t info = get_reference_vars_info_from_cgraph (fn); + ipa_reference_vars_info_t info = get_reference_vars_info (fn); ipa_reference_local_vars_info_t l = info->local; - ipa_reference_global_vars_info_t g = info->global; - if (l) { if (l->statics_read @@ -747,8 +716,19 @@ clean_function (struct cgraph_node *fn) &&l->statics_written != all_module_statics) BITMAP_FREE (l->statics_written); free (l); + info->local = NULL; } +} + +/* Remove all data associated with function FN. */ + +static void +clean_function (struct cgraph_node *fn) +{ + ipa_reference_vars_info_t info = get_reference_vars_info (fn); + ipa_reference_global_vars_info_t g = info->global; + clean_function_local_data (fn); if (g) { if (g->statics_read @@ -767,10 +747,11 @@ clean_function (struct cgraph_node *fn) && g->statics_not_written != all_module_statics) BITMAP_FREE (g->statics_not_written); free (g); + info->global = NULL; } - free (get_function_ann (fn->decl)->reference_vars_info); - get_function_ann (fn->decl)->reference_vars_info = NULL; + free (get_reference_vars_info (fn)); + set_reference_vars_info (fn, NULL); } /* Called when new function is inserted to callgraph late. */ @@ -785,6 +766,76 @@ add_new_function (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED) visited_nodes = NULL; } +static bitmap +copy_local_bitmap (bitmap src) +{ + bitmap dst; + if (!src) + return NULL; + if (src == all_module_statics) + return all_module_statics; + dst = BITMAP_ALLOC (&local_info_obstack); + bitmap_copy (dst, src); + return dst; +} + +static bitmap +copy_global_bitmap (bitmap src) +{ + bitmap dst; + if (!src) + return NULL; + if (src == all_module_statics) + return all_module_statics; + dst = BITMAP_ALLOC (&global_info_obstack); + bitmap_copy (dst, src); + return dst; +} + +/* Called when new clone is inserted to callgraph late. */ + +static void +duplicate_node_data (struct cgraph_node *src, struct cgraph_node *dst, + void *data ATTRIBUTE_UNUSED) +{ + ipa_reference_global_vars_info_t ginfo; + ipa_reference_local_vars_info_t linfo; + ipa_reference_global_vars_info_t dst_ginfo; + ipa_reference_local_vars_info_t dst_linfo; + + ginfo = get_global_reference_vars_info (src); + linfo = get_local_reference_vars_info (src); + if (!linfo && !ginfo) + return; + init_function_info (dst); + if (linfo) + { + dst_linfo = get_local_reference_vars_info (dst); + dst_linfo->statics_read = copy_local_bitmap (linfo->statics_read); + dst_linfo->statics_written = copy_local_bitmap (linfo->statics_written); + dst_linfo->calls_read_all = linfo->calls_read_all; + dst_linfo->calls_write_all = linfo->calls_write_all; + } + if (ginfo) + { + get_reference_vars_info (dst)->global = XCNEW (struct ipa_reference_global_vars_info_d); + dst_ginfo = get_global_reference_vars_info (dst); + dst_ginfo->statics_read = copy_global_bitmap (ginfo->statics_read); + dst_ginfo->statics_written = copy_global_bitmap (ginfo->statics_written); + dst_ginfo->statics_not_read = copy_global_bitmap (ginfo->statics_not_read); + dst_ginfo->statics_not_written = copy_global_bitmap (ginfo->statics_not_written); + } +} + +/* Called when node is removed. */ + +static void +remove_node_data (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED) +{ + if (get_reference_vars_info (node)) + clean_function (node); +} + /* Analyze each function in the cgraph to see which global or statics are read or written. */ @@ -800,6 +851,10 @@ generate_summary (void) function_insertion_hook_holder = cgraph_add_function_insertion_hook (&add_new_function, NULL); + node_removal_hook_holder = + cgraph_add_node_removal_hook (&remove_node_data, NULL); + node_duplication_hook_holder = + cgraph_add_node_duplication_hook (&duplicate_node_data, NULL); ipa_init (); module_statics_readonly = BITMAP_ALLOC (&local_info_obstack); bm_temp = BITMAP_ALLOC (&local_info_obstack); @@ -820,10 +875,7 @@ generate_summary (void) replaced with worst case info. */ for (node = cgraph_nodes; node; node = node->next) - if (node->analyzed - && (cgraph_is_master_clone (node) - || (cgraph_function_body_availability (node) - == AVAIL_OVERWRITABLE))) + if (cgraph_function_body_availability (node) >= AVAIL_OVERWRITABLE) analyze_function (node); pointer_set_destroy (visited_nodes); @@ -888,13 +940,10 @@ generate_summary (void) } for (node = cgraph_nodes; node; node = node->next) - if (node->analyzed - && (cgraph_is_master_clone (node) - || (cgraph_function_body_availability (node) - == AVAIL_OVERWRITABLE))) + if (cgraph_function_body_availability (node) >= AVAIL_OVERWRITABLE) { ipa_reference_local_vars_info_t l; - l = get_reference_vars_info_from_cgraph (node)->local; + l = get_reference_vars_info (node)->local; /* Any variables that are not in all_module_statics are removed from the local maps. This will include all of the @@ -911,16 +960,13 @@ generate_summary (void) if (dump_file) for (node = cgraph_nodes; node; node = node->next) - if (node->analyzed - && (cgraph_is_master_clone (node) - || (cgraph_function_body_availability (node) - == AVAIL_OVERWRITABLE))) + if (cgraph_function_body_availability (node) >= AVAIL_OVERWRITABLE) { ipa_reference_local_vars_info_t l; unsigned int index; bitmap_iterator bi; - l = get_reference_vars_info_from_cgraph (node)->local; + l = get_reference_vars_info (node)->local; fprintf (dump_file, "\nFunction name:%s/%i:", cgraph_node_name (node), node->uid); @@ -938,6 +984,10 @@ generate_summary (void) fprintf(dump_file, "%s ", get_static_name (index)); } + if (l->calls_read_all) + fprintf (dump_file, "\n calls read all: "); + if (l->calls_write_all) + fprintf (dump_file, "\n calls read all: "); } } @@ -979,7 +1029,7 @@ propagate (void) struct ipa_dfs_info * w_info; node = order[i]; - node_info = get_reference_vars_info_from_cgraph (node); + node_info = get_reference_vars_info (node); if (!node_info) { dump_cgraph_node (stderr, node); @@ -987,7 +1037,7 @@ propagate (void) gcc_unreachable (); } - node_info->global = node_g; + gcc_assert (!node_info->global); node_l = node_info->local; read_all = node_l->calls_read_all; @@ -1000,7 +1050,7 @@ propagate (void) while (w) { ipa_reference_local_vars_info_t w_l = - get_reference_vars_info_from_cgraph (w)->local; + get_reference_vars_info (w)->local; read_all |= w_l->calls_read_all; write_all |= w_l->calls_write_all; @@ -1027,16 +1077,14 @@ propagate (void) node_l->statics_written); } + propagate_bits (node_g, node); w_info = (struct ipa_dfs_info *) node->aux; w = w_info->next_cycle; while (w) { ipa_reference_vars_info_t w_ri = - get_reference_vars_info_from_cgraph (w); + get_reference_vars_info (w); ipa_reference_local_vars_info_t w_l = w_ri->local; - - /* All nodes within a cycle share the same global info bitmaps. */ - w_ri->global = node_g; /* These global bitmaps are initialized from the local info of all of the nodes in the region. However there is no @@ -1048,36 +1096,25 @@ propagate (void) if (!write_all) bitmap_ior_into (node_g->statics_written, w_l->statics_written); + propagate_bits (node_g, w); w_info = (struct ipa_dfs_info *) w->aux; w = w_info->next_cycle; } - w = node; - while (w) - { - propagate_bits (w); - w_info = (struct ipa_dfs_info *) w->aux; - w = w_info->next_cycle; - } - } - - /* Need to fix up the local information sets. The information that - has been gathered so far is preinlining. However, the - compilation will progress post inlining so the local sets for the - inlined calls need to be merged into the callers. Note that the - local sets are not shared between all of the nodes in a cycle so - those nodes in the cycle must be processed explicitly. */ - for (i = 0; i < order_pos; i++ ) - { - struct ipa_dfs_info * w_info; - node = order[i]; - merge_callee_local_info (node, node); - + /* All nodes within a cycle have the same global info bitmaps. */ + node_info->global = node_g; w_info = (struct ipa_dfs_info *) node->aux; w = w_info->next_cycle; while (w) { - merge_callee_local_info (w, w); + ipa_reference_vars_info_t w_ri = + get_reference_vars_info (w); + + gcc_assert (!w_ri->global); + w_ri->global = XCNEW (struct ipa_reference_global_vars_info_d); + w_ri->global->statics_read = copy_global_bitmap (node_g->statics_read); + w_ri->global->statics_written = copy_global_bitmap (node_g->statics_written); + w_info = (struct ipa_dfs_info *) w->aux; w = w_info->next_cycle; } @@ -1095,7 +1132,7 @@ propagate (void) struct ipa_dfs_info * w_info; node = order[i]; - node_info = get_reference_vars_info_from_cgraph (node); + node_info = get_reference_vars_info (node); node_g = node_info->global; node_l = node_info->local; fprintf (dump_file, @@ -1121,7 +1158,7 @@ propagate (void) while (w) { ipa_reference_vars_info_t w_ri = - get_reference_vars_info_from_cgraph (w); + get_reference_vars_info (w); ipa_reference_local_vars_info_t w_l = w_ri->local; fprintf (dump_file, "\n next cycle: %s/%i ", cgraph_node_name (w), w->uid); @@ -1168,7 +1205,7 @@ propagate (void) ipa_reference_vars_info_t node_info; ipa_reference_global_vars_info_t node_g; node = order[i]; - node_info = get_reference_vars_info_from_cgraph (node); + node_info = get_reference_vars_info (node); node_g = node_info->global; /* Create the complimentary sets. These are more useful for @@ -1177,11 +1214,9 @@ propagate (void) node_g->statics_not_written = BITMAP_ALLOC (&global_info_obstack); if (node_g->statics_read != all_module_statics) - { - bitmap_and_compl (node_g->statics_not_read, - all_module_statics, - node_g->statics_read); - } + bitmap_and_compl (node_g->statics_not_read, + all_module_statics, + node_g->statics_read); if (node_g->statics_written != all_module_statics) @@ -1195,7 +1230,7 @@ propagate (void) for (node = cgraph_nodes; node; node = node->next) { ipa_reference_vars_info_t node_info; - node_info = get_reference_vars_info_from_cgraph (node); + node_info = get_reference_vars_info (node); /* Get rid of the aux information. */ if (node->aux) @@ -1204,19 +1239,10 @@ propagate (void) node->aux = NULL; } - if (node->analyzed - && (cgraph_function_body_availability (node) == AVAIL_OVERWRITABLE)) + if (cgraph_function_body_availability (node) == AVAIL_OVERWRITABLE) clean_function (node); else if (node_info) - { - /* Remove local info we no longer need. */ - if (node_info->local->statics_read - && node_info->local->statics_read != all_module_statics) - BITMAP_FREE (node_info->local->statics_read); - if (node_info->local->statics_written - && node_info->local->statics_written != all_module_statics) - BITMAP_FREE (node_info->local->statics_written); - } + clean_function_local_data (node); } bitmap_obstack_release (&local_info_obstack); return 0; diff --git a/gcc/ipa-reference.h b/gcc/ipa-reference.h index 1800a8ca9b9..7d5b36ed36b 100644 --- a/gcc/ipa-reference.h +++ b/gcc/ipa-reference.h @@ -23,60 +23,11 @@ along with GCC; see the file COPYING3. If not see #include "bitmap.h" #include "tree.h" -/* The static variables defined within the compilation unit that are - loaded or stored directly by function that owns this structure. */ - -struct ipa_reference_local_vars_info_d -{ - bitmap statics_read; - bitmap statics_written; - - /* Set when this function calls another function external to the - compilation unit or if the function has a asm clobber of memory. - In general, such calls are modeled as reading and writing all - variables (both bits on) but sometime there are attributes on the - called function so we can do better. */ - bool calls_read_all; - bool calls_write_all; -}; - -struct ipa_reference_global_vars_info_d -{ - bitmap statics_read; - bitmap statics_written; - bitmap statics_not_read; - bitmap statics_not_written; -}; - -/* Statics that are read and written by some set of functions. The - local ones are based on the loads and stores local to the function. - The global ones are based on the local info as well as the - transitive closure of the functions that are called. The - structures are separated to allow the global structures to be - shared between several functions since every function within a - strongly connected component will have the same information. This - sharing saves both time and space in the computation of the vectors - as well as their translation from decl_uid form to ann_uid - form. */ - -typedef struct ipa_reference_local_vars_info_d *ipa_reference_local_vars_info_t; -typedef struct ipa_reference_global_vars_info_d *ipa_reference_global_vars_info_t; - -struct ipa_reference_vars_info_d -{ - ipa_reference_local_vars_info_t local; - ipa_reference_global_vars_info_t global; -}; - -typedef struct ipa_reference_vars_info_d *ipa_reference_vars_info_t; - /* In ipa-reference.c */ -bitmap ipa_reference_get_read_local (tree fn); -bitmap ipa_reference_get_written_local (tree fn); -bitmap ipa_reference_get_read_global (tree fn); -bitmap ipa_reference_get_written_global (tree fn); -bitmap ipa_reference_get_not_read_global (tree fn); -bitmap ipa_reference_get_not_written_global (tree fn); +bitmap ipa_reference_get_read_global (struct cgraph_node *fn); +bitmap ipa_reference_get_written_global (struct cgraph_node *fn); +bitmap ipa_reference_get_not_read_global (struct cgraph_node *fn); +bitmap ipa_reference_get_not_written_global (struct cgraph_node *fn); #endif /* GCC_IPA_REFERENCE_H */ diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c index 729a84d8710..95e1856ac5b 100644 --- a/gcc/ipa-utils.c +++ b/gcc/ipa-utils.c @@ -100,10 +100,8 @@ searchc (struct searchc_env* env, struct cgraph_node *v) { struct ipa_dfs_info * w_info; struct cgraph_node *w = edge->callee; - /* Bypass the clones and only look at the master node. Skip - external and other bogus nodes. */ - w = cgraph_master_clone (w); - if (w && w->aux) + + if (w->aux && cgraph_function_body_availability (edge->callee) > AVAIL_OVERWRITABLE) { w_info = (struct ipa_dfs_info *) w->aux; if (w_info->new_node) @@ -168,27 +166,29 @@ ipa_utils_reduced_inorder (struct cgraph_node **order, env.reduce = reduce; for (node = cgraph_nodes; node; node = node->next) - if ((node->analyzed) - && (cgraph_is_master_clone (node) - || (allow_overwritable - && (cgraph_function_body_availability (node) == - AVAIL_OVERWRITABLE)))) - { - /* Reuse the info if it is already there. */ - struct ipa_dfs_info *info = (struct ipa_dfs_info *) node->aux; - if (!info) - info = XCNEW (struct ipa_dfs_info); - info->new_node = true; - info->on_stack = false; - info->next_cycle = NULL; - node->aux = info; - - splay_tree_insert (env.nodes_marked_new, - (splay_tree_key)node->uid, - (splay_tree_value)node); - } - else - node->aux = NULL; + { + enum availability avail = cgraph_function_body_availability (node); + + if (avail > AVAIL_OVERWRITABLE + || (allow_overwritable + && (avail == AVAIL_OVERWRITABLE))) + { + /* Reuse the info if it is already there. */ + struct ipa_dfs_info *info = (struct ipa_dfs_info *) node->aux; + if (!info) + info = XCNEW (struct ipa_dfs_info); + info->new_node = true; + info->on_stack = false; + info->next_cycle = NULL; + node->aux = info; + + splay_tree_insert (env.nodes_marked_new, + (splay_tree_key)node->uid, + (splay_tree_value)node); + } + else + node->aux = NULL; + } result = splay_tree_min (env.nodes_marked_new); while (result) { diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index c88eca60d74..e7b62637416 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,16 @@ +2008-09-17 Andrew Pinski <andrew_pinski@playstation.sony.com> + + * lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): Don't define. + (java_get_callee_fndecl): Kill. + +2008-09-17 Jan Hubicka <jh@suse.cz> + + PR c++/18071 + * class.c (add_method_1): Do not initialize DECL_INLINE. + (make_local_function_alias): Likewise. + * expr.c (rewrite_arglist_getcaller): Set DECL_UNINLINABLE. + * lang.c (java_decl_ok_for_sibcall): Use DECL_UNINLINABLE. + 2008-09-09 Richard Guenther <rguenther@suse.de> * decl.c (build_result_decl): Remove no longer applicable diff --git a/gcc/java/class.c b/gcc/java/class.c index 647da9ad23e..13cc54e024d 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -795,7 +795,7 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type) if (access_flags & ACC_PUBLIC) METHOD_PUBLIC (fndecl) = 1; if (access_flags & ACC_PROTECTED) METHOD_PROTECTED (fndecl) = 1; if (access_flags & ACC_PRIVATE) - METHOD_PRIVATE (fndecl) = DECL_INLINE (fndecl) = 1; + METHOD_PRIVATE (fndecl) = 1; if (access_flags & ACC_NATIVE) { METHOD_NATIVE (fndecl) = 1; @@ -806,9 +806,9 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type) file. */ DECL_EXTERNAL (fndecl) = CLASS_FROM_CURRENTLY_COMPILED_P (this_class) == 0; if (access_flags & ACC_STATIC) - METHOD_STATIC (fndecl) = DECL_INLINE (fndecl) = 1; + METHOD_STATIC (fndecl) = 1; if (access_flags & ACC_FINAL) - METHOD_FINAL (fndecl) = DECL_INLINE (fndecl) = 1; + METHOD_FINAL (fndecl) = 1; if (access_flags & ACC_SYNCHRONIZED) METHOD_SYNCHRONIZED (fndecl) = 1; if (access_flags & ACC_ABSTRACT) METHOD_ABSTRACT (fndecl) = 1; if (access_flags & ACC_STRICT) METHOD_STRICTFP (fndecl) = 1; @@ -1393,7 +1393,6 @@ make_local_function_alias (tree method) TREE_PUBLIC (alias) = 0; DECL_EXTERNAL (alias) = 0; DECL_ARTIFICIAL (alias) = 1; - DECL_INLINE (alias) = 0; DECL_INITIAL (alias) = error_mark_node; TREE_ADDRESSABLE (alias) = 1; TREE_USED (alias) = 1; diff --git a/gcc/java/expr.c b/gcc/java/expr.c index ff28bbb0b40..0882b520d51 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -2089,9 +2089,9 @@ rewrite_arglist_getcaller (tree arglist) tree retaddr = build_call_expr (built_in_decls[BUILT_IN_RETURN_ADDRESS], 1, integer_zero_node); - - DECL_INLINE (current_function_decl) = 0; + DECL_UNINLINABLE (current_function_decl) = 1; + return chainon (arglist, tree_cons (NULL_TREE, retaddr, NULL_TREE)); diff --git a/gcc/java/lang.c b/gcc/java/lang.c index d049aeb2bc1..2a962c04736 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -61,7 +61,6 @@ static int inline_init_test_initialization (void * *, void *); static bool java_dump_tree (void *, tree); static void dump_compound_expr (dump_info_p, tree); static bool java_decl_ok_for_sibcall (const_tree); -static tree java_get_callee_fndecl (const_tree); static enum classify_record java_classify_record (tree type); @@ -156,9 +155,6 @@ struct language_function GTY(()) #undef LANG_HOOKS_DECL_OK_FOR_SIBCALL #define LANG_HOOKS_DECL_OK_FOR_SIBCALL java_decl_ok_for_sibcall -#undef LANG_HOOKS_GET_CALLEE_FNDECL -#define LANG_HOOKS_GET_CALLEE_FNDECL java_get_callee_fndecl - #undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME #define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME java_mangle_decl @@ -845,59 +841,9 @@ static bool java_decl_ok_for_sibcall (const_tree decl) { return (decl != NULL && DECL_CONTEXT (decl) == output_class - && DECL_INLINE (decl)); -} - -/* Given a call_expr, try to figure out what its target might be. In - the case of an indirection via the atable, search for the decl. If - the decl is external, we return NULL. If we don't, the optimizer - will replace the indirection with a direct call, which undoes the - purpose of the atable indirection. */ -static tree -java_get_callee_fndecl (const_tree call_expr) -{ - tree method, table, element, atable_methods; - - HOST_WIDE_INT index; - - /* FIXME: This is disabled because we end up passing calls through - the PLT, and we do NOT want to do that. */ - return NULL; - - if (TREE_CODE (call_expr) != CALL_EXPR) - return NULL; - method = CALL_EXPR_FN (call_expr); - STRIP_NOPS (method); - if (TREE_CODE (method) != ARRAY_REF) - return NULL; - table = TREE_OPERAND (method, 0); - if (! DECL_LANG_SPECIFIC(table) - || !DECL_OWNER (table) - || TYPE_ATABLE_DECL (DECL_OWNER (table)) != table) - return NULL; - - atable_methods = TYPE_ATABLE_METHODS (DECL_OWNER (table)); - index = TREE_INT_CST_LOW (TREE_OPERAND (method, 1)); - - /* FIXME: Replace this for loop with a hash table lookup. */ - for (element = atable_methods; element; element = TREE_CHAIN (element)) - { - if (index == 1) - { - tree purpose = TREE_PURPOSE (element); - if (TREE_CODE (purpose) == FUNCTION_DECL - && ! DECL_EXTERNAL (purpose)) - return purpose; - else - return NULL; - } - --index; - } - - return NULL; + && !DECL_UNINLINABLE (decl)); } - static enum classify_record java_classify_record (tree type) { diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index 37b5905ed98..996e2f209a6 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -105,7 +105,6 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *, #define LANG_HOOKS_PRINT_ERROR_FUNCTION lhd_print_error_function #define LANG_HOOKS_DECL_PRINTABLE_NAME lhd_decl_printable_name #define LANG_HOOKS_DWARF_NAME lhd_dwarf_name -#define LANG_HOOKS_GET_CALLEE_FNDECL lhd_return_null_const_tree #define LANG_HOOKS_EXPR_SIZE lhd_expr_size #define LANG_HOOKS_TREE_SIZE lhd_tree_size #define LANG_HOOKS_TYPES_COMPATIBLE_P lhd_types_compatible_p @@ -255,7 +254,6 @@ extern tree lhd_make_node (enum tree_code); LANG_HOOKS_DECL_PRINTABLE_NAME, \ LANG_HOOKS_DWARF_NAME, \ LANG_HOOKS_TYPES_COMPATIBLE_P, \ - LANG_HOOKS_GET_CALLEE_FNDECL, \ LANG_HOOKS_PRINT_ERROR_FUNCTION, \ LANG_HOOKS_EXPR_SIZE, \ LANG_HOOKS_TO_TARGET_CHARSET, \ diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 2d62f99f28d..752ad99501f 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -354,9 +354,6 @@ struct lang_hooks in contexts where erroneously returning 0 causes problems. */ int (*types_compatible_p) (tree x, tree y); - /* Given a CALL_EXPR, return a function decl that is its target. */ - tree (*lang_get_callee_fndecl) (const_tree); - /* Called by report_error_function to print out function name. */ void (*print_error_function) (struct diagnostic_context *, const char *, struct diagnostic_info *); diff --git a/gcc/loop-doloop.c b/gcc/loop-doloop.c index a039f367925..25369dd4a4d 100644 --- a/gcc/loop-doloop.c +++ b/gcc/loop-doloop.c @@ -333,11 +333,13 @@ add_test (rtx cond, edge *e, basic_block dest) describes the loop, DESC describes the number of iterations of the loop, and DOLOOP_INSN is the low-overhead looping insn to emit at the end of the loop. CONDITION is the condition separated from the - DOLOOP_SEQ. COUNT is the number of iterations of the LOOP. */ + DOLOOP_SEQ. COUNT is the number of iterations of the LOOP. + ZERO_EXTEND_P says to zero extend COUNT after the increment of it to + word_mode. */ static void doloop_modify (struct loop *loop, struct niter_desc *desc, - rtx doloop_seq, rtx condition, rtx count) + rtx doloop_seq, rtx condition, rtx count, bool zero_extend_p) { rtx counter_reg; rtx tmp, noloop = NULL_RTX; @@ -413,6 +415,10 @@ doloop_modify (struct loop *loop, struct niter_desc *desc, if (increment_count) count = simplify_gen_binary (PLUS, mode, count, const1_rtx); + if (zero_extend_p) + count = simplify_gen_unary (ZERO_EXTEND, word_mode, + count, mode); + /* Insert initialization of the count register into the loop header. */ start_sequence (); tmp = force_operand (count, counter_reg); @@ -547,6 +553,7 @@ doloop_optimize (struct loop *loop) struct niter_desc *desc; unsigned word_mode_size; unsigned HOST_WIDE_INT word_mode_max; + bool zero_extend_p = false; if (dump_file) fprintf (dump_file, "Doloop: Processing loop %d.\n", loop->num); @@ -621,8 +628,7 @@ doloop_optimize (struct loop *loop) { if (word_mode_size > GET_MODE_BITSIZE (mode)) { - count = simplify_gen_unary (ZERO_EXTEND, word_mode, - count, mode); + zero_extend_p = true; iterations = simplify_gen_unary (ZERO_EXTEND, word_mode, iterations, mode); iterations_max = simplify_gen_unary (ZERO_EXTEND, word_mode, @@ -666,7 +672,7 @@ doloop_optimize (struct loop *loop) return false; } - doloop_modify (loop, desc, doloop_seq, condition, count); + doloop_modify (loop, desc, doloop_seq, condition, count, zero_extend_p); return true; } diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index e4f952d8475..039ad3b1bf0 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,16 @@ +2008-09-17 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR objc/37460 + * objc-lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): Don't define. + * objc-act.h (objc_get_callee_fndecl): Remove prototype. + * objc-act.c (objc_get_callee_fndecl): Kill. + +2008-09-17 Jan Hubicka <jh@suse.cz> + + PR c++/18071 + * objc/objc-act.c (objc_finish_method_definition): Do not set + DECL_INLINE. + 2008-09-01 Aldy Hernandez <aldyh@redhat.com> * objc-act.c (build_typed_selector_reference): Pass input_location to diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 8f9571942c2..837f3cf5c0b 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -8800,7 +8800,6 @@ objc_finish_method_definition (tree fndecl) /* We cannot validly inline ObjC methods, at least not without a language extension to declare that a method need not be dynamically dispatched, so suppress all thoughts of doing so. */ - DECL_INLINE (fndecl) = 0; DECL_UNINLINABLE (fndecl) = 1; #ifndef OBJCPLUS @@ -9511,25 +9510,4 @@ objc_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) #endif } -/* Given a CALL expression, find the function being called. The ObjC - version looks for the OBJ_TYPE_REF_EXPR which is used for objc_msgSend. */ - -tree -objc_get_callee_fndecl (const_tree call_expr) -{ - tree addr = CALL_EXPR_FN (call_expr); - if (TREE_CODE (addr) != OBJ_TYPE_REF) - return 0; - - addr = OBJ_TYPE_REF_EXPR (addr); - - /* If the address is just `&f' for some function `f', then we know - that `f' is being called. */ - if (TREE_CODE (addr) == ADDR_EXPR - && TREE_CODE (TREE_OPERAND (addr, 0)) == FUNCTION_DECL) - return TREE_OPERAND (addr, 0); - - return 0; -} - #include "gt-objc-objc-act.h" diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h index 741401d8356..6c6b227bd6b 100644 --- a/gcc/objc/objc-act.h +++ b/gcc/objc/objc-act.h @@ -29,7 +29,6 @@ along with GCC; see the file COPYING3. If not see bool objc_init (void); const char *objc_printable_name (tree, int); -tree objc_get_callee_fndecl (const_tree); void objc_finish_file (void); tree objc_fold_obj_type_ref (tree, tree); enum gimplify_status objc_gimplify_expr (tree *, gimple_seq *, gimple_seq *); diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c index 11ba6ac462c..37c785c6ac4 100644 --- a/gcc/objc/objc-lang.c +++ b/gcc/objc/objc-lang.c @@ -48,8 +48,6 @@ static void objc_init_ts (void); #define LANG_HOOKS_DECL_PRINTABLE_NAME objc_printable_name #undef LANG_HOOKS_GIMPLIFY_EXPR #define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr -#undef LANG_HOOKS_GET_CALLEE_FNDECL -#define LANG_HOOKS_GET_CALLEE_FNDECL objc_get_callee_fndecl #undef LANG_HOOKS_INIT_TS #define LANG_HOOKS_INIT_TS objc_init_ts diff --git a/gcc/objcp/ChangeLog b/gcc/objcp/ChangeLog index e8bf0d6ccfa..b296480f495 100644 --- a/gcc/objcp/ChangeLog +++ b/gcc/objcp/ChangeLog @@ -1,3 +1,8 @@ +2008-09-17 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR objc/37460 + * objcp-lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): Don't define. + 2008-04-03 Tom Tromey <tromey@redhat.com> * Make-lang.in (obj-c++_OBJS): New variable. diff --git a/gcc/objcp/objcp-lang.c b/gcc/objcp/objcp-lang.c index d595ba22cd7..ab3206a25ad 100644 --- a/gcc/objcp/objcp-lang.c +++ b/gcc/objcp/objcp-lang.c @@ -48,8 +48,6 @@ static void objcxx_init_ts (void); #define LANG_HOOKS_DECL_PRINTABLE_NAME objc_printable_name #undef LANG_HOOKS_GIMPLIFY_EXPR #define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr -#undef LANG_HOOKS_GET_CALLEE_FNDECL -#define LANG_HOOKS_GET_CALLEE_FNDECL objc_get_callee_fndecl #undef LANG_HOOKS_INIT_TS #define LANG_HOOKS_INIT_TS objcxx_init_ts diff --git a/gcc/regrename.c b/gcc/regrename.c index bd2373cbb5a..e70dae8d139 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -1314,6 +1314,10 @@ maybe_mode_change (enum machine_mode orig_mode, enum machine_mode copy_mode, enum machine_mode new_mode, unsigned int regno, unsigned int copy_regno ATTRIBUTE_UNUSED) { + if (GET_MODE_SIZE (copy_mode) < GET_MODE_SIZE (orig_mode) + && GET_MODE_SIZE (copy_mode) < GET_MODE_SIZE (new_mode)) + return NULL_RTX; + if (orig_mode == new_mode) return gen_rtx_raw_REG (new_mode, regno); else if (mode_change_ok (orig_mode, new_mode, regno)) diff --git a/gcc/sched-int.h b/gcc/sched-int.h index 7fd3b5526a2..e332c61f458 100644 --- a/gcc/sched-int.h +++ b/gcc/sched-int.h @@ -678,9 +678,6 @@ struct _haifa_insn_data /* A priority for each insn. */ int priority; - /* Number of instructions referring to this insn. */ - int ref_count; - /* The minimum clock tick at which the insn becomes ready. This is used to note timing constraints for the insns in the pending list. */ int tick; diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index 8ea3d098dcc..004064ecf42 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -2395,9 +2395,9 @@ sets_likely_spilled_1 (rtx x, const_rtx pat, void *data) *ret = true; } -/* An array used to hold the number of dependencies in which insn - participates. Used in add_branch_dependences. */ -static int *ref_counts; +/* A bitmap to note insns that participate in any dependency. Used in + add_branch_dependences. */ +static sbitmap insn_referenced; /* Add dependences so that branches are scheduled to run last in their block. */ @@ -2424,8 +2424,6 @@ add_branch_dependences (rtx head, rtx tail) are not moved before reload because we can wind up with register allocation failures. */ -#define INSN_REF_COUNT(INSN) (ref_counts[INSN_UID (INSN)]) - insn = tail; last = 0; while (CALL_P (insn) @@ -2448,7 +2446,7 @@ add_branch_dependences (rtx head, rtx tail) { if (! sched_insns_conditions_mutex_p (last, insn)) add_dependence (last, insn, REG_DEP_ANTI); - INSN_REF_COUNT (insn)++; + SET_BIT (insn_referenced, INSN_LUID (insn)); } CANT_MOVE (insn) = 1; @@ -2470,12 +2468,11 @@ add_branch_dependences (rtx head, rtx tail) { insn = prev_nonnote_insn (insn); - if (INSN_REF_COUNT (insn) != 0) + if (TEST_BIT (insn_referenced, INSN_LUID (insn))) continue; if (! sched_insns_conditions_mutex_p (last, insn)) add_dependence (last, insn, REG_DEP_ANTI); - INSN_REF_COUNT (insn) = 1; } #ifdef HAVE_conditional_execution @@ -3086,14 +3083,15 @@ sched_rgn_compute_dependencies (int rgn) for (bb = 0; bb < current_nr_blocks; bb++) init_deps (bb_deps + bb); - /* Initialize array used in add_branch_dependencies (). */ - ref_counts = XCNEWVEC (int, get_max_uid () + 1); + /* Initialize bitmap used in add_branch_dependences. */ + insn_referenced = sbitmap_alloc (sched_max_luid); + sbitmap_zero (insn_referenced); /* Compute backward dependencies. */ for (bb = 0; bb < current_nr_blocks; bb++) compute_block_dependences (bb); - free (ref_counts); + sbitmap_free (insn_referenced); free_pending_lists (); finish_deps_global (); free (bb_deps); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 849db2e2df6..247d214cb47 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,406 @@ +2008-09-18 Bob Wilson <bob.wilson@acm.org> + + * gcc.c-torture/compile/pr11832.c: xfail on xtensa*-*-*. + * gcc.c-torture/compile/pr33009.c: Likewise. + +2008-09-18 Janis Johnson <janis187@us.ibm.com> + + PR testsuite/25241 + * lib/g++.exp (g++_init): Enable overrides of dg-error, dg-warning + for C++ tests. + * g++.dg/conversion/ambig1.C: Clean up dg-error/dg-warning; use + dg-message for notes. + * g++.dg/conversion/simd1.C: Ditto. + * g++.dg/conversion/simd3.C: Ditto. + * g++.dg/cpp0x/rv2n.C: Ditto. + * g++.dg/cpp0x/rv3n.C: Ditto. + * g++.dg/cpp0x/rv4n.C: Ditto. + * g++.dg/cpp0x/rv5n.C: Ditto. + * g++.dg/cpp0x/rv6n.C: Ditto. + * g++.dg/cpp0x/rv7n.C: Ditto. + * g++.dg/cpp0x/variadic36.C: Ditto. + * g++.dg/cpp0x/variadic59.C: Ditto. + * g++.dg/cpp0x/variadic71.C: Ditto. + * g++.dg/cpp0x/variadic-ex13.C: Ditto. + * g++.dg/expr/cond9.C: Ditto. + * g++.dg/expr/pmf-1.C: Ditto. + * g++.dg/ext/case-range2.C: Ditto. + * g++.dg/ext/case-range3.C: Ditto. + * g++.dg/ext/is_class_error2.C: Ditto. + * g++.dg/ext/label5.C: Ditto. + * g++.dg/ext/pr27019.C: Ditto. + * g++.dg/gomp/pr26690-1.C: Ditto. + * g++.dg/gomp/pr26690-2.C: Ditto. + * g++.dg/gomp/pr34694.C: Ditto. + * g++.dg/gomp/tpl-parallel-2.C: Ditto. + * g++.dg/inherit/base3.C: Ditto. + * g++.dg/inherit/using6.C: Ditto. + * g++.dg/init/brace6.C: Ditto. + * g++.dg/init/ctor4.C: Ditto. + * g++.dg/lookup/conv-1.C: Ditto. + * g++.dg/lookup/new1.C: Ditto. + * g++.dg/lookup/scoped6.C: Ditto. + * g++.dg/lookup/using7.C: Ditto. + * g++.dg/lookup/using9.C: Ditto. + * g++.dg/other/abstract1.C: Ditto. + * g++.dg/other/abstract2.C: Ditto. + * g++.dg/other/anon5.C: Ditto. + * g++.dg/other/crash-4.C: Ditto. + * g++.dg/other/error10.C: Ditto. + * g++.dg/other/error13.C: Ditto. + * g++.dg/other/error20.C: Ditto. + * g++.dg/other/error5.C: Ditto. + * g++.dg/other/field1.C: Ditto. + * g++.dg/other/offsetof5.C: Ditto. + * g++.dg/other/semicolon.C: Ditto. + * g++.dg/overload/ambig1.C: Ditto. + * g++.dg/overload/arg3.C: Ditto. + * g++.dg/overload/builtin1.C: Ditto. + * g++.dg/overload/copy1.C: Ditto. + * g++.dg/overload/new1.C: Ditto. + * g++.dg/overload/template4.C: Ditto. + * g++.dg/overload/using2.C: Ditto. + * g++.dg/parse/bitfield2.C: Ditto. + * g++.dg/parse/constant4.C: Ditto. + * g++.dg/parse/crash20.C: Ditto. + * g++.dg/parse/crash36.C: Ditto. + * g++.dg/parse/crash5.C: Ditto. + * g++.dg/parse/error11.C: Ditto. + * g++.dg/parse/error12.C: Ditto. + * g++.dg/parse/error19.C: Ditto. + * g++.dg/parse/error28.C: Ditto. + * g++.dg/parse/friend5.C: Ditto. + * g++.dg/parse/invalid-op1.C: Ditto. + * g++.dg/parse/missing-template1.C: Ditto. + * g++.dg/parse/non-dependent2.C: Ditto. + * g++.dg/parse/ret-type2.C: Ditto. + * g++.dg/parse/specialization1.C: Ditto. + * g++.dg/parse/template18.C: Ditto. + * g++.dg/parse/template3.C: Ditto. + * g++.dg/parse/template9.C: Ditto. + * g++.dg/tc1/dr108.C: Ditto. + * g++.dg/tc1/dr152.C: Ditto. + * g++.dg/tc1/dr166.C: Ditto. + * g++.dg/template/access11.C: Ditto. + * g++.dg/template/access2.C: Ditto. + * g++.dg/template/access3.C: Ditto. + * g++.dg/template/access7.C: Ditto. + * g++.dg/template/copy1.C: Ditto. + * g++.dg/template/crash13.C: Ditto. + * g++.dg/template/crash37.C: Ditto. + * g++.dg/template/crash40.C: Ditto. + * g++.dg/template/crash58.C: Ditto. + * g++.dg/template/ctor5.C: Ditto. + * g++.dg/template/dependent-expr5.C: Ditto. + * g++.dg/template/eh2.C: Ditto. + * g++.dg/template/error2.C: Ditto. + * g++.dg/template/error33.C: Ditto. + * g++.dg/template/error4.C: Ditto. + * g++.dg/template/friend31.C: Ditto. + * g++.dg/template/friend32.C: Ditto. + * g++.dg/template/instantiate1.C: Ditto. + * g++.dg/template/instantiate3.C: Ditto. + * g++.dg/template/instantiate5.C: Ditto. + * g++.dg/template/instantiate7.C: Ditto. + * g++.dg/template/local6.C: Ditto. + * g++.dg/template/lookup2.C: Ditto. + * g++.dg/template/member5.C: Ditto. + * g++.dg/template/memfriend15.C: Ditto. + * g++.dg/template/memfriend16.C: Ditto. + * g++.dg/template/memfriend17.C: Ditto. + * g++.dg/template/memfriend7.C: Ditto. + * g++.dg/template/meminit1.C: Ditto. + * g++.dg/template/nested3.C: Ditto. + * g++.dg/template/new3.C: Ditto. + * g++.dg/template/nontype12.C: Ditto. + * g++.dg/template/nontype13.C: Ditto. + * g++.dg/template/nontype6.C: Ditto. + * g++.dg/template/non-type-template-argument-1.C: Ditto. + * g++.dg/template/overload9.C: Ditto. + * g++.dg/template/ptrmem15.C: Ditto. + * g++.dg/template/ptrmem17.C: Ditto. + * g++.dg/template/ptrmem4.C: Ditto. + * g++.dg/template/ptrmem6.C: Ditto. + * g++.dg/template/ptrmem8.C: Ditto. + * g++.dg/template/qualified-id1.C: Ditto. + * g++.dg/template/qualttp20.C: Ditto. + * g++.dg/template/qualttp3.C: Ditto. + * g++.dg/template/qualttp4.C: Ditto. + * g++.dg/template/qualttp5.C: Ditto. + * g++.dg/template/qualttp6.C: Ditto. + * g++.dg/template/qualttp7.C: Ditto. + * g++.dg/template/qualttp8.C: Ditto. + * g++.dg/template/recurse.C: Ditto. + * g++.dg/template/sfinae10.C: Ditto. + * g++.dg/template/sfinae3.C: Ditto. + * g++.dg/template/spec22.C: Ditto. + * g++.dg/template/spec23.C: Ditto. + * g++.dg/template/static9.C: Ditto. + * g++.dg/template/template-id-2.C: Ditto. + * g++.dg/template/typename2.C: Ditto. + * g++.dg/template/typename4.C: Ditto. + * g++.dg/template/using14.C: Ditto. + * g++.dg/template/using2.C: Ditto. + * g++.dg/template/warn1.C: Ditto. + * g++.dg/warn/incomplete1.C: Ditto. + * g++.dg/warn/noeffect2.C: Ditto. + * g++.dg/warn/noeffect4.C: Ditto. + * g++.dg/warn/pr8570.C: Ditto. + * g++.dg/warn/Wparentheses-13.C: Ditto. + * g++.dg/warn/Wparentheses-15.C: Ditto. + * g++.dg/warn/Wparentheses-16.C: Ditto. + * g++.dg/warn/Wparentheses-17.C: Ditto. + * g++.dg/warn/Wparentheses-18.C: Ditto. + * g++.dg/warn/Wparentheses-19.C: Ditto. + * g++.dg/warn/Wparentheses-20.C: Ditto. + * g++.dg/warn/Wparentheses-23.C: Ditto. + * g++.dg/warn/Wstrict-aliasing-3.C: Ditto. + * g++.old-deja/g++.benjamin/15799.C: Ditto. + * g++.old-deja/g++.benjamin/15800-1.C: Ditto. + * g++.old-deja/g++.benjamin/16077.C: Ditto. + * g++.old-deja/g++.bob/inherit2.C: Ditto. + * g++.old-deja/g++.brendan/ambiguity1.C: Ditto. + * g++.old-deja/g++.brendan/crash29.C: Ditto. + * g++.old-deja/g++.brendan/crash48.C: Ditto. + * g++.old-deja/g++.brendan/crash56.C: Ditto. + * g++.old-deja/g++.brendan/cvt3.C: Ditto. + * g++.old-deja/g++.brendan/overload1.C: Ditto. + * g++.old-deja/g++.brendan/overload4.C: Ditto. + * g++.old-deja/g++.brendan/overload9.C: Ditto. + * g++.old-deja/g++.bugs/900127_01.C: Ditto. + * g++.old-deja/g++.bugs/900205_04.C: Ditto. + * g++.old-deja/g++.bugs/900330_02.C: Ditto. + * g++.old-deja/g++.bugs/900404_03.C: Ditto. + * g++.old-deja/g++.bugs/900514_03.C: Ditto. + * g++.old-deja/g++.eh/ctor1.C: Ditto. + * g++.old-deja/g++.eh/spec6.C: Ditto. + * g++.old-deja/g++.ext/overload1.C: Ditto. + * g++.old-deja/g++.jason/conversion11.C: Ditto. + * g++.old-deja/g++.jason/crash3.C: Ditto. + * g++.old-deja/g++.jason/lineno3.C: Ditto. + * g++.old-deja/g++.jason/lineno4.C: Ditto. + * g++.old-deja/g++.jason/opeq3.C: Ditto. + * g++.old-deja/g++.jason/overload16.C: Ditto. + * g++.old-deja/g++.jason/overload28.C: Ditto. + * g++.old-deja/g++.jason/pmf5.C: Ditto. + * g++.old-deja/g++.jason/scoping10.C: Ditto. + * g++.old-deja/g++.jason/template30.C: Ditto. + * g++.old-deja/g++.jason/temporary2.C: Ditto. + * g++.old-deja/g++.jason/tredecl4.C: Ditto. + * g++.old-deja/g++.law/arg11.C: Ditto. + * g++.old-deja/g++.law/arg1.C: Ditto. + * g++.old-deja/g++.law/arm9.C: Ditto. + * g++.old-deja/g++.law/ctors11.C: Ditto. + * g++.old-deja/g++.law/ctors17.C: Ditto. + * g++.old-deja/g++.law/ctors5.C: Ditto. + * g++.old-deja/g++.law/ctors9.C: Ditto. + * g++.old-deja/g++.law/enum4.C: Ditto. + * g++.old-deja/g++.law/missed-error2.C: Ditto. + * g++.old-deja/g++.law/operators9.C: Ditto. + * g++.old-deja/g++.mike/net22.C: Ditto. + * g++.old-deja/g++.mike/net2.C: Ditto. + * g++.old-deja/g++.mike/p11110.C: Ditto. + * g++.old-deja/g++.mike/p1989.C: Ditto. + * g++.old-deja/g++.mike/p2431.C: Ditto. + * g++.old-deja/g++.mike/p438.C: Ditto. + * g++.old-deja/g++.mike/p807a.C: Ditto. + * g++.old-deja/g++.mike/p9068.C: Ditto. + * g++.old-deja/g++.niklas/t120.C: Ditto. + * g++.old-deja/g++.niklas/t121.C: Ditto. + * g++.old-deja/g++.niklas/t128.C: Ditto. + * g++.old-deja/g++.ns/overload2.C: Ditto. + * g++.old-deja/g++.ns/template13.C: Ditto. + * g++.old-deja/g++.ns/using12.C: Ditto. + * g++.old-deja/g++.oliva/delete1.C: Ditto. + * g++.old-deja/g++.oliva/overload1.C: Ditto. + * g++.old-deja/g++.other/crash24.C: Ditto. + * g++.old-deja/g++.other/crash25.C: Ditto. + * g++.old-deja/g++.other/decl3.C: Ditto. + * g++.old-deja/g++.other/expr1.C: Ditto. + * g++.old-deja/g++.other/overcnv2.C: Ditto. + * g++.old-deja/g++.other/overload11.C: Ditto. + * g++.old-deja/g++.other/pmf3.C: Ditto. + * g++.old-deja/g++.other/ptrmem7.C: Ditto. + * g++.old-deja/g++.other/vaarg3.C: Ditto. + * g++.old-deja/g++.other/volatile1.C: Ditto. + * g++.old-deja/g++.pt/assign1.C: Ditto. + * g++.old-deja/g++.pt/auto_ptr.C: Ditto. + * g++.old-deja/g++.pt/const2.C: Ditto. + * g++.old-deja/g++.pt/crash10.C: Ditto. + * g++.old-deja/g++.pt/crash20.C: Ditto. + * g++.old-deja/g++.pt/crash36.C: Ditto. + * g++.old-deja/g++.pt/crash38.C: Ditto. + * g++.old-deja/g++.pt/derived3.C: Ditto. + * g++.old-deja/g++.pt/error2.C: Ditto. + * g++.old-deja/g++.pt/explicit34.C: Ditto. + * g++.old-deja/g++.pt/explicit70.C: Ditto. + * g++.old-deja/g++.pt/friend23.C: Ditto. + * g++.old-deja/g++.pt/ptrmem10.C: Ditto. + * g++.old-deja/g++.pt/redecl1.C: Ditto. + * g++.old-deja/g++.pt/spec35.C: Ditto. + * g++.old-deja/g++.pt/t05.C: Ditto. + * g++.old-deja/g++.pt/typename3.C: Ditto. + * g++.old-deja/g++.pt/typename6.C: Ditto. + * g++.old-deja/g++.pt/unify8.C: Ditto. + * g++.old-deja/g++.pt/vaarg3.C: Ditto. + * g++.old-deja/g++.robertl/eb109.C: Ditto. + * g++.old-deja/g++.robertl/eb131.C: Ditto. + * g++.old-deja/g++.robertl/eb22.C: Ditto. + * g++.old-deja/g++.robertl/eb44.C: Ditto. + * g++.old-deja/g++.robertl/eb4.C: Ditto. + * g++.old-deja/g++.robertl/eb69.C: Ditto. + * g++.dg/parse/constructor1.C: Remove "error" from dg-error, preserving + column number. + * g++.dg/parse/error10.C: Ditto. + * g++.dg/parse/error13.C: Ditto. + * g++.dg/parse/error14.C: Ditto. + * g++.dg/parse/error15.C: Ditto. + * g++.dg/parse/error16.C: Ditto. + * g++.dg/parse/error17.C: Ditto. + * g++.dg/parse/error18.C: Ditto. + * g++.dg/parse/error1.C: Ditto. + * g++.dg/parse/error20.C: Ditto. + * g++.dg/parse/error21.C: Ditto. + * g++.dg/parse/error22.C: Ditto. + * g++.dg/parse/error23.C: Ditto. + * g++.dg/parse/error24.C: Ditto. + * g++.dg/parse/error25.C: Ditto. + * g++.dg/parse/error26.C: Ditto. + * g++.dg/parse/error27.C: Ditto. + * g++.dg/parse/error29.C: Ditto. + * g++.dg/parse/error2.C: Ditto. + * g++.dg/parse/error30.C: Ditto. + * g++.dg/parse/error31.C: Ditto. + * g++.dg/parse/error3.C: Ditto. + * g++.dg/parse/error4.C: Ditto. + * g++.dg/parse/error5.C: Ditto. + * g++.dg/parse/error6.C: Ditto. + * g++.dg/parse/error7.C: Ditto. + * g++.dg/parse/error8.C: Ditto. + * g++.dg/parse/error9.C: Ditto. + * g++.dg/parse/error-column.C: Ditto. + * g++.dg/template/crash80.C: Ditto. + * g++.dg/template/friend44.C: Ditto. + * g++.dg/warn/pr26785.C: Ditto. + * g++.old-deja/g++.brendan/crash16.C: Ditto. + +2008-09-18 H.J. Lu <hongjiu.lu@intel.com> + + PR target/37394 + * g++.dg/other/pr37394.C: New. + +2008-09-18 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/35945 + * gfortran.dg/host_assoc_types_2.f90: New test. + + PR fortran/36700 + * gfortran.dg/host_assoc_call_2.f90: New test. + +2008-09-18 DJ Delorie <dj@redhat.com> + + * gcc.c-torture/execute/20060420-1.c: Fix alignment logic. + +2008-09-18 Simon Baldwin <simonb@google.com> + + * gcc.dg/builtin-redefine.c: New. + +2008-09-18 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/37258 + * gcc.c-torture/compile/pr37258.c: New testcase. + +2008-09-18 Andrew MacLeod <amacleod@redhat.com> + + PR tree-optimization/37102 + * gcc.c-torture/execute/pr37102.c: New Test. + +2008-09-18 Richard Guenther <rguenther@suse.de> + + PR middle-end/37284 + * g++.dg/tree-ssa/pr37284.C: New testcase. + +2008-09-18 Daniel Kraft <d@domob.eu> + + PR fortran/37507 + * gfortran.dg/allocate_error_1.f90: New test. + * gfortran.dg/deallocate_error_1.f90: New test. + * gfortran.dg/deallocate_error_2.f90: New test. + +2008-09-18 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/37456 + * testsuite/g++.dg/torture/pr37456.C: New testcase. + +2008-09-18 Uros Bizjak <ubizjak@gmail.com> + + PR rtl-optimization/37544 + * gcc.dg/pr37544.c: New test. + +2008-09-17 Janis Johnson <janis187@us.ibm.com> + + PR testsuite/25241 + * g++.old-deja/g++.brendan/crash7.C: Remove "error" or "warning" from + message for dg-error/dg-warning. + * g++.old-deja/g++.jason/crash11.C: Ditto. + * g++.old-deja/g++.oliva/template1.C: Ditto. + * g++.old-deja/g++.benjamin/tem03.C: Ditto. + * g++.dg/rtti/no-rtti.C: Ditto. + * g++.dg/cpp/pedantic-errors.C: Ditto. + * g++.dg/cpp/string-2.C: Ditto. + * g++.dg/ext/fpreg1.C: Ditto. + * g++.dg/ext/altivec-types-1.C: Ditto. + * g++.dg/warn/write-strings-default.C: Ditto. + * g++.dg/warn/Wvla-2.C: Ditto. + * g++.dg/warn/register-var-1.C: Ditto. + * g++.dg/warn/deprecated-3.C: Ditto. + * g++.dg/warn/pr30551-2.C: Ditto. + * g++.dg/warn/overflow-warn-1.C: Ditto. + * g++.dg/warn/pr30551.C: Ditto. + * g++.dg/warn/pointer-integer-comparison.C: Ditto. + * g++.dg/warn/pr12242.C: Ditto. + * g++.dg/warn/write-strings.C: Ditto. + * g++.dg/warn/overflow-warn-3.C: Ditto. + * g++.dg/warn/overflow-warn-4.C: Ditto. + * g++.dg/warn/overflow-warn-6.C: Ditto. + * g++.dg/parse/crash43.C: Ditto. + * g++.dg/parse/crash44.C: Ditto. + * g++.dg/parse/offsetof8.C: Ditto. + * g++.dg/gomp/pr35158.C: Ditto. + * g++.dg/template/crash81.C: Ditto. + +2008-09-18 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/37274 + * gfortran.dg/used_types_22.f90: New test. + * gfortran.dg/used_types_23.f90: New test. + + PR fortran/36374 + * gfortran.dg/generic_17.f90: New test. + * gfortran.dg/ambiguous_specific_2.f90: New test. + * gfortran.dg/generic_actual_arg.f90: Add test for case that is + not ambiguous. + + PR fortran/36454 + * gfortran.dg/access_spec_3.f90: New test. + +2008-09-17 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/specs/static_initializer3.ads: New test. + +2008-09-17 Jakub Jelinek <jakub@redhat.com> + + PR c++/37552 + * g++.dg/parse/crash49.C: New test. + + PR preprocessor/37324 + * lib/target-supports.exp + (check_effective_target_wchar_t_char16_t_compatible, + check_effective_target_wchar_t_char32_t_compatible): New. + * gcc.dg/utf-array.c: Use __CHAR{16,32}_TYPE__ macros in typedefs. + Only require from incompatible errors for char{16,32}_t vs. wchar_t + initializations if those types are indeed incompatible. + 2008-09-16 Janis Johnson <janis187@us.ibm.com> PR testsuite/25241 diff --git a/gcc/testsuite/g++.dg/conversion/ambig1.C b/gcc/testsuite/g++.dg/conversion/ambig1.C index 42ac4038ec6..1db1667073f 100644 --- a/gcc/testsuite/g++.dg/conversion/ambig1.C +++ b/gcc/testsuite/g++.dg/conversion/ambig1.C @@ -1,8 +1,8 @@ // PR c++/19787 struct H { - operator char(); // { dg-error "" } - operator short(); // { dg-error "" } + operator char(); // { dg-message "note" } + operator short(); // { dg-message "note" } }; -int const& ref = H(); // { dg-error "" } +int const& ref = H(); // { dg-error "ambiguous" } diff --git a/gcc/testsuite/g++.dg/conversion/simd1.C b/gcc/testsuite/g++.dg/conversion/simd1.C index 0a5302d1bde..06cdc1ab341 100644 --- a/gcc/testsuite/g++.dg/conversion/simd1.C +++ b/gcc/testsuite/g++.dg/conversion/simd1.C @@ -5,9 +5,9 @@ #define vector __attribute__((vector_size(16))) -vector signed int vld (int a1, const vector signed int *a2) { return *a2; } /* { dg-error "vld" } */ +vector signed int vld (int a1, const vector signed int *a2) { return *a2; } /* { dg-message "vld" } */ /* { dg-warning "vector returned by ref" "" { target { powerpc*-*-linux* && ilp32 } } 8 } */ -vector signed short vld (int a1, const vector signed short *a2) { return *a2; } /* { dg-error "vld" } */ +vector signed short vld (int a1, const vector signed short *a2) { return *a2; } /* { dg-message "vld" } */ extern int i; extern vector signed short vss; diff --git a/gcc/testsuite/g++.dg/conversion/simd3.C b/gcc/testsuite/g++.dg/conversion/simd3.C index cdc2ed68a3b..7aea5449d38 100644 --- a/gcc/testsuite/g++.dg/conversion/simd3.C +++ b/gcc/testsuite/g++.dg/conversion/simd3.C @@ -10,6 +10,6 @@ unsigned int __attribute__((vector_size(16))) e; void foo() { b + d; /* { dg-error "invalid operands to binary" } */ - d += e; /* { dg-error "use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts.*cannot convert 'unsigned int __vector__' to 'int __vector__' in assignment" } */ + d += e; /* { dg-message "use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts.*cannot convert 'unsigned int __vector__' to 'int __vector__' in assignment" } */ d2 += d; } diff --git a/gcc/testsuite/g++.dg/cpp/pedantic-errors.C b/gcc/testsuite/g++.dg/cpp/pedantic-errors.C index 1684749b282..0c6045af8d1 100644 --- a/gcc/testsuite/g++.dg/cpp/pedantic-errors.C +++ b/gcc/testsuite/g++.dg/cpp/pedantic-errors.C @@ -2,4 +2,4 @@ /* { dg-options "-std=c++98 -pedantic-errors" } */ #if 1 -#endif 1 /* { dg-error "error: extra tokens at end of #endif directive" } */ +#endif 1 /* { dg-error "extra tokens at end of #endif directive" } */ diff --git a/gcc/testsuite/g++.dg/cpp/string-2.C b/gcc/testsuite/g++.dg/cpp/string-2.C index 137c3de1931..f7148623152 100644 --- a/gcc/testsuite/g++.dg/cpp/string-2.C +++ b/gcc/testsuite/g++.dg/cpp/string-2.C @@ -3,4 +3,4 @@ // { dg-do compile } // { dg-options "" } -const char *s = "\q"; // { dg-warning "warning: unknown escape sequence" } +const char *s = "\q"; // { dg-warning "unknown escape sequence" } diff --git a/gcc/testsuite/g++.dg/cpp0x/rv2n.C b/gcc/testsuite/g++.dg/cpp0x/rv2n.C index df35358a6c1..a4c11c60e2d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/rv2n.C +++ b/gcc/testsuite/g++.dg/cpp0x/rv2n.C @@ -30,8 +30,8 @@ const volatile A cv_source(); // 2 at a time -one sink_2_12( A&); // { dg-error "" } -two sink_2_12(const A&); // { dg-error "" } +one sink_2_12( A&); // { dg-message "candidates" } +two sink_2_12(const A&); // { dg-message "note" } int test2_12() { @@ -46,8 +46,8 @@ int test2_12() return 0; } -one sink_2_13( A&); // { dg-error "" } -three sink_2_13(volatile A&); // { dg-error "" } +one sink_2_13( A&); // { dg-message "candidates" } +three sink_2_13(volatile A&); // { dg-message "note" } int test2_13() { @@ -64,8 +64,8 @@ int test2_13() return 0; } -one sink_2_14( A&); // { dg-error "" } -four sink_2_14(const volatile A&); // { dg-error "" } +one sink_2_14( A&); // { dg-message "candidates" } +four sink_2_14(const volatile A&); // { dg-message "note" } int test2_14() { @@ -80,8 +80,8 @@ int test2_14() return 0; } -one sink_2_15( A&); // { dg-error "" } -five sink_2_15( A&&); // { dg-error "" } +one sink_2_15( A&); // { dg-message "candidates" } +five sink_2_15( A&&); // { dg-message "note" } int test2_15() { @@ -98,8 +98,8 @@ int test2_15() return 0; } -one sink_2_16( A&); // { dg-error "" } -six sink_2_16(const A&&); // { dg-error "" } +one sink_2_16( A&); // { dg-message "candidates" } +six sink_2_16(const A&&); // { dg-message "note" } int test2_16() { @@ -114,8 +114,8 @@ int test2_16() return 0; } -one sink_2_17( A&); // { dg-error "" } -seven sink_2_17(volatile A&&); // { dg-error "" } +one sink_2_17( A&); // { dg-message "candidates" } +seven sink_2_17(volatile A&&); // { dg-message "note" } int test2_17() { @@ -130,8 +130,8 @@ int test2_17() return 0; } -two sink_2_23(const A&); // { dg-error "" } -three sink_2_23(volatile A&); // { dg-error "" } +two sink_2_23(const A&); // { dg-message "candidates" } +three sink_2_23(volatile A&); // { dg-message "note" } int test2_23() { @@ -146,8 +146,8 @@ int test2_23() return 0; } -two sink_2_24(const A&); // { dg-error "" } -four sink_2_24(const volatile A&); // { dg-error "" } +two sink_2_24(const A&); // { dg-message "candidates" } +four sink_2_24(const volatile A&); // { dg-message "note" } int test2_24() { @@ -160,8 +160,8 @@ int test2_24() return 0; } -three sink_2_34(volatile A&); // { dg-error "" } -four sink_2_34(const volatile A&); // { dg-error "" } +three sink_2_34(volatile A&); // { dg-message "candidate" } +four sink_2_34(const volatile A&); // { dg-message "note" } int test2_34() { @@ -176,8 +176,8 @@ int test2_34() return 0; } -two sink_2_25(const A&); // { dg-error "" } -five sink_2_25( A&&); // { dg-error "" } +two sink_2_25(const A&); // { dg-message "candidate" } +five sink_2_25( A&&); // { dg-message "note" } int test2_25() { @@ -192,8 +192,8 @@ int test2_25() return 0; } -two sink_2_26(const A&); // { dg-error "" } -six sink_2_26(const A&&); // { dg-error "" } +two sink_2_26(const A&); // { dg-message "candidate" } +six sink_2_26(const A&&); // { dg-message "note" } int test2_26() { @@ -208,8 +208,8 @@ int test2_26() return 0; } -two sink_2_27(const A&); // { dg-error "" } -seven sink_2_27(volatile A&&); // { dg-error "" } +two sink_2_27(const A&); // { dg-message "candidate" } +seven sink_2_27(volatile A&&); // { dg-message "note" } int test2_27() { @@ -222,8 +222,8 @@ int test2_27() return 0; } -three sink_2_35(volatile A&); // { dg-error "" } -five sink_2_35( A&&); // { dg-error "" } +three sink_2_35(volatile A&); // { dg-message "candidate" } +five sink_2_35( A&&); // { dg-message "note" } int test2_35() { @@ -239,8 +239,8 @@ int test2_35() return 0; } -three sink_2_36(volatile A&); // { dg-error "" } -six sink_2_36(const A&&); // { dg-error "" } +three sink_2_36(volatile A&); // { dg-message "candidate" } +six sink_2_36(const A&&); // { dg-message "note" } int test2_36() { @@ -254,8 +254,8 @@ int test2_36() return 0; } -three sink_2_37(volatile A&); // { dg-error "" } -seven sink_2_37(volatile A&&); // { dg-error "" } +three sink_2_37(volatile A&); // { dg-message "candidate" } +seven sink_2_37(volatile A&&); // { dg-message "note" } int test2_37() { @@ -270,8 +270,8 @@ int test2_37() return 0; } -four sink_2_45(const volatile A&); // { dg-error "" } -five sink_2_45( A&&); // { dg-error "" } +four sink_2_45(const volatile A&); // { dg-message "candidate" } +five sink_2_45( A&&); // { dg-message "note" } int test2_45() { @@ -285,8 +285,8 @@ int test2_45() return 0; } -four sink_2_46(const volatile A&); // { dg-error "" } -six sink_2_46(const A&&); // { dg-error "" } +four sink_2_46(const volatile A&); // { dg-message "candidate" } +six sink_2_46(const A&&); // { dg-message "note" } int test2_46() { @@ -299,8 +299,8 @@ int test2_46() return 0; } -four sink_2_47(const volatile A&); // { dg-error "" } -seven sink_2_47(volatile A&&); // { dg-error "" } +four sink_2_47(const volatile A&); // { dg-message "candidate" } +seven sink_2_47(volatile A&&); // { dg-message "note" } int test2_47() { @@ -313,8 +313,8 @@ int test2_47() return 0; } -five sink_2_56( A&&); // { dg-error "" } -six sink_2_56(const A&&); // { dg-error "" } +five sink_2_56( A&&); // { dg-message "candidate" } +six sink_2_56(const A&&); // { dg-message "note" } int test2_56() { @@ -329,8 +329,8 @@ int test2_56() return 0; } -five sink_2_57( A&&); // { dg-error "" } -seven sink_2_57(volatile A&&); // { dg-error "" } +five sink_2_57( A&&); // { dg-message "candidate" } +seven sink_2_57(volatile A&&); // { dg-message "note" } int test2_57() { @@ -345,8 +345,8 @@ int test2_57() return 0; } -six sink_2_67(const A&&); // { dg-error "" } -seven sink_2_67(volatile A&&); // { dg-error "" } +six sink_2_67(const A&&); // { dg-message "candidate" } +seven sink_2_67(volatile A&&); // { dg-message "note" } int test2_67() { diff --git a/gcc/testsuite/g++.dg/cpp0x/rv3n.C b/gcc/testsuite/g++.dg/cpp0x/rv3n.C index e04ef4fee34..84675b37fee 100644 --- a/gcc/testsuite/g++.dg/cpp0x/rv3n.C +++ b/gcc/testsuite/g++.dg/cpp0x/rv3n.C @@ -30,9 +30,9 @@ const volatile A cv_source(); // 3 at a time -one sink_3_123( A&); // { dg-error "" } -two sink_3_123(const A&); // { dg-error "" } -three sink_3_123(volatile A&); // { dg-error "" } +one sink_3_123( A&); // { dg-message "candidates" } +two sink_3_123(const A&); // { dg-message "note" } +three sink_3_123(volatile A&); // { dg-message "note" } int test3_123() { @@ -46,13 +46,13 @@ int test3_123() return 0; } -one sink_3_125( A&); // { dg-error "" } -two sink_3_125(const A&); // { dg-error "" } -five sink_3_125( A&&); // { dg-error "" } +one sink_3_125( A&); // { dg-message "candidates" } +two sink_3_125(const A&); // { dg-message "note" } +five sink_3_125( A&&); // { dg-message "note" } -one sink_3_124( A&); // { dg-error "" } -two sink_3_124(const A&); // { dg-error "" } -four sink_3_124(const volatile A&); // { dg-error "" } +one sink_3_124( A&); // { dg-message "candidates" } +two sink_3_124(const A&); // { dg-message "note" } +four sink_3_124(const volatile A&); // { dg-message "note" } int test3_124() { @@ -78,9 +78,9 @@ int test3_125() return 0; } -one sink_3_126( A&); // { dg-error "" } -two sink_3_126(const A&); // { dg-error "" } -six sink_3_126(const A&&); // { dg-error "" } +one sink_3_126( A&); // { dg-message "candidates" } +two sink_3_126(const A&); // { dg-message "note" } +six sink_3_126(const A&&); // { dg-message "note" } int test3_126() { @@ -95,9 +95,9 @@ int test3_126() return 0; } -one sink_3_127( A&); // { dg-error "" } -two sink_3_127(const A&); // { dg-error "" } -seven sink_3_127(volatile A&&); // { dg-error "" } +one sink_3_127( A&); // { dg-message "candidates" } +two sink_3_127(const A&); // { dg-message "note" } +seven sink_3_127(volatile A&&); // { dg-message "note" } int test3_127() { @@ -110,9 +110,9 @@ int test3_127() return 0; } -one sink_3_134( A&); // { dg-error "" } -three sink_3_134(volatile A&); // { dg-error "" } -four sink_3_134(const volatile A&); // { dg-error "" } +one sink_3_134( A&); // { dg-message "candidates" } +three sink_3_134(volatile A&); // { dg-message "note" } +four sink_3_134(const volatile A&); // { dg-message "note" } int test3_134() { @@ -127,9 +127,9 @@ int test3_134() return 0; } -one sink_3_135( A&); // { dg-error "" } -three sink_3_135(volatile A&); // { dg-error "" } -five sink_3_135( A&&); // { dg-error "" } +one sink_3_135( A&); // { dg-message "candidates" } +three sink_3_135(volatile A&); // { dg-message "note" } +five sink_3_135( A&&); // { dg-message "note" } int test3_135() { @@ -145,9 +145,9 @@ int test3_135() return 0; } -one sink_3_136( A&); // { dg-error "" } -three sink_3_136(volatile A&); // { dg-error "" } -six sink_3_136(const A&&); // { dg-error "" } +one sink_3_136( A&); // { dg-message "candidates" } +three sink_3_136(volatile A&); // { dg-message "note" } +six sink_3_136(const A&&); // { dg-message "note" } int test3_136() { @@ -161,9 +161,9 @@ int test3_136() return 0; } -one sink_3_137( A&); // { dg-error "" } -three sink_3_137(volatile A&); // { dg-error "" } -seven sink_3_137(volatile A&&); // { dg-error "" } +one sink_3_137( A&); // { dg-message "candidates" } +three sink_3_137(volatile A&); // { dg-message "note" } +seven sink_3_137(volatile A&&); // { dg-message "note" } int test3_137() { @@ -178,9 +178,9 @@ int test3_137() return 0; } -one sink_3_145( A&); // { dg-error "" } -four sink_3_145(const volatile A&); // { dg-error "" } -five sink_3_145( A&&); // { dg-error "" } +one sink_3_145( A&); // { dg-message "candidates" } +four sink_3_145(const volatile A&); // { dg-message "note" } +five sink_3_145( A&&); // { dg-message "note" } int test3_145() { @@ -194,9 +194,9 @@ int test3_145() return 0; } -one sink_3_146( A&); // { dg-error "" } -four sink_3_146(const volatile A&); // { dg-error "" } -six sink_3_146(const A&&); // { dg-error "" } +one sink_3_146( A&); // { dg-message "candidates" } +four sink_3_146(const volatile A&); // { dg-message "note" } +six sink_3_146(const A&&); // { dg-message "note" } int test3_146() { @@ -209,9 +209,9 @@ int test3_146() return 0; } -one sink_3_147( A&); // { dg-error "" } -four sink_3_147(const volatile A&); // { dg-error "" } -seven sink_3_147(volatile A&&); // { dg-error "" } +one sink_3_147( A&); // { dg-message "candidates" } +four sink_3_147(const volatile A&); // { dg-message "note" } +seven sink_3_147(volatile A&&); // { dg-message "note" } int test3_147() { @@ -224,9 +224,9 @@ int test3_147() return 0; } -one sink_3_156( A&); // { dg-error "" } -five sink_3_156( A&&); // { dg-error "" } -six sink_3_156(const A&&); // { dg-error "" } +one sink_3_156( A&); // { dg-message "candidates" } +five sink_3_156( A&&); // { dg-message "note" } +six sink_3_156(const A&&); // { dg-message "note" } int test3_156() { @@ -241,9 +241,9 @@ int test3_156() return 0; } -one sink_3_157( A&); // { dg-error "" } -five sink_3_157( A&&); // { dg-error "" } -seven sink_3_157(volatile A&&); // { dg-error "" } +one sink_3_157( A&); // { dg-message "candidates" } +five sink_3_157( A&&); // { dg-message "note" } +seven sink_3_157(volatile A&&); // { dg-message "note" } int test3_157() { @@ -258,9 +258,9 @@ int test3_157() return 0; } -one sink_3_167( A&); // { dg-error "" } -six sink_3_167(const A&&); // { dg-error "" } -seven sink_3_167(volatile A&&); // { dg-error "" } +one sink_3_167( A&); // { dg-message "candidates" } +six sink_3_167(const A&&); // { dg-message "note" } +seven sink_3_167(volatile A&&); // { dg-message "note" } int test3_167() { @@ -274,9 +274,9 @@ int test3_167() return 0; } -two sink_3_234(const A&); // { dg-error "" } -three sink_3_234(volatile A&); // { dg-error "" } -four sink_3_234(const volatile A&); // { dg-error "" } +two sink_3_234(const A&); // { dg-message "candidates" } +three sink_3_234(volatile A&); // { dg-message "note" } +four sink_3_234(const volatile A&); // { dg-message "note" } int test3_234() { @@ -290,9 +290,9 @@ int test3_234() return 0; } -two sink_3_235(const A&); // { dg-error "" } -three sink_3_235(volatile A&); // { dg-error "" } -five sink_3_235( A&&); // { dg-error "" } +two sink_3_235(const A&); // { dg-message "candidates" } +three sink_3_235(volatile A&); // { dg-message "note" } +five sink_3_235( A&&); // { dg-message "note" } int test3_235() { @@ -307,9 +307,9 @@ int test3_235() return 0; } -two sink_3_236(const A&); // { dg-error "" } -three sink_3_236(volatile A&); // { dg-error "" } -six sink_3_236(const A&&); // { dg-error "" } +two sink_3_236(const A&); // { dg-message "candidates" } +three sink_3_236(volatile A&); // { dg-message "note" } +six sink_3_236(const A&&); // { dg-message "note" } int test3_236() { @@ -324,9 +324,9 @@ int test3_236() return 0; } -two sink_3_237(const A&); // { dg-error "" } -three sink_3_237(volatile A&); // { dg-error "" } -seven sink_3_237(volatile A&&); // { dg-error "" } +two sink_3_237(const A&); // { dg-message "candidates" } +three sink_3_237(volatile A&); // { dg-message "note" } +seven sink_3_237(volatile A&&); // { dg-message "note" } int test3_237() { @@ -340,9 +340,9 @@ int test3_237() return 0; } -two sink_3_238(const A&); // { dg-error "" } -three sink_3_238(volatile A&); // { dg-error "" } -eight sink_3_238(const volatile A&&); // { dg-error "" } +two sink_3_238(const A&); // { dg-message "candidates" } +three sink_3_238(volatile A&); // { dg-message "note" } +eight sink_3_238(const volatile A&&); // { dg-message "note" } int test3_238() { @@ -354,9 +354,9 @@ int test3_238() return 0; } -two sink_3_245(const A&); // { dg-error "" } -four sink_3_245(const volatile A&); // { dg-error "" } -five sink_3_245( A&&); // { dg-error "" } +two sink_3_245(const A&); // { dg-message "candidates" } +four sink_3_245(const volatile A&); // { dg-message "note" } +five sink_3_245( A&&); // { dg-message "note" } int test3_245() { @@ -369,9 +369,9 @@ int test3_245() return 0; } -two sink_3_246(const A&); // { dg-error "" } -four sink_3_246(const volatile A&); // { dg-error "" } -six sink_3_246(const A&&); // { dg-error "" } +two sink_3_246(const A&); // { dg-message "candidates" } +four sink_3_246(const volatile A&); // { dg-message "note" } +six sink_3_246(const A&&); // { dg-message "note" } int test3_246() { @@ -384,9 +384,9 @@ int test3_246() return 0; } -two sink_3_247(const A&); // { dg-error "" } -four sink_3_247(const volatile A&); // { dg-error "" } -seven sink_3_247(volatile A&&); // { dg-error "" } +two sink_3_247(const A&); // { dg-message "candidates" } +four sink_3_247(const volatile A&); // { dg-message "note" } +seven sink_3_247(volatile A&&); // { dg-message "note" } int test3_247() { @@ -398,9 +398,9 @@ int test3_247() return 0; } -two sink_3_256(const A&); // { dg-error "" } -five sink_3_256( A&&); // { dg-error "" } -six sink_3_256(const A&&); // { dg-error "" } +two sink_3_256(const A&); // { dg-message "candidates" } +five sink_3_256( A&&); // { dg-message "note" } +six sink_3_256(const A&&); // { dg-message "note" } int test3_256() { @@ -415,9 +415,9 @@ int test3_256() return 0; } -two sink_3_257(const A&); // { dg-error "" } -five sink_3_257( A&&); // { dg-error "" } -seven sink_3_257(volatile A&&); // { dg-error "" } +two sink_3_257(const A&); // { dg-message "candidates" } +five sink_3_257( A&&); // { dg-message "note" } +seven sink_3_257(volatile A&&); // { dg-message "note" } int test3_257() { @@ -430,9 +430,9 @@ int test3_257() return 0; } -two sink_3_267(const A&); // { dg-error "" } -six sink_3_267(const A&&); // { dg-error "" } -seven sink_3_267(volatile A&&); // { dg-error "" } +two sink_3_267(const A&); // { dg-message "candidates" } +six sink_3_267(const A&&); // { dg-message "note" } +seven sink_3_267(volatile A&&); // { dg-message "note" } int test3_267() { @@ -446,9 +446,9 @@ int test3_267() return 0; } -three sink_3_345(volatile A&); // { dg-error "" } -four sink_3_345(const volatile A&); // { dg-error "" } -five sink_3_345( A&&); // { dg-error "" } +three sink_3_345(volatile A&); // { dg-message "candidates" } +four sink_3_345(const volatile A&); // { dg-message "note" } +five sink_3_345( A&&); // { dg-message "note" } int test3_345() { @@ -462,9 +462,9 @@ int test3_345() return 0; } -three sink_3_346(volatile A&); // { dg-error "" } -four sink_3_346(const volatile A&); // { dg-error "" } -six sink_3_346(const A&&); // { dg-error "" } +three sink_3_346(volatile A&); // { dg-message "candidates" } +four sink_3_346(const volatile A&); // { dg-message "note" } +six sink_3_346(const A&&); // { dg-message "note" } int test3_346() { @@ -477,9 +477,9 @@ int test3_346() return 0; } -three sink_3_347(volatile A&); // { dg-error "" } -four sink_3_347(const volatile A&); // { dg-error "" } -seven sink_3_347(volatile A&&); // { dg-error "" } +three sink_3_347(volatile A&); // { dg-message "candidates" } +four sink_3_347(const volatile A&); // { dg-message "note" } +seven sink_3_347(volatile A&&); // { dg-message "note" } int test3_347() { @@ -492,9 +492,9 @@ int test3_347() return 0; } -three sink_3_356(volatile A&); // { dg-error "" } -five sink_3_356( A&&); // { dg-error "" } -six sink_3_356(const A&&); // { dg-error "" } +three sink_3_356(volatile A&); // { dg-message "candidates" } +five sink_3_356( A&&); // { dg-message "note" } +six sink_3_356(const A&&); // { dg-message "note" } int test3_356() { @@ -508,9 +508,9 @@ int test3_356() return 0; } -three sink_3_357(volatile A&); // { dg-error "" } -five sink_3_357( A&&); // { dg-error "" } -seven sink_3_357(volatile A&&); // { dg-error "" } +three sink_3_357(volatile A&); // { dg-message "candidates" } +five sink_3_357( A&&); // { dg-message "note" } +seven sink_3_357(volatile A&&); // { dg-message "note" } int test3_357() { @@ -525,9 +525,9 @@ int test3_357() return 0; } -three sink_3_367(volatile A&); // { dg-error "" } -six sink_3_367(const A&&); // { dg-error "" } -seven sink_3_367(volatile A&&); // { dg-error "" } +three sink_3_367(volatile A&); // { dg-message "candidates" } +six sink_3_367(const A&&); // { dg-message "note" } +seven sink_3_367(volatile A&&); // { dg-message "note" } int test3_367() { @@ -541,9 +541,9 @@ int test3_367() return 0; } -four sink_3_456(const volatile A&); // { dg-error "" } -five sink_3_456( A&&); // { dg-error "" } -six sink_3_456(const A&&); // { dg-error "" } +four sink_3_456(const volatile A&); // { dg-message "candidates" } +five sink_3_456( A&&); // { dg-message "note" } +six sink_3_456(const A&&); // { dg-message "note" } int test3_456() { @@ -556,9 +556,9 @@ int test3_456() return 0; } -four sink_3_457(const volatile A&); // { dg-error "" } -five sink_3_457( A&&); // { dg-error "" } -seven sink_3_457(volatile A&&); // { dg-error "" } +four sink_3_457(const volatile A&); // { dg-message "candidates" } +five sink_3_457( A&&); // { dg-message "note" } +seven sink_3_457(volatile A&&); // { dg-message "note" } int test3_457() { @@ -571,9 +571,9 @@ int test3_457() return 0; } -four sink_3_467(const volatile A&); // { dg-error "" } -six sink_3_467(const A&&); // { dg-error "" } -seven sink_3_467(volatile A&&); // { dg-error "" } +four sink_3_467(const volatile A&); // { dg-message "candidates" } +six sink_3_467(const A&&); // { dg-message "note" } +seven sink_3_467(volatile A&&); // { dg-message "note" } int test3_467() { @@ -586,9 +586,9 @@ int test3_467() return 0; } -five sink_3_567( A&&); // { dg-error "" } -six sink_3_567(const A&&); // { dg-error "" } -seven sink_3_567(volatile A&&); // { dg-error "" } +five sink_3_567( A&&); // { dg-message "candidates" } +six sink_3_567(const A&&); // { dg-message "note" } +seven sink_3_567(volatile A&&); // { dg-message "note" } int test3_567() { @@ -601,9 +601,9 @@ int test3_567() return 0; } -six sink_3_678(const A&&); // { dg-error "" } -seven sink_3_678(volatile A&&); // { dg-error "" } -eight sink_3_678(const volatile A&&); // { dg-error "" } +six sink_3_678(const A&&); // { dg-message "candidates" } +seven sink_3_678(volatile A&&); // { dg-message "note" } +eight sink_3_678(const volatile A&&); // { dg-message "note" } int test3_678() { diff --git a/gcc/testsuite/g++.dg/cpp0x/rv4n.C b/gcc/testsuite/g++.dg/cpp0x/rv4n.C index 302ab8eedcc..b88e3f77061 100644 --- a/gcc/testsuite/g++.dg/cpp0x/rv4n.C +++ b/gcc/testsuite/g++.dg/cpp0x/rv4n.C @@ -30,10 +30,10 @@ const volatile A cv_source(); // 4 at a time -one sink_4_1234( A&); // { dg-error "" } -two sink_4_1234(const A&); // { dg-error "" } -three sink_4_1234(volatile A&); // { dg-error "" } -four sink_4_1234(const volatile A&); // { dg-error "" } +one sink_4_1234( A&); // { dg-message "candidates" } +two sink_4_1234(const A&); // { dg-message "note" } +three sink_4_1234(volatile A&); // { dg-message "note" } +four sink_4_1234(const volatile A&); // { dg-message "note" } int test4_1234() { @@ -46,10 +46,10 @@ int test4_1234() return 0; } -one sink_4_1235( A&); // { dg-error "" } -two sink_4_1235(const A&); // { dg-error "" } -three sink_4_1235(volatile A&); // { dg-error "" } -five sink_4_1235( A&&); // { dg-error "" } +one sink_4_1235( A&); // { dg-message "candidates" } +two sink_4_1235(const A&); // { dg-message "note" } +three sink_4_1235(volatile A&); // { dg-message "note" } +five sink_4_1235( A&&); // { dg-message "note" } int test4_1235() { @@ -63,10 +63,10 @@ int test4_1235() return 0; } -one sink_4_1236( A&); // { dg-error "" } -two sink_4_1236(const A&); // { dg-error "" } -three sink_4_1236(volatile A&); // { dg-error "" } -six sink_4_1236(const A&&); // { dg-error "" } +one sink_4_1236( A&); // { dg-message "candidates" } +two sink_4_1236(const A&); // { dg-message "note" } +three sink_4_1236(volatile A&); // { dg-message "note" } +six sink_4_1236(const A&&); // { dg-message "note" } int test4_1236() { @@ -80,10 +80,10 @@ int test4_1236() return 0; } -one sink_4_1237( A&); // { dg-error "" } -two sink_4_1237(const A&); // { dg-error "" } -three sink_4_1237(volatile A&); // { dg-error "" } -seven sink_4_1237(volatile A&&); // { dg-error "" } +one sink_4_1237( A&); // { dg-message "candidates" } +two sink_4_1237(const A&); // { dg-message "note" } +three sink_4_1237(volatile A&); // { dg-message "note" } +seven sink_4_1237(volatile A&&); // { dg-message "note" } int test4_1237() { @@ -96,10 +96,10 @@ int test4_1237() return 0; } -one sink_4_1245( A&); // { dg-error "" } -two sink_4_1245(const A&); // { dg-error "" } -four sink_4_1245(const volatile A&); // { dg-error "" } -five sink_4_1245( A&&); // { dg-error "" } +one sink_4_1245( A&); // { dg-message "candidates" } +two sink_4_1245(const A&); // { dg-message "note" } +four sink_4_1245(const volatile A&); // { dg-message "note" } +five sink_4_1245( A&&); // { dg-message "note" } int test4_1245() { @@ -112,10 +112,10 @@ int test4_1245() return 0; } -one sink_4_1246( A&); // { dg-error "" } -two sink_4_1246(const A&); // { dg-error "" } -four sink_4_1246(const volatile A&); // { dg-error "" } -six sink_4_1246(const A&&); // { dg-error "" } +one sink_4_1246( A&); // { dg-message "candidates" } +two sink_4_1246(const A&); // { dg-message "note" } +four sink_4_1246(const volatile A&); // { dg-message "note" } +six sink_4_1246(const A&&); // { dg-message "note" } int test4_1246() { @@ -128,10 +128,10 @@ int test4_1246() return 0; } -one sink_4_1247( A&); // { dg-error "" } -two sink_4_1247(const A&); // { dg-error "" } -four sink_4_1247(const volatile A&); // { dg-error "" } -seven sink_4_1247(volatile A&&); // { dg-error "" } +one sink_4_1247( A&); // { dg-message "candidates" } +two sink_4_1247(const A&); // { dg-message "note" } +four sink_4_1247(const volatile A&); // { dg-message "note" } +seven sink_4_1247(volatile A&&); // { dg-message "note" } int test4_1247() { @@ -143,10 +143,10 @@ int test4_1247() return 0; } -one sink_4_1256( A&); // { dg-error "" } -two sink_4_1256(const A&); // { dg-error "" } -five sink_4_1256( A&&); // { dg-error "" } -six sink_4_1256(const A&&); // { dg-error "" } +one sink_4_1256( A&); // { dg-message "candidates" } +two sink_4_1256(const A&); // { dg-message "note" } +five sink_4_1256( A&&); // { dg-message "note" } +six sink_4_1256(const A&&); // { dg-message "note" } int test4_1256() { @@ -161,10 +161,10 @@ int test4_1256() return 0; } -one sink_4_1257( A&); // { dg-error "" } -two sink_4_1257(const A&); // { dg-error "" } -five sink_4_1257( A&&); // { dg-error "" } -seven sink_4_1257(volatile A&&); // { dg-error "" } +one sink_4_1257( A&); // { dg-message "candidates" } +two sink_4_1257(const A&); // { dg-message "note" } +five sink_4_1257( A&&); // { dg-message "note" } +seven sink_4_1257(volatile A&&); // { dg-message "note" } int test4_1257() { @@ -177,10 +177,10 @@ int test4_1257() return 0; } -one sink_4_1267( A&); // { dg-error "" } -two sink_4_1267(const A&); // { dg-error "" } -six sink_4_1267(const A&&); // { dg-error "" } -seven sink_4_1267(volatile A&&); // { dg-error "" } +one sink_4_1267( A&); // { dg-message "candidates" } +two sink_4_1267(const A&); // { dg-message "note" } +six sink_4_1267(const A&&); // { dg-message "note" } +seven sink_4_1267(volatile A&&); // { dg-message "note" } int test4_1267() { @@ -194,10 +194,10 @@ int test4_1267() return 0; } -one sink_4_1345( A&); // { dg-error "" } -three sink_4_1345(volatile A&); // { dg-error "" } -four sink_4_1345(const volatile A&); // { dg-error "" } -five sink_4_1345( A&&); // { dg-error "" } +one sink_4_1345( A&); // { dg-message "candidates" } +three sink_4_1345(volatile A&); // { dg-message "note" } +four sink_4_1345(const volatile A&); // { dg-message "note" } +five sink_4_1345( A&&); // { dg-message "note" } int test4_1345() { @@ -211,10 +211,10 @@ int test4_1345() return 0; } -one sink_4_1346( A&); // { dg-error "" } -three sink_4_1346(volatile A&); // { dg-error "" } -four sink_4_1346(const volatile A&); // { dg-error "" } -six sink_4_1346(const A&&); // { dg-error "" } +one sink_4_1346( A&); // { dg-message "candidates" } +three sink_4_1346(volatile A&); // { dg-message "note" } +four sink_4_1346(const volatile A&); // { dg-message "note" } +six sink_4_1346(const A&&); // { dg-message "note" } int test4_1346() { @@ -227,10 +227,10 @@ int test4_1346() return 0; } -one sink_4_1347( A&); // { dg-error "" } -three sink_4_1347(volatile A&); // { dg-error "" } -four sink_4_1347(const volatile A&); // { dg-error "" } -seven sink_4_1347(volatile A&&); // { dg-error "" } +one sink_4_1347( A&); // { dg-message "candidates" } +three sink_4_1347(volatile A&); // { dg-message "note" } +four sink_4_1347(const volatile A&); // { dg-message "note" } +seven sink_4_1347(volatile A&&); // { dg-message "note" } int test4_1347() { @@ -243,10 +243,10 @@ int test4_1347() return 0; } -one sink_4_1356( A&); // { dg-error "" } -three sink_4_1356(volatile A&); // { dg-error "" } -five sink_4_1356( A&&); // { dg-error "" } -six sink_4_1356(const A&&); // { dg-error "" } +one sink_4_1356( A&); // { dg-message "candidates" } +three sink_4_1356(volatile A&); // { dg-message "note" } +five sink_4_1356( A&&); // { dg-message "note" } +six sink_4_1356(const A&&); // { dg-message "note" } int test4_1356() { @@ -260,10 +260,10 @@ int test4_1356() return 0; } -one sink_4_1357( A&); // { dg-error "" } -three sink_4_1357(volatile A&); // { dg-error "" } -five sink_4_1357( A&&); // { dg-error "" } -seven sink_4_1357(volatile A&&); // { dg-error "" } +one sink_4_1357( A&); // { dg-message "candidates" } +three sink_4_1357(volatile A&); // { dg-message "note" } +five sink_4_1357( A&&); // { dg-message "note" } +seven sink_4_1357(volatile A&&); // { dg-message "note" } int test4_1357() { @@ -278,10 +278,10 @@ int test4_1357() return 0; } -one sink_4_1367( A&); // { dg-error "" } -three sink_4_1367(volatile A&); // { dg-error "" } -six sink_4_1367(const A&&); // { dg-error "" } -seven sink_4_1367(volatile A&&); // { dg-error "" } +one sink_4_1367( A&); // { dg-message "candidates" } +three sink_4_1367(volatile A&); // { dg-message "note" } +six sink_4_1367(const A&&); // { dg-message "note" } +seven sink_4_1367(volatile A&&); // { dg-message "note" } int test4_1367() { @@ -295,10 +295,10 @@ int test4_1367() return 0; } -one sink_4_1456( A&); // { dg-error "" } -four sink_4_1456(const volatile A&); // { dg-error "" } -five sink_4_1456( A&&); // { dg-error "" } -six sink_4_1456(const A&&); // { dg-error "" } +one sink_4_1456( A&); // { dg-message "candidates" } +four sink_4_1456(const volatile A&); // { dg-message "note" } +five sink_4_1456( A&&); // { dg-message "note" } +six sink_4_1456(const A&&); // { dg-message "note" } int test4_1456() { @@ -311,10 +311,10 @@ int test4_1456() return 0; } -one sink_4_1457( A&); // { dg-error "" } -four sink_4_1457(const volatile A&); // { dg-error "" } -five sink_4_1457( A&&); // { dg-error "" } -seven sink_4_1457(volatile A&&); // { dg-error "" } +one sink_4_1457( A&); // { dg-message "candidates" } +four sink_4_1457(const volatile A&); // { dg-message "note" } +five sink_4_1457( A&&); // { dg-message "note" } +seven sink_4_1457(volatile A&&); // { dg-message "note" } int test4_1457() { @@ -327,10 +327,10 @@ int test4_1457() return 0; } -one sink_4_1467( A&); // { dg-error "" } -four sink_4_1467(const volatile A&); // { dg-error "" } -six sink_4_1467(const A&&); // { dg-error "" } -seven sink_4_1467(volatile A&&); // { dg-error "" } +one sink_4_1467( A&); // { dg-message "candidates" } +four sink_4_1467(const volatile A&); // { dg-message "note" } +six sink_4_1467(const A&&); // { dg-message "note" } +seven sink_4_1467(volatile A&&); // { dg-message "note" } int test4_1467() { @@ -343,10 +343,10 @@ int test4_1467() return 0; } -one sink_4_1567( A&); // { dg-error "" } -five sink_4_1567( A&&); // { dg-error "" } -six sink_4_1567(const A&&); // { dg-error "" } -seven sink_4_1567(volatile A&&); // { dg-error "" } +one sink_4_1567( A&); // { dg-message "candidates" } +five sink_4_1567( A&&); // { dg-message "note" } +six sink_4_1567(const A&&); // { dg-message "note" } +seven sink_4_1567(volatile A&&); // { dg-message "note" } int test4_1567() { @@ -360,9 +360,9 @@ int test4_1567() } one sink_4_1678( A&); -six sink_4_1678(const A&&); // { dg-error "" } -seven sink_4_1678(volatile A&&); // { dg-error "" } -eight sink_4_1678(const volatile A&&); // { dg-error "" } +six sink_4_1678(const A&&); // { dg-message "candidates" } +seven sink_4_1678(volatile A&&); // { dg-message "note" } +eight sink_4_1678(const volatile A&&); // { dg-message "note" } int test4_1678() { @@ -374,10 +374,10 @@ int test4_1678() return 0; } -two sink_4_2345(const A&); // { dg-error "" } -three sink_4_2345(volatile A&); // { dg-error "" } -four sink_4_2345(const volatile A&); // { dg-error "" } -five sink_4_2345( A&&); // { dg-error "" } +two sink_4_2345(const A&); // { dg-message "candidates" } +three sink_4_2345(volatile A&); // { dg-message "note" } +four sink_4_2345(const volatile A&); // { dg-message "note" } +five sink_4_2345( A&&); // { dg-message "note" } int test4_2345() { @@ -391,10 +391,10 @@ int test4_2345() return 0; } -two sink_4_2346(const A&); // { dg-error "" } -three sink_4_2346(volatile A&); // { dg-error "" } -four sink_4_2346(const volatile A&); // { dg-error "" } -six sink_4_2346(const A&&); // { dg-error "" } +two sink_4_2346(const A&); // { dg-message "candidates" } +three sink_4_2346(volatile A&); // { dg-message "note" } +four sink_4_2346(const volatile A&); // { dg-message "note" } +six sink_4_2346(const A&&); // { dg-message "note" } int test4_2346() { @@ -408,10 +408,10 @@ int test4_2346() return 0; } -two sink_4_2347(const A&); // { dg-error "" } -three sink_4_2347(volatile A&); // { dg-error "" } -four sink_4_2347(const volatile A&); // { dg-error "" } -seven sink_4_2347(volatile A&&); // { dg-error "" } +two sink_4_2347(const A&); // { dg-message "candidates" } +three sink_4_2347(volatile A&); // { dg-message "note" } +four sink_4_2347(const volatile A&); // { dg-message "note" } +seven sink_4_2347(volatile A&&); // { dg-message "note" } int test4_2347() { @@ -424,10 +424,10 @@ int test4_2347() return 0; } -two sink_4_2348(const A&); // { dg-error "" } -three sink_4_2348(volatile A&); // { dg-error "" } -four sink_4_2348(const volatile A&); // { dg-error "" } -eight sink_4_2348(const volatile A&&); // { dg-error "" } +two sink_4_2348(const A&); // { dg-message "candidates" } +three sink_4_2348(volatile A&); // { dg-message "note" } +four sink_4_2348(const volatile A&); // { dg-message "note" } +eight sink_4_2348(const volatile A&&); // { dg-message "note" } int test4_2348() { @@ -439,10 +439,10 @@ int test4_2348() return 0; } -two sink_4_2356(const A&); // { dg-error "" } -three sink_4_2356(volatile A&); // { dg-error "" } -five sink_4_2356( A&&); // { dg-error "" } -six sink_4_2356(const A&&); // { dg-error "" } +two sink_4_2356(const A&); // { dg-message "candidates" } +three sink_4_2356(volatile A&); // { dg-message "note" } +five sink_4_2356( A&&); // { dg-message "note" } +six sink_4_2356(const A&&); // { dg-message "note" } int test4_2356() { @@ -457,10 +457,10 @@ int test4_2356() return 0; } -two sink_4_2357(const A&); // { dg-error "" } -three sink_4_2357(volatile A&); // { dg-error "" } -five sink_4_2357( A&&); // { dg-error "" } -seven sink_4_2357(volatile A&&); // { dg-error "" } +two sink_4_2357(const A&); // { dg-message "candidates" } +three sink_4_2357(volatile A&); // { dg-message "note" } +five sink_4_2357( A&&); // { dg-message "note" } +seven sink_4_2357(volatile A&&); // { dg-message "note" } int test4_2357() { @@ -474,10 +474,10 @@ int test4_2357() return 0; } -two sink_4_2358(const A&); // { dg-error "" } -three sink_4_2358(volatile A&); // { dg-error "" } -five sink_4_2358( A&&); // { dg-error "" } -eight sink_4_2358(const volatile A&&); // { dg-error "" } +two sink_4_2358(const A&); // { dg-message "candidates" } +three sink_4_2358(volatile A&); // { dg-message "note" } +five sink_4_2358( A&&); // { dg-message "note" } +eight sink_4_2358(const volatile A&&); // { dg-message "note" } int test4_2358() { @@ -489,10 +489,10 @@ int test4_2358() return 0; } -two sink_4_2367(const A&); // { dg-error "" } -three sink_4_2367(volatile A&); // { dg-error "" } -six sink_4_2367(const A&&); // { dg-error "" } -seven sink_4_2367(volatile A&&); // { dg-error "" } +two sink_4_2367(const A&); // { dg-message "candidates" } +three sink_4_2367(volatile A&); // { dg-message "note" } +six sink_4_2367(const A&&); // { dg-message "note" } +seven sink_4_2367(volatile A&&); // { dg-message "note" } int test4_2367() { @@ -507,10 +507,10 @@ int test4_2367() return 0; } -two sink_4_2368(const A&); // { dg-error "" } -three sink_4_2368(volatile A&); // { dg-error "" } -six sink_4_2368(const A&&); // { dg-error "" } -eight sink_4_2368(const volatile A&&); // { dg-error "" } +two sink_4_2368(const A&); // { dg-message "candidates" } +three sink_4_2368(volatile A&); // { dg-message "note" } +six sink_4_2368(const A&&); // { dg-message "note" } +eight sink_4_2368(const volatile A&&); // { dg-message "note" } int test4_2368() { @@ -522,10 +522,10 @@ int test4_2368() return 0; } -two sink_4_2378(const A&); // { dg-error "" } -three sink_4_2378(volatile A&); // { dg-error "" } -seven sink_4_2378(volatile A&&); // { dg-error "" } -eight sink_4_2378(const volatile A&&); // { dg-error "" } +two sink_4_2378(const A&); // { dg-message "candidates" } +three sink_4_2378(volatile A&); // { dg-message "note" } +seven sink_4_2378(volatile A&&); // { dg-message "note" } +eight sink_4_2378(const volatile A&&); // { dg-message "note" } int test4_2378() { @@ -537,10 +537,10 @@ int test4_2378() return 0; } -two sink_4_2456(const A&); // { dg-error "" } -four sink_4_2456(const volatile A&); // { dg-error "" } -five sink_4_2456( A&&); // { dg-error "" } -six sink_4_2456(const A&&); // { dg-error "" } +two sink_4_2456(const A&); // { dg-message "candidates" } +four sink_4_2456(const volatile A&); // { dg-message "note" } +five sink_4_2456( A&&); // { dg-message "note" } +six sink_4_2456(const A&&); // { dg-message "note" } int test4_2456() { @@ -553,10 +553,10 @@ int test4_2456() return 0; } -two sink_4_2457(const A&); // { dg-error "" } -four sink_4_2457(const volatile A&); // { dg-error "" } -five sink_4_2457( A&&); // { dg-error "" } -seven sink_4_2457(volatile A&&); // { dg-error "" } +two sink_4_2457(const A&); // { dg-message "candidates" } +four sink_4_2457(const volatile A&); // { dg-message "note" } +five sink_4_2457( A&&); // { dg-message "note" } +seven sink_4_2457(volatile A&&); // { dg-message "note" } int test4_2457() { @@ -568,10 +568,10 @@ int test4_2457() return 0; } -two sink_4_2467(const A&); // { dg-error "" } -four sink_4_2467(const volatile A&); // { dg-error "" } -six sink_4_2467(const A&&); // { dg-error "" } -seven sink_4_2467(volatile A&&); // { dg-error "" } +two sink_4_2467(const A&); // { dg-message "candidates" } +four sink_4_2467(const volatile A&); // { dg-message "note" } +six sink_4_2467(const A&&); // { dg-message "note" } +seven sink_4_2467(volatile A&&); // { dg-message "note" } int test4_2467() { @@ -584,10 +584,10 @@ int test4_2467() return 0; } -two sink_4_2567(const A&); // { dg-error "" } -five sink_4_2567( A&&); // { dg-error "" } -six sink_4_2567(const A&&); // { dg-error "" } -seven sink_4_2567(volatile A&&); // { dg-error "" } +two sink_4_2567(const A&); // { dg-message "candidates" } +five sink_4_2567( A&&); // { dg-message "note" } +six sink_4_2567(const A&&); // { dg-message "note" } +seven sink_4_2567(volatile A&&); // { dg-message "note" } int test4_2567() { @@ -600,10 +600,10 @@ int test4_2567() return 0; } -two sink_4_2678(const A&); // { dg-error "" } -six sink_4_2678(const A&&); // { dg-error "" } -seven sink_4_2678(volatile A&&); // { dg-error "" } -eight sink_4_2678(const volatile A&&); // { dg-error "" } +two sink_4_2678(const A&); // { dg-message "candidates" } +six sink_4_2678(const A&&); // { dg-message "note" } +seven sink_4_2678(volatile A&&); // { dg-message "note" } +eight sink_4_2678(const volatile A&&); // { dg-message "note" } int test4_2678() { @@ -615,10 +615,10 @@ int test4_2678() return 0; } -three sink_4_3456(volatile A&); // { dg-error "" } -four sink_4_3456(const volatile A&); // { dg-error "" } -five sink_4_3456( A&&); // { dg-error "" } -six sink_4_3456(const A&&); // { dg-error "" } +three sink_4_3456(volatile A&); // { dg-message "candidates" } +four sink_4_3456(const volatile A&); // { dg-message "note" } +five sink_4_3456( A&&); // { dg-message "note" } +six sink_4_3456(const A&&); // { dg-message "note" } int test4_3456() { @@ -631,10 +631,10 @@ int test4_3456() return 0; } -three sink_4_3457(volatile A&); // { dg-error "" } -four sink_4_3457(const volatile A&); // { dg-error "" } -five sink_4_3457( A&&); // { dg-error "" } -seven sink_4_3457(volatile A&&); // { dg-error "" } +three sink_4_3457(volatile A&); // { dg-message "candidates" } +four sink_4_3457(const volatile A&); // { dg-message "note" } +five sink_4_3457( A&&); // { dg-message "note" } +seven sink_4_3457(volatile A&&); // { dg-message "note" } int test4_3457() { @@ -647,10 +647,10 @@ int test4_3457() return 0; } -three sink_4_3467(volatile A&); // { dg-error "" } -four sink_4_3467(const volatile A&); // { dg-error "" } -six sink_4_3467(const A&&); // { dg-error "" } -seven sink_4_3467(volatile A&&); // { dg-error "" } +three sink_4_3467(volatile A&); // { dg-message "candidates" } +four sink_4_3467(const volatile A&); // { dg-message "note" } +six sink_4_3467(const A&&); // { dg-message "note" } +seven sink_4_3467(volatile A&&); // { dg-message "note" } int test4_3467() { @@ -663,10 +663,10 @@ int test4_3467() return 0; } -three sink_4_3567(volatile A&); // { dg-error "" } -five sink_4_3567( A&&); // { dg-error "" } -six sink_4_3567(const A&&); // { dg-error "" } -seven sink_4_3567(volatile A&&); // { dg-error "" } +three sink_4_3567(volatile A&); // { dg-message "candidates" } +five sink_4_3567( A&&); // { dg-message "note" } +six sink_4_3567(const A&&); // { dg-message "note" } +seven sink_4_3567(volatile A&&); // { dg-message "note" } int test4_3567() { @@ -680,9 +680,9 @@ int test4_3567() } three sink_4_3678(volatile A&); -six sink_4_3678(const A&&); // { dg-error "" } -seven sink_4_3678(volatile A&&); // { dg-error "" } -eight sink_4_3678(const volatile A&&); // { dg-error "" } +six sink_4_3678(const A&&); // { dg-message "candidates" } +seven sink_4_3678(volatile A&&); // { dg-message "note" } +eight sink_4_3678(const volatile A&&); // { dg-message "note" } int test4_3678() { @@ -694,10 +694,10 @@ int test4_3678() return 0; } -four sink_4_4567(const volatile A&); // { dg-error "" } -five sink_4_4567( A&&); // { dg-error "" } -six sink_4_4567(const A&&); // { dg-error "" } -seven sink_4_4567(volatile A&&); // { dg-error "" } +four sink_4_4567(const volatile A&); // { dg-message "candidates" } +five sink_4_4567( A&&); // { dg-message "note" } +six sink_4_4567(const A&&); // { dg-message "note" } +seven sink_4_4567(volatile A&&); // { dg-message "note" } int test4_4567() { @@ -710,9 +710,9 @@ int test4_4567() } four sink_4_4678(const volatile A&); -six sink_4_4678(const A&&); // { dg-error "" } -seven sink_4_4678(volatile A&&); // { dg-error "" } -eight sink_4_4678(const volatile A&&); // { dg-error "" } +six sink_4_4678(const A&&); // { dg-message "candidates" } +seven sink_4_4678(volatile A&&); // { dg-message "note" } +eight sink_4_4678(const volatile A&&); // { dg-message "note" } int test4_4678() { diff --git a/gcc/testsuite/g++.dg/cpp0x/rv5n.C b/gcc/testsuite/g++.dg/cpp0x/rv5n.C index 715716e45ee..14128b2aa36 100644 --- a/gcc/testsuite/g++.dg/cpp0x/rv5n.C +++ b/gcc/testsuite/g++.dg/cpp0x/rv5n.C @@ -30,11 +30,11 @@ const volatile A cv_source(); // 5 at a time -one sink_5_12345( A&); // { dg-error "" } -two sink_5_12345(const A&); // { dg-error "" } -three sink_5_12345(volatile A&); // { dg-error "" } -four sink_5_12345(const volatile A&); // { dg-error "" } -five sink_5_12345( A&&); // { dg-error "" } +one sink_5_12345( A&); // { dg-message "candidates" } +two sink_5_12345(const A&); // { dg-message "note" } +three sink_5_12345(volatile A&); // { dg-message "note" } +four sink_5_12345(const volatile A&); // { dg-message "note" } +five sink_5_12345( A&&); // { dg-message "note" } int test5_12345() { @@ -47,11 +47,11 @@ int test5_12345() return 0; } -one sink_5_12346( A&); // { dg-error "" } -two sink_5_12346(const A&); // { dg-error "" } -three sink_5_12346(volatile A&); // { dg-error "" } -four sink_5_12346(const volatile A&); // { dg-error "" } -six sink_5_12346(const A&&); // { dg-error "" } +one sink_5_12346( A&); // { dg-message "candidates" } +two sink_5_12346(const A&); // { dg-message "note" } +three sink_5_12346(volatile A&); // { dg-message "note" } +four sink_5_12346(const volatile A&); // { dg-message "note" } +six sink_5_12346(const A&&); // { dg-message "note" } int test5_12346() { @@ -64,11 +64,11 @@ int test5_12346() return 0; } -one sink_5_12347( A&); // { dg-error "" } -two sink_5_12347(const A&); // { dg-error "" } -three sink_5_12347(volatile A&); // { dg-error "" } -four sink_5_12347(const volatile A&); // { dg-error "" } -seven sink_5_12347(volatile A&&); // { dg-error "" } +one sink_5_12347( A&); // { dg-message "candidates" } +two sink_5_12347(const A&); // { dg-message "note" } +three sink_5_12347(volatile A&); // { dg-message "note" } +four sink_5_12347(const volatile A&); // { dg-message "note" } +seven sink_5_12347(volatile A&&); // { dg-message "note" } int test5_12347() { @@ -80,11 +80,11 @@ int test5_12347() return 0; } -one sink_5_12356( A&); // { dg-error "" } -two sink_5_12356(const A&); // { dg-error "" } -three sink_5_12356(volatile A&); // { dg-error "" } -five sink_5_12356( A&&); // { dg-error "" } -six sink_5_12356(const A&&); // { dg-error "" } +one sink_5_12356( A&); // { dg-message "candidates" } +two sink_5_12356(const A&); // { dg-message "note" } +three sink_5_12356(volatile A&); // { dg-message "note" } +five sink_5_12356( A&&); // { dg-message "note" } +six sink_5_12356(const A&&); // { dg-message "note" } int test5_12356() { @@ -98,11 +98,11 @@ int test5_12356() return 0; } -one sink_5_12357( A&); // { dg-error "" } -two sink_5_12357(const A&); // { dg-error "" } -three sink_5_12357(volatile A&); // { dg-error "" } -five sink_5_12357( A&&); // { dg-error "" } -seven sink_5_12357(volatile A&&); // { dg-error "" } +one sink_5_12357( A&); // { dg-message "candidates" } +two sink_5_12357(const A&); // { dg-message "note" } +three sink_5_12357(volatile A&); // { dg-message "note" } +five sink_5_12357( A&&); // { dg-message "note" } +seven sink_5_12357(volatile A&&); // { dg-message "note" } int test5_12357() { @@ -115,11 +115,11 @@ int test5_12357() return 0; } -one sink_5_12367( A&); // { dg-error "" } -two sink_5_12367(const A&); // { dg-error "" } -three sink_5_12367(volatile A&); // { dg-error "" } -six sink_5_12367(const A&&); // { dg-error "" } -seven sink_5_12367(volatile A&&); // { dg-error "" } +one sink_5_12367( A&); // { dg-message "candidates" } +two sink_5_12367(const A&); // { dg-message "note" } +three sink_5_12367(volatile A&); // { dg-message "note" } +six sink_5_12367(const A&&); // { dg-message "note" } +seven sink_5_12367(volatile A&&); // { dg-message "note" } int test5_12367() { @@ -133,11 +133,11 @@ int test5_12367() return 0; } -one sink_5_12456( A&); // { dg-error "" } -two sink_5_12456(const A&); // { dg-error "" } -four sink_5_12456(const volatile A&); // { dg-error "" } -five sink_5_12456( A&&); // { dg-error "" } -six sink_5_12456(const A&&); // { dg-error "" } +one sink_5_12456( A&); // { dg-message "candidates" } +two sink_5_12456(const A&); // { dg-message "note" } +four sink_5_12456(const volatile A&); // { dg-message "note" } +five sink_5_12456( A&&); // { dg-message "note" } +six sink_5_12456(const A&&); // { dg-message "note" } int test5_12456() { @@ -150,11 +150,11 @@ int test5_12456() return 0; } -one sink_5_12457( A&); // { dg-error "" } -two sink_5_12457(const A&); // { dg-error "" } -four sink_5_12457(const volatile A&); // { dg-error "" } -five sink_5_12457( A&&); // { dg-error "" } -seven sink_5_12457(volatile A&&); // { dg-error "" } +one sink_5_12457( A&); // { dg-message "candidates" } +two sink_5_12457(const A&); // { dg-message "note" } +four sink_5_12457(const volatile A&); // { dg-message "note" } +five sink_5_12457( A&&); // { dg-message "note" } +seven sink_5_12457(volatile A&&); // { dg-message "note" } int test5_12457() { @@ -166,11 +166,11 @@ int test5_12457() return 0; } -one sink_5_12467( A&); // { dg-error "" } -two sink_5_12467(const A&); // { dg-error "" } -four sink_5_12467(const volatile A&); // { dg-error "" } -six sink_5_12467(const A&&); // { dg-error "" } -seven sink_5_12467(volatile A&&); // { dg-error "" } +one sink_5_12467( A&); // { dg-message "candidates" } +two sink_5_12467(const A&); // { dg-message "note" } +four sink_5_12467(const volatile A&); // { dg-message "note" } +six sink_5_12467(const A&&); // { dg-message "note" } +seven sink_5_12467(volatile A&&); // { dg-message "note" } int test5_12467() { @@ -183,11 +183,11 @@ int test5_12467() return 0; } -one sink_5_12567( A&); // { dg-error "" } -two sink_5_12567(const A&); // { dg-error "" } -five sink_5_12567( A&&); // { dg-error "" } -six sink_5_12567(const A&&); // { dg-error "" } -seven sink_5_12567(volatile A&&); // { dg-error "" } +one sink_5_12567( A&); // { dg-message "candidates" } +two sink_5_12567(const A&); // { dg-message "note" } +five sink_5_12567( A&&); // { dg-message "note" } +six sink_5_12567(const A&&); // { dg-message "note" } +seven sink_5_12567(volatile A&&); // { dg-message "note" } int test5_12567() { @@ -201,10 +201,10 @@ int test5_12567() } one sink_5_12678( A&); -two sink_5_12678(const A&); // { dg-error "" } -six sink_5_12678(const A&&); // { dg-error "" } -seven sink_5_12678(volatile A&&); // { dg-error "" } -eight sink_5_12678(const volatile A&&); // { dg-error "" } +two sink_5_12678(const A&); // { dg-message "candidates" } +six sink_5_12678(const A&&); // { dg-message "note" } +seven sink_5_12678(volatile A&&); // { dg-message "note" } +eight sink_5_12678(const volatile A&&); // { dg-message "note" } int test5_12678() { @@ -216,11 +216,11 @@ int test5_12678() return 0; } -one sink_5_13456( A&); // { dg-error "" } -three sink_5_13456(volatile A&); // { dg-error "" } -four sink_5_13456(const volatile A&); // { dg-error "" } -five sink_5_13456( A&&); // { dg-error "" } -six sink_5_13456(const A&&); // { dg-error "" } +one sink_5_13456( A&); // { dg-message "candidates" } +three sink_5_13456(volatile A&); // { dg-message "note" } +four sink_5_13456(const volatile A&); // { dg-message "note" } +five sink_5_13456( A&&); // { dg-message "note" } +six sink_5_13456(const A&&); // { dg-message "note" } int test5_13456() { @@ -233,11 +233,11 @@ int test5_13456() return 0; } -one sink_5_13457( A&); // { dg-error "" } -three sink_5_13457(volatile A&); // { dg-error "" } -four sink_5_13457(const volatile A&); // { dg-error "" } -five sink_5_13457( A&&); // { dg-error "" } -seven sink_5_13457(volatile A&&); // { dg-error "" } +one sink_5_13457( A&); // { dg-message "candidates" } +three sink_5_13457(volatile A&); // { dg-message "note" } +four sink_5_13457(const volatile A&); // { dg-message "note" } +five sink_5_13457( A&&); // { dg-message "note" } +seven sink_5_13457(volatile A&&); // { dg-message "note" } int test5_13457() { @@ -250,11 +250,11 @@ int test5_13457() return 0; } -one sink_5_13467( A&); // { dg-error "" } -three sink_5_13467(volatile A&); // { dg-error "" } -four sink_5_13467(const volatile A&); // { dg-error "" } -six sink_5_13467(const A&&); // { dg-error "" } -seven sink_5_13467(volatile A&&); // { dg-error "" } +one sink_5_13467( A&); // { dg-message "candidates" } +three sink_5_13467(volatile A&); // { dg-message "note" } +four sink_5_13467(const volatile A&); // { dg-message "note" } +six sink_5_13467(const A&&); // { dg-message "note" } +seven sink_5_13467(volatile A&&); // { dg-message "note" } int test5_13467() { @@ -267,11 +267,11 @@ int test5_13467() return 0; } -one sink_5_13567( A&); // { dg-error "" } -three sink_5_13567(volatile A&); // { dg-error "" } -five sink_5_13567( A&&); // { dg-error "" } -six sink_5_13567(const A&&); // { dg-error "" } -seven sink_5_13567(volatile A&&); // { dg-error "" } +one sink_5_13567( A&); // { dg-message "candidates" } +three sink_5_13567(volatile A&); // { dg-message "note" } +five sink_5_13567( A&&); // { dg-message "note" } +six sink_5_13567(const A&&); // { dg-message "note" } +seven sink_5_13567(volatile A&&); // { dg-message "note" } int test5_13567() { @@ -286,9 +286,9 @@ int test5_13567() one sink_5_13678( A&); three sink_5_13678(volatile A&); -six sink_5_13678(const A&&); // { dg-error "" } -seven sink_5_13678(volatile A&&); // { dg-error "" } -eight sink_5_13678(const volatile A&&); // { dg-error "" } +six sink_5_13678(const A&&); // { dg-message "candidates" } +seven sink_5_13678(volatile A&&); // { dg-message "note" } +eight sink_5_13678(const volatile A&&); // { dg-message "note" } int test5_13678() { @@ -300,11 +300,11 @@ int test5_13678() return 0; } -one sink_5_14567( A&); // { dg-error "" } -four sink_5_14567(const volatile A&); // { dg-error "" } -five sink_5_14567( A&&); // { dg-error "" } -six sink_5_14567(const A&&); // { dg-error "" } -seven sink_5_14567(volatile A&&); // { dg-error "" } +one sink_5_14567( A&); // { dg-message "candidates" } +four sink_5_14567(const volatile A&); // { dg-message "note" } +five sink_5_14567( A&&); // { dg-message "note" } +six sink_5_14567(const A&&); // { dg-message "note" } +seven sink_5_14567(volatile A&&); // { dg-message "note" } int test5_14567() { @@ -318,9 +318,9 @@ int test5_14567() one sink_5_14678( A&); four sink_5_14678(const volatile A&); -six sink_5_14678(const A&&); // { dg-error "" } -seven sink_5_14678(volatile A&&); // { dg-error "" } -eight sink_5_14678(const volatile A&&); // { dg-error "" } +six sink_5_14678(const A&&); // { dg-message "candidates" } +seven sink_5_14678(volatile A&&); // { dg-message "note" } +eight sink_5_14678(const volatile A&&); // { dg-message "note" } int test5_14678() { @@ -332,11 +332,11 @@ int test5_14678() return 0; } -two sink_5_23456(const A&); // { dg-error "" } -three sink_5_23456(volatile A&); // { dg-error "" } -four sink_5_23456(const volatile A&); // { dg-error "" } -five sink_5_23456( A&&); // { dg-error "" } -six sink_5_23456(const A&&); // { dg-error "" } +two sink_5_23456(const A&); // { dg-message "candidates" } +three sink_5_23456(volatile A&); // { dg-message "note" } +four sink_5_23456(const volatile A&); // { dg-message "note" } +five sink_5_23456( A&&); // { dg-message "note" } +six sink_5_23456(const A&&); // { dg-message "note" } int test5_23456() { @@ -350,11 +350,11 @@ int test5_23456() return 0; } -two sink_5_23457(const A&); // { dg-error "" } -three sink_5_23457(volatile A&); // { dg-error "" } -four sink_5_23457(const volatile A&); // { dg-error "" } -five sink_5_23457( A&&); // { dg-error "" } -seven sink_5_23457(volatile A&&); // { dg-error "" } +two sink_5_23457(const A&); // { dg-message "candidates" } +three sink_5_23457(volatile A&); // { dg-message "note" } +four sink_5_23457(const volatile A&); // { dg-message "note" } +five sink_5_23457( A&&); // { dg-message "note" } +seven sink_5_23457(volatile A&&); // { dg-message "note" } int test5_23457() { @@ -367,11 +367,11 @@ int test5_23457() return 0; } -two sink_5_23458(const A&); // { dg-error "" } -three sink_5_23458(volatile A&); // { dg-error "" } -four sink_5_23458(const volatile A&); // { dg-error "" } -five sink_5_23458( A&&); // { dg-error "" } -eight sink_5_23458(const volatile A&&); // { dg-error "" } +two sink_5_23458(const A&); // { dg-message "candidates" } +three sink_5_23458(volatile A&); // { dg-message "note" } +four sink_5_23458(const volatile A&); // { dg-message "note" } +five sink_5_23458( A&&); // { dg-message "note" } +eight sink_5_23458(const volatile A&&); // { dg-message "note" } int test5_23458() { @@ -383,11 +383,11 @@ int test5_23458() return 0; } -two sink_5_23467(const A&); // { dg-error "" } -three sink_5_23467(volatile A&); // { dg-error "" } -four sink_5_23467(const volatile A&); // { dg-error "" } -six sink_5_23467(const A&&); // { dg-error "" } -seven sink_5_23467(volatile A&&); // { dg-error "" } +two sink_5_23467(const A&); // { dg-message "candidates" } +three sink_5_23467(volatile A&); // { dg-message "note" } +four sink_5_23467(const volatile A&); // { dg-message "note" } +six sink_5_23467(const A&&); // { dg-message "note" } +seven sink_5_23467(volatile A&&); // { dg-message "note" } int test5_23467() { @@ -401,11 +401,11 @@ int test5_23467() return 0; } -two sink_5_23468(const A&); // { dg-error "" } -three sink_5_23468(volatile A&); // { dg-error "" } -four sink_5_23468(const volatile A&); // { dg-error "" } -six sink_5_23468(const A&&); // { dg-error "" } -eight sink_5_23468(const volatile A&&); // { dg-error "" } +two sink_5_23468(const A&); // { dg-message "candidates" } +three sink_5_23468(volatile A&); // { dg-message "note" } +four sink_5_23468(const volatile A&); // { dg-message "note" } +six sink_5_23468(const A&&); // { dg-message "note" } +eight sink_5_23468(const volatile A&&); // { dg-message "note" } int test5_23468() { @@ -417,11 +417,11 @@ int test5_23468() return 0; } -two sink_5_23478(const A&); // { dg-error "" } -three sink_5_23478(volatile A&); // { dg-error "" } -four sink_5_23478(const volatile A&); // { dg-error "" } -seven sink_5_23478(volatile A&&); // { dg-error "" } -eight sink_5_23478(const volatile A&&); // { dg-error "" } +two sink_5_23478(const A&); // { dg-message "candidates" } +three sink_5_23478(volatile A&); // { dg-message "note" } +four sink_5_23478(const volatile A&); // { dg-message "note" } +seven sink_5_23478(volatile A&&); // { dg-message "note" } +eight sink_5_23478(const volatile A&&); // { dg-message "note" } int test5_23478() { @@ -433,11 +433,11 @@ int test5_23478() return 0; } -two sink_5_23567(const A&); // { dg-error "" } -three sink_5_23567(volatile A&); // { dg-error "" } -five sink_5_23567( A&&); // { dg-error "" } -six sink_5_23567(const A&&); // { dg-error "" } -seven sink_5_23567(volatile A&&); // { dg-error "" } +two sink_5_23567(const A&); // { dg-message "candidates" } +three sink_5_23567(volatile A&); // { dg-message "note" } +five sink_5_23567( A&&); // { dg-message "note" } +six sink_5_23567(const A&&); // { dg-message "note" } +seven sink_5_23567(volatile A&&); // { dg-message "note" } int test5_23567() { @@ -451,11 +451,11 @@ int test5_23567() return 0; } -two sink_5_23568(const A&); // { dg-error "" } -three sink_5_23568(volatile A&); // { dg-error "" } -five sink_5_23568( A&&); // { dg-error "" } -six sink_5_23568(const A&&); // { dg-error "" } -eight sink_5_23568(const volatile A&&); // { dg-error "" } +two sink_5_23568(const A&); // { dg-message "candidates" } +three sink_5_23568(volatile A&); // { dg-message "note" } +five sink_5_23568( A&&); // { dg-message "note" } +six sink_5_23568(const A&&); // { dg-message "note" } +eight sink_5_23568(const volatile A&&); // { dg-message "note" } int test5_23568() { @@ -467,11 +467,11 @@ int test5_23568() return 0; } -two sink_5_23578(const A&); // { dg-error "" } -three sink_5_23578(volatile A&); // { dg-error "" } -five sink_5_23578( A&&); // { dg-error "" } -seven sink_5_23578(volatile A&&); // { dg-error "" } -eight sink_5_23578(const volatile A&&); // { dg-error "" } +two sink_5_23578(const A&); // { dg-message "candidates" } +three sink_5_23578(volatile A&); // { dg-message "note" } +five sink_5_23578( A&&); // { dg-message "note" } +seven sink_5_23578(volatile A&&); // { dg-message "note" } +eight sink_5_23578(const volatile A&&); // { dg-message "note" } int test5_23578() { @@ -483,11 +483,11 @@ int test5_23578() return 0; } -two sink_5_23678(const A&); // { dg-error "" } -three sink_5_23678(volatile A&); // { dg-error "" } -six sink_5_23678(const A&&); // { dg-error "" } -seven sink_5_23678(volatile A&&); // { dg-error "" } -eight sink_5_23678(const volatile A&&); // { dg-error "" } +two sink_5_23678(const A&); // { dg-message "candidates" } +three sink_5_23678(volatile A&); // { dg-message "note" } +six sink_5_23678(const A&&); // { dg-message "note" } +seven sink_5_23678(volatile A&&); // { dg-message "note" } +eight sink_5_23678(const volatile A&&); // { dg-message "note" } int test5_23678() { @@ -500,11 +500,11 @@ int test5_23678() return 0; } -two sink_5_24567(const A&); // { dg-error "" } -four sink_5_24567(const volatile A&); // { dg-error "" } -five sink_5_24567( A&&); // { dg-error "" } -six sink_5_24567(const A&&); // { dg-error "" } -seven sink_5_24567(volatile A&&); // { dg-error "" } +two sink_5_24567(const A&); // { dg-message "candidates" } +four sink_5_24567(const volatile A&); // { dg-message "note" } +five sink_5_24567( A&&); // { dg-message "note" } +six sink_5_24567(const A&&); // { dg-message "note" } +seven sink_5_24567(volatile A&&); // { dg-message "note" } int test5_24567() { @@ -516,11 +516,11 @@ int test5_24567() return 0; } -two sink_5_24678(const A&); // { dg-error "" } +two sink_5_24678(const A&); // { dg-message "candidates" } four sink_5_24678(const volatile A&); -six sink_5_24678(const A&&); // { dg-error "" } -seven sink_5_24678(volatile A&&); // { dg-error "" } -eight sink_5_24678(const volatile A&&); // { dg-error "" } +six sink_5_24678(const A&&); // { dg-message "note" } +seven sink_5_24678(volatile A&&); // { dg-message "note" } +eight sink_5_24678(const volatile A&&); // { dg-message "note" } int test5_24678() { @@ -532,11 +532,11 @@ int test5_24678() return 0; } -three sink_5_34567(volatile A&); // { dg-error "" } -four sink_5_34567(const volatile A&); // { dg-error "" } -five sink_5_34567( A&&); // { dg-error "" } -six sink_5_34567(const A&&); // { dg-error "" } -seven sink_5_34567(volatile A&&); // { dg-error "" } +three sink_5_34567(volatile A&); // { dg-message "candidates" } +four sink_5_34567(const volatile A&); // { dg-message "note" } +five sink_5_34567( A&&); // { dg-message "note" } +six sink_5_34567(const A&&); // { dg-message "note" } +seven sink_5_34567(volatile A&&); // { dg-message "note" } int test5_34567() { @@ -550,9 +550,9 @@ int test5_34567() three sink_5_34678(volatile A&); four sink_5_34678(const volatile A&); -six sink_5_34678(const A&&); // { dg-error "" } -seven sink_5_34678(volatile A&&); // { dg-error "" } -eight sink_5_34678(const volatile A&&); // { dg-error "" } +six sink_5_34678(const A&&); // { dg-message "candidates" } +seven sink_5_34678(volatile A&&); // { dg-message "note" } +eight sink_5_34678(const volatile A&&); // { dg-message "note" } int test5_34678() { diff --git a/gcc/testsuite/g++.dg/cpp0x/rv6n.C b/gcc/testsuite/g++.dg/cpp0x/rv6n.C index 9a925ef0c61..040c0f6c3e8 100644 --- a/gcc/testsuite/g++.dg/cpp0x/rv6n.C +++ b/gcc/testsuite/g++.dg/cpp0x/rv6n.C @@ -30,12 +30,12 @@ const volatile A cv_source(); // 6 at a time -one sink_6_123456( A&); // { dg-error "" } -two sink_6_123456(const A&); // { dg-error "" } -three sink_6_123456(volatile A&); // { dg-error "" } -four sink_6_123456(const volatile A&); // { dg-error "" } -five sink_6_123456( A&&); // { dg-error "" } -six sink_6_123456(const A&&); // { dg-error "" } +one sink_6_123456( A&); // { dg-message "candidates" } +two sink_6_123456(const A&); // { dg-message "note" } +three sink_6_123456(volatile A&); // { dg-message "note" } +four sink_6_123456(const volatile A&); // { dg-message "note" } +five sink_6_123456( A&&); // { dg-message "note" } +six sink_6_123456(const A&&); // { dg-message "note" } int test6_123456() { @@ -48,12 +48,12 @@ int test6_123456() return 0; } -one sink_6_123457( A&); // { dg-error "" } -two sink_6_123457(const A&); // { dg-error "" } -three sink_6_123457(volatile A&); // { dg-error "" } -four sink_6_123457(const volatile A&); // { dg-error "" } -five sink_6_123457( A&&); // { dg-error "" } -seven sink_6_123457(volatile A&&); // { dg-error "" } +one sink_6_123457( A&); // { dg-message "candidates" } +two sink_6_123457(const A&); // { dg-message "note" } +three sink_6_123457(volatile A&); // { dg-message "note" } +four sink_6_123457(const volatile A&); // { dg-message "note" } +five sink_6_123457( A&&); // { dg-message "note" } +seven sink_6_123457(volatile A&&); // { dg-message "note" } int test6_123457() { @@ -65,12 +65,12 @@ int test6_123457() return 0; } -two sink_6_235678(const A&); // { dg-error "" } -three sink_6_235678(volatile A&); // { dg-error "" } -five sink_6_235678( A&&); // { dg-error "" } -six sink_6_235678(const A&&); // { dg-error "" } -seven sink_6_235678(volatile A&&); // { dg-error "" } -eight sink_6_235678(const volatile A&&); // { dg-error "" } +two sink_6_235678(const A&); // { dg-message "candidates" } +three sink_6_235678(volatile A&); // { dg-message "note" } +five sink_6_235678( A&&); // { dg-message "note" } +six sink_6_235678(const A&&); // { dg-message "note" } +seven sink_6_235678(volatile A&&); // { dg-message "note" } +eight sink_6_235678(const volatile A&&); // { dg-message "note" } int test6_235678() { @@ -82,12 +82,12 @@ int test6_235678() return 0; } -two sink_6_234678(const A&); // { dg-error "" } -three sink_6_234678(volatile A&); // { dg-error "" } -four sink_6_234678(const volatile A&); // { dg-error "" } -six sink_6_234678(const A&&); // { dg-error "" } -seven sink_6_234678(volatile A&&); // { dg-error "" } -eight sink_6_234678(const volatile A&&); // { dg-error "" } +two sink_6_234678(const A&); // { dg-message "candidates" } +three sink_6_234678(volatile A&); // { dg-message "note" } +four sink_6_234678(const volatile A&); // { dg-message "note" } +six sink_6_234678(const A&&); // { dg-message "note" } +seven sink_6_234678(volatile A&&); // { dg-message "note" } +eight sink_6_234678(const volatile A&&); // { dg-message "note" } int test6_234678() { @@ -100,12 +100,12 @@ int test6_234678() return 0; } -two sink_6_234578(const A&); // { dg-error "" } -three sink_6_234578(volatile A&); // { dg-error "" } -four sink_6_234578(const volatile A&); // { dg-error "" } -five sink_6_234578( A&&); // { dg-error "" } -seven sink_6_234578(volatile A&&); // { dg-error "" } -eight sink_6_234578(const volatile A&&); // { dg-error "" } +two sink_6_234578(const A&); // { dg-message "candidates" } +three sink_6_234578(volatile A&); // { dg-message "note" } +four sink_6_234578(const volatile A&); // { dg-message "note" } +five sink_6_234578( A&&); // { dg-message "note" } +seven sink_6_234578(volatile A&&); // { dg-message "note" } +eight sink_6_234578(const volatile A&&); // { dg-message "note" } int test6_234578() { @@ -117,12 +117,12 @@ int test6_234578() return 0; } -two sink_6_234568(const A&); // { dg-error "" } -three sink_6_234568(volatile A&); // { dg-error "" } -four sink_6_234568(const volatile A&); // { dg-error "" } -five sink_6_234568( A&&); // { dg-error "" } -six sink_6_234568(const A&&); // { dg-error "" } -eight sink_6_234568(const volatile A&&); // { dg-error "" } +two sink_6_234568(const A&); // { dg-message "candidates" } +three sink_6_234568(volatile A&); // { dg-message "note" } +four sink_6_234568(const volatile A&); // { dg-message "note" } +five sink_6_234568( A&&); // { dg-message "note" } +six sink_6_234568(const A&&); // { dg-message "note" } +eight sink_6_234568(const volatile A&&); // { dg-message "note" } int test6_234568() { @@ -134,12 +134,12 @@ int test6_234568() return 0; } -two sink_6_234567(const A&); // { dg-error "" } -three sink_6_234567(volatile A&); // { dg-error "" } -four sink_6_234567(const volatile A&); // { dg-error "" } -five sink_6_234567( A&&); // { dg-error "" } -six sink_6_234567(const A&&); // { dg-error "" } -seven sink_6_234567(volatile A&&); // { dg-error "" } +two sink_6_234567(const A&); // { dg-message "candidates" } +three sink_6_234567(volatile A&); // { dg-message "note" } +four sink_6_234567(const volatile A&); // { dg-message "note" } +five sink_6_234567( A&&); // { dg-message "note" } +six sink_6_234567(const A&&); // { dg-message "note" } +seven sink_6_234567(volatile A&&); // { dg-message "note" } int test6_234567() { @@ -155,9 +155,9 @@ int test6_234567() one sink_6_134678( A&); three sink_6_134678(volatile A&); four sink_6_134678(const volatile A&); -six sink_6_134678(const A&&); // { dg-error "" } -seven sink_6_134678(volatile A&&); // { dg-error "" } -eight sink_6_134678(const volatile A&&); // { dg-error "" } +six sink_6_134678(const A&&); // { dg-message "candidates" } +seven sink_6_134678(volatile A&&); // { dg-message "note" } +eight sink_6_134678(const volatile A&&); // { dg-message "note" } int test6_134678() { @@ -170,11 +170,11 @@ int test6_134678() } one sink_6_124678( A&); -two sink_6_124678(const A&); // { dg-error "" } +two sink_6_124678(const A&); // { dg-message "candidates" } four sink_6_124678(const volatile A&); -six sink_6_124678(const A&&); // { dg-error "" } -seven sink_6_124678(volatile A&&); // { dg-error "" } -eight sink_6_124678(const volatile A&&); // { dg-error "" } +six sink_6_124678(const A&&); // { dg-message "note" } +seven sink_6_124678(volatile A&&); // { dg-message "note" } +eight sink_6_124678(const volatile A&&); // { dg-message "note" } int test6_124678() { @@ -187,11 +187,11 @@ int test6_124678() } one sink_6_123678( A&); -two sink_6_123678(const A&); // { dg-error "" } +two sink_6_123678(const A&); // { dg-message "candidates" } three sink_6_123678(volatile A&); -six sink_6_123678(const A&&); // { dg-error "" } -seven sink_6_123678(volatile A&&); // { dg-error "" } -eight sink_6_123678(const volatile A&&); // { dg-error "" } +six sink_6_123678(const A&&); // { dg-message "note" } +seven sink_6_123678(volatile A&&); // { dg-message "note" } +eight sink_6_123678(const volatile A&&); // { dg-message "note" } int test6_123678() { @@ -203,12 +203,12 @@ int test6_123678() return 0; } -one sink_6_123567( A&); // { dg-error "" } -two sink_6_123567(const A&); // { dg-error "" } -three sink_6_123567(volatile A&); // { dg-error "" } -five sink_6_123567( A&&); // { dg-error "" } -six sink_6_123567(const A&&); // { dg-error "" } -seven sink_6_123567(volatile A&&); // { dg-error "" } +one sink_6_123567( A&); // { dg-message "candidates" } +two sink_6_123567(const A&); // { dg-message "note" } +three sink_6_123567(volatile A&); // { dg-message "note" } +five sink_6_123567( A&&); // { dg-message "note" } +six sink_6_123567(const A&&); // { dg-message "note" } +seven sink_6_123567(volatile A&&); // { dg-message "note" } int test6_123567() { @@ -221,12 +221,12 @@ int test6_123567() return 0; } -one sink_6_123467( A&); // { dg-error "" } -two sink_6_123467(const A&); // { dg-error "" } -three sink_6_123467(volatile A&); // { dg-error "" } -four sink_6_123467(const volatile A&); // { dg-error "" } -six sink_6_123467(const A&&); // { dg-error "" } -seven sink_6_123467(volatile A&&); // { dg-error "" } +one sink_6_123467( A&); // { dg-message "candidates" } +two sink_6_123467(const A&); // { dg-message "note" } +three sink_6_123467(volatile A&); // { dg-message "note" } +four sink_6_123467(const volatile A&); // { dg-message "note" } +six sink_6_123467(const A&&); // { dg-message "note" } +seven sink_6_123467(volatile A&&); // { dg-message "note" } int test6_123467() { @@ -239,12 +239,12 @@ int test6_123467() return 0; } -one sink_6_124567( A&); // { dg-error "" } -two sink_6_124567(const A&); // { dg-error "" } -four sink_6_124567(const volatile A&); // { dg-error "" } -five sink_6_124567( A&&); // { dg-error "" } -six sink_6_124567(const A&&); // { dg-error "" } -seven sink_6_124567(volatile A&&); // { dg-error "" } +one sink_6_124567( A&); // { dg-message "candidates" } +two sink_6_124567(const A&); // { dg-message "note" } +four sink_6_124567(const volatile A&); // { dg-message "note" } +five sink_6_124567( A&&); // { dg-message "note" } +six sink_6_124567(const A&&); // { dg-message "note" } +seven sink_6_124567(volatile A&&); // { dg-message "note" } int test6_124567() { @@ -256,12 +256,12 @@ int test6_124567() return 0; } -one sink_6_134567( A&); // { dg-error "" } -three sink_6_134567(volatile A&); // { dg-error "" } -four sink_6_134567(const volatile A&); // { dg-error "" } -five sink_6_134567( A&&); // { dg-error "" } -six sink_6_134567(const A&&); // { dg-error "" } -seven sink_6_134567(volatile A&&); // { dg-error "" } +one sink_6_134567( A&); // { dg-message "candidates" } +three sink_6_134567(volatile A&); // { dg-message "note" } +four sink_6_134567(const volatile A&); // { dg-message "note" } +five sink_6_134567( A&&); // { dg-message "note" } +six sink_6_134567(const A&&); // { dg-message "note" } +seven sink_6_134567(volatile A&&); // { dg-message "note" } int test6_134567() { diff --git a/gcc/testsuite/g++.dg/cpp0x/rv7n.C b/gcc/testsuite/g++.dg/cpp0x/rv7n.C index acd884bdde4..9d81bd5d722 100644 --- a/gcc/testsuite/g++.dg/cpp0x/rv7n.C +++ b/gcc/testsuite/g++.dg/cpp0x/rv7n.C @@ -1,6 +1,6 @@ // I, Howard Hinnant, hereby place this code in the public domain. -// Test overlaod resolution among referece types +// Test overload resolution among reference types // { dg-do compile } // { dg-options "-std=c++0x" } @@ -30,13 +30,13 @@ const volatile A cv_source(); // 7 at a time -one sink_7_1234567( A&); // { dg-error "" } -two sink_7_1234567(const A&); // { dg-error "" } -three sink_7_1234567(volatile A&); // { dg-error "" } -four sink_7_1234567(const volatile A&); // { dg-error "" } -five sink_7_1234567( A&&); // { dg-error "" } -six sink_7_1234567(const A&&); // { dg-error "" } -seven sink_7_1234567(volatile A&&); // { dg-error "" } +one sink_7_1234567( A&); // { dg-message "candidates" } +two sink_7_1234567(const A&); // { dg-message "note" } +three sink_7_1234567(volatile A&); // { dg-message "note" } +four sink_7_1234567(const volatile A&); // { dg-message "note" } +five sink_7_1234567( A&&); // { dg-message "note" } +six sink_7_1234567(const A&&); // { dg-message "note" } +seven sink_7_1234567(volatile A&&); // { dg-message "note" } int test7_1234567() { @@ -48,13 +48,13 @@ int test7_1234567() return 0; } -two sink_7_2345678(const A&); // { dg-error "" } -three sink_7_2345678(volatile A&); // { dg-error "" } -four sink_7_2345678(const volatile A&); // { dg-error "" } -five sink_7_2345678( A&&); // { dg-error "" } -six sink_7_2345678(const A&&); // { dg-error "" } -seven sink_7_2345678(volatile A&&); // { dg-error "" } -eight sink_7_2345678(const volatile A&&); // { dg-error "" } +two sink_7_2345678(const A&); // { dg-message "candidates" } +three sink_7_2345678(volatile A&); // { dg-message "note" } +four sink_7_2345678(const volatile A&); // { dg-message "note" } +five sink_7_2345678( A&&); // { dg-message "note" } +six sink_7_2345678(const A&&); // { dg-message "note" } +seven sink_7_2345678(volatile A&&); // { dg-message "note" } +eight sink_7_2345678(const volatile A&&); // { dg-message "note" } int test7_2345678() { @@ -67,12 +67,12 @@ int test7_2345678() } one sink_7_1234678( A&); -two sink_7_1234678(const A&); // { dg-error "" } +two sink_7_1234678(const A&); // { dg-message "candidates" } three sink_7_1234678(volatile A&); four sink_7_1234678(const volatile A&); -six sink_7_1234678(const A&&); // { dg-error "" } -seven sink_7_1234678(volatile A&&); // { dg-error "" } -eight sink_7_1234678(const volatile A&&); // { dg-error "" } +six sink_7_1234678(const A&&); // { dg-message "note" } +seven sink_7_1234678(volatile A&&); // { dg-message "note" } +eight sink_7_1234678(const volatile A&&); // { dg-message "note" } int test7_1234678() { diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-ex13.C b/gcc/testsuite/g++.dg/cpp0x/variadic-ex13.C index f1cce3a4363..b742cb1d369 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic-ex13.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-ex13.C @@ -34,6 +34,6 @@ template<typename... Args> void g(Args... args) f(const_cast<const Args*>(&args)...); // okay: ``Args'' and ``args'' are expanded f(5 ...); // { dg-error "contains no argument packs" } f(args); // { dg-error "parameter packs not expanded" } - // { dg-error "args" "" { target *-*-* } 36 } + // { dg-message "args" "note" { target *-*-* } 36 } f(h(args...) + args...); // okay: first ``args'' expanded within h, second ``args'' expanded within f. } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic36.C b/gcc/testsuite/g++.dg/cpp0x/variadic36.C index 370d475eb6d..90636020401 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic36.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic36.C @@ -11,5 +11,5 @@ struct tuple_base { }; template<typename... Values> struct tuple : tuple_base<Values> { }; // { dg-error "packs not expanded" } -// { dg-error "args" "" { target *-*-* } 5 } -// { dg-error "Values" "" { target *-*-* } 12 } +// { dg-message "args" "note" { target *-*-* } 5 } +// { dg-message "Values" "note" { target *-*-* } 12 } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic59.C b/gcc/testsuite/g++.dg/cpp0x/variadic59.C index f0730d33baf..6d6e52f9319 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic59.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic59.C @@ -1,4 +1,4 @@ // { dg-options "-std=gnu++0x" } template<class T, typename... VarArgs> void print(T t, VarArgs args); // { dg-error "packs not expanded" } -// { dg-error "VarArgs" "" { target *-*-* } 3 } +// { dg-message "VarArgs" "note" { target *-*-* } 3 } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic71.C b/gcc/testsuite/g++.dg/cpp0x/variadic71.C index d4219dace83..bea3cc34631 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic71.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic71.C @@ -9,4 +9,4 @@ struct push_front<list<Elements...>, Head> { typedef list<Head, Elements> type; // { dg-error "parameter packs not expanded" } }; -// { dg-error "Elements" "" { target *-*-* } 9 } +// { dg-message "Elements" "note" { target *-*-* } 9 } diff --git a/gcc/testsuite/g++.dg/expr/cond9.C b/gcc/testsuite/g++.dg/expr/cond9.C index 9e8f08c1d6b..e71a84ba43e 100644 --- a/gcc/testsuite/g++.dg/expr/cond9.C +++ b/gcc/testsuite/g++.dg/expr/cond9.C @@ -1,7 +1,7 @@ // PR c++/27666 -struct A { // { dg-error "A" } - A(int); // { dg-error "A" } +struct A { // { dg-message "A" } + A(int); // { dg-message "A" } }; void foo(volatile A a) { diff --git a/gcc/testsuite/g++.dg/expr/pmf-1.C b/gcc/testsuite/g++.dg/expr/pmf-1.C index 9bb8a037d75..8f6426b401b 100644 --- a/gcc/testsuite/g++.dg/expr/pmf-1.C +++ b/gcc/testsuite/g++.dg/expr/pmf-1.C @@ -7,13 +7,13 @@ struct A { void f(); - void foo(void (A::*)(int)); // { dg-error "candidate" "" } + void foo(void (A::*)(int)); // { dg-message "candidate" "" } template<typename T> void g(T); void h() { void (A::*p)() = &A::f; void (A::*q)() = &(A::f); // { dg-error "parenthesized" "" } - foo(&g<int>); // { dg-error "" "" } + foo(&g<int>); // { dg-error "no matching" "" } } }; diff --git a/gcc/testsuite/g++.dg/ext/altivec-types-1.C b/gcc/testsuite/g++.dg/ext/altivec-types-1.C index 9e9ca96e8c6..d322e5ebe97 100644 --- a/gcc/testsuite/g++.dg/ext/altivec-types-1.C +++ b/gcc/testsuite/g++.dg/ext/altivec-types-1.C @@ -68,21 +68,21 @@ __vector __complex unsigned long long v_cull; /* { dg-error "AltiVec types" "" } /* These should be rejected because the component types are invalid. We don't care about the actual error messages here. */ -__vector __bool unsigned char vbuc; /* { dg-error "error" "" } */ -__vector __bool signed char vbsc; /* { dg-error "error" "" } */ -__vector __bool unsigned short vbuh; /* { dg-error "error" "" } */ -__vector __bool signed short vbsh; /* { dg-error "error" "" } */ -__vector __bool unsigned int vbui; /* { dg-error "error" "" } */ -__vector __bool signed int vbsi; /* { dg-error "error" "" } */ -__vector __bool unsigned vbuj; /* { dg-error "error" "" } */ -__vector __bool signed vbsj; /* { dg-error "error" "" } */ -__vector signed float vsf; /* { dg-error "error" "" } */ -__vector unsigned float vuf; /* { dg-error "error" "" } */ -__vector short float vsf; /* { dg-error "error" "" } */ -__vector signed double vsd; /* { dg-error "error" "" } */ -__vector unsigned double vud; /* { dg-error "error" "" } */ -__vector short double vsd; /* { dg-error "error" "" } */ -__vector __bool float vbf; /* { dg-error "error" "" } */ -__vector __bool double vbd; /* { dg-error "error" "" } */ -__vector __bool short float blf; /* { dg-error "error" "" } */ -__vector __bool short double vlbd; /* { dg-error "error" "" } */ +__vector __bool unsigned char vbuc; /* { dg-error "" "" } */ +__vector __bool signed char vbsc; /* { dg-error "" "" } */ +__vector __bool unsigned short vbuh; /* { dg-error "" "" } */ +__vector __bool signed short vbsh; /* { dg-error "" "" } */ +__vector __bool unsigned int vbui; /* { dg-error "" "" } */ +__vector __bool signed int vbsi; /* { dg-error "" "" } */ +__vector __bool unsigned vbuj; /* { dg-error "" "" } */ +__vector __bool signed vbsj; /* { dg-error "" "" } */ +__vector signed float vsf; /* { dg-error "" "" } */ +__vector unsigned float vuf; /* { dg-error "" "" } */ +__vector short float vsf; /* { dg-error "" "" } */ +__vector signed double vsd; /* { dg-error "" "" } */ +__vector unsigned double vud; /* { dg-error "" "" } */ +__vector short double vsd; /* { dg-error "" "" } */ +__vector __bool float vbf; /* { dg-error "" "" } */ +__vector __bool double vbd; /* { dg-error "" "" } */ +__vector __bool short float blf; /* { dg-error "" "" } */ +__vector __bool short double vlbd; /* { dg-error "" "" } */ diff --git a/gcc/testsuite/g++.dg/ext/case-range2.C b/gcc/testsuite/g++.dg/ext/case-range2.C index 33befbd588a..de1f2a7e763 100644 --- a/gcc/testsuite/g++.dg/ext/case-range2.C +++ b/gcc/testsuite/g++.dg/ext/case-range2.C @@ -11,7 +11,7 @@ T f2 (T i) { switch (i) { - case low ... high : return i + 1; // { dg-error "" } + case low ... high : return i + 1; // { dg-error "previously" } case 5 : return i + 2; // { dg-error "duplicate" } default : return 0; } @@ -20,8 +20,8 @@ T f2 (T i) int f (int i) { switch (i) { - case 1 ... 10: return i + 1; // { dg-error "" } + case 1 ... 10: return i + 1; // { dg-error "first entry" } case 3 ... 5 : return i + 3; // { dg-error "duplicate" } - default: return f2 (i); // { dg-error "" } + default: return f2 (i); // { dg-message "instantiated" } } } diff --git a/gcc/testsuite/g++.dg/ext/case-range3.C b/gcc/testsuite/g++.dg/ext/case-range3.C index 569ce627455..5a09c12d61d 100644 --- a/gcc/testsuite/g++.dg/ext/case-range3.C +++ b/gcc/testsuite/g++.dg/ext/case-range3.C @@ -9,7 +9,7 @@ T f2 (T i) { switch (i) { - case low ... high : return i + 1; // { dg-error "non-standard" } + case low ... high : return i + 1; // { dg-warning "non-standard" } default : return 0; } } @@ -17,7 +17,7 @@ T f2 (T i) int f (int i) { switch (i) { - case 1 ... 10: return i + 1; // { dg-error "non-standard" } - default: return f2 (i); // { dg-error "" } + case 1 ... 10: return i + 1; // { dg-warning "non-standard" } + default: return f2 (i); // { dg-message "instantiated" } } } diff --git a/gcc/testsuite/g++.dg/ext/fpreg1.C b/gcc/testsuite/g++.dg/ext/fpreg1.C index 72b81134fb8..c5170a4a4b6 100644 --- a/gcc/testsuite/g++.dg/ext/fpreg1.C +++ b/gcc/testsuite/g++.dg/ext/fpreg1.C @@ -8,7 +8,7 @@ double d; // Default initialized __fpreg is OK. __fpreg fpreg, fpreg2; // But explicitly zero-initialized is an invalid conversion. -__fpreg fi = 0; // { dg-error "error: invalid conversion to '__fpreg'" } +__fpreg fi = 0; // { dg-error "invalid conversion to '__fpreg'" } __fpreg f0 (__fpreg); int f1 (__float80); @@ -36,47 +36,47 @@ f (void) d = sizeof (fpreg); (void)(fpreg, fpreg); // Invalid operations. - ++fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - --fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - fpreg++; // { dg-error "error: invalid operation on '__fpreg'" } - fpreg--; // { dg-error "error: invalid operation on '__fpreg'" } - fpreg = -fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - fpreg = ~fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = !fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = *fpreg; // { dg-error "error: invalid type argument" } - if (fpreg) // { dg-error "error: invalid conversion from '__fpreg'" } + ++fpreg; // { dg-error "invalid operation on '__fpreg'" } + --fpreg; // { dg-error "invalid operation on '__fpreg'" } + fpreg++; // { dg-error "invalid operation on '__fpreg'" } + fpreg--; // { dg-error "invalid operation on '__fpreg'" } + fpreg = -fpreg; // { dg-error "invalid operation on '__fpreg'" } + fpreg = ~fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = !fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = *fpreg; // { dg-error "invalid type argument" } + if (fpreg) // { dg-error "invalid conversion from '__fpreg'" } return; - d = fpreg; // { dg-error "error: invalid conversion from '__fpreg'" } - d = (double) fpreg; // { dg-error "error: invalid conversion from '__fpreg'" } - fpreg = (__fpreg) d; // { dg-error "error: invalid conversion to '__fpreg'" } - fpreg = fpreg * fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - fpreg = fpreg / fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - fpreg = fpreg % fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - fpreg = fpreg + fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - fpreg = fpreg - fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - fpreg = fpreg << fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - fpreg = fpreg >> fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = fpreg < fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = fpreg > fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = fpreg <= fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = fpreg >= fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = fpreg == fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = fpreg != fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = fpreg & fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = fpreg ^ fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = fpreg | fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = fpreg && fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = fpreg || fpreg; // { dg-error "error: invalid operation on '__fpreg'" } - d = (fpreg ? 1 : 2); // { dg-error "error: invalid conversion from '__fpreg'" } - fpreg = (d ? fpreg : d); // { dg-error "error: invalid conversion to '__fpreg'" } - fpreg *= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" } - fpreg /= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" } - fpreg %= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" } - fpreg += fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" } - fpreg -= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" } - fpreg <<= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" } - fpreg >>= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" } - fpreg &= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" } - fpreg ^= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" } - fpreg |= fpreg; // { dg-error "error: invalid operation on '__fpreg'|in evaluation" } + d = fpreg; // { dg-error "invalid conversion from '__fpreg'" } + d = (double) fpreg; // { dg-error "invalid conversion from '__fpreg'" } + fpreg = (__fpreg) d; // { dg-error "invalid conversion to '__fpreg'" } + fpreg = fpreg * fpreg; // { dg-error "invalid operation on '__fpreg'" } + fpreg = fpreg / fpreg; // { dg-error "invalid operation on '__fpreg'" } + fpreg = fpreg % fpreg; // { dg-error "invalid operation on '__fpreg'" } + fpreg = fpreg + fpreg; // { dg-error "invalid operation on '__fpreg'" } + fpreg = fpreg - fpreg; // { dg-error "invalid operation on '__fpreg'" } + fpreg = fpreg << fpreg; // { dg-error "invalid operation on '__fpreg'" } + fpreg = fpreg >> fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = fpreg < fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = fpreg > fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = fpreg <= fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = fpreg >= fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = fpreg == fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = fpreg != fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = fpreg & fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = fpreg ^ fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = fpreg | fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = fpreg && fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = fpreg || fpreg; // { dg-error "invalid operation on '__fpreg'" } + d = (fpreg ? 1 : 2); // { dg-error "invalid conversion from '__fpreg'" } + fpreg = (d ? fpreg : d); // { dg-error "invalid conversion to '__fpreg'" } + fpreg *= fpreg; // { dg-error "invalid operation on '__fpreg'|in evaluation" } + fpreg /= fpreg; // { dg-error "invalid operation on '__fpreg'|in evaluation" } + fpreg %= fpreg; // { dg-error "invalid operation on '__fpreg'|in evaluation" } + fpreg += fpreg; // { dg-error "invalid operation on '__fpreg'|in evaluation" } + fpreg -= fpreg; // { dg-error "invalid operation on '__fpreg'|in evaluation" } + fpreg <<= fpreg; // { dg-error "invalid operation on '__fpreg'|in evaluation" } + fpreg >>= fpreg; // { dg-error "invalid operation on '__fpreg'|in evaluation" } + fpreg &= fpreg; // { dg-error "invalid operation on '__fpreg'|in evaluation" } + fpreg ^= fpreg; // { dg-error "invalid operation on '__fpreg'|in evaluation" } + fpreg |= fpreg; // { dg-error "invalid operation on '__fpreg'|in evaluation" } } diff --git a/gcc/testsuite/g++.dg/ext/is_class_error2.C b/gcc/testsuite/g++.dg/ext/is_class_error2.C index 9f19d624534..8649dc4410f 100644 --- a/gcc/testsuite/g++.dg/ext/is_class_error2.C +++ b/gcc/testsuite/g++.dg/ext/is_class_error2.C @@ -13,7 +13,7 @@ template<int> void foo() __is_abstract(int)(); // { dg-error "'__is_abstract\\(int\\)' cannot be used" } __is_base_of(int, float)(); // { dg-error "'__is_base_of\\(int, float\\)' cannot be used" } __is_class(int)(); // { dg-error "'__is_class\\(int\\)' cannot be used" } - __is_convertible_to(int, float)(); // { dg-error "unimplemented" } + __is_convertible_to(int, float)(); // { dg-message "unimplemented" } __is_empty(int)(); // { dg-error "'__is_empty\\(int\\)' cannot be used" } __is_enum(int)(); // { dg-error "'__is_enum\\(int\\)' cannot be used" } __is_pod(int)(); // { dg-error "'__is_pod\\(int\\)' cannot be used" } diff --git a/gcc/testsuite/g++.dg/ext/label5.C b/gcc/testsuite/g++.dg/ext/label5.C index 0032b0f8e67..9c5a24e5803 100644 --- a/gcc/testsuite/g++.dg/ext/label5.C +++ b/gcc/testsuite/g++.dg/ext/label5.C @@ -4,4 +4,4 @@ struct A { }; int main() { b: A() && && b; } // { dg-error "A\\(\\) && && *b" } -// { dg-error "candidate" "additional" { target *-*-* } 5 } +// { dg-message "candidate" "additional" { target *-*-* } 5 } diff --git a/gcc/testsuite/g++.dg/ext/pr27019.C b/gcc/testsuite/g++.dg/ext/pr27019.C index d7644180c29..c96d51c14ec 100644 --- a/gcc/testsuite/g++.dg/ext/pr27019.C +++ b/gcc/testsuite/g++.dg/ext/pr27019.C @@ -8,4 +8,4 @@ struct A int z[1]; }; -A a = { z:{} }; // { dg-error "unimplemented" } +A a = { z:{} }; // { dg-message "unimplemented" } diff --git a/gcc/testsuite/g++.dg/gomp/pr26690-1.C b/gcc/testsuite/g++.dg/gomp/pr26690-1.C index 9efd8d45ee9..3b7a4f8d572 100644 --- a/gcc/testsuite/g++.dg/gomp/pr26690-1.C +++ b/gcc/testsuite/g++.dg/gomp/pr26690-1.C @@ -2,8 +2,8 @@ // { dg-do compile } struct A -{ // { dg-error "A::A\\(const A&\\)" } - A (int); // { dg-error "candidates" } +{ // { dg-message "A::A\\(const A&\\)" } + A (int); // { dg-message "candidates" } }; void diff --git a/gcc/testsuite/g++.dg/gomp/pr26690-2.C b/gcc/testsuite/g++.dg/gomp/pr26690-2.C index 4ebf677cd08..5d29f322c9d 100644 --- a/gcc/testsuite/g++.dg/gomp/pr26690-2.C +++ b/gcc/testsuite/g++.dg/gomp/pr26690-2.C @@ -3,8 +3,8 @@ struct A { - A (int x = 6); // { dg-error "A::A\\(int\\)" } - A (long long x = 12LL); // { dg-error "candidates" } + A (int x = 6); // { dg-message "A::A\\(int\\)" } + A (long long x = 12LL); // { dg-message "candidates" } }; void diff --git a/gcc/testsuite/g++.dg/gomp/pr34694.C b/gcc/testsuite/g++.dg/gomp/pr34694.C index 5b98bd2a9a7..c225e154523 100644 --- a/gcc/testsuite/g++.dg/gomp/pr34694.C +++ b/gcc/testsuite/g++.dg/gomp/pr34694.C @@ -9,7 +9,7 @@ foo () { #pragma omp parallel { - int j; // { dg-warning "note: 'j' was declared here" } + int j; // { dg-message "note: 'j' was declared here" } i = j; // { dg-warning "is used uninitialized" } } } diff --git a/gcc/testsuite/g++.dg/gomp/pr35158.C b/gcc/testsuite/g++.dg/gomp/pr35158.C index 933eba1ab2c..9577cd236fc 100644 --- a/gcc/testsuite/g++.dg/gomp/pr35158.C +++ b/gcc/testsuite/g++.dg/gomp/pr35158.C @@ -5,7 +5,7 @@ int main(int argc, char *argv[]) { #pragma omp parallel for - for (int i(0) ; // { dg-error "error: parenthesized initialization is not allowed in OpenMP 'for' loop" } + for (int i(0) ; // { dg-error "parenthesized initialization is not allowed in OpenMP 'for' loop" } i < 10 ; i++) ; diff --git a/gcc/testsuite/g++.dg/gomp/tpl-parallel-2.C b/gcc/testsuite/g++.dg/gomp/tpl-parallel-2.C index 3f2e3bb6211..2dceb093287 100644 --- a/gcc/testsuite/g++.dg/gomp/tpl-parallel-2.C +++ b/gcc/testsuite/g++.dg/gomp/tpl-parallel-2.C @@ -17,4 +17,4 @@ void S<T>::test() template struct S<int>; template struct S<long>; -template struct S<float>; // { dg-error "instantiated from here" } +template struct S<float>; // { dg-message "instantiated from here" } diff --git a/gcc/testsuite/g++.dg/inherit/using6.C b/gcc/testsuite/g++.dg/inherit/using6.C index 46c23ce582e..7bdfc3405c1 100644 --- a/gcc/testsuite/g++.dg/inherit/using6.C +++ b/gcc/testsuite/g++.dg/inherit/using6.C @@ -12,4 +12,4 @@ template <typename T> struct TPL : A }; TPL<int> i; -TPL<float> j; // { dg-error "instantiated" } +TPL<float> j; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/init/brace6.C b/gcc/testsuite/g++.dg/init/brace6.C index 066d1ba65ff..bff89daa2f2 100644 --- a/gcc/testsuite/g++.dg/init/brace6.C +++ b/gcc/testsuite/g++.dg/init/brace6.C @@ -6,7 +6,7 @@ struct A { }; struct B { - B(const B&); // { dg-error "candidate" } + B(const B&); // { dg-message "candidate" } int b; }; diff --git a/gcc/testsuite/g++.dg/init/ctor4.C b/gcc/testsuite/g++.dg/init/ctor4.C index 70643ec4e10..0671dd8537d 100644 --- a/gcc/testsuite/g++.dg/init/ctor4.C +++ b/gcc/testsuite/g++.dg/init/ctor4.C @@ -16,5 +16,5 @@ foo::foo() { int main(int argc, char **argv) { - bar x; // { dg-error "synthesized" } + bar x; // { dg-message "synthesized" } } diff --git a/gcc/testsuite/g++.dg/lookup/conv-1.C b/gcc/testsuite/g++.dg/lookup/conv-1.C index 6a595f71997..b861c6036df 100644 --- a/gcc/testsuite/g++.dg/lookup/conv-1.C +++ b/gcc/testsuite/g++.dg/lookup/conv-1.C @@ -7,12 +7,12 @@ struct A1 { - operator int () const; // { dg-error "A1::operator" "" } + operator int () const; // { dg-message "A1::operator" "" } }; struct A2 { - operator int () const; // { dg-error "A2::operator" "" } + operator int () const; // { dg-message "A2::operator" "" } }; struct B : A1, A2 diff --git a/gcc/testsuite/g++.dg/lookup/friend13.C b/gcc/testsuite/g++.dg/lookup/friend13.C new file mode 100644 index 00000000000..bec71df37b2 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/friend13.C @@ -0,0 +1,6 @@ +// PR c++/37558 + +class Foo { + friend class Bar; + friend void func(const class Bar*); +}; diff --git a/gcc/testsuite/g++.dg/lookup/new1.C b/gcc/testsuite/g++.dg/lookup/new1.C index ae1121339cf..b29aa46ce42 100644 --- a/gcc/testsuite/g++.dg/lookup/new1.C +++ b/gcc/testsuite/g++.dg/lookup/new1.C @@ -10,4 +10,4 @@ int main() { return 0; } -// { dg-error "candidate" "" { target *-*-* } 0 } +// { dg-message "candidate" "" { target *-*-* } 0 } diff --git a/gcc/testsuite/g++.dg/lookup/scoped6.C b/gcc/testsuite/g++.dg/lookup/scoped6.C index d9566a7e099..b83b08fe94f 100644 --- a/gcc/testsuite/g++.dg/lookup/scoped6.C +++ b/gcc/testsuite/g++.dg/lookup/scoped6.C @@ -10,7 +10,7 @@ public: class Bar { Foo<int> foo_; public: - Bar() {} // { dg-error "instantiated" } + Bar() {} // { dg-message "instantiated" } }; template class Foo<int>; diff --git a/gcc/testsuite/g++.dg/lookup/using7.C b/gcc/testsuite/g++.dg/lookup/using7.C index e62d3f310ac..b250c5823f5 100644 --- a/gcc/testsuite/g++.dg/lookup/using7.C +++ b/gcc/testsuite/g++.dg/lookup/using7.C @@ -4,8 +4,9 @@ template <typename T, bool=T::X> struct A }; template <typename T> struct B : A<T> -{ // { dg-error "" } - using A<T>::i; // { dg-error "" } +{ // { dg-error "incomplete" } + using A<T>::i; // { dg-error "incomplete" "incomplete" } + // { dg-error "using" "using" { target *-*-* } 8 } }; -B<void> b; // { dg-error "" } +B<void> b; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/lookup/using9.C b/gcc/testsuite/g++.dg/lookup/using9.C index c62267519b0..7c3b30d8873 100644 --- a/gcc/testsuite/g++.dg/lookup/using9.C +++ b/gcc/testsuite/g++.dg/lookup/using9.C @@ -4,14 +4,14 @@ // an ambiguous overload set to be created. namespace B { - void f(int); // { dg-error "note" } - void f(double); // { dg-error "note" } + void f(int); // { dg-message "candidates" } + void f(double); // { dg-message "note" } } namespace C { - void f(int); // { dg-error "note" } - void f(double); // { dg-error "note" } - void f(char); // { dg-error "note" } + void f(int); // { dg-message "note" } + void f(double); // { dg-message "note" } + void f(char); // { dg-message "note" } } void h() diff --git a/gcc/testsuite/g++.dg/other/abstract1.C b/gcc/testsuite/g++.dg/other/abstract1.C index 86962c7bc3a..8406f8a25d7 100644 --- a/gcc/testsuite/g++.dg/other/abstract1.C +++ b/gcc/testsuite/g++.dg/other/abstract1.C @@ -5,7 +5,7 @@ // c++/9256: Make sure that a pointer to an array of abstract elements // cannot be created, not even during template substitution (DR337). -struct Abstract { virtual void f() = 0; }; // { dg-error "" } +struct Abstract { virtual void f() = 0; }; // { dg-message "note" } struct Complete { void f(); }; @@ -35,7 +35,7 @@ template <class T> struct K { T (*a)[2]; // { dg-error "abstract class type" } }; -template struct K<Abstract>; // { dg-error "from here" } +template struct K<Abstract>; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/other/abstract2.C b/gcc/testsuite/g++.dg/other/abstract2.C index d242ffdc0b3..b79493285c2 100644 --- a/gcc/testsuite/g++.dg/other/abstract2.C +++ b/gcc/testsuite/g++.dg/other/abstract2.C @@ -19,22 +19,22 @@ namespace N1 { void g(X (*parm6)[2]); // { dg-error "abstract" } }; - struct X { // { dg-error "note" } - virtual void xfunc(void) = 0; // { dg-error "note" } + struct X { // { dg-message "note" } + virtual void xfunc(void) = 0; // { dg-message "note" } }; } namespace N2 { - struct X1 { // { dg-error "note" } - virtual void xfunc(void) = 0; // { dg-error "note" } + struct X1 { // { dg-message "note" } + virtual void xfunc(void) = 0; // { dg-message "note" } void g(X1 parm7); // { dg-error "abstract" } void g(X1 parm8[2]); // { dg-error "abstract" } void g(X1 (*parm9)[2]); // { dg-error "abstract" } }; template <int N> - struct X2 { // { dg-error "note" } - virtual void xfunc(void) = 0; // { dg-error "note" } + struct X2 { // { dg-message "note" } + virtual void xfunc(void) = 0; // { dg-message "note" } void g(X2 parm10); // { dg-error "abstract" } void g(X2 parm11[2]); // { dg-error "abstract" } void g(X2 (*parm12)[2]); // { dg-error "abstract" } @@ -42,8 +42,8 @@ namespace N2 { } namespace N3 { - struct X { // { dg-error "note" "" } - virtual void xfunc(void) = 0; // { dg-error "note" } + struct X { // { dg-message "note" "" } + virtual void xfunc(void) = 0; // { dg-message "note" } }; void g(X parm13); // { dg-error "abstract" } void g(X parm14[2]); // { dg-error "abstract" } diff --git a/gcc/testsuite/g++.dg/other/anon5.C b/gcc/testsuite/g++.dg/other/anon5.C index a82d3f7b50e..53cf9e33c12 100644 --- a/gcc/testsuite/g++.dg/other/anon5.C +++ b/gcc/testsuite/g++.dg/other/anon5.C @@ -11,7 +11,7 @@ namespace { const bool &f() { - return c::t; // { dg-error "undefined" "undefined" { target *-*-* } 0 } + return c::t; // { dg-message "undefined" "undefined" { target *-*-* } 0 } // Some targets report the error for the previous line, others // don't give line number inforamtion for it, so use line 0. } diff --git a/gcc/testsuite/g++.dg/other/crash-4.C b/gcc/testsuite/g++.dg/other/crash-4.C index a37b8b2f020..bc2c457f1b4 100644 --- a/gcc/testsuite/g++.dg/other/crash-4.C +++ b/gcc/testsuite/g++.dg/other/crash-4.C @@ -22,5 +22,5 @@ struct b struct c { b bb; - c(const b& __a): bb(__a) {} // { dg-error "synthesized" "" { target { ! default_packed } } } + c(const b& __a): bb(__a) {} // { dg-message "synthesized" "" { target { ! default_packed } } } }; diff --git a/gcc/testsuite/g++.dg/other/error10.C b/gcc/testsuite/g++.dg/other/error10.C index d8025801f13..9e6da6529aa 100644 --- a/gcc/testsuite/g++.dg/other/error10.C +++ b/gcc/testsuite/g++.dg/other/error10.C @@ -10,6 +10,6 @@ void foo(const A<N> &a) void bar() { - foo(A<0>()); // { dg-error "instantiated from here" "" } + foo(A<0>()); // { dg-message "instantiated from here" "" } } diff --git a/gcc/testsuite/g++.dg/other/error13.C b/gcc/testsuite/g++.dg/other/error13.C index 037e28866e1..d3b1eabc0b2 100644 --- a/gcc/testsuite/g++.dg/other/error13.C +++ b/gcc/testsuite/g++.dg/other/error13.C @@ -1,10 +1,10 @@ //PR c++/28258 struct A -{ // { dg-error "" } +{ // { dg-message "note" } A(void x); // { dg-error "invalid use|incomplete type|candidates" } }; struct B : A {}; // { dg-error "no matching function for call" } -B b; // { dg-error "synthesized method" } +B b; // { dg-message "synthesized method" } diff --git a/gcc/testsuite/g++.dg/other/error20.C b/gcc/testsuite/g++.dg/other/error20.C index 3c8e8f22aaf..50a4495cff9 100644 --- a/gcc/testsuite/g++.dg/other/error20.C +++ b/gcc/testsuite/g++.dg/other/error20.C @@ -2,7 +2,7 @@ // { dg-do compile } struct A -{ // { dg-error "candidates" } +{ // { dg-message "candidates" } virtual A foo (); }; diff --git a/gcc/testsuite/g++.dg/other/error5.C b/gcc/testsuite/g++.dg/other/error5.C index 552f7bf27b5..c7a142fb57d 100644 --- a/gcc/testsuite/g++.dg/other/error5.C +++ b/gcc/testsuite/g++.dg/other/error5.C @@ -10,4 +10,4 @@ template <typename T> struct S2 : S<T> { using S<T>::operator typename S<T>::I*; // { dg-error "operator S\\<int\\>" "" } }; -template struct S2<int>; // { dg-error "instantiated" "" } +template struct S2<int>; // { dg-message "instantiated" "" } diff --git a/gcc/testsuite/g++.dg/other/field1.C b/gcc/testsuite/g++.dg/other/field1.C index 3afe3d908de..61a9df69563 100644 --- a/gcc/testsuite/g++.dg/other/field1.C +++ b/gcc/testsuite/g++.dg/other/field1.C @@ -22,4 +22,4 @@ template <> struct X<int> { X(); }; -X<float> i; // { dg-error "instantiated from" "" } +X<float> i; // { dg-message "instantiated from" "" } diff --git a/gcc/testsuite/g++.dg/other/offsetof5.C b/gcc/testsuite/g++.dg/other/offsetof5.C index 97dd5e93710..3c484338055 100644 --- a/gcc/testsuite/g++.dg/other/offsetof5.C +++ b/gcc/testsuite/g++.dg/other/offsetof5.C @@ -19,4 +19,4 @@ struct S static const int j = offsetof (S, i); // { dg-warning "invalid access|offsetof" } }; -int k = S<int>::j; // { dg-warning "instantiated from here" } +int k = S<int>::j; // { dg-message "instantiated from here" } diff --git a/gcc/testsuite/g++.dg/other/pr37394.C b/gcc/testsuite/g++.dg/other/pr37394.C new file mode 100644 index 00000000000..7b5772e8efb --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr37394.C @@ -0,0 +1,12 @@ +// Origin: Martin Michlmayr <tbm@cyrius.com> +// { dg-do compile { target ia64-*-* } } +// { dg-options "-O -fschedule-insns2" } + +struct _Words +{ + void *_M_pword; + _Words (): + _M_pword (0) + { + } +} _M_word_zero; diff --git a/gcc/testsuite/g++.dg/other/semicolon.C b/gcc/testsuite/g++.dg/other/semicolon.C index 542d3b7b554..efbae8b7021 100644 --- a/gcc/testsuite/g++.dg/other/semicolon.C +++ b/gcc/testsuite/g++.dg/other/semicolon.C @@ -5,6 +5,7 @@ struct A { - struct B { int i; } // { dg-error "3: error: new types may not be defined in a return type|note: \\(perhaps a semicolon is missing" } - void foo(); // { dg-error "12: error: two or more|return type" } + struct B { int i; } // { dg-error "3:new types may not be defined in a return type" } + // { dg-message "perhaps a semicolon is missing" "note" { target *-*-* } 8 } + void foo(); // { dg-error "12:two or more" } }; diff --git a/gcc/testsuite/g++.dg/overload/ambig1.C b/gcc/testsuite/g++.dg/overload/ambig1.C index 2adc78c795a..21948bf3146 100644 --- a/gcc/testsuite/g++.dg/overload/ambig1.C +++ b/gcc/testsuite/g++.dg/overload/ambig1.C @@ -14,8 +14,8 @@ struct B B(int); }; -void f(A); // { dg-error "" "candidate" } -void f(B); // { dg-error "" "candidate" } +void f(A); // { dg-message "note" "candidate" } +void f(B); // { dg-message "note" "candidate" } int main() { diff --git a/gcc/testsuite/g++.dg/overload/arg3.C b/gcc/testsuite/g++.dg/overload/arg3.C index 1778ce5a43c..8ece6a6f3ca 100644 --- a/gcc/testsuite/g++.dg/overload/arg3.C +++ b/gcc/testsuite/g++.dg/overload/arg3.C @@ -10,13 +10,14 @@ struct A {}; struct B : A { - B(int); // { dg-error "" "" } - B(B&); // { dg-error "" "" } + B(int); // { dg-message "B::B" "" } + B(B&); // { dg-message "candidates" "" } }; void foo(B); void bar() { - foo(0); // { dg-error "no matching function|initializing" "" } + foo(0); // { dg-error "no matching function" "no matching" } + // { dg-error "initializing" "initializing" { target *-*-* } 21 } } diff --git a/gcc/testsuite/g++.dg/overload/builtin1.C b/gcc/testsuite/g++.dg/overload/builtin1.C index 9f66e336065..652b8e1b760 100644 --- a/gcc/testsuite/g++.dg/overload/builtin1.C +++ b/gcc/testsuite/g++.dg/overload/builtin1.C @@ -7,10 +7,11 @@ struct A { operator B (); }; -void operator+ (B, B); // { dg-error "" "candidate" } +void operator+ (B, B); // { dg-message "operator" "operator" } int main () { A a; - a + a; // { dg-error "" "ambiguous" } + a + a; // { dg-error "ambiguous" "ambiguous" } + // { dg-message "candidates" "candidates" { target *-*-* } 15 } } diff --git a/gcc/testsuite/g++.dg/overload/copy1.C b/gcc/testsuite/g++.dg/overload/copy1.C index 87f8317acbe..6a774c6770b 100644 --- a/gcc/testsuite/g++.dg/overload/copy1.C +++ b/gcc/testsuite/g++.dg/overload/copy1.C @@ -4,8 +4,8 @@ struct A; struct B { - B (A const &); // { dg-warning "note" } - B (B &); // { dg-warning "note" } + B (A const &); // { dg-message "note" } + B (B &); // { dg-message "note" } }; struct A @@ -16,5 +16,6 @@ struct A B f (B const& b) { - return b; // { dg-error "" } + return b; // { dg-error "matching" "matching" } + // { dg-error "initializing" "initializing" { target *-*-* } 19 } } diff --git a/gcc/testsuite/g++.dg/overload/new1.C b/gcc/testsuite/g++.dg/overload/new1.C index 7f8935895c9..89282faf66c 100644 --- a/gcc/testsuite/g++.dg/overload/new1.C +++ b/gcc/testsuite/g++.dg/overload/new1.C @@ -16,6 +16,6 @@ void f(X *x = new X[4]); // { dg-error "" } void f(X *x = new (3) X(6)); // { dg-error "" } void f(X *x = new (2) X[10]); // { dg-error "" } -// { dg-error "candidate" "" { target *-*-* } 00 } +// { dg-message "candidate" "" { target *-*-* } 00 } void f(X *x = new X[10][5]); // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/overload/template4.C b/gcc/testsuite/g++.dg/overload/template4.C index 4c3ca05e6c2..6638dc9d246 100644 --- a/gcc/testsuite/g++.dg/overload/template4.C +++ b/gcc/testsuite/g++.dg/overload/template4.C @@ -3,14 +3,14 @@ namespace { - template <int> void foo (...); // { dg-error "" "candidate" } - template <int> void bar (int, ...); // { dg-error "" "candidate" } - void baz (...); // { dg-error "" "candidate" } + template <int> void foo (...); // { dg-message "foo" } + template <int> void bar (int, ...); // { dg-message "bar" } + void baz (...); // { dg-message "baz" } } -template <int> void foo (...); // { dg-error "" "candidate" } -template <int> void bar (int, ...); // { dg-error "" "candidate" } -void baz (...); // { dg-error "" "candidate" } +template <int> void foo (...); // { dg-message "candidate" } +template <int> void bar (int, ...); // { dg-message "candidate" } +void baz (...); // { dg-message "candidate" } void test () diff --git a/gcc/testsuite/g++.dg/overload/using2.C b/gcc/testsuite/g++.dg/overload/using2.C index 2ecb5fad6b0..54b12219bd8 100644 --- a/gcc/testsuite/g++.dg/overload/using2.C +++ b/gcc/testsuite/g++.dg/overload/using2.C @@ -20,21 +20,21 @@ namespace std { extern "C" void *malloc (__SIZE_TYPE__) throw () __attribute__((malloc)); void abort (void) throw (); // these aren't - void _exit (int) throw (); // { dg-error "std::_exit" } + void _exit (int) throw (); // { dg-message "std::_exit" } extern "C" void c1 (void) throw (); - void C1 (void) throw (); // { dg-error "std::C1" } + void C1 (void) throw (); // { dg-message "std::C1" } extern "C" void c2 (void) throw (); void C2 (void) throw (); extern "C" void c3 (void) throw (); - void C3 (void) throw (); // { dg-error "std::C3" } + void C3 (void) throw (); // { dg-message "std::C3" } } namespace other { extern "C" void c3 (void) throw (); - void C3 (void) throw (); // { dg-error "other::C3" } + void C3 (void) throw (); // { dg-message "other::C3" } } using std::exit; @@ -46,10 +46,12 @@ using std::C1; extern "C" void *malloc (__SIZE_TYPE__) throw () __attribute__((malloc)); void abort (void) throw (); - void _exit (int) throw (); // { dg-error "conflicts|void _exit" } + void _exit (int) throw (); // { dg-error "conflicts" "conflicts" } + // { dg-message "void _exit" "_exit" { target *-*-* } 49 } extern "C" void c1 (void) throw (); - void C1 (void) throw (); // { dg-error "conflicts|void C1" } + void C1 (void) throw (); // { dg-error "conflicts" "conflicts" } + // { dg-message "void C1" "C1" { target *-*-* } 53 } extern "C" void c2 (void) throw (); void C2 (void) throw (); diff --git a/gcc/testsuite/g++.dg/parse/bitfield2.C b/gcc/testsuite/g++.dg/parse/bitfield2.C index 49aace1dc76..a04d2adf8f3 100644 --- a/gcc/testsuite/g++.dg/parse/bitfield2.C +++ b/gcc/testsuite/g++.dg/parse/bitfield2.C @@ -22,7 +22,7 @@ struct D T t : 3; // { dg-error "non-integral type" } }; -D<double> d; // { dg-error "instantiated" } +D<double> d; // { dg-message "instantiated" } template <typename T> struct E diff --git a/gcc/testsuite/g++.dg/parse/constant4.C b/gcc/testsuite/g++.dg/parse/constant4.C index 65c84d94a13..d69f60ba8ca 100644 --- a/gcc/testsuite/g++.dg/parse/constant4.C +++ b/gcc/testsuite/g++.dg/parse/constant4.C @@ -34,7 +34,7 @@ template <typename> struct X void Baz () { - Foo<int> (); // { dg-error "instantiated" "" } + Foo<int> (); // { dg-message "instantiated" "" } } diff --git a/gcc/testsuite/g++.dg/parse/constructor1.C b/gcc/testsuite/g++.dg/parse/constructor1.C index 8f222f80b10..1796531487c 100644 --- a/gcc/testsuite/g++.dg/parse/constructor1.C +++ b/gcc/testsuite/g++.dg/parse/constructor1.C @@ -1,7 +1,8 @@ // { dg-do compile } // { dg-options "-fshow-column" } -ACE_Process_Descriptor::ACE_Process_Descriptor () : // { dg-error "" } - process_ (0) // { dg-error "3: error: only constructors take base initializers" } +ACE_Process_Descriptor::ACE_Process_Descriptor () : // { dg-error "declared" "declared" } + // { dg-error "no type" "no type" { target *-*-* } 4 } + process_ (0) // { dg-error "3: only constructors take base initializers" } { } diff --git a/gcc/testsuite/g++.dg/parse/crash20.C b/gcc/testsuite/g++.dg/parse/crash20.C index b39e572c39a..d04869fa7af 100644 --- a/gcc/testsuite/g++.dg/parse/crash20.C +++ b/gcc/testsuite/g++.dg/parse/crash20.C @@ -11,4 +11,4 @@ template<typename T> struct A typedef typename T::X Y; // { dg-error "not a class" "" } }; -A<int>::Y y; // { dg-error "instantiated from here" "" } +A<int>::Y y; // { dg-message "instantiated from here" "" } diff --git a/gcc/testsuite/g++.dg/parse/crash36.C b/gcc/testsuite/g++.dg/parse/crash36.C index 1397e87d256..6f5c86734a8 100644 --- a/gcc/testsuite/g++.dg/parse/crash36.C +++ b/gcc/testsuite/g++.dg/parse/crash36.C @@ -2,9 +2,10 @@ // { dg-do compile } // { dg-options "-std=c++98" } -template <typename... T> struct A // { dg-error "variadic templates" } +template <typename... T> struct A // { dg-warning "variadic templates" } { - static T &t; // { dg-error "not expanded with|T" } + static T &t; // { dg-error "not expanded with" "not expanded" } + // { dg-message "T" "T" { target *-*-* } 7 } static const int i = sizeof (++t); // { dg-error "was not declared in this scope" } }; diff --git a/gcc/testsuite/g++.dg/parse/crash44.C b/gcc/testsuite/g++.dg/parse/crash44.C index abdf827cd4d..41947b7d14f 100644 --- a/gcc/testsuite/g++.dg/parse/crash44.C +++ b/gcc/testsuite/g++.dg/parse/crash44.C @@ -8,7 +8,7 @@ struct test { int main(void) { struct test foo = { - once: PTHREAD_ONCE_INITIALIZER // { dg-error "error: 'PTHREAD_ONCE_INITIALIZER' was not declared in this scope" } + once: PTHREAD_ONCE_INITIALIZER // { dg-error "'PTHREAD_ONCE_INITIALIZER' was not declared in this scope" } }; return 0; diff --git a/gcc/testsuite/g++.dg/parse/crash49.C b/gcc/testsuite/g++.dg/parse/crash49.C new file mode 100644 index 00000000000..07d7c3b2f95 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/crash49.C @@ -0,0 +1,10 @@ +// PR c++/37552 +// { dg-do compile } + +extern struct A a[1]; // { dg-error "forward declaration" } + +void +foo () +{ + a[0]; // { dg-error "invalid use of incomplete type" } +} diff --git a/gcc/testsuite/g++.dg/parse/crash5.C b/gcc/testsuite/g++.dg/parse/crash5.C index 3a4185b7e6c..acf9e9d4bba 100644 --- a/gcc/testsuite/g++.dg/parse/crash5.C +++ b/gcc/testsuite/g++.dg/parse/crash5.C @@ -1,13 +1,13 @@ // { dg-options "-w" } -class QString { // { dg-error "" } - QString (const QString & a); // { dg-error "" } +class QString { // { dg-error "previous definition" } + QString (const QString & a); // { dg-message "candidates" } }; -class QString { }; // { dg-error "" } +class QString { }; // { dg-error "redefinition" } const QString q () { - QString z; // { dg-error "" } + QString z; // { dg-error "matching" } int x; - return x ? QString () : QString (); // { dg-error "" } + return x ? QString () : QString (); // { dg-error "matching" } } diff --git a/gcc/testsuite/g++.dg/parse/error-column.C b/gcc/testsuite/g++.dg/parse/error-column.C index 812a499ff4d..18dc4633a5d 100644 --- a/gcc/testsuite/g++.dg/parse/error-column.C +++ b/gcc/testsuite/g++.dg/parse/error-column.C @@ -5,5 +5,5 @@ void foo () { - cout << "blah"; // { dg-error "3: error: 'cout'" } + cout << "blah"; // { dg-error "3:'cout'" } } diff --git a/gcc/testsuite/g++.dg/parse/error1.C b/gcc/testsuite/g++.dg/parse/error1.C index 60e7d6587b3..1f8bb37732c 100644 --- a/gcc/testsuite/g++.dg/parse/error1.C +++ b/gcc/testsuite/g++.dg/parse/error1.C @@ -3,5 +3,5 @@ struct INCOMPLETE; template <int> struct X { static INCOMPLETE value; }; -template <> INCOMPLETE X<1>::value = 0; // { dg-error "30: error: variable 'INCOMPLETE X<1>::value' has initializer but incomplete type" } +template <> INCOMPLETE X<1>::value = 0; // { dg-error "30:variable 'INCOMPLETE X<1>::value' has initializer but incomplete type" } diff --git a/gcc/testsuite/g++.dg/parse/error10.C b/gcc/testsuite/g++.dg/parse/error10.C index 6e46922a115..8301172adbe 100644 --- a/gcc/testsuite/g++.dg/parse/error10.C +++ b/gcc/testsuite/g++.dg/parse/error10.C @@ -15,5 +15,5 @@ template <typename T> void foo() } // Here, columns nums are not very accurate either. Still acceptable though -// { dg-error "30: error: invalid type in declaration before ';' token" "" { target *-*-* } { 14 } } -// { dg-error "30: error: two or more data types in declaration of 'e4'" "" { target *-*-* } { 14 } } +// { dg-error "30:invalid type in declaration before ';' token" "" { target *-*-* } 14 } +// { dg-error "30:two or more data types in declaration of 'e4'" "" { target *-*-* } 14 } diff --git a/gcc/testsuite/g++.dg/parse/error11.C b/gcc/testsuite/g++.dg/parse/error11.C index f7093a8f987..39039a880b1 100644 --- a/gcc/testsuite/g++.dg/parse/error11.C +++ b/gcc/testsuite/g++.dg/parse/error11.C @@ -16,45 +16,56 @@ struct Foo }; void method(void) { - typename Foo<::B>::template Nested<::B> n; // { dg-error "17: error: '<::' cannot begin|17: note: '<:' is an alternate spelling|39: error: '<::' cannot begin|39: note: '<:' is an alternate" } + typename Foo<::B>::template Nested<::B> n; // { dg-error "17:'<::' cannot begin" "17-begin" } +// { dg-message "17:'<:' is an alternate spelling" "17-alt" { target *-*-* } 19 } +// { dg-error "39:'<::' cannot begin" "39-begin" { target *-*-* } 19 } +// { dg-message "39:'<:' is an alternate spelling" "39-alt" { target *-*-* } 19 } n.template Nested<B>::method(); - n.template Nested<::B>::method(); // { dg-error "22: error: '<::' cannot begin|22: note: '<:' is an alternate" } + n.template Nested<::B>::method(); // { dg-error "22:'<::' cannot begin" "error" } +// { dg-message "22:'<:' is an alternate" "note" { target *-*-* } 24 } Nested<B>::method(); - Nested<::B>::method(); // { dg-error "11: error: '<::' cannot begin|11: note: '<:' is an alternate" } + Nested<::B>::method(); // { dg-error "11:'<::' cannot begin" "error" } +// { dg-message "11:'<:' is an alternate" "note" { target *-*-* } 27 } } }; template <int N> struct Foo2 {}; -template struct Foo2<::B>; // { dg-error "21: error: '<::' cannot begin|21: note: '<:' is an alternate|25: error: type/value mismatch|25: error: expected a constant" } +template struct Foo2<::B>; // { dg-error "21:'<::' cannot begin" "begin" } +// { dg-message "21:'<:' is an alternate" "alt" { target *-*-* } 33 } +// { dg-message "25:type/value mismatch" "mismatch" { target *-*-* } 33 } +// { dg-error "25:expected a constant" "const" { target *-*-* } 33 } int value = 0; void func(void) { - Foo<::B> f; // { dg-error "cannot begin|alternate spelling" } + Foo<::B> f; // { dg-error "cannot begin" "begin" } +// { dg-message "alternate spelling" "alt" { target *-*-* } 42 } f.Foo<B>::method(); - f.Foo<::B>::method(); // { dg-error "8: error|8: note" } + f.Foo<::B>::method(); // { dg-error "8:cannot begin" "begin" } +// { dg-message "8:alternate spelling" "alt" { target *-*-* } 45 } // Check cases where we the token sequence is the correct one, but there // was no digraph or whitespaces in the middle, so we should not emit // the special error message. Foo<: :B> k2; // { dg-bogus "cannot begin|alternate spelling" "smart error should not be triggered here" } Foo[:B> k1; // { dg-bogus "cannot begin|alternate spelling" "smart error should not be triggered here" } -// { dg-error "6: error: missing template arguments before" "" { target *-*-* } { 41 } } -// { dg-error "9: error: expected primary-expression before ':' token" "" { target *-*-* } 41 } -// { dg-error "9: error: expected '\]' before ':' token" "" { target *-*-* } 41 } -// { dg-error "9: error: expected ';' before ':' token" "" { target *-*-* } 41 } -// { dg-error "6: error: missing template arguments before" "" { target *-*-* } 42 } -// { dg-error "7: error: expected primary-expression before ':' token" "" { target *-*-* } 42 } -// { dg-error "7: error: expected '\]' before ':' token" "" { target *-*-* } 42 } -// { dg-error "7: error: expected ';' before ':' token" "" { target *-*-* } 42 } +// { dg-error "6:missing template arguments before" "template" { target *-*-* } { 51 } } +// { dg-error "9:expected primary-expression before ':' token" "primary" { target *-*-* } 51 } +// { dg-error "9:expected '\]' before ':' token" "backslash" { target *-*-* } 51 } +// { dg-error "9:expected ';' before ':' token" "semicolon" { target *-*-* } 51 } +// { dg-error "6:missing template arguments before" "template" { target *-*-* } 52 } +// { dg-error "7:expected primary-expression before ':' token" "primary" { target *-*-* } 52 } +// { dg-error "7:expected '\]' before ':' token" "backslash" { target *-*-* } 52 } +// { dg-error "7:expected ';' before ':' token" "semicolon" { target *-*-* } 52 } // int Foo[2]; Foo[::value] = 0; } -template struct Foo<::B>; // { dg-error "20: error: '<::' cannot begin|20: note: '<:' is an alternate" } +template struct Foo<::B>; // { dg-error "20:'<::' cannot begin" "begin" } +// { dg-message "20:is an alternate" "alt" { target *-*-* } 66 } // On the first error message, an additional note about the use of // -fpermissive should be present -// { dg-error "17: note: \\(if you use '-fpermissive' G\\+\\+ will accept your code\\)" "-fpermissive" { target *-*-* } 19 } +// { dg-message "17:\\(if you use '-fpermissive' G\\+\\+ will accept your code\\)" "-fpermissive" { target *-*-* } 19 } diff --git a/gcc/testsuite/g++.dg/parse/error12.C b/gcc/testsuite/g++.dg/parse/error12.C index b0025885bf4..3ebcf389413 100644 --- a/gcc/testsuite/g++.dg/parse/error12.C +++ b/gcc/testsuite/g++.dg/parse/error12.C @@ -9,5 +9,5 @@ template <class A> struct Foo {}; Foo<::B> foo; // { dg-bogus "error" "error in place of warning" } -// { dg-error "4: warning: '<::' cannot begin a template-argument list" "warning <::" { target *-*-* } 11 } -// { dg-error "4: note: '<:' is an alternate spelling for '.'. Insert whitespace between '<' and '::'" "note <:" { target *-*-* } 11 } +// { dg-warning "4: '<::' cannot begin a template-argument list" "warning <::" { target *-*-* } 11 } +// { dg-message "4:'<:' is an alternate spelling for '.'. Insert whitespace between '<' and '::'" "note <:" { target *-*-* } 11 } diff --git a/gcc/testsuite/g++.dg/parse/error13.C b/gcc/testsuite/g++.dg/parse/error13.C index 94ddae89705..9bce98d7fc8 100644 --- a/gcc/testsuite/g++.dg/parse/error13.C +++ b/gcc/testsuite/g++.dg/parse/error13.C @@ -1,14 +1,14 @@ // { dg-options "-fshow-column" } // PR c++/13975 -public: // { dg-error "1: error: expected unqualified-id before 'public'" } +public: // { dg-error "1:expected unqualified-id before 'public'" } int i; -protected: // { dg-error "1: error: expected unqualified-id before 'protected'" } +protected: // { dg-error "1:expected unqualified-id before 'protected'" } int j; -private: // { dg-error "1: error: expected unqualified-id before 'private'" } +private: // { dg-error "1:expected unqualified-id before 'private'" } int k; diff --git a/gcc/testsuite/g++.dg/parse/error14.C b/gcc/testsuite/g++.dg/parse/error14.C index 906b98f87e2..9e672c286b2 100644 --- a/gcc/testsuite/g++.dg/parse/error14.C +++ b/gcc/testsuite/g++.dg/parse/error14.C @@ -19,5 +19,8 @@ struct X Zinc<int>( //); // } -}; // { dg-error "2: error: expected '.' at end of input|1: error: expected primary-expression before '.' token|1: error: expected ';' before '.' token|1: error: expected unqualified-id at end of input" } +}; // { dg-error "2:expected '.' at end of input" "at end of input" } + // { dg-error "1:expected primary-expression before '.' token" "primary" { target *-*-* } 22 } + // { dg-error "1:expected ';' before '.' token" "semicolon" { target *-*-* } 22 } + // { dg-error "1:expected unqualified-id at end of input" "unqual" { target *-*-* } 22 } diff --git a/gcc/testsuite/g++.dg/parse/error15.C b/gcc/testsuite/g++.dg/parse/error15.C index 5d30b554369..c5d3d3d7d67 100644 --- a/gcc/testsuite/g++.dg/parse/error15.C +++ b/gcc/testsuite/g++.dg/parse/error15.C @@ -10,29 +10,32 @@ namespace N int K; } -N::A f2; // { dg-error "1: error: invalid use of template-name 'N::A' without an argument list" } -N::INVALID f3; // { dg-error "1: error: 'INVALID' in namespace 'N' does not name a type" } -N::C::INVALID f4; // { dg-error "1: error: 'INVALID' in class 'N::C' does not name a type" } -N::K f6; // { dg-error "1: error: 'K' in namespace 'N' does not name a type" } -typename N::A f7; // { dg-error "1: error: using 'typename' outside of template|13: error: invalid use of template-name 'N::A' without an argument list|17: error: invalid type in declaration before ';' token" } +N::A f2; // { dg-error "1:invalid use of template-name 'N::A' without an argument list" } +N::INVALID f3; // { dg-error "1:'INVALID' in namespace 'N' does not name a type" } +N::C::INVALID f4; // { dg-error "1:'INVALID' in class 'N::C' does not name a type" } +N::K f6; // { dg-error "1:'K' in namespace 'N' does not name a type" } +typename N::A f7; // { dg-error "1:using 'typename' outside of template" "1" } +// { dg-error "13:invalid use of template-name 'N::A' without an argument list" "13" { target *-*-* } 17 } +// { dg-error "17:invalid type in declaration before ';' token" "17" { target *-*-* } 17 } struct B { - N::A f2; // { dg-error "3: error: invalid use of template-name 'N::A' without an argument list" } - N::INVALID f3; // { dg-error "3: error: 'INVALID' in namespace 'N' does not name a type" } - N::C::INVALID f4; // { dg-error "3: error: 'INVALID' in class 'N::C' does not name a type" } - N::K f6; // { dg-error "3: error: 'K' in namespace 'N' does not name a type" } - typename N::A f7; // { dg-error "3: error: using 'typename' outside of template|15: error: invalid use of template-name 'N::A' without an argument list" } + N::A f2; // { dg-error "3:invalid use of template-name 'N::A' without an argument list" } + N::INVALID f3; // { dg-error "3:'INVALID' in namespace 'N' does not name a type" } + N::C::INVALID f4; // { dg-error "3:'INVALID' in class 'N::C' does not name a type" } + N::K f6; // { dg-error "3:'K' in namespace 'N' does not name a type" } + typename N::A f7; // { dg-error "3:using 'typename' outside of template" } +// { dg-error "15:invalid use of template-name 'N::A' without an argument list" "15" { target *-*-* } 27 } }; template <int> struct C { - N::A f2; // { dg-error "3: error: invalid use of template-name 'N::A' without an argument list" } - N::INVALID f3; // { dg-error "3: error: 'INVALID' in namespace 'N' does not name a type" } - N::C::INVALID f4; // { dg-error "3: error: 'INVALID' in class 'N::C' does not name a type" } - N::K f6; // { dg-error "3: error: 'K' in namespace 'N' does not name a type" } - typename N::A f7; // { dg-error "15: error: invalid use of template-name 'N::A' without an argument list" } + N::A f2; // { dg-error "3:invalid use of template-name 'N::A' without an argument list" } + N::INVALID f3; // { dg-error "3:'INVALID' in namespace 'N' does not name a type" } + N::C::INVALID f4; // { dg-error "3:'INVALID' in class 'N::C' does not name a type" } + N::K f6; // { dg-error "3:'K' in namespace 'N' does not name a type" } + typename N::A f7; // { dg-error "15:invalid use of template-name 'N::A' without an argument list" } }; // { dg-bogus "bogus excess errors in declaration" "bogus excess errors in declaration" { target *-*-* } 17 } diff --git a/gcc/testsuite/g++.dg/parse/error16.C b/gcc/testsuite/g++.dg/parse/error16.C index ddc302c7cd6..ba9aacc26e3 100644 --- a/gcc/testsuite/g++.dg/parse/error16.C +++ b/gcc/testsuite/g++.dg/parse/error16.C @@ -3,7 +3,7 @@ struct A { - struct B {}; // { dg-error "12: error: previous definition of 'struct A::B'" } + struct B {}; // { dg-error "12:previous definition of 'struct A::B'" } }; -struct A::B{}; // { dg-error "11: error: redefinition of 'struct A::B'" } +struct A::B{}; // { dg-error "11:redefinition of 'struct A::B'" } diff --git a/gcc/testsuite/g++.dg/parse/error17.C b/gcc/testsuite/g++.dg/parse/error17.C index defd708982d..4cd4044e3d0 100644 --- a/gcc/testsuite/g++.dg/parse/error17.C +++ b/gcc/testsuite/g++.dg/parse/error17.C @@ -2,8 +2,10 @@ // PR c++/16965 template <typename T> struct B { - static int Bar(T); // { dg-error "14: error: candidates are: |14: error: " } + static int Bar(T); // { dg-error "14:candidates are: " "1" } + // { dg-error "14:with T = int" "2" { target *-*-* } 5 } }; struct D : B<int>, B<char> {}; -int i2 = D::Bar(2); // { dg-error "13: error: reference to 'Bar' is ambiguous|10: error: reference to 'Bar' is ambiguous" } +int i2 = D::Bar(2); // { dg-error "13:reference to 'Bar' is ambiguous" } +// { dg-error "10:reference to 'Bar' is ambiguous" "2" { target *-*-* } 10 } diff --git a/gcc/testsuite/g++.dg/parse/error18.C b/gcc/testsuite/g++.dg/parse/error18.C index 926af11eb6a..b5e722221b9 100644 --- a/gcc/testsuite/g++.dg/parse/error18.C +++ b/gcc/testsuite/g++.dg/parse/error18.C @@ -3,6 +3,6 @@ void f() { - double Q *= 5.0; // { dg-error "12: error: expected initializer before '..' token" } + double Q *= 5.0; // { dg-error "12:expected initializer before '..' token" } } diff --git a/gcc/testsuite/g++.dg/parse/error19.C b/gcc/testsuite/g++.dg/parse/error19.C index b22156a5d71..5582891c974 100644 --- a/gcc/testsuite/g++.dg/parse/error19.C +++ b/gcc/testsuite/g++.dg/parse/error19.C @@ -2,7 +2,7 @@ // PR C++/17867 struct A -{ // { dg-error "1: note: candidates are:" } +{ // { dg-message "1:candidates are:" } A(int); }; @@ -10,5 +10,5 @@ const A& foo(); void bar() { - foo()=A(0); // { dg-error "12: error: no match for 'operator='" } + foo()=A(0); // { dg-error "12:no match for 'operator='" } } diff --git a/gcc/testsuite/g++.dg/parse/error2.C b/gcc/testsuite/g++.dg/parse/error2.C index 075dcc2b0d1..619f89421d9 100644 --- a/gcc/testsuite/g++.dg/parse/error2.C +++ b/gcc/testsuite/g++.dg/parse/error2.C @@ -8,8 +8,8 @@ int func(double); template <int> struct Foo {}; -Foo<func(g)> f; // { dg-error "5: error: 'int func.double.' cannot appear in a constant-expression" "" { target *-*-* } { 11 } } -// { dg-error "10: error: 'g' cannot appear in a constant-expression" "" { target *-*-* } { 11 } } -// { dg-error "11: error: a function call cannot appear in a constant-expression" "" { target *-*-* } { 11 } } -// { dg-error "12: error: template argument 1 is invalid" "" { target *-*-* } { 11 } } -// { dg-error "15: error: invalid type in declaration before ';' token" "" { target *-*-* } { 11 } } +Foo<func(g)> f; // { dg-error "5:'int func.double.' cannot appear in a constant-expression" "" { target *-*-* } 11 } +// { dg-error "10:'g' cannot appear in a constant-expression" "" { target *-*-* } 11 } +// { dg-error "11:a function call cannot appear in a constant-expression" "" { target *-*-* } 11 } +// { dg-error "12:template argument 1 is invalid" "" { target *-*-* } 11 } +// { dg-error "15:invalid type in declaration before ';' token" "" { target *-*-* } 11 } diff --git a/gcc/testsuite/g++.dg/parse/error20.C b/gcc/testsuite/g++.dg/parse/error20.C index 9564fab757b..d2f9353a7cc 100644 --- a/gcc/testsuite/g++.dg/parse/error20.C +++ b/gcc/testsuite/g++.dg/parse/error20.C @@ -12,7 +12,7 @@ struct C { }; int main() { C c; - A(c.p.i); // { dg-error "9: error: request for member 'i' in 'c.C::p', which is of non-class type 'B" } + A(c.p.i); // { dg-error "9:request for member 'i' in 'c.C::p', which is of non-class type 'B" } return 0; } diff --git a/gcc/testsuite/g++.dg/parse/error21.C b/gcc/testsuite/g++.dg/parse/error21.C index f60bf2b9c54..469e5fb4e1c 100644 --- a/gcc/testsuite/g++.dg/parse/error21.C +++ b/gcc/testsuite/g++.dg/parse/error21.C @@ -7,6 +7,7 @@ void foo() { // Check that we do not complain about an unused // compiler-generated variable. - A& = a; // { dg-error "6: error: expected unqualified-id before '=' token|8: error: 'a' was not declared in this scope" } + A& = a; // { dg-error "6:expected unqualified-id before '=' token" "6" } + // { dg-error "8:'a' was not declared in this scope" "8" { target *-*-* } 10 } } diff --git a/gcc/testsuite/g++.dg/parse/error22.C b/gcc/testsuite/g++.dg/parse/error22.C index 30141219abc..29552c67a6e 100644 --- a/gcc/testsuite/g++.dg/parse/error22.C +++ b/gcc/testsuite/g++.dg/parse/error22.C @@ -2,5 +2,5 @@ // PR c++/15786 struct A { - void foo(bar* p); /* { dg-error "12: error: 'bar' has not been declared" } */ + void foo(bar* p); /* { dg-error "12:'bar' has not been declared" } */ }; diff --git a/gcc/testsuite/g++.dg/parse/error23.C b/gcc/testsuite/g++.dg/parse/error23.C index 21b24349608..9c19b562c6d 100644 --- a/gcc/testsuite/g++.dg/parse/error23.C +++ b/gcc/testsuite/g++.dg/parse/error23.C @@ -5,5 +5,5 @@ struct QChar { QChar( char c ); QChar( const QChar& c ); //following column number is not accurate enough but will make it for now - static const ; // { dg-error "10: error: declaration does not declare anything" } + static const ; // { dg-error "10:declaration does not declare anything" } }; diff --git a/gcc/testsuite/g++.dg/parse/error24.C b/gcc/testsuite/g++.dg/parse/error24.C index e341c341291..c8ab6d9921a 100644 --- a/gcc/testsuite/g++.dg/parse/error24.C +++ b/gcc/testsuite/g++.dg/parse/error24.C @@ -2,7 +2,7 @@ // PR c++/19395 struct A { - typedef int ::X; // { dg-error "17: error: typedef name may not be a nested-name-specifier" } + typedef int ::X; // { dg-error "17:typedef name may not be a nested-name-specifier" } }; diff --git a/gcc/testsuite/g++.dg/parse/error25.C b/gcc/testsuite/g++.dg/parse/error25.C index b5cb57ee1f0..a0fd24c3a6f 100644 --- a/gcc/testsuite/g++.dg/parse/error25.C +++ b/gcc/testsuite/g++.dg/parse/error25.C @@ -9,10 +9,10 @@ class foo { virtual void bar1 () = 0; - virtual void bar2 () = __null; // { dg-error "32: error: invalid pure specifier" } - virtual void bar3 () = 4; // { dg-error "27: error: invalid pure specifier" } - virtual void bar4 () = A::f; // { dg-error "27: error: invalid pure specifier" } - virtual void bar5 () = 0l; // { dg-error "28: error: invalid pure specifier" } - virtual void bar6 () = 00; // { dg-error "28: error: invalid pure specifier" } - virtual void bar7 () = 0x0; // { dg-error "29: error: invalid pure specifier" } + virtual void bar2 () = __null; // { dg-error "32:invalid pure specifier" } + virtual void bar3 () = 4; // { dg-error "27:invalid pure specifier" } + virtual void bar4 () = A::f; // { dg-error "27:invalid pure specifier" } + virtual void bar5 () = 0l; // { dg-error "28:invalid pure specifier" } + virtual void bar6 () = 00; // { dg-error "28:invalid pure specifier" } + virtual void bar7 () = 0x0; // { dg-error "29:invalid pure specifier" } }; diff --git a/gcc/testsuite/g++.dg/parse/error26.C b/gcc/testsuite/g++.dg/parse/error26.C index 81f7ba6d382..befaf3bb3b8 100644 --- a/gcc/testsuite/g++.dg/parse/error26.C +++ b/gcc/testsuite/g++.dg/parse/error26.C @@ -3,10 +3,12 @@ void foo() { - if (({int c[2];})) ; // { dg-error "7: error: ISO C.. forbids|20: error: could not convert" } + if (({int c[2];})) ; // { dg-error "7:ISO C.. forbids" "7" } + // { dg-error "20:could not convert" "20" { target *-*-* } 6 } } void bar() { - if (({})); // { dg-error "7: error: ISO C.. forbids|11: error: could not convert" } + if (({})); // { dg-error "7:ISO C.. forbids" "7" } + // { dg-error "11:could not convert" "11" { target *-*-* } 12 } } diff --git a/gcc/testsuite/g++.dg/parse/error27.C b/gcc/testsuite/g++.dg/parse/error27.C index f1fd5376e59..c07d1d3a758 100644 --- a/gcc/testsuite/g++.dg/parse/error27.C +++ b/gcc/testsuite/g++.dg/parse/error27.C @@ -1,8 +1,8 @@ // { dg-options "-fshow-column -ansi -pedantic-errors -Wno-long-long" } // PR c++/20152 -struct KrSelectionMode { virtual void init() = 0; }; // { dg-error "24: error: previous definition of 'struct KrSelectionMode'" } -struct KrKDESelectionMode : public KrSelectionMode { void init() { } }; // { dg-error "52: error: previous definition of 'struct KrKDESelectionMode'" } -struct KrSelectionMode { virtual void init() = 0; }; // { dg-error "8: error: redefinition of 'struct KrSelectionMode'" } -struct KrKDESelectionMode : public KrSelectionMode { void init() { } }; // { dg-error "8: error: redefinition of 'struct KrKDESelectionMode'" } +struct KrSelectionMode { virtual void init() = 0; }; // { dg-error "24:previous definition of 'struct KrSelectionMode'" } +struct KrKDESelectionMode : public KrSelectionMode { void init() { } }; // { dg-error "52:previous definition of 'struct KrKDESelectionMode'" } +struct KrSelectionMode { virtual void init() = 0; }; // { dg-error "8:redefinition of 'struct KrSelectionMode'" } +struct KrKDESelectionMode : public KrSelectionMode { void init() { } }; // { dg-error "8:redefinition of 'struct KrKDESelectionMode'" } KrKDESelectionMode krKDESelectionMode; diff --git a/gcc/testsuite/g++.dg/parse/error28.C b/gcc/testsuite/g++.dg/parse/error28.C index 7162afa3a02..50ad960e09e 100644 --- a/gcc/testsuite/g++.dg/parse/error28.C +++ b/gcc/testsuite/g++.dg/parse/error28.C @@ -2,10 +2,10 @@ // PR c++/21908 struct virt { virt () {} virt (int i) {} }; -struct der : public virtual virt { // { dg-error "34: note: der::der" } - der (int i) : virt(i) {} // { dg-error "3: note: candidates are: der" } +struct der : public virtual virt { // { dg-message "34:der::der" } + der (int i) : virt(i) {} // { dg-message "3:candidates are: der" } }; struct top : public der { top () {} // { dg-bogus "der\\(const" } }; -// { dg-error "10: error: no matching function for call to 'der" "" { target *-*-* } 9 } +// { dg-error "10:no matching function for call to 'der" "" { target *-*-* } 9 } diff --git a/gcc/testsuite/g++.dg/parse/error29.C b/gcc/testsuite/g++.dg/parse/error29.C index fcd091b0b65..2c3a3a7f288 100644 --- a/gcc/testsuite/g++.dg/parse/error29.C +++ b/gcc/testsuite/g++.dg/parse/error29.C @@ -7,7 +7,7 @@ struct A { void operator delete(void *); }; struct B { - friend void A::foo() {} // { dg-error "22: error: cannot define member function 'A::foo' within 'B'" } - friend void A::operator delete(void*) {} // { dg-error "39: error: cannot define member function 'A::operator delete' within 'B'" } - friend A::A() {} // { dg-error "15: error: cannot define member function 'A::A' within 'B'" } + friend void A::foo() {} // { dg-error "22:cannot define member function 'A::foo' within 'B'" } + friend void A::operator delete(void*) {} // { dg-error "39:cannot define member function 'A::operator delete' within 'B'" } + friend A::A() {} // { dg-error "15:cannot define member function 'A::A' within 'B'" } }; diff --git a/gcc/testsuite/g++.dg/parse/error3.C b/gcc/testsuite/g++.dg/parse/error3.C index 2856850fb76..55ae024d412 100644 --- a/gcc/testsuite/g++.dg/parse/error3.C +++ b/gcc/testsuite/g++.dg/parse/error3.C @@ -5,5 +5,5 @@ static void InstantiateConstraint(const float&, unsigned, void(*AddFunction)(const TYPE&,bool&, char*, char*, unsigned*)); -// { dg-error "64: error: expected ',' or '...' before '&' token" "" { target *-*-* } { 5 } } -// { dg-error "60: error: ISO C\\+\\+ forbids declaration of 'TYPE' with no type" "" { target *-*-* } { 5 } } +// { dg-error "64:expected ',' or '...' before '&' token" "" { target *-*-* } { 5 } } +// { dg-error "60:ISO C\\+\\+ forbids declaration of 'TYPE' with no type" "" { target *-*-* } { 5 } } diff --git a/gcc/testsuite/g++.dg/parse/error30.C b/gcc/testsuite/g++.dg/parse/error30.C index 5c52d1ee67a..26c55c49c68 100644 --- a/gcc/testsuite/g++.dg/parse/error30.C +++ b/gcc/testsuite/g++.dg/parse/error30.C @@ -8,5 +8,5 @@ struct A A(int); }; -A a = -A(); // { dg-error "10: error: no match for.*operator-.*in.*-A\\(\\)" } -A b = -A(5); // { dg-error "11: error: no match for.*operator-.*in.*-A\\(5\\)" } +A a = -A(); // { dg-error "10:no match for.*operator-.*in.*-A\\(\\)" } +A b = -A(5); // { dg-error "11:no match for.*operator-.*in.*-A\\(5\\)" } diff --git a/gcc/testsuite/g++.dg/parse/error31.C b/gcc/testsuite/g++.dg/parse/error31.C index d354cc3e0dd..e3928522711 100644 --- a/gcc/testsuite/g++.dg/parse/error31.C +++ b/gcc/testsuite/g++.dg/parse/error31.C @@ -6,7 +6,7 @@ template<typename T> class foo{ }; int main() { foo<int> i; // this column number is not accurate yet, but that will make it for now. - foo<foo<int> j; // { dg-error "18: error: template argument 1 is invalid" } + foo<foo<int> j; // { dg-error "18:template argument 1 is invalid" } int k; int l; foo<int> m; diff --git a/gcc/testsuite/g++.dg/parse/error4.C b/gcc/testsuite/g++.dg/parse/error4.C index 790e5c9a40b..792bf4dc063 100644 --- a/gcc/testsuite/g++.dg/parse/error4.C +++ b/gcc/testsuite/g++.dg/parse/error4.C @@ -7,4 +7,4 @@ struct X { int); }; -// { dg-error "4: error: 'itn' has not been declared" "" { target *-*-* } { 6 } } +// { dg-error "4:'itn' has not been declared" "" { target *-*-* } 6 } diff --git a/gcc/testsuite/g++.dg/parse/error5.C b/gcc/testsuite/g++.dg/parse/error5.C index 8c9a039ac3c..6ebb087306b 100644 --- a/gcc/testsuite/g++.dg/parse/error5.C +++ b/gcc/testsuite/g++.dg/parse/error5.C @@ -3,17 +3,17 @@ class Foo { int foo() return 0; } }; -// { dg-error "30: error: expected identifier before numeric constant" "" { target *-*-* } { 4 } } +// { dg-error "30:expected identifier before numeric constant" "" { target *-*-* } 4 } -// { dg-error "23: error: named return values are no longer supported" "" { target *-*-* } { 4 } } +// { dg-error "23:named return values are no longer supported" "" { target *-*-* } 4 } // the column number info of this error output is still wrong because the error // message has been generated by cp_parser_error() which does not // necessarily allow accurate column number display. At some point, we will // need make cp_parser_error() report more accurate column numbers. -// { dg-error "30: error: expected '\{' at end of input" "" { target *-*-* } { 4 } } +// { dg-error "30:expected '\{' at end of input" "" { target *-*-* } 4 } -// { dg-error "35: error: expected unqualified-id before '\}' token" "" {target *-*-* } { 4 } } +// { dg-error "35:expected unqualified-id before '\}' token" "" {target *-*-* } 4 } -// { dg-error "35: error: expected declaration before '\}' token" "" {target *-*-* } { 4 } } +// { dg-error "35:expected declaration before '\}' token" "" {target *-*-* } 4 } diff --git a/gcc/testsuite/g++.dg/parse/error6.C b/gcc/testsuite/g++.dg/parse/error6.C index cd1b6b8cd33..81e04e21722 100644 --- a/gcc/testsuite/g++.dg/parse/error6.C +++ b/gcc/testsuite/g++.dg/parse/error6.C @@ -5,7 +5,7 @@ int f(int not) { return 1-not; } -// { dg-error "11: error: expected ',' or '...' before '!' token" "" { target *-*-* } { 4 } } +// { dg-error "11:expected ',' or '...' before '!' token" "" { target *-*-* } 4 } -// { dg-error "15: error: expected primary\\-expression before ';' token" "" { target *-*-* } { 5 } } +// { dg-error "15:expected primary\\-expression before ';' token" "" { target *-*-* } 5 } diff --git a/gcc/testsuite/g++.dg/parse/error7.C b/gcc/testsuite/g++.dg/parse/error7.C index f71c9aa9fa0..78b7caac9cd 100644 --- a/gcc/testsuite/g++.dg/parse/error7.C +++ b/gcc/testsuite/g++.dg/parse/error7.C @@ -4,4 +4,4 @@ void f(int x int y); -// { dg-error "8: error: expected ',' or '...' before 'int'" "" { target *-*-* } { 5 } } +// { dg-error "8:expected ',' or '...' before 'int'" "" { target *-*-* } 5 } diff --git a/gcc/testsuite/g++.dg/parse/error8.C b/gcc/testsuite/g++.dg/parse/error8.C index a399cfe63f7..ba572b0db7d 100644 --- a/gcc/testsuite/g++.dg/parse/error8.C +++ b/gcc/testsuite/g++.dg/parse/error8.C @@ -4,7 +4,7 @@ struct A { friend typename struct B; }; -// { dg-error "19: error: using 'typename' outside of template" "" { target *-*-* } { 4 } } -// { dg-error "28: error: expected nested-name-specifier before 'struct'" "" { target *-*-* } { 4 } } -// { dg-error "35: error: multiple types in one declaration" "" { target *-*-* } { 4 } } -// { dg-error "12: error: friend declaration does not name a class or function" "" { target *-*-* } { 4 } } +// { dg-error "19:using 'typename' outside of template" "" { target *-*-* } 4 } +// { dg-error "28:expected nested-name-specifier before 'struct'" "" { target *-*-* } 4 } +// { dg-error "35:multiple types in one declaration" "" { target *-*-* } 4 } +// { dg-error "12:friend declaration does not name a class or function" "" { target *-*-* } 4 } diff --git a/gcc/testsuite/g++.dg/parse/error9.C b/gcc/testsuite/g++.dg/parse/error9.C index c1be6979b47..b16c84e81ff 100644 --- a/gcc/testsuite/g++.dg/parse/error9.C +++ b/gcc/testsuite/g++.dg/parse/error9.C @@ -5,5 +5,5 @@ enum { FOO = 1, BAR = 2 }; int a[] = { FOO: 1, BAR: 2 }; // the following 2 column locations are still not accurate enough -// { dg-error "28: error: name 'FOO' used in a GNU-style designated initializer for an array" "" { target *-*-* } { 5 } } -// { dg-error "28: error: name 'BAR' used in a GNU-style designated initializer for an array" "" { target *-*-* } { 5 } } +// { dg-error "28:name 'FOO' used in a GNU-style designated initializer for an array" "" { target *-*-* } 5 } +// { dg-error "28:name 'BAR' used in a GNU-style designated initializer for an array" "" { target *-*-* } 5 } diff --git a/gcc/testsuite/g++.dg/parse/friend5.C b/gcc/testsuite/g++.dg/parse/friend5.C index 5e23f457829..ec134c26ea9 100644 --- a/gcc/testsuite/g++.dg/parse/friend5.C +++ b/gcc/testsuite/g++.dg/parse/friend5.C @@ -3,5 +3,6 @@ extern "C" struct A { friend void foo(int) {} // { dg-error "declaration" } - friend void foo() {} // { dg-error "foo" } + friend void foo() {} // { dg-error "foo" "err" } + // { dg-warning "already a friend" "warn" { target *-*-* } 6 } }; diff --git a/gcc/testsuite/g++.dg/parse/invalid-op1.C b/gcc/testsuite/g++.dg/parse/invalid-op1.C index 37e480983f8..0b75d079135 100644 --- a/gcc/testsuite/g++.dg/parse/invalid-op1.C +++ b/gcc/testsuite/g++.dg/parse/invalid-op1.C @@ -6,8 +6,9 @@ template <int I> struct A { template <int> struct B { - enum { e = I * A<I-1>::B }; // { dg-error "" } + enum { e = I * A<I-1>::B }; // { dg-error "dependent-name" "depname" } + // { dg-message "note" "note" { target *-*-* } 9 } }; }; -A<0>::B<0> a; // { dg-error "instantiated" } +A<0>::B<0> a; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/parse/missing-template1.C b/gcc/testsuite/g++.dg/parse/missing-template1.C index 40f8502be37..e5e03146dbb 100644 --- a/gcc/testsuite/g++.dg/parse/missing-template1.C +++ b/gcc/testsuite/g++.dg/parse/missing-template1.C @@ -12,7 +12,9 @@ template <typename T> struct A template <typename T> void foo() { - typedef typename A<T>::B<T>::X Y; // { dg-error "" } + typedef typename A<T>::B<T>::X Y; // { dg-error "non-template" "non" } + // { dg-error "not declare" "decl" { target *-*-* } 15 } + // { dg-message "note" "note" { target *-*-* } 15 } } void bar() diff --git a/gcc/testsuite/g++.dg/parse/non-dependent2.C b/gcc/testsuite/g++.dg/parse/non-dependent2.C index ef75c17aef3..4df2da7faf4 100644 --- a/gcc/testsuite/g++.dg/parse/non-dependent2.C +++ b/gcc/testsuite/g++.dg/parse/non-dependent2.C @@ -8,14 +8,14 @@ template <class T> struct Foo { int j; // we never see this one. - int k; // { dg-error "" "" } + int k; // { dg-error "Foo" "" } }; struct Baz { int j; - int k; // { dg-error "" "" } + int k; // { dg-error "candidates" "" } }; @@ -31,7 +31,7 @@ int main() Bar<int> bar; bar.baz (); - bar.foo (); // { dg-error "instantiated" "" } + bar.foo (); // { dg-message "instantiated" "" } return 0; } diff --git a/gcc/testsuite/g++.dg/parse/offsetof8.C b/gcc/testsuite/g++.dg/parse/offsetof8.C index 9add91e3768..e613ddcbb9a 100644 --- a/gcc/testsuite/g++.dg/parse/offsetof8.C +++ b/gcc/testsuite/g++.dg/parse/offsetof8.C @@ -12,5 +12,5 @@ struct B void foo() { - __builtin_offsetof(B, a[0]); /* { dg-error "error: cannot apply 'offsetof' when 'operator\\\[\\\]' is overloaded" } */ + __builtin_offsetof(B, a[0]); /* { dg-error "cannot apply 'offsetof' when 'operator\\\[\\\]' is overloaded" } */ } diff --git a/gcc/testsuite/g++.dg/parse/ret-type2.C b/gcc/testsuite/g++.dg/parse/ret-type2.C index 2e8fa36ec0c..35638c28afc 100644 --- a/gcc/testsuite/g++.dg/parse/ret-type2.C +++ b/gcc/testsuite/g++.dg/parse/ret-type2.C @@ -1,5 +1,10 @@ -struct S {} f(); // { dg-error "" } -struct T {} *g(); // { dg-error "" } -struct U {} h() {} // { dg-error "" } -struct V {} *i() {} // { dg-error "" } -struct W {} (*p) (); // { dg-error "" } +struct S {} f(); // { dg-error "return" "err" } +// { dg-message "note" "note" { target *-*-* } 1 } +struct T {} *g(); // { dg-error "return" } +// { dg-message "note" "note" { target *-*-* } 3 } +struct U {} h() {} // { dg-error "return" } +// { dg-message "note" "note" { target *-*-* } 5 } +struct V {} *i() {} // { dg-error "return" } +// { dg-message "note" "note" { target *-*-* } 7 } +struct W {} (*p) (); // { dg-error "return" } +// { dg-message "note" "note" { target *-*-* } 9 } diff --git a/gcc/testsuite/g++.dg/parse/specialization1.C b/gcc/testsuite/g++.dg/parse/specialization1.C index 7378570d65d..8a47f177205 100644 --- a/gcc/testsuite/g++.dg/parse/specialization1.C +++ b/gcc/testsuite/g++.dg/parse/specialization1.C @@ -3,4 +3,5 @@ // { dg-do compile } template <typename T> class A; -template <typename T> class A<T>::B; // { dg-error "declaration" } +template <typename T> class A<T>::B; // { dg-error "declaration" "err" } +// { dg-warning "declaration" "warn" { target *-*-* } 6 } diff --git a/gcc/testsuite/g++.dg/parse/template18.C b/gcc/testsuite/g++.dg/parse/template18.C index 532f9a48971..98209b2449c 100644 --- a/gcc/testsuite/g++.dg/parse/template18.C +++ b/gcc/testsuite/g++.dg/parse/template18.C @@ -49,4 +49,4 @@ template<int I> void f2() A::template B<I>::template b2<double>(0); } -template void f2<0>(); // { dg-error "instantiated" } +template void f2<0>(); // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/parse/template3.C b/gcc/testsuite/g++.dg/parse/template3.C index 290721eaa53..d10d46d8133 100644 --- a/gcc/testsuite/g++.dg/parse/template3.C +++ b/gcc/testsuite/g++.dg/parse/template3.C @@ -13,5 +13,7 @@ struct X : Outer<b>::template Inner<T> {}; template <bool b, typename T> -struct Y : Outer<b>::Inner<T> {}; // { dg-error "" "" } +struct Y : Outer<b>::Inner<T> {}; // { dg-error "used as template" "temp" } +// { dg-error "expected" "exp" { target *-*-* } 16 } +// { dg-message "note" "note" { target *-*-* } 16 } diff --git a/gcc/testsuite/g++.dg/parse/template9.C b/gcc/testsuite/g++.dg/parse/template9.C index 90ce9fe61ac..17b7da91f37 100644 --- a/gcc/testsuite/g++.dg/parse/template9.C +++ b/gcc/testsuite/g++.dg/parse/template9.C @@ -1,5 +1,6 @@ template <typename T> void f() { - g(); // { dg-error "" } - h(3); // { dg-error "" } + g(); // { dg-error "must be available" "err" } + // { dg-message "note" "note" { target *-*-* } 3 } + h(3); // { dg-error "must be available" } } diff --git a/gcc/testsuite/g++.dg/rtti/no-rtti.C b/gcc/testsuite/g++.dg/rtti/no-rtti.C index ca9cb72fdff..fdf2e605274 100644 --- a/gcc/testsuite/g++.dg/rtti/no-rtti.C +++ b/gcc/testsuite/g++.dg/rtti/no-rtti.C @@ -14,5 +14,5 @@ A* f(); int main() { - B* b = dynamic_cast<B*>(f()); // { dg-error "error: " } + B* b = dynamic_cast<B*>(f()); // { dg-error "" } } diff --git a/gcc/testsuite/g++.dg/tc1/dr108.C b/gcc/testsuite/g++.dg/tc1/dr108.C index 6b567a9fad5..43bae15eaf1 100644 --- a/gcc/testsuite/g++.dg/tc1/dr108.C +++ b/gcc/testsuite/g++.dg/tc1/dr108.C @@ -7,9 +7,7 @@ template <class T> struct S { typedef int X; }; struct I2 : public I1 { - X x; // { dg-error "does not name a type" } + X x; // { dg-error "does not name a type" "name" } + // { dg-message "note" "note" { target *-*-* } 10 } }; }; - -// Additional notes on the same line are allowed -// { dg-error "" "additional" { target *-*-* } 10 } diff --git a/gcc/testsuite/g++.dg/tc1/dr152.C b/gcc/testsuite/g++.dg/tc1/dr152.C index 1b6dd870d18..a635213b3a7 100644 --- a/gcc/testsuite/g++.dg/tc1/dr152.C +++ b/gcc/testsuite/g++.dg/tc1/dr152.C @@ -11,7 +11,8 @@ namespace N1 { int foo() { X x; - f(x); // { dg-error "" "" } + f(x); // { dg-error "matching" "matching" } + // { dg-error "initializing" "initializing" { target *-*-* } 14 } } } @@ -29,8 +30,9 @@ namespace N2 { int foo() { X<T> x; - N2::f(x); // { dg-error "" "" } + N2::f(x); // { dg-error "matching" "matching" } + // { dg-error "initializing " initializing" { target *-*-* } 33 } } - template int foo<float>(); // { dg-error "instantiated from here" } + template int foo<float>(); // { dg-message "instantiated from here" } } diff --git a/gcc/testsuite/g++.dg/tc1/dr166.C b/gcc/testsuite/g++.dg/tc1/dr166.C index cc4631a5f38..8c142906a56 100644 --- a/gcc/testsuite/g++.dg/tc1/dr166.C +++ b/gcc/testsuite/g++.dg/tc1/dr166.C @@ -32,7 +32,7 @@ namespace N { template <> void f<double>(double ) { M::B::x = 0; - M::f<long>(0); // { dg-error "instantiated" } + M::f<long>(0); // { dg-message "instantiated" } } void g(void) @@ -47,7 +47,7 @@ namespace N { template <> void f<int>(int ) { - N::f<long>(0); // { dg-error "instantiated" } + N::f<long>(0); // { dg-message "instantiated" } M::A::x = 0; M::B::x = 0; // { dg-error "within this context" } } diff --git a/gcc/testsuite/g++.dg/template/access11.C b/gcc/testsuite/g++.dg/template/access11.C index f061f6616eb..4c8dce521a8 100644 --- a/gcc/testsuite/g++.dg/template/access11.C +++ b/gcc/testsuite/g++.dg/template/access11.C @@ -21,4 +21,4 @@ template <typename T> struct X::Y { typename T::X x; // { dg-error "this context" } }; -template struct X::Y<A>; // { dg-error "instantiated" } +template struct X::Y<A>; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/access2.C b/gcc/testsuite/g++.dg/template/access2.C index 9da8ecf58bf..c5e3f110395 100644 --- a/gcc/testsuite/g++.dg/template/access2.C +++ b/gcc/testsuite/g++.dg/template/access2.C @@ -15,6 +15,6 @@ class B { int main() { - A<B> ab; // { dg-error "instantiated" } - ab.f(); // { dg-error "instantiated" } + A<B> ab; // { dg-message "instantiated" } + ab.f(); // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/access3.C b/gcc/testsuite/g++.dg/template/access3.C index e8ee1041d13..c7a155e8ba6 100644 --- a/gcc/testsuite/g++.dg/template/access3.C +++ b/gcc/testsuite/g++.dg/template/access3.C @@ -13,5 +13,5 @@ class B { int main() { - A<B> ab; // { dg-error "instantiated" } + A<B> ab; // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/access7.C b/gcc/testsuite/g++.dg/template/access7.C index 92d4c68db39..412ad00c0b7 100644 --- a/gcc/testsuite/g++.dg/template/access7.C +++ b/gcc/testsuite/g++.dg/template/access7.C @@ -14,5 +14,5 @@ typename A::T* f (A) { // { dg-error "this context" } } void g () { - f (S<int> ()); // { dg-error "context|instantiated" } + f (S<int> ()); // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/copy1.C b/gcc/testsuite/g++.dg/template/copy1.C index 3b45cc08386..e56545332ae 100644 --- a/gcc/testsuite/g++.dg/template/copy1.C +++ b/gcc/testsuite/g++.dg/template/copy1.C @@ -6,9 +6,9 @@ struct A { - A(A&); // { dg-error "candidate" "" } + A(A&); // { dg-message "candidate" } template <class T> A(T); }; -A a = 0; // { dg-error "no matching function|initializing" "" } +A a = 0; // { dg-error "no matching function" } diff --git a/gcc/testsuite/g++.dg/template/crash13.C b/gcc/testsuite/g++.dg/template/crash13.C index 50ec37f2eae..0518666d1e5 100644 --- a/gcc/testsuite/g++.dg/template/crash13.C +++ b/gcc/testsuite/g++.dg/template/crash13.C @@ -15,4 +15,4 @@ template <typename T> struct C X::Y; // { dg-error "not a base type" } }; -C<void> c; // { dg-error "instantiated" } +C<void> c; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/crash37.C b/gcc/testsuite/g++.dg/template/crash37.C index 0d837bd132d..8af516018f7 100644 --- a/gcc/testsuite/g++.dg/template/crash37.C +++ b/gcc/testsuite/g++.dg/template/crash37.C @@ -11,7 +11,7 @@ struct coperator_stack struct helper {}; template<class F> -void bla(F f) // { dg-error "candidates" } +void bla(F f) // { dg-message "candidates" } { } @@ -20,7 +20,7 @@ struct definition { definition() { - bla(coperator_stack::push3<helper>); // { dg-error "" } + bla(coperator_stack::push3<helper>); // { dg-error "matching" } } }; diff --git a/gcc/testsuite/g++.dg/template/crash40.C b/gcc/testsuite/g++.dg/template/crash40.C index 716b4a26137..45123dd0d05 100644 --- a/gcc/testsuite/g++.dg/template/crash40.C +++ b/gcc/testsuite/g++.dg/template/crash40.C @@ -7,4 +7,4 @@ template<typename T> void foo() T::~T(); // { dg-error "member" } } -template void foo<A>(); // { dg-error "instantiated" } +template void foo<A>(); // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/crash58.C b/gcc/testsuite/g++.dg/template/crash58.C index af2172c6732..5194ee263c0 100644 --- a/gcc/testsuite/g++.dg/template/crash58.C +++ b/gcc/testsuite/g++.dg/template/crash58.C @@ -1,6 +1,6 @@ //PR 26938 -template<int, int = 0> struct A; // { dg-error "previous declaration" } +template<int, int = 0> struct A; // { dg-message "previous declaration" } template<int> struct A // { dg-error "template" } { diff --git a/gcc/testsuite/g++.dg/template/crash81.C b/gcc/testsuite/g++.dg/template/crash81.C index f2b76744f33..849470a5e88 100644 --- a/gcc/testsuite/g++.dg/template/crash81.C +++ b/gcc/testsuite/g++.dg/template/crash81.C @@ -2,5 +2,7 @@ struct A { - template<T::X> struct X; // { dg-error "error: 'T' has not been declared|error: declaration of 'template<int X> struct A::X'|error: shadows template parm 'int X'" } + template<T::X> struct X; // { dg-error "'T' has not been declared" "T" } + // { dg-error "declaration of 'template<int X> struct A::X'" "A::X" { target *-*-* } 5 } + // { dg-error "shadows template parm 'int X'" "shadow" { target *-*-* } 5 } }; diff --git a/gcc/testsuite/g++.dg/template/ctor5.C b/gcc/testsuite/g++.dg/template/ctor5.C index 18e55d179fa..6938b36b62f 100644 --- a/gcc/testsuite/g++.dg/template/ctor5.C +++ b/gcc/testsuite/g++.dg/template/ctor5.C @@ -5,4 +5,4 @@ template<typename T> struct A A() : T(0) {} // { dg-error "base" } }; -A<int*> a; // { dg-error "instantiated" } +A<int*> a; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/dependent-expr5.C b/gcc/testsuite/g++.dg/template/dependent-expr5.C index 023f433da5d..64e86c7289f 100644 --- a/gcc/testsuite/g++.dg/template/dependent-expr5.C +++ b/gcc/testsuite/g++.dg/template/dependent-expr5.C @@ -7,14 +7,14 @@ template<class F> void bind(F f) {} template<class F> void bindm(F f) {} -template<class F, class T> void bindm(F (T::*f)(void)) {} // { dg-error "note" } +template<class F, class T> void bindm(F (T::*f)(void)) {} // { dg-message "note" } template<class F> void bindn(F f) {} template<class F, class T> void bindn(F (*f)(T)) {} template<class F> void bindb(F f) {} -template<class F, class T> void bindb(F (*f)(T)) {} // { dg-error "note" } -template<class F, class T> void bindb(F (T::*f)(void)) {} // { dg-error "note" } +template<class F, class T> void bindb(F (*f)(T)) {} // { dg-message "note" } +template<class F, class T> void bindb(F (T::*f)(void)) {} // { dg-message "note" } struct foo { static int baist; diff --git a/gcc/testsuite/g++.dg/template/eh2.C b/gcc/testsuite/g++.dg/template/eh2.C index 8ec767d3933..d2c049c8a06 100644 --- a/gcc/testsuite/g++.dg/template/eh2.C +++ b/gcc/testsuite/g++.dg/template/eh2.C @@ -7,4 +7,4 @@ template<typename T> struct A void foo() throw(typename T::X); // { dg-error "not a class" } }; -A<void> a; // { dg-error "instantiated" } +A<void> a; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/error2.C b/gcc/testsuite/g++.dg/template/error2.C index 0f3e975cd4f..86486a2e7f2 100644 --- a/gcc/testsuite/g++.dg/template/error2.C +++ b/gcc/testsuite/g++.dg/template/error2.C @@ -7,22 +7,24 @@ template<class T> struct X { - T m; // { dg-error "" "" } + T m; // { dg-error "as type 'void'" "void" } + // { dg-error "incomplete type" "incomplate" { target *-*-* } 10 } + // { dg-error "invalid" "invalid" { target *-*-* } 10 } }; template<class T > struct Derived { class Nested : public X<T> - { // { dg-error "instantiated" "" } + { // { dg-message "instantiated" "" } }; - Nested m; // { dg-error "instantiated" "" } + Nested m; // { dg-message "instantiated" "" } void Foo (); }; void Foo (Derived<void> &x) { - x.Foo (); // { dg-error "instantiated" "" } + x.Foo (); // { dg-message "instantiated" "" } } diff --git a/gcc/testsuite/g++.dg/template/error33.C b/gcc/testsuite/g++.dg/template/error33.C index e1ac82210bf..b6a2a8ae820 100644 --- a/gcc/testsuite/g++.dg/template/error33.C +++ b/gcc/testsuite/g++.dg/template/error33.C @@ -6,6 +6,7 @@ template<int> struct A A() { ++i; } }; -template<int> int A<0>::i(0); // { dg-error "template" } +template<int> int A<0>::i(0); // { dg-error "template" "error" } +// { dg-message "note" "note" { target *-*-* } 9 } A<0> a; diff --git a/gcc/testsuite/g++.dg/template/error4.C b/gcc/testsuite/g++.dg/template/error4.C index a3196ee8e77..12942fcb773 100644 --- a/gcc/testsuite/g++.dg/template/error4.C +++ b/gcc/testsuite/g++.dg/template/error4.C @@ -5,4 +5,5 @@ template<class T> struct C1 }; template<class T, class U> -void foo(typename C1<T>::C2<U>::Type *) { } // { dg-error "template" } +void foo(typename C1<T>::C2<U>::Type *) { } // { dg-error "template" "error " } +// { dg-message "note" "note" { target *-*-* } 8 } diff --git a/gcc/testsuite/g++.dg/template/friend31.C b/gcc/testsuite/g++.dg/template/friend31.C index 222ce238d78..5e60540b693 100644 --- a/gcc/testsuite/g++.dg/template/friend31.C +++ b/gcc/testsuite/g++.dg/template/friend31.C @@ -5,7 +5,7 @@ // PR c++/15410: Declaration of friend class template with wrong // template parameter. -template <typename T, typename U> struct F; // { dg-error "previous declaration" } +template <typename T, typename U> struct F; // { dg-message "previous declaration" } class W { diff --git a/gcc/testsuite/g++.dg/template/friend32.C b/gcc/testsuite/g++.dg/template/friend32.C index 4ce2ba3f2cc..81e6390d798 100644 --- a/gcc/testsuite/g++.dg/template/friend32.C +++ b/gcc/testsuite/g++.dg/template/friend32.C @@ -17,5 +17,5 @@ template<class T> class B int f () { - B<int> b; // { dg-error "instantiated" } + B<int> b; // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/friend44.C b/gcc/testsuite/g++.dg/template/friend44.C index 04d68c3e0f0..814fec1d5f7 100644 --- a/gcc/testsuite/g++.dg/template/friend44.C +++ b/gcc/testsuite/g++.dg/template/friend44.C @@ -3,7 +3,7 @@ template<int> struct A { - friend int foo(); // { dg-error "14: error: new declaration" } + friend int foo(); // { dg-error "14:new declaration" } }; -void foo() { A<0> a; } // { dg-error "6: error: ambiguates old declaration" } +void foo() { A<0> a; } // { dg-error "6:ambiguates old declaration" } diff --git a/gcc/testsuite/g++.dg/template/instantiate1.C b/gcc/testsuite/g++.dg/template/instantiate1.C index 0c739d0f615..828f2e9c564 100644 --- a/gcc/testsuite/g++.dg/template/instantiate1.C +++ b/gcc/testsuite/g++.dg/template/instantiate1.C @@ -9,11 +9,11 @@ template <class T> struct X { }; template <class T> struct Y { - X<T> x; // { dg-error "instantiated" } + X<T> x; // { dg-message "instantiated" } }; template <class T> struct Z { // { dg-error "declaration" } - Y<Z<T> > y; // { dg-error "instantiated" } + Y<Z<T> > y; // { dg-message "instantiated" } }; struct ZZ : Z<int> diff --git a/gcc/testsuite/g++.dg/template/instantiate3.C b/gcc/testsuite/g++.dg/template/instantiate3.C index 4644fd02b55..de3d3a084c9 100644 --- a/gcc/testsuite/g++.dg/template/instantiate3.C +++ b/gcc/testsuite/g++.dg/template/instantiate3.C @@ -14,4 +14,4 @@ struct ACE_Cleanup_Adapter TYPE object_; // { dg-error "incomplete type" } }; -template class ACE_Cleanup_Adapter<ACE_Null_Mutex>; // { dg-error "instantiated from here" } +template class ACE_Cleanup_Adapter<ACE_Null_Mutex>; // { dg-message "instantiated from here" } diff --git a/gcc/testsuite/g++.dg/template/instantiate5.C b/gcc/testsuite/g++.dg/template/instantiate5.C index 8d076356294..70ed2b059f9 100644 --- a/gcc/testsuite/g++.dg/template/instantiate5.C +++ b/gcc/testsuite/g++.dg/template/instantiate5.C @@ -13,7 +13,7 @@ int baz() { return A<0>::i; } struct B { - static void foo (int); // { dg-error "candidates" } + static void foo (int); // { dg-message "candidates" } }; template <typename T> struct C @@ -21,4 +21,4 @@ template <typename T> struct C virtual void bar() const { T::foo(); } // { dg-error "no matching function" } }; -C<B> c; // { dg-error "instantiated" } +C<B> c; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/instantiate7.C b/gcc/testsuite/g++.dg/template/instantiate7.C index 14a1a33cf21..2e54106ffdd 100644 --- a/gcc/testsuite/g++.dg/template/instantiate7.C +++ b/gcc/testsuite/g++.dg/template/instantiate7.C @@ -7,4 +7,4 @@ template<typename T> struct A template<T&> struct B; // { dg-error "reference to void" } }; -A<void> a; // { dg-error "instantiated" } +A<void> a; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/local6.C b/gcc/testsuite/g++.dg/template/local6.C index 3472f59a7d7..7094e7480d8 100644 --- a/gcc/testsuite/g++.dg/template/local6.C +++ b/gcc/testsuite/g++.dg/template/local6.C @@ -1,10 +1,10 @@ template <class T> struct PCVector2 -{ // { dg-error "" } +{ // { dg-message "candidates" } template <class T2> PCVector2(const PCVector2<T> &cv) ; PCVector2<T> operator- (const PCVector2<T> &ov) const { - return PCVector2<T>(ov.xFIELD, ov.yFIELD); // { dg-error "" } + return PCVector2<T>(ov.xFIELD, ov.yFIELD); // { dg-error "matching" } } T xFIELD, yFIELD; @@ -15,5 +15,5 @@ void findIntersection( PCVector2<double>& p0, PCVector2<double>& p1); void findIntersection( PCVector2<double>& p0, PCVector2<double>& p1) { - PCVector2<double> e = p1 - p0; // { dg-error "" } + PCVector2<double> e = p1 - p0; // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/lookup2.C b/gcc/testsuite/g++.dg/template/lookup2.C index 493b807aec9..15ab352682f 100644 --- a/gcc/testsuite/g++.dg/template/lookup2.C +++ b/gcc/testsuite/g++.dg/template/lookup2.C @@ -14,5 +14,5 @@ template <typename T> void Bar () void Foo () { - Bar<B> (); // { dg-error "instantiated" "" } + Bar<B> (); // { dg-message "instantiated" "" } } diff --git a/gcc/testsuite/g++.dg/template/member5.C b/gcc/testsuite/g++.dg/template/member5.C index 45dcd6c6c66..ba6a9705bee 100644 --- a/gcc/testsuite/g++.dg/template/member5.C +++ b/gcc/testsuite/g++.dg/template/member5.C @@ -27,6 +27,7 @@ struct S { template< typename _A > void S::foo() {} -template void S::foo< 0 >(); // { dg-error "no definition available|instantiated from here" } +template void S::foo< 0 >(); // { dg-error "no definition available" "no def" } + // { dg-message "instantiated" "instantiated" { target *-*-* } 30 } } diff --git a/gcc/testsuite/g++.dg/template/memfriend15.C b/gcc/testsuite/g++.dg/template/memfriend15.C index 08db7aef655..c12ec4b5af2 100644 --- a/gcc/testsuite/g++.dg/template/memfriend15.C +++ b/gcc/testsuite/g++.dg/template/memfriend15.C @@ -30,5 +30,5 @@ template<class T> void A<T>::B2::f() int main() { A<int>::B2 b1; - b1.f(); // { dg-error "instantiated" } + b1.f(); // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/memfriend16.C b/gcc/testsuite/g++.dg/template/memfriend16.C index a4eeafd79fe..2827ef3f7a1 100644 --- a/gcc/testsuite/g++.dg/template/memfriend16.C +++ b/gcc/testsuite/g++.dg/template/memfriend16.C @@ -30,5 +30,5 @@ template<class T> template <class U> void A<T>::B2<U>::f() int main() { A<int>::B2<int> b1; - b1.f(); // { dg-error "instantiated" } + b1.f(); // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/memfriend17.C b/gcc/testsuite/g++.dg/template/memfriend17.C index fd26bc0171e..5e163fa477a 100644 --- a/gcc/testsuite/g++.dg/template/memfriend17.C +++ b/gcc/testsuite/g++.dg/template/memfriend17.C @@ -43,4 +43,4 @@ void A<T>::B::func2(void) (void)F2<T*>::foo; } -template class A<int>; // { dg-error "instantiated" } +template class A<int>; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/memfriend7.C b/gcc/testsuite/g++.dg/template/memfriend7.C index aed029500af..1583646c0df 100644 --- a/gcc/testsuite/g++.dg/template/memfriend7.C +++ b/gcc/testsuite/g++.dg/template/memfriend7.C @@ -116,18 +116,18 @@ template <> void A<char>::j<0>() int main() { A<int *> a1; - a1.f(0); // { dg-error "instantiated" } - a1.g<char>(); // { dg-error "instantiated" } - a1.g<int>(); // { dg-error "instantiated" } - a1.h(); // { dg-error "instantiated" } - a1.i('a'); // { dg-error "instantiated" } - a1.j<1>(); // { dg-error "instantiated" } + a1.f(0); // { dg-message "instantiated" } + a1.g<char>(); // { dg-message "instantiated" } + a1.g<int>(); // { dg-message "instantiated" } + a1.h(); // { dg-message "instantiated" } + a1.i('a'); // { dg-message "instantiated" } + a1.j<1>(); // { dg-message "instantiated" } A<char> a2; a2.f(0); - a2.g<char>(); // { dg-error "instantiated" } + a2.g<char>(); // { dg-message "instantiated" } a2.g<int>(); a2.h(); a2.i('a'); - a2.j<1>(); // { dg-error "instantiated" } + a2.j<1>(); // { dg-message "instantiated" } a2.j<0>(); } diff --git a/gcc/testsuite/g++.dg/template/meminit1.C b/gcc/testsuite/g++.dg/template/meminit1.C index 077bf60cb80..6fd024a2633 100644 --- a/gcc/testsuite/g++.dg/template/meminit1.C +++ b/gcc/testsuite/g++.dg/template/meminit1.C @@ -5,4 +5,4 @@ struct S S() : S() {} // { dg-error "base" } }; -S<int> s; // { dg-error "instantiated" } +S<int> s; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/nested3.C b/gcc/testsuite/g++.dg/template/nested3.C index 0094783166a..1ae4bf7647d 100644 --- a/gcc/testsuite/g++.dg/template/nested3.C +++ b/gcc/testsuite/g++.dg/template/nested3.C @@ -5,24 +5,27 @@ class A { int _k; }; T1 _t1; - T2 _t2; // { dg-error "instantiated" } + T2 _t2; // { dg-message "instantiated" } }; template <class U> -class B { // { dg-error "" } +class B { // { dg-error "declaration" } class SubB1 { - B _i; // { dg-error "" } + B _i; // { dg-error "incomplete type" } }; class SubB2 { int _j; }; - A<U,SubB1>::SubA<SubB2> _a; // { dg-error "" } + A<U,SubB1>::SubA<SubB2> _a; // { dg-error "not a base type" "not base" } + // { dg-message "note" "note" { target *-*-* } 20 } + // { dg-message "instantiated" "inst" { target *-*-* } 20 } + // { dg-error "non-template" "non-template" { target *-*-* } 20 } }; int main() { - B<char> objB; // { dg-error "instantiated" } + B<char> objB; // { dg-message "instantiated" } return 0; } diff --git a/gcc/testsuite/g++.dg/template/new3.C b/gcc/testsuite/g++.dg/template/new3.C index c6c108903e1..50be5f1c3ba 100644 --- a/gcc/testsuite/g++.dg/template/new3.C +++ b/gcc/testsuite/g++.dg/template/new3.C @@ -1,4 +1,4 @@ -extern void *operator new(__SIZE_TYPE__); // { dg-error "candidate" } +extern void *operator new(__SIZE_TYPE__); // { dg-message "candidate" } template <class T > struct C diff --git a/gcc/testsuite/g++.dg/template/non-type-template-argument-1.C b/gcc/testsuite/g++.dg/template/non-type-template-argument-1.C index 9d400d5b104..41243649a11 100644 --- a/gcc/testsuite/g++.dg/template/non-type-template-argument-1.C +++ b/gcc/testsuite/g++.dg/template/non-type-template-argument-1.C @@ -9,4 +9,4 @@ template <typename T> struct D C<T::X> c; // { dg-error "parsed as a non-type|if a type is meant" } }; -D<B> d; // { dg-error "instantiated from here" } +D<B> d; // { dg-message "instantiated from here" } diff --git a/gcc/testsuite/g++.dg/template/nontype12.C b/gcc/testsuite/g++.dg/template/nontype12.C index 0200e870b95..a290ec337ea 100644 --- a/gcc/testsuite/g++.dg/template/nontype12.C +++ b/gcc/testsuite/g++.dg/template/nontype12.C @@ -9,7 +9,7 @@ template<typename T> struct A }; A<char> a1; -A<double> a2; // { dg-error "instantiated" } +A<double> a2; // { dg-message "instantiated" } template<typename T> struct B { @@ -27,9 +27,9 @@ template<typename T> struct C template<T> int foo(); // { dg-error "double" } }; -template<typename T> int baz(T) { C<T> c; } // { dg-error "instantiated" } +template<typename T> int baz(T) { C<T> c; } // { dg-message "instantiated" } void foobar() { - baz(1.2); // { dg-error "instantiated" } + baz(1.2); // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/nontype13.C b/gcc/testsuite/g++.dg/template/nontype13.C index 9b76d1aa65a..6fffb8d8e53 100644 --- a/gcc/testsuite/g++.dg/template/nontype13.C +++ b/gcc/testsuite/g++.dg/template/nontype13.C @@ -24,6 +24,6 @@ struct Dummy int main() { Dummy<int> d; - d.tester<true> (); // { dg-error "instantiated" } + d.tester<true> (); // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/nontype6.C b/gcc/testsuite/g++.dg/template/nontype6.C index 298ce82591c..97b093ae551 100644 --- a/gcc/testsuite/g++.dg/template/nontype6.C +++ b/gcc/testsuite/g++.dg/template/nontype6.C @@ -12,8 +12,8 @@ struct A template <class T> void func(void) { - (void)A<T>::type(); // { dg-error "if a type is meant" } -// { dg-error "parsed as a non-type" "non-type" { target *-*-* } 15 } + (void)A<T>::type(); // { dg-error "non-type" "non-type" } +// { dg-message "if a type" "note" { target *-*-* } 15 } } -template void func<float>(void); // { dg-error "instantiated from here" } +template void func<float>(void); // { dg-message "instantiated from here" } diff --git a/gcc/testsuite/g++.dg/template/overload9.C b/gcc/testsuite/g++.dg/template/overload9.C index bc73c41fc88..cef8ebe9fc8 100644 --- a/gcc/testsuite/g++.dg/template/overload9.C +++ b/gcc/testsuite/g++.dg/template/overload9.C @@ -7,7 +7,7 @@ template <typename T> A<T>& operator<<(A<T>&, const B<T>&); template <typename T> struct A { - A<T>& operator<<(A<T>& (*)(A<T>&)); // { dg-error "candidate" } + A<T>& operator<<(A<T>& (*)(A<T>&)); // { dg-message "candidate" } }; template <typename T> A<T>& foo(A<T>&); diff --git a/gcc/testsuite/g++.dg/template/ptrmem15.C b/gcc/testsuite/g++.dg/template/ptrmem15.C index 553d2953fd9..b52ff89174a 100644 --- a/gcc/testsuite/g++.dg/template/ptrmem15.C +++ b/gcc/testsuite/g++.dg/template/ptrmem15.C @@ -6,4 +6,4 @@ template<typename T> struct A T A::* p; // { dg-error "void" } }; -A<void> a; // { dg-error "instantiated" } +A<void> a; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/ptrmem17.C b/gcc/testsuite/g++.dg/template/ptrmem17.C index 154f17a8d86..a79e3c882fa 100644 --- a/gcc/testsuite/g++.dg/template/ptrmem17.C +++ b/gcc/testsuite/g++.dg/template/ptrmem17.C @@ -7,4 +7,4 @@ template<int> struct A ~A() { &A::i; } // { dg-error "reference" } }; -A<0> a; // { dg-error "instantiated" } +A<0> a; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/ptrmem4.C b/gcc/testsuite/g++.dg/template/ptrmem4.C index db80eecf830..0ea73a13106 100644 --- a/gcc/testsuite/g++.dg/template/ptrmem4.C +++ b/gcc/testsuite/g++.dg/template/ptrmem4.C @@ -6,7 +6,7 @@ // Pointer to member function template argument deduction ICE. -template <class CONT> void queryAliases(CONT& fill_me); // { dg-error "candidates" } +template <class CONT> void queryAliases(CONT& fill_me); // { dg-message "candidates" } struct SpyExample { @@ -16,5 +16,5 @@ struct SpyExample void SpyExample::ready() { - queryAliases(inputs); // { dg-error "" } + queryAliases(inputs); // { dg-error "matching" } } diff --git a/gcc/testsuite/g++.dg/template/ptrmem6.C b/gcc/testsuite/g++.dg/template/ptrmem6.C index 0d7dec21981..a355cfe8939 100644 --- a/gcc/testsuite/g++.dg/template/ptrmem6.C +++ b/gcc/testsuite/g++.dg/template/ptrmem6.C @@ -4,7 +4,7 @@ void g(int S::**); template <typename T> void f (int T::* volatile *p) { - g(p); // { dg-error "" } + g(p); // { dg-error "conversion" } } -template void f(int S::* volatile *); // { dg-error "instantiated" } +template void f(int S::* volatile *); // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/ptrmem8.C b/gcc/testsuite/g++.dg/template/ptrmem8.C index 588ac1fc50a..e25b4084129 100644 --- a/gcc/testsuite/g++.dg/template/ptrmem8.C +++ b/gcc/testsuite/g++.dg/template/ptrmem8.C @@ -15,6 +15,10 @@ template <int (D::*fun)() const> int Get(); int main () { - Get<&B::I>(); // { dg-error "" } - Get<&D::I>(); // { dg-error "" } + Get<&B::I>(); // { dg-error "not a valid template argument" "not valid" } + // { dg-error "no match" "no match" { target *-*-* } 18 } + // { dg-message "note" "note" { target *-*-* } 18 } + Get<&D::I>(); // { dg-error "not a valid template argument" "not valid" } + // { dg-error "no match" "no match" { target *-*-* } 21 } + // { dg-message "note" "note" { target *-*-* } 21 } } diff --git a/gcc/testsuite/g++.dg/template/qualified-id1.C b/gcc/testsuite/g++.dg/template/qualified-id1.C index 967764281c0..602be5bf154 100644 --- a/gcc/testsuite/g++.dg/template/qualified-id1.C +++ b/gcc/testsuite/g++.dg/template/qualified-id1.C @@ -16,11 +16,12 @@ template <> struct A::B<false> {}; template <typename T> void foo() { - T::C (); // { dg-error "parsed as a non-type|if a type is meant" "" } - T::template B<false>(); // { dg-error "parsed as a non-type|if a type is meant" "" } + T::C (); // { dg-error "parsed as a non-type|if a type is meant" } + T::template B<false>(); // { dg-error "parsed as a non-type" "non-type" } + // { dg-message "if a type" "if a type" { target *-*-* } 20 } } void bar() { - foo<A>(); // { dg-error "instantiated" "" } + foo<A>(); // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/qualttp20.C b/gcc/testsuite/g++.dg/template/qualttp20.C index ae20d762902..d65fd1b61e7 100644 --- a/gcc/testsuite/g++.dg/template/qualttp20.C +++ b/gcc/testsuite/g++.dg/template/qualttp20.C @@ -32,5 +32,5 @@ template <typename T> struct B2 : T myconst b; }; -B1<AS> b1; // { dg-error "instantiated" "" } +B1<AS> b1; // { dg-message "instantiated" "" } B2<AS> b2; diff --git a/gcc/testsuite/g++.dg/template/qualttp3.C b/gcc/testsuite/g++.dg/template/qualttp3.C index 929fa628ca7..4b9ffe34ea6 100644 --- a/gcc/testsuite/g++.dg/template/qualttp3.C +++ b/gcc/testsuite/g++.dg/template/qualttp3.C @@ -14,10 +14,10 @@ template <template <class> class TT> struct X template <class T> struct C { - X<T::template B> x; // { dg-error "type" "" } + X<T::template B> x; // { dg-error "type" } }; int main() { - C<A> c; // { dg-error "instantiated" } + C<A> c; // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/qualttp4.C b/gcc/testsuite/g++.dg/template/qualttp4.C index 04335f16cc8..c55ce2d3750 100644 --- a/gcc/testsuite/g++.dg/template/qualttp4.C +++ b/gcc/testsuite/g++.dg/template/qualttp4.C @@ -10,7 +10,7 @@ struct A template <template <class, class> class TT> // { dg-error "provided" } struct X { - TT<int> y; // { dg-error "number|type" } + TT<int> y; // { dg-error "number" } }; template <class T> struct C @@ -20,5 +20,5 @@ template <class T> struct C int main() { - C<A> c; // { dg-error "instantiated" } + C<A> c; // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/qualttp5.C b/gcc/testsuite/g++.dg/template/qualttp5.C index 7ac7a315abb..7d1062e3a8f 100644 --- a/gcc/testsuite/g++.dg/template/qualttp5.C +++ b/gcc/testsuite/g++.dg/template/qualttp5.C @@ -4,7 +4,7 @@ template <class U> struct A { - template <class T> class B {}; // { dg-error "candidates" } + template <class T> class B {}; // { dg-message "candidates" } }; template <template <class> class TT> void f() @@ -15,11 +15,11 @@ template <template <class> class TT> void f() template <class T> struct C { - void g() { f<A<T>::template B>(); } // { dg-error "instantiated" } + void g() { f<A<T>::template B>(); } // { dg-message "instantiated" } }; int main() { C<int> c; - c.g(); // { dg-error "instantiated" } + c.g(); // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/qualttp6.C b/gcc/testsuite/g++.dg/template/qualttp6.C index 046895830d8..aa1a4670033 100644 --- a/gcc/testsuite/g++.dg/template/qualttp6.C +++ b/gcc/testsuite/g++.dg/template/qualttp6.C @@ -12,4 +12,4 @@ template <class T> struct D { struct E { }; -D<E> d; // { dg-error "instantiated" } +D<E> d; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/qualttp7.C b/gcc/testsuite/g++.dg/template/qualttp7.C index f6573ac5d95..f37123e778f 100644 --- a/gcc/testsuite/g++.dg/template/qualttp7.C +++ b/gcc/testsuite/g++.dg/template/qualttp7.C @@ -9,4 +9,4 @@ template <class T> struct D { C<T::template B> c; // { dg-error "no class template" } }; -D<int> d; // { dg-error "instantiated" } +D<int> d; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/qualttp8.C b/gcc/testsuite/g++.dg/template/qualttp8.C index da67a09fc46..5f55e60b316 100644 --- a/gcc/testsuite/g++.dg/template/qualttp8.C +++ b/gcc/testsuite/g++.dg/template/qualttp8.C @@ -14,4 +14,4 @@ struct E { template <class T> class B {}; // { dg-error "private" } }; -D<E> d; // { dg-error "instantiated" } +D<E> d; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/recurse.C b/gcc/testsuite/g++.dg/template/recurse.C index ce4c9268cfe..25552d05ef9 100644 --- a/gcc/testsuite/g++.dg/template/recurse.C +++ b/gcc/testsuite/g++.dg/template/recurse.C @@ -5,8 +5,9 @@ template <int I> struct F { int operator()() { - F<I+1> f; // { dg-error "" "" } - return f()*I; // { dg-error "" "" } + F<I+1> f; // { dg-error "incomplete type" "incomplete" } + // { dg-error "exceeds maximum" "exceeds" { target *-*-* } 8 } + return f()*I; // { dg-message "instantiated" "recurse" } } }; @@ -18,5 +19,8 @@ template <> struct F<52> int main () { F<1> f; - return f(); // { dg-error "instantiate" "excessive recursion" } + return f(); // { dg-message "instantiated from here" "excessive recursion" } } + +// Ignore excess messages from recursion. +// { dg-prune-output "instantiated from 'int" } diff --git a/gcc/testsuite/g++.dg/template/sfinae10.C b/gcc/testsuite/g++.dg/template/sfinae10.C index e0680db65a6..f44c4458f35 100644 --- a/gcc/testsuite/g++.dg/template/sfinae10.C +++ b/gcc/testsuite/g++.dg/template/sfinae10.C @@ -169,13 +169,13 @@ STATIC_ASSERT((has_postdecrement<X>::value)); STATIC_ASSERT((!has_postdecrement<Y>::value)); // Check for private members -STATIC_ASSERT((has_unary_plus<Z>::value)); // { dg-error "instantiated from here" } -STATIC_ASSERT((is_negatable<Z>::value)); // { dg-error "instantiated from here" } -STATIC_ASSERT((is_dereferenceable<Z>::value)); // { dg-error "instantiated from here" } -STATIC_ASSERT((has_bitwise_not<Z>::value)); // { dg-error "instantiated from here" } -STATIC_ASSERT((has_truth_not<Z>::value)); // { dg-error "instantiated from here" } -STATIC_ASSERT((has_preincrement<Z>::value)); // { dg-error "instantiated from here" } -STATIC_ASSERT((has_predecrement<Z>::value)); // { dg-error "instantiated from here" } -STATIC_ASSERT((has_postincrement<Z>::value)); // { dg-error "instantiated from here" } -STATIC_ASSERT((has_postdecrement<Z>::value)); // { dg-error "instantiated from here" } +STATIC_ASSERT((has_unary_plus<Z>::value)); // { dg-message "instantiated from here" } +STATIC_ASSERT((is_negatable<Z>::value)); // { dg-message "instantiated from here" } +STATIC_ASSERT((is_dereferenceable<Z>::value)); // { dg-message "instantiated from here" } +STATIC_ASSERT((has_bitwise_not<Z>::value)); // { dg-message "instantiated from here" } +STATIC_ASSERT((has_truth_not<Z>::value)); // { dg-message "instantiated from here" } +STATIC_ASSERT((has_preincrement<Z>::value)); // { dg-message "instantiated from here" } +STATIC_ASSERT((has_predecrement<Z>::value)); // { dg-message "instantiated from here" } +STATIC_ASSERT((has_postincrement<Z>::value)); // { dg-message "instantiated from here" } +STATIC_ASSERT((has_postdecrement<Z>::value)); // { dg-message "instantiated from here" } diff --git a/gcc/testsuite/g++.dg/template/sfinae3.C b/gcc/testsuite/g++.dg/template/sfinae3.C index 8d141ea0ad1..5799a364e42 100644 --- a/gcc/testsuite/g++.dg/template/sfinae3.C +++ b/gcc/testsuite/g++.dg/template/sfinae3.C @@ -9,7 +9,7 @@ template<typename> struct A template<typename> struct B { - B(const B&); // { dg-error "candidate" } + B(const B&); // { dg-message "candidate" } typedef typename A<char[A<B>::i]>::X Y; template<typename T> B(T, Y); // { dg-error "call" } }; diff --git a/gcc/testsuite/g++.dg/template/spec22.C b/gcc/testsuite/g++.dg/template/spec22.C index a091b0f36bf..7e627f16763 100644 --- a/gcc/testsuite/g++.dg/template/spec22.C +++ b/gcc/testsuite/g++.dg/template/spec22.C @@ -8,11 +8,11 @@ template <typename T> class srp; template <typename T> struct ptr { - template <typename U> ptr(const srp<U> &other); // { dg-error "ptr<T>::ptr" } + template <typename U> ptr(const srp<U> &other); // { dg-message "ptr<T>::ptr" } }; template <typename T> struct srp { - template <typename U> operator ptr<U>(void) const; // { dg-error "srp<T>::operator" } + template <typename U> operator ptr<U>(void) const; // { dg-message "srp<T>::operator" } }; ptr<int> parent_get() { diff --git a/gcc/testsuite/g++.dg/template/spec23.C b/gcc/testsuite/g++.dg/template/spec23.C index 00272ad4995..1c027fa4388 100644 --- a/gcc/testsuite/g++.dg/template/spec23.C +++ b/gcc/testsuite/g++.dg/template/spec23.C @@ -8,18 +8,18 @@ struct Foo { template <typename T> - Foo (const T &); // { dg-error "T = Bar" "" } + Foo (const T &); // { dg-message "T = Bar" } }; struct Bar { template <typename T> - operator T () const; // { dg-error "T = Foo" "" } + operator T () const; // { dg-message "T = Foo" } }; Foo Quux (Bar const &b) { - return b; // { dg-error "ambiguous" "" } + return b; // { dg-error "ambiguous" } } diff --git a/gcc/testsuite/g++.dg/template/static9.C b/gcc/testsuite/g++.dg/template/static9.C index 4575708e4e5..a98144185bb 100644 --- a/gcc/testsuite/g++.dg/template/static9.C +++ b/gcc/testsuite/g++.dg/template/static9.C @@ -2,7 +2,8 @@ template<typename T> struct A { - static const T i = 0; // { dg-error "" } + static const T i = 0; // { dg-error "declared void" "void" } + // { dg-error "invalid" "invalid" { target *-*-* } 5 } }; -A<void> a; // { dg-error "" } +A<void> a; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/template-id-2.C b/gcc/testsuite/g++.dg/template/template-id-2.C index 1bc378c14e6..6d37350e93b 100644 --- a/gcc/testsuite/g++.dg/template/template-id-2.C +++ b/gcc/testsuite/g++.dg/template/template-id-2.C @@ -18,5 +18,5 @@ template<> struct A<void> void bar() { A<void> a; - a.foo<int>(); // { dg-error "instantiated" } + a.foo<int>(); // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/typename2.C b/gcc/testsuite/g++.dg/template/typename2.C index 644c62a7f4c..b0e16d46434 100644 --- a/gcc/testsuite/g++.dg/template/typename2.C +++ b/gcc/testsuite/g++.dg/template/typename2.C @@ -21,5 +21,6 @@ class ctype : public __ctype_abstract_base<_CharT> template<typename _CharT> class ctype2 : public __ctype_abstract_base<_CharT> { - typedef mask mask; // { dg-error "" } + typedef mask mask; // { dg-error "does not name a type" "no type" } + // { dg-message "note" "note" { target *-*-* } 24 } }; diff --git a/gcc/testsuite/g++.dg/template/typename4.C b/gcc/testsuite/g++.dg/template/typename4.C index add95156cec..18cdd1aba01 100644 --- a/gcc/testsuite/g++.dg/template/typename4.C +++ b/gcc/testsuite/g++.dg/template/typename4.C @@ -1,3 +1,3 @@ struct B { template <typename U> struct C; }; -template <typename T> struct A { typedef typename T::C V; }; // { dg-error "" } -void f () { A<B>::V p; } // { dg-error "" } +template <typename T> struct A { typedef typename T::C V; }; // { dg-error "not a type" } +void f () { A<B>::V p; } // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/template/using14.C b/gcc/testsuite/g++.dg/template/using14.C index d1049487732..ebb4e090a37 100644 --- a/gcc/testsuite/g++.dg/template/using14.C +++ b/gcc/testsuite/g++.dg/template/using14.C @@ -10,12 +10,12 @@ template <class T> struct C : public B1<T>, public B2 void f() { i(); // should be accepted - i.i(); // { dg-error "" } + i.i(); // { dg-error "member" } } }; int main() { C<int> c; - c.f(); // { dg-error "instantiated" } + c.f(); // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/using2.C b/gcc/testsuite/g++.dg/template/using2.C index 87cdbc18657..5d21f575b3c 100644 --- a/gcc/testsuite/g++.dg/template/using2.C +++ b/gcc/testsuite/g++.dg/template/using2.C @@ -7,12 +7,12 @@ template <class T> struct Foo { - int i; // { dg-error "" "" } + int i; // { dg-error "Foo" } }; struct Baz { - int i; // { dg-error "" "" } + int i; // { dg-error "Baz" } }; template <class T> @@ -20,11 +20,11 @@ struct Bar : public Foo<T>, Baz { using Foo<T>::i; using Baz::i; - int foo () { return i; } // { dg-error "request for member" "" } + int foo () { return i; } // { dg-error "request for member" } }; void foo (Bar<int> &bar) { - bar.foo(); // { dg-error "instantiated" "" } + bar.foo(); // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.dg/template/warn1.C b/gcc/testsuite/g++.dg/template/warn1.C index 827c65e24c5..0cdffcd3c51 100644 --- a/gcc/testsuite/g++.dg/template/warn1.C +++ b/gcc/testsuite/g++.dg/template/warn1.C @@ -17,7 +17,7 @@ template <class T> void Foo(T i) void Bar () { - Foo (1); // { dg-error "instantiated" "" } + Foo (1); // { dg-message "instantiated" } } struct M {}; @@ -31,6 +31,6 @@ struct C void Baz (int i) { - i ? i + 1 : i + 2; // { dg-error "operand of" "" } + i ? i + 1 : i + 2; // { dg-warning "operand of" } i ? i++ : 0; } diff --git a/gcc/testsuite/g++.dg/torture/pr37456.C b/gcc/testsuite/g++.dg/torture/pr37456.C new file mode 100644 index 00000000000..cf2021be203 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr37456.C @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +int zot(int); +struct bar { + ~bar() { } +}; +int x; +void doit(int a, int b, int c) +{ + bar pn; + int b1 = zot(a) * c; + int b2 = zot(b) * c; + x = b1 + b2; +} diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr37284.C b/gcc/testsuite/g++.dg/tree-ssa/pr37284.C new file mode 100644 index 00000000000..26ddc1a05ad --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/pr37284.C @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-fstrict-aliasing" } */ + +void* operator new(__SIZE_TYPE__, void* __p) throw() +{ + return __p; +} + +class PatternDriverTop; + +typedef const PatternDriverTop* _Tp; + +void construct(_Tp* __p, const _Tp& __val) +{ + ::new((void *)__p) _Tp(__val); +} + diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-13.C b/gcc/testsuite/g++.dg/warn/Wparentheses-13.C index 22525cd9d1c..ebe8f426a3b 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-13.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-13.C @@ -66,4 +66,4 @@ bar (T) foo (27); } -template void bar<int> (int); // { dg-warning "instantiated" } +template void bar<int> (int); // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-15.C b/gcc/testsuite/g++.dg/warn/Wparentheses-15.C index ab156b757e0..db73d430aea 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-15.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-15.C @@ -65,4 +65,4 @@ bar (T a, T b, T c) foo (1 != (2 != 3)); } -template void bar<int> (int, int, int); // { dg-warning "instantiated" } +template void bar<int> (int, int, int); // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-16.C b/gcc/testsuite/g++.dg/warn/Wparentheses-16.C index d8151aecdd1..6381552370d 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-16.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-16.C @@ -83,4 +83,4 @@ bar (T a, T b, T c) foo (6 >> (5 - 4)); } -template void bar<int> (int, int, int); // { dg-warning "instantiated" } +template void bar<int> (int, int, int); // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-17.C b/gcc/testsuite/g++.dg/warn/Wparentheses-17.C index def181a12dc..1af1e2e0380 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-17.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-17.C @@ -29,4 +29,4 @@ bar (T a, T b, T c) foo (1 || (2 && 3)); } -template void bar<int> (int, int, int); // { dg-warning "instantiated" } +template void bar<int> (int, int, int); // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-18.C b/gcc/testsuite/g++.dg/warn/Wparentheses-18.C index 32fa1fe958f..d562315f3c7 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-18.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-18.C @@ -119,4 +119,4 @@ bar (T a, T b, T c) foo (1 | (2 <= 3)); } -template void bar<int> (int, int, int); // { dg-warning "instantiated" } +template void bar<int> (int, int, int); // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-19.C b/gcc/testsuite/g++.dg/warn/Wparentheses-19.C index c7e45cf1afc..e3dfc5d05c3 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-19.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-19.C @@ -119,4 +119,4 @@ bar (T a, T b, T c) foo (1 ^ (2 < 3)); } -template void bar<int> (int, int, int); // { dg-warning "instantiated" } +template void bar<int> (int, int, int); // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-20.C b/gcc/testsuite/g++.dg/warn/Wparentheses-20.C index 8789d592f9a..a1ba89dfcd5 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-20.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-20.C @@ -101,4 +101,4 @@ bar (T a, T b, T c) foo (1 & (2 != 3)); } -template void bar<int> (int, int, int); // { dg-warning "instantiated" } +template void bar<int> (int, int, int); // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-23.C b/gcc/testsuite/g++.dg/warn/Wparentheses-23.C index 755c574d0f2..cadc287fe96 100644 --- a/gcc/testsuite/g++.dg/warn/Wparentheses-23.C +++ b/gcc/testsuite/g++.dg/warn/Wparentheses-23.C @@ -114,8 +114,8 @@ bar4 (T) return (a = a); } -template void bar<int> (int); // { dg-warning "instantiated" } -template bool bar1<int> (int); // { dg-warning "instantiated" } +template void bar<int> (int); // { dg-message "instantiated" } +template bool bar1<int> (int); // { dg-message "instantiated" } template bool bar2<int> (int); -template bool bar3<int> (int); // { dg-warning "instantiated" } +template bool bar3<int> (int); // { dg-message "instantiated" } template bool bar4<int> (int); diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-3.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-3.C index 9fc35389073..94c2f47020f 100644 --- a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-3.C +++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-3.C @@ -9,6 +9,6 @@ T *foo(void) return (T *)&x; /* { dg-warning "strict-aliasing" } */ } -template int *foo<int>(void); /* { dg-warning "instantiated from here" } */ +template int *foo<int>(void); /* { dg-message "instantiated from here" } */ template char *foo<char>(void); /* { dg-bogus "instantiated from here" } */ diff --git a/gcc/testsuite/g++.dg/warn/Wvla-2.C b/gcc/testsuite/g++.dg/warn/Wvla-2.C index c611f07aab4..ba83ac1a9f2 100644 --- a/gcc/testsuite/g++.dg/warn/Wvla-2.C +++ b/gcc/testsuite/g++.dg/warn/Wvla-2.C @@ -3,5 +3,5 @@ void func (int i) { - int array[i]; /* { dg-error "error: ISO C.* forbids variable.* array 'array'" } */ + int array[i]; /* { dg-error "ISO C.* forbids variable.* array 'array'" } */ } diff --git a/gcc/testsuite/g++.dg/warn/deprecated-3.C b/gcc/testsuite/g++.dg/warn/deprecated-3.C index 6087cc733fd..8b4378c410b 100644 --- a/gcc/testsuite/g++.dg/warn/deprecated-3.C +++ b/gcc/testsuite/g++.dg/warn/deprecated-3.C @@ -10,5 +10,5 @@ struct Foo void g(void) { Foo f; - (int)f; // { dg-warning "warning: 'Foo::operator int\\(\\)' is deprecated \\(declared at" } + (int)f; // { dg-warning "'Foo::operator int\\(\\)' is deprecated \\(declared at" } } diff --git a/gcc/testsuite/g++.dg/warn/incomplete1.C b/gcc/testsuite/g++.dg/warn/incomplete1.C index aed32a19ac4..26cfe2eae4b 100644 --- a/gcc/testsuite/g++.dg/warn/incomplete1.C +++ b/gcc/testsuite/g++.dg/warn/incomplete1.C @@ -16,6 +16,7 @@ A *a; // { dg-warning "'a' has incomplete type" "" } int main (int argc, char **argv) { - delete a; // { dg-warning "delete" "" } + delete a; // { dg-warning "delete" "warn" } + // { dg-message "note" "note" { target *-*-* } 19 } return 0; } diff --git a/gcc/testsuite/g++.dg/warn/noeffect2.C b/gcc/testsuite/g++.dg/warn/noeffect2.C index 69adf396367..01323659597 100644 --- a/gcc/testsuite/g++.dg/warn/noeffect2.C +++ b/gcc/testsuite/g++.dg/warn/noeffect2.C @@ -12,9 +12,9 @@ extern "C" void FormatDisk(); struct C { C(){ FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" } }; - template struct C<int>; // { dg-warning "instantiated" } + template struct C<int>; // { dg-message "instantiated" } template <class T> void f() { FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" } - template void f<int> (); // { dg-warning "instantiated" } + template void f<int> (); // { dg-message "instantiated" } void g() { FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" } diff --git a/gcc/testsuite/g++.dg/warn/noeffect4.C b/gcc/testsuite/g++.dg/warn/noeffect4.C index 7b051dd6766..966716bbc48 100644 --- a/gcc/testsuite/g++.dg/warn/noeffect4.C +++ b/gcc/testsuite/g++.dg/warn/noeffect4.C @@ -85,4 +85,4 @@ template<int I> void Foo (X &x) __alignof__ (x++); // { dg-warning "no effect" "" } } -template void Foo<4> (X&); // { dg-warning "instantiated" } +template void Foo<4> (X&); // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/warn/overflow-warn-1.C b/gcc/testsuite/g++.dg/warn/overflow-warn-1.C index 1c6c849990b..78f4348c8c0 100644 --- a/gcc/testsuite/g++.dg/warn/overflow-warn-1.C +++ b/gcc/testsuite/g++.dg/warn/overflow-warn-1.C @@ -12,23 +12,23 @@ enum e { /* Overflow in an unevaluated part of an expression is OK (example in the standard). */ E2 = 2 || 1 / 0, /* { dg-bogus "warning: division by zero" "" { xfail *-*-* } 14 } */ - E3 = 1 / 0, /* { dg-warning "warning: division by zero" } */ - /* { dg-error "error: enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */ + E3 = 1 / 0, /* { dg-warning "division by zero" } */ + /* { dg-error "enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */ /* But as in DR#031, the 1/0 in an evaluated subexpression means the whole expression violates the constraints. */ - E4 = 0 * (1 / 0), /* { dg-warning "warning: division by zero" } */ - /* { dg-error "error: enumerator value for 'E4' is not an integer constant" "enum error" { xfail *-*-* } 19 } */ - E5 = INT_MAX + 1, /* { dg-warning "warning: integer overflow in expression" } */ + E4 = 0 * (1 / 0), /* { dg-warning "division by zero" } */ + /* { dg-error "enumerator value for 'E4' is not an integer constant" "enum error" { xfail *-*-* } 19 } */ + E5 = INT_MAX + 1, /* { dg-warning "integer overflow in expression" } */ /* Again, overflow in evaluated subexpression. */ - E6 = 0 * (INT_MAX + 1), /* { dg-warning "warning: integer overflow in expression" } */ + E6 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */ /* A cast does not constitute overflow in conversion. */ E7 = (char) INT_MAX }; struct s { int a; - int : 0 * (1 / 0); /* { dg-warning "warning: division by zero" } */ - int : 0 * (INT_MAX + 1); /* { dg-warning "warning: integer overflow in expression" } */ + int : 0 * (1 / 0); /* { dg-warning "division by zero" } */ + int : 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */ }; void @@ -36,11 +36,11 @@ f (void) { /* This expression is not required to be a constant expression, so it should just involve undefined behavior at runtime. */ - int c = INT_MAX + 1; /* { dg-warning "warning: integer overflow in expression" } */ + int c = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ } /* This expression is neither required to be constant. */ -static int sc = INT_MAX + 1; /* { dg-warning "warning: integer overflow in expression" } */ +static int sc = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ // Test for overflow in null pointer constant. @@ -48,9 +48,9 @@ void *n = 0; /* The first two of these involve overflow, so are not null pointer constants. The third has the overflow in an unevaluated subexpression, so is a null pointer constant. */ -void *p = 0 * (INT_MAX + 1); /* { dg-warning "warning: integer overflow in expression" } */ +void *p = 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */ /* { dg-error "invalid conversion from 'int' to 'void" "null" { target *-*-* } 51 } */ -void *q = 0 * (1 / 0); /* { dg-warning "warning: division by zero" } */ +void *q = 0 * (1 / 0); /* { dg-warning "division by zero" } */ /* { dg-error "invalid conversion from 'int' to 'void*'" "null" { xfail *-*-* } 53 } */ void *r = (1 ? 0 : INT_MAX+1); /* { dg-bogus "integer overflow in expression" "" { xfail *-*-* } 55 } */ @@ -59,9 +59,9 @@ g (int i) { switch (i) { - case 0 * (1/0): /* { dg-warning "warning: division by zero" } */ + case 0 * (1/0): /* { dg-warning "division by zero" } */ ; - case 1 + 0 * (INT_MAX + 1): /* { dg-warning "warning: integer overflow in expression" } */ + case 1 + 0 * (INT_MAX + 1): /* { dg-warning "integer overflow in expression" } */ ; } } @@ -69,13 +69,13 @@ g (int i) int h (void) { - return INT_MAX + 1; /* { dg-warning "warning: integer overflow in expression" } */ + return INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ } int h1 (void) { - return INT_MAX + 1 - INT_MAX; /* { dg-warning "warning: integer overflow in expression" } */ + return INT_MAX + 1 - INT_MAX; /* { dg-warning "integer overflow in expression" } */ } void fuc (unsigned char); @@ -85,14 +85,14 @@ void h2 (void) { fsc (SCHAR_MAX + 1); - fsc (SCHAR_MIN - 1); /* { dg-warning "warning: overflow in implicit constant conversion" } */ + fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */ fsc (UCHAR_MAX); - fsc (UCHAR_MAX + 1); /* { dg-warning "warning: overflow in implicit constant conversion" } */ + fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */ fuc (-1); - fuc (UCHAR_MAX + 1); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */ + fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */ fuc (SCHAR_MIN); - fuc (SCHAR_MIN - 1); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */ - fuc (-UCHAR_MAX); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */ + fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */ + fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */ } void fui (unsigned int); diff --git a/gcc/testsuite/g++.dg/warn/overflow-warn-3.C b/gcc/testsuite/g++.dg/warn/overflow-warn-3.C index b449a495103..fa45eebac30 100644 --- a/gcc/testsuite/g++.dg/warn/overflow-warn-3.C +++ b/gcc/testsuite/g++.dg/warn/overflow-warn-3.C @@ -12,26 +12,26 @@ enum e { /* Overflow in an unevaluated part of an expression is OK (example in the standard). */ E2 = 2 || 1 / 0, /* { dg-bogus "warning: division by zero" "" { xfail *-*-* } 14 } */ - E3 = 1 / 0, /* { dg-warning "warning: division by zero" } */ - /* { dg-error "error: enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */ + E3 = 1 / 0, /* { dg-warning "division by zero" } */ + /* { dg-error "enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */ /* But as in DR#031, the 1/0 in an evaluated subexpression means the whole expression violates the constraints. */ - E4 = 0 * (1 / 0), /* { dg-warning "warning: division by zero" } */ - /* { dg-error "error: enumerator value for 'E4' is not an integer constant" "enum error" { xfail *-*-* } 19 } */ - E5 = INT_MAX + 1, /* { dg-warning "warning: integer overflow in expression" } */ - /* { dg-warning "warning: overflow in constant expression" "constant" { target *-*-* } 21 } */ + E4 = 0 * (1 / 0), /* { dg-warning "division by zero" } */ + /* { dg-error "enumerator value for 'E4' is not an integer constant" "enum error" { xfail *-*-* } 19 } */ + E5 = INT_MAX + 1, /* { dg-warning "integer overflow in expression" } */ + /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 21 } */ /* Again, overflow in evaluated subexpression. */ - E6 = 0 * (INT_MAX + 1), /* { dg-warning "warning: integer overflow in expression" } */ - /* { dg-warning "warning: overflow in constant expression" "constant" { target *-*-* } 24 } */ + E6 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */ + /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 24 } */ /* A cast does not constitute overflow in conversion. */ E7 = (char) INT_MAX }; struct s { int a; - int : 0 * (1 / 0); /* { dg-warning "warning: division by zero" } */ - int : 0 * (INT_MAX + 1); /* { dg-warning "warning: integer overflow in expression" } */ - /* { dg-warning "warning: overflow in constant expression" "constant" { target *-*-* } 33 } */ + int : 0 * (1 / 0); /* { dg-warning "division by zero" } */ + int : 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */ + /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 33 } */ }; void @@ -39,12 +39,12 @@ f (void) { /* This expression is not required to be a constant expression, so it should just involve undefined behavior at runtime. */ - int c = INT_MAX + 1; /* { dg-warning "warning: integer overflow in expression" } */ + int c = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ } /* This expression is neither required to be constant. */ -static int sc = INT_MAX + 1; /* { dg-warning "warning: integer overflow in expression" } */ +static int sc = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ // Test for overflow in null pointer constant. @@ -52,11 +52,11 @@ void *n = 0; /* The first two of these involve overflow, so are not null pointer constants. The third has the overflow in an unevaluated subexpression, so is a null pointer constant. */ -void *p = 0 * (INT_MAX + 1); /* { dg-warning "warning: integer overflow in expression" } */ -/* { dg-error "invalid conversion from 'int' to 'void" "null" { target *-*-* } 55 } */ +void *p = 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */ +/* { dg-warning "invalid conversion from 'int' to 'void" "null" { target *-*-* } 55 } */ -void *q = 0 * (1 / 0); /* { dg-warning "warning: division by zero" } */ -/* { dg-error "invalid conversion from 'int' to 'void*'" "null" { xfail *-*-* } 58 } */ +void *q = 0 * (1 / 0); /* { dg-warning "division by zero" } */ +/* { dg-warning "invalid conversion from 'int' to 'void*'" "null" { xfail *-*-* } 58 } */ void *r = (1 ? 0 : INT_MAX+1); /* { dg-bogus "integer overflow in expression" "" { xfail *-*-* } 60 } */ void @@ -64,10 +64,10 @@ g (int i) { switch (i) { - case 0 * (1/0): /* { dg-warning "warning: division by zero" } */ + case 0 * (1/0): /* { dg-warning "division by zero" } */ ; - case 1 + 0 * (INT_MAX + 1): /* { dg-warning "warning: integer overflow in expression" } */ - /* { dg-warning "warning: overflow in constant expression" "constant" { target *-*-* } 69 } */ + case 1 + 0 * (INT_MAX + 1): /* { dg-warning "integer overflow in expression" } */ + /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 69 } */ ; } } @@ -75,13 +75,13 @@ g (int i) int h (void) { - return INT_MAX + 1; /* { dg-warning "warning: integer overflow in expression" } */ + return INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ } int h1 (void) { - return INT_MAX + 1 - INT_MAX; /* { dg-warning "warning: integer overflow in expression" } */ + return INT_MAX + 1 - INT_MAX; /* { dg-warning "integer overflow in expression" } */ } void fuc (unsigned char); @@ -90,15 +90,15 @@ void fsc (signed char); void h2 (void) { - fsc (SCHAR_MAX + 1); /* { dg-warning "warning: overflow in implicit constant conversion" } */ - fsc (SCHAR_MIN - 1); /* { dg-warning "warning: overflow in implicit constant conversion" } */ - fsc (UCHAR_MAX); /* { dg-warning "warning: overflow in implicit constant conversion" } */ - fsc (UCHAR_MAX + 1); /* { dg-warning "warning: overflow in implicit constant conversion" } */ + fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */ + fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */ + fsc (UCHAR_MAX); /* { dg-warning "overflow in implicit constant conversion" } */ + fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */ fuc (-1); - fuc (UCHAR_MAX + 1); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */ + fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */ fuc (SCHAR_MIN); - fuc (SCHAR_MIN - 1); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */ - fuc (-UCHAR_MAX); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */ + fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */ + fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */ } void fui (unsigned int); diff --git a/gcc/testsuite/g++.dg/warn/overflow-warn-4.C b/gcc/testsuite/g++.dg/warn/overflow-warn-4.C index 65e220070fb..ae06a80a7ce 100644 --- a/gcc/testsuite/g++.dg/warn/overflow-warn-4.C +++ b/gcc/testsuite/g++.dg/warn/overflow-warn-4.C @@ -12,26 +12,26 @@ enum e { /* Overflow in an unevaluated part of an expression is OK (example in the standard). */ E2 = 2 || 1 / 0, /* { dg-bogus "warning: division by zero" "" { xfail *-*-* } 14 } */ - E3 = 1 / 0, /* { dg-warning "warning: division by zero" } */ - /* { dg-error "error: enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */ + E3 = 1 / 0, /* { dg-warning "division by zero" } */ + /* { dg-error "enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */ /* But as in DR#031, the 1/0 in an evaluated subexpression means the whole expression violates the constraints. */ - E4 = 0 * (1 / 0), /* { dg-warning "warning: division by zero" } */ - /* { dg-error "error: enumerator value for 'E4' is not an integer constant" "enum error" { xfail *-*-* } 19 } */ - E5 = INT_MAX + 1, /* { dg-warning "warning: integer overflow in expression" } */ - /* { dg-error "error: overflow in constant expression" "constant" { target *-*-* } 21 } */ + E4 = 0 * (1 / 0), /* { dg-warning "division by zero" } */ + /* { dg-error "enumerator value for 'E4' is not an integer constant" "enum error" { xfail *-*-* } 19 } */ + E5 = INT_MAX + 1, /* { dg-warning "integer overflow in expression" } */ + /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 21 } */ /* Again, overflow in evaluated subexpression. */ - E6 = 0 * (INT_MAX + 1), /* { dg-warning "warning: integer overflow in expression" } */ - /* { dg-error "error: overflow in constant expression" "constant" { target *-*-* } 24 } */ + E6 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */ + /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 24 } */ /* A cast does not constitute overflow in conversion. */ E7 = (char) INT_MAX }; struct s { int a; - int : 0 * (1 / 0); /* { dg-warning "warning: division by zero" } */ - int : 0 * (INT_MAX + 1); /* { dg-warning "warning: integer overflow in expression" } */ - /* { dg-error "error: overflow in constant expression" "constant" { target *-*-* } 33 } */ + int : 0 * (1 / 0); /* { dg-warning "division by zero" } */ + int : 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */ + /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 33 } */ }; void @@ -39,12 +39,12 @@ f (void) { /* This expression is not required to be a constant expression, so it should just involve undefined behavior at runtime. */ - int c = INT_MAX + 1; /* { dg-warning "warning: integer overflow in expression" } */ + int c = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ } /* This expression is neither required to be constant. */ -static int sc = INT_MAX + 1; /* { dg-warning "warning: integer overflow in expression" } */ +static int sc = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ // Test for overflow in null pointer constant. @@ -52,10 +52,10 @@ void *n = 0; /* The first two of these involve overflow, so are not null pointer constants. The third has the overflow in an unevaluated subexpression, so is a null pointer constant. */ -void *p = 0 * (INT_MAX + 1); /* { dg-warning "warning: integer overflow in expression" } */ +void *p = 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */ /* { dg-error "invalid conversion from 'int' to 'void" "null" { target *-*-* } 55 } */ -void *q = 0 * (1 / 0); /* { dg-warning "warning: division by zero" } */ +void *q = 0 * (1 / 0); /* { dg-warning "division by zero" } */ /* { dg-error "invalid conversion from 'int' to 'void*'" "null" { xfail *-*-* } 58 } */ void *r = (1 ? 0 : INT_MAX+1); /* { dg-bogus "integer overflow in expression" "" { xfail *-*-* } 60 } */ @@ -64,10 +64,10 @@ g (int i) { switch (i) { - case 0 * (1/0): /* { dg-warning "warning: division by zero" } */ + case 0 * (1/0): /* { dg-warning "division by zero" } */ ; - case 1 + 0 * (INT_MAX + 1): /* { dg-warning "warning: integer overflow in expression" } */ - /* { dg-error "error: overflow in constant expression" "constant" { target *-*-* } 69 } */ + case 1 + 0 * (INT_MAX + 1): /* { dg-warning "integer overflow in expression" } */ + /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 69 } */ ; } } @@ -75,13 +75,13 @@ g (int i) int h (void) { - return INT_MAX + 1; /* { dg-warning "warning: integer overflow in expression" } */ + return INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */ } int h1 (void) { - return INT_MAX + 1 - INT_MAX; /* { dg-warning "warning: integer overflow in expression" } */ + return INT_MAX + 1 - INT_MAX; /* { dg-warning "integer overflow in expression" } */ } void fuc (unsigned char); @@ -90,15 +90,15 @@ void fsc (signed char); void h2 (void) { - fsc (SCHAR_MAX + 1); /* { dg-warning "warning: overflow in implicit constant conversion" } */ - fsc (SCHAR_MIN - 1); /* { dg-warning "warning: overflow in implicit constant conversion" } */ - fsc (UCHAR_MAX); /* { dg-warning "warning: overflow in implicit constant conversion" } */ - fsc (UCHAR_MAX + 1); /* { dg-warning "warning: overflow in implicit constant conversion" } */ + fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */ + fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */ + fsc (UCHAR_MAX); /* { dg-warning "overflow in implicit constant conversion" } */ + fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */ fuc (-1); - fuc (UCHAR_MAX + 1); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */ + fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */ fuc (SCHAR_MIN); - fuc (SCHAR_MIN - 1); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */ - fuc (-UCHAR_MAX); /* { dg-warning "warning: large integer implicitly truncated to unsigned type" } */ + fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */ + fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */ } void fui (unsigned int); diff --git a/gcc/testsuite/g++.dg/warn/overflow-warn-6.C b/gcc/testsuite/g++.dg/warn/overflow-warn-6.C index fa0cc83fa4d..6c7a28b3c54 100644 --- a/gcc/testsuite/g++.dg/warn/overflow-warn-6.C +++ b/gcc/testsuite/g++.dg/warn/overflow-warn-6.C @@ -7,12 +7,12 @@ int h1 (int x) { - return x * (0 * (INT_MAX + 1)); /* { dg-warning "warning: integer overflow in expression" } */ + return x * (0 * (INT_MAX + 1)); /* { dg-warning "integer overflow in expression" } */ } int h2 (int x) { - return ((INT_MAX + 1) * 0) * x; /* { dg-warning "warning: integer overflow in expression" } */ + return ((INT_MAX + 1) * 0) * x; /* { dg-warning "integer overflow in expression" } */ } diff --git a/gcc/testsuite/g++.dg/warn/pointer-integer-comparison.C b/gcc/testsuite/g++.dg/warn/pointer-integer-comparison.C index 48489ebcb8c..c6b75a7fc12 100644 --- a/gcc/testsuite/g++.dg/warn/pointer-integer-comparison.C +++ b/gcc/testsuite/g++.dg/warn/pointer-integer-comparison.C @@ -3,24 +3,24 @@ int foo (int i, void *p) { - if (i == p) // { dg-warning "warning: ISO C.. forbids comparison between pointer and integer" } + if (i == p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" } return 0; - else if (i != p) // { dg-warning "warning: ISO C.. forbids comparison between pointer and integer" } + else if (i != p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" } return 1; } int bar (int i, void *p) { - if (i < p) // { dg-warning "warning: ISO C.. forbids comparison between pointer and integer" } + if (i < p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" } return 0; - else if (i >= p) // { dg-warning "warning: ISO C.. forbids comparison between pointer and integer" } + else if (i >= p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" } return 1; } int baz (int i, void *p) { - if (i <= p) // { dg-warning "warning: ISO C.. forbids comparison between pointer and integer" } + if (i <= p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" } return 0; - else if (i > p) // { dg-warning "warning: ISO C.. forbids comparison between pointer and integer" } + else if (i > p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" } return 1; } diff --git a/gcc/testsuite/g++.dg/warn/pr8570.C b/gcc/testsuite/g++.dg/warn/pr8570.C index 0136bb1050a..608f4d6b5bf 100644 --- a/gcc/testsuite/g++.dg/warn/pr8570.C +++ b/gcc/testsuite/g++.dg/warn/pr8570.C @@ -2,12 +2,12 @@ // { dg-do compile } // { dg-options "" } template <typename T, typename P> -class X { // { dg-warning "note: previous declaration .* used 2" } +class X { // { dg-message "note: previous declaration .* used 2" } public: X() { } private: - template <typename U> friend class X; // { dg-error "error: .*redeclared with 1 template parameter" } + template <typename U> friend class X; // { dg-error "redeclared with 1 template parameter" } }; -X<int, int> i; +X<int, int> i; // { dg-message "instantiated" } diff --git a/gcc/testsuite/g++.dg/warn/register-var-1.C b/gcc/testsuite/g++.dg/warn/register-var-1.C index 3396d211385..6cbd23e2c93 100644 --- a/gcc/testsuite/g++.dg/warn/register-var-1.C +++ b/gcc/testsuite/g++.dg/warn/register-var-1.C @@ -10,5 +10,5 @@ void g(int *); void f(void) { register int x __asm ("eax"); - g(&x); /* { dg-error "error: address of explicit register variable" } */ + g(&x); /* { dg-error "address of explicit register variable" } */ } diff --git a/gcc/testsuite/g++.dg/warn/write-strings-default.C b/gcc/testsuite/g++.dg/warn/write-strings-default.C index 234c473801b..ee6b217185c 100644 --- a/gcc/testsuite/g++.dg/warn/write-strings-default.C +++ b/gcc/testsuite/g++.dg/warn/write-strings-default.C @@ -3,5 +3,5 @@ int main() { - char* p = "Asgaard"; // { dg-warning "warning:.*deprecated.*" } + char* p = "Asgaard"; // { dg-warning "deprecated" } } diff --git a/gcc/testsuite/g++.dg/warn/write-strings.C b/gcc/testsuite/g++.dg/warn/write-strings.C index 38233e0e1d9..73c81490983 100644 --- a/gcc/testsuite/g++.dg/warn/write-strings.C +++ b/gcc/testsuite/g++.dg/warn/write-strings.C @@ -3,5 +3,5 @@ int main() { - char* p = "Asgaard"; // { dg-warning "warning:.*deprecated.*" } + char* p = "Asgaard"; // { dg-warning "deprecated" } } diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/15799.C b/gcc/testsuite/g++.old-deja/g++.benjamin/15799.C index 64195fcf028..35d882b21b3 100644 --- a/gcc/testsuite/g++.old-deja/g++.benjamin/15799.C +++ b/gcc/testsuite/g++.old-deja/g++.benjamin/15799.C @@ -15,15 +15,15 @@ typedef unsigned long uint_32; class sanjose { public: sanjose(); - sanjose(const sanjose&); // { dg-error "" } candidate - sanjose(int_8 value); // { dg-error "" } // ERROR - - sanjose(uint_32 value); // { dg-error "" } // ERROR - + sanjose(const sanjose&); // { dg-message "note" } + sanjose(int_8 value); // { dg-message "note" } + sanjose(uint_32 value); // { dg-message "note" } }; enum { first, last}; void foo(void) { - sanjose obj(first); // { dg-error "" } // ERROR - + sanjose obj(first); // { dg-error "ambiguous" } } diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/15800-1.C b/gcc/testsuite/g++.old-deja/g++.benjamin/15800-1.C index 2fdcdfc432a..deedfba75a2 100644 --- a/gcc/testsuite/g++.old-deja/g++.benjamin/15800-1.C +++ b/gcc/testsuite/g++.old-deja/g++.benjamin/15800-1.C @@ -5,13 +5,13 @@ struct panama { panama(); panama(panama &); - panama& operator=(panama&); // { dg-error "" } // ERROR - + panama& operator=(panama&); // { dg-message "candidates" } }; extern panama dig(); void foo() { panama obj; - obj = dig(); // { dg-error "" } // ERROR - + obj = dig(); // { dg-error "no match" } } diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/16077.C b/gcc/testsuite/g++.old-deja/g++.benjamin/16077.C index 9f854b5e189..9338e875532 100644 --- a/gcc/testsuite/g++.old-deja/g++.benjamin/16077.C +++ b/gcc/testsuite/g++.old-deja/g++.benjamin/16077.C @@ -21,7 +21,9 @@ public: void peace(const colombia&); void foo(nicaragua& b) { - peace(b); // { dg-warning "" } // WARNING - + peace(b); // { dg-warning "choosing 'nicaragua::operator" "nic" } + // { dg-warning "conversion" "conv" { target *-*-* } 24 } + // { dg-message "note" "note" { target *-*-* } 24 } } diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C b/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C index 8f7459f17fb..fb9830e689d 100644 --- a/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C +++ b/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C @@ -83,7 +83,7 @@ public: template <class T10, int i> struct Xfour {// { dg-error "" } .* int T10; // { dg-error "" } .* void f(){ - char T10; // { dg-error "error: declaration of 'char T10'" } + char T10; // { dg-error "declaration of 'char T10'" } } }; @@ -123,7 +123,7 @@ public: template <class U> friend bool fooy(U u); - template <class T161> // { dg-error "error: declaration of 'class T161'" } + template <class T161> // { dg-error "declaration of 'class T161'" } friend bool foo(T161 u) { Xseven<T161, 5, int> obj; diff --git a/gcc/testsuite/g++.old-deja/g++.bob/inherit2.C b/gcc/testsuite/g++.old-deja/g++.bob/inherit2.C index 9a64de4dc3e..14bc32b6a78 100644 --- a/gcc/testsuite/g++.old-deja/g++.bob/inherit2.C +++ b/gcc/testsuite/g++.old-deja/g++.bob/inherit2.C @@ -20,5 +20,6 @@ void f(B b) { void g() { B h; - f(h); // { dg-error "synthesized|argument" } + f(h); // { dg-error "argument" "arg" } + // { dg-message "synthesized" "synth" { target *-*-* } 23 } } diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/ambiguity1.C b/gcc/testsuite/g++.old-deja/g++.brendan/ambiguity1.C index b0c37e1965d..ddf93c4bdae 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/ambiguity1.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/ambiguity1.C @@ -8,10 +8,10 @@ struct B { B (int); }; -void myfunc (const A& t0); // { dg-error "" } -void myfunc (const B& t0); // { dg-error "" } +void myfunc (const A& t0); // { dg-message "candidates" } +void myfunc (const B& t0); // { dg-message "note" } int main () { - myfunc(1); // { dg-error "" } ambiguous call + myfunc(1); // { dg-error "ambiguous" } } diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash16.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash16.C index d05c73b8015..674fc4fa679 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash16.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash16.C @@ -2,13 +2,13 @@ // { dg-options "-fshow-column" } // GROUPS passed old-abort -class Graph { // { dg-error "1: error: new types|1: note: \\(perhaps" } +class Graph { // { dg-error "1:new types|1: note: \\(perhaps" } public: unsigned char N; - Graph(void) {} // { dg-error "7: error: 'Graph" } + Graph(void) {} // { dg-error "7:'Graph" } } -Graph::Graph(void) // { dg-error "18: error: return type|1: error: redefinition" } +Graph::Graph(void) // { dg-error "18:return type|1: error: redefinition" } { N = 10; } diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash29.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash29.C index 6fd031f3450..fd2fa2ff986 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash29.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash29.C @@ -7,13 +7,13 @@ union Value }; struct GlobalAddress -{// { dg-error "" } candidates .* - GlobalAddress(Value *nvar){}// { dg-error "" } .* +{// { dg-message "note" } + GlobalAddress(Value *nvar){} // { dg-message "candidates" } }; int main() { - new GlobalAddress(Value()); // internal error occured here// { dg-error "" } no matching function .* + new GlobalAddress(Value()); // internal error occured here// { dg-error "no matching" } //new GlobalAddress(new Value()); // This line is correct code } diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash48.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash48.C index bdb522aeb56..e7d621cf0a2 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash48.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash48.C @@ -1,16 +1,16 @@ // { dg-do compile } // GROUPS passed old-abort -class internal { // { dg-error "internal::internal" } +class internal { // { dg-message "internal::internal" } int field; int anotherfield; }; -class bug { // { dg-error "bug::bug" } +class bug { // { dg-message "bug::bug" } internal* numbers; bug(int size); }; -bug::bug(int size) // { dg-error "bug::bug" } +bug::bug(int size) // { dg-message "bug::bug" } { numbers = new internal(size * size);// { dg-error "no match" } } diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C index d1cae6d198a..dcb89dc9e48 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C @@ -343,7 +343,7 @@ operator>=(const SetLD<T>& a, const SetLD<T>& b) class String { }; class IcaseString: public String { }; template <> class SetLD< IcaseString >: public SetLD< String > { public: SetLD (): SetLD< String >() { }; SetLD (const ListD< IcaseString >& other): SetLD< String >() { ListD< IcaseString >::Vix x; for (other.first(x); 0 != x; other.next(x)) add(other(x)); }; SetLD (const SetLD & other): SetLD< String >(other) { }; const IcaseString & operator()(const Vix& x) const { return ( IcaseString &) SetLD< String >::operator()(x); } }; typedef SetLD< String > SetLD_String_IcaseString_old_tmp99; typedef SetLD< IcaseString > SetLD_String_IcaseString_new_tmp99; -inline int operator== (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b) // { dg-error "operator==" } +inline int operator== (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b) // { dg-message "operator==" } { const SetLD_String_IcaseString_old_tmp99& oa = a; const SetLD_String_IcaseString_old_tmp99& ob = b; diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash7.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash7.C index d53dee77dd3..44339ea2c7f 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash7.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash7.C @@ -44,5 +44,5 @@ void Sort<Comp>::sort (Vector<Comp::T> &v)// { dg-error "" } use of bad T void f (Vector<int> &vi) { - Sort<Comparator<int> >::sort (vi); // { dg-error "error: 'sort' is not a member of 'Sort<Comparator<int> >'" } + Sort<Comparator<int> >::sort (vi); // { dg-error "'sort' is not a member of 'Sort<Comparator<int> >'" } } diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/cvt3.C b/gcc/testsuite/g++.old-deja/g++.brendan/cvt3.C index 9849c4a8df9..638ba9f9252 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/cvt3.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/cvt3.C @@ -38,11 +38,11 @@ struct bar class nnyacc { public: - static void assign(void*& lval, void*& rval); // { dg-error "" } candidates + static void assign(void*& lval, void*& rval); // { dg-message "candidates" } }; void foo (bar yylval, bar *yyvsp) { - nnyacc::assign(yylval.valueList, yyvsp[0].valueList);// { dg-error "" } + nnyacc::assign(yylval.valueList, yyvsp[0].valueList);// { dg-error "no matching" } } diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/overload1.C b/gcc/testsuite/g++.old-deja/g++.brendan/overload1.C index e30ccdf2860..92b04c4d02b 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/overload1.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/overload1.C @@ -9,13 +9,13 @@ public: class Bar : public Foo { public: - int f (int); // { dg-error "" } candidates are + int f (int); // { dg-message "candidates" } }; int main () { Bar b; - b.f ();// { dg-error "" } + b.f ();// { dg-error "no matching" } b.f (10); } diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/overload4.C b/gcc/testsuite/g++.old-deja/g++.brendan/overload4.C index ac4f8c8ddfb..d832a4b47c1 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/overload4.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/overload4.C @@ -5,7 +5,7 @@ class B { public: - static void WantsNew (NewObject creator); // { dg-error "" } candidates are + static void WantsNew (NewObject creator); // { dg-message "candidates" } }; class A @@ -18,6 +18,6 @@ B::WantsNew ( (NewObject) A::NewOne ); // This used to die in convert_harshness_{ansi,old} cuz it // didn't know what to do about a void type. - B::WantsNew ( A::NewOne );// { dg-error "" } + B::WantsNew ( A::NewOne );// { dg-error "no matching" } } }; diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/overload9.C b/gcc/testsuite/g++.old-deja/g++.brendan/overload9.C index 32d69406b88..b168e860410 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/overload9.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/overload9.C @@ -3,8 +3,8 @@ class CLogger { public: - void operator() (int,const char *) {}; // { dg-error "" } candidates - void operator() (int,const char *, ...) {}; // { dg-error "" } candidates + void operator() (int,const char *) {}; // { dg-message "candidates" } + void operator() (int,const char *, ...) {}; // { dg-message "note" } } Log; class CGLogger : public CLogger @@ -13,8 +13,8 @@ class CGLogger : public CLogger int main() { - Log(1,"Test");// { dg-error "" } call of.* + Log(1,"Test");// { dg-error "ambiguous" } Log(1,"Test %d",3); - GLog(1,"Test");// { dg-error "" } call of.* + GLog(1,"Test");// { dg-error "ambiguous" } GLog(1,"Test %d",3); } diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900127_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900127_01.C index 3ea60aae23c..1c315b7fadd 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900127_01.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900127_01.C @@ -15,12 +15,12 @@ int foo (void); typedef int (*f_ptr_t1) (void); typedef void (*f_ptr_t2) (int); -void bar (f_ptr_t1); // { dg-error "" } -void bar (f_ptr_t2); // { dg-error "" } +void bar (f_ptr_t1); // { dg-message "note" } +void bar (f_ptr_t2); // { dg-message "note" } void function () { - bar (foo); // { dg-error "" } ambiguous + bar (foo); // { dg-error "ambiguous" } } int main () { return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C b/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C index d93181ebb1e..8d91db67ae8 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C @@ -13,19 +13,19 @@ // implicitly-declared constructor is used, then it is implicitly // defined and found to be ill-formed. -struct struct0 { // { dg-error "note" } +struct struct0 { // { dg-message "note" } int data_member; struct0 (int, void *); // suppresses implicit default constructor }; -struct0::struct0 (int, void *) // { dg-error "note" } +struct0::struct0 (int, void *) // { dg-message "note" } { } struct struct0_derived_struct_0 : public struct0 { // { dg-error "no matching" } }; -struct0_derived_struct_0 object; // { dg-error "synthesized" } +struct0_derived_struct_0 object; // { dg-message "synthesized" } int main () { return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C b/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C index 98393ba3b4a..f1da7fba722 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C @@ -19,12 +19,12 @@ struct B { }; struct D : public B { - int f(struct B); // { dg-error "" } referred to below + int f(struct B); // { dg-message "candidates" } referred to below }; void h(D* pd) { - pd->f(1); // { dg-error "" } D::f(struct B) hides B::f(int) + pd->f(1); // { dg-error "no matching" } D::f(struct B) hides B::f(int) } int main () { return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900404_03.C b/gcc/testsuite/g++.old-deja/g++.bugs/900404_03.C index 726f9ef933e..6f7ea3f4581 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900404_03.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900404_03.C @@ -8,12 +8,12 @@ // keywords: overloading, ambiguity, resolution -void function0 (int i, char c) // { dg-error "function0" } +void function0 (int i, char c) // { dg-message "function0" } { i = c; } -void function0 (char c, int i) // { dg-error "function0" } +void function0 (char c, int i) // { dg-message "function0" } { i = c; } diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900514_03.C b/gcc/testsuite/g++.old-deja/g++.bugs/900514_03.C index a5419fb9ee9..3826e08e009 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900514_03.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900514_03.C @@ -19,14 +19,14 @@ struct t_0_st_0; struct t_0_st_1 { int member; - t_0_st_1 (t_0_st_0&);// { dg-error "" } + t_0_st_1 (t_0_st_0&);// { dg-message "note" } t_0_st_1 (); }; struct t_0_st_0 { int member; - operator t_0_st_1 ();// { dg-error "" } + operator t_0_st_1 ();// { dg-message "note" } }; t_0_st_0 t_0_st_0_obj0; @@ -37,13 +37,13 @@ void t_0_assignment () t_0_st_1 t_0_st_1_obj1; t_0_st_1 t_0_st_1_obj2; - t_0_st_1_obj0 = t_0_st_0_obj0; // { dg-error "" } caught + t_0_st_1_obj0 = t_0_st_0_obj0; // { dg-error "ambiguous" } caught t_0_st_1_obj1 = t_0_st_1 (t_0_st_0_obj0); } void t_0_local_init () { - t_0_st_1 t_0_st_1_obj0 = t_0_st_0_obj0; // { dg-error "" } + t_0_st_1 t_0_st_1_obj0 = t_0_st_0_obj0; // { dg-error "ambiguous" } t_0_st_1 t_0_st_1_obj1 = t_0_st_1 (t_0_st_0_obj0); } @@ -52,15 +52,15 @@ struct t_1_st_0; struct t_1_st_1 { int member; - t_1_st_1 (t_1_st_0&); // { dg-error "" } + t_1_st_1 (t_1_st_0&); // { dg-message "note" } t_1_st_1 (); - void operator= (t_1_st_1&); // { dg-error "" } + void operator= (t_1_st_1&); // { dg-message "note" } }; struct t_1_st_0 { int member; - operator t_1_st_1 (); // { dg-error "" } + operator t_1_st_1 (); // { dg-message "note" } }; t_1_st_0 t_1_st_0_obj0; @@ -71,13 +71,13 @@ void t_1_assignment () t_1_st_1 t_1_st_1_obj1; t_1_st_1 t_1_st_1_obj2; - t_1_st_1_obj0 = t_1_st_0_obj0; // { dg-error "" } - t_1_st_1_obj1 = t_1_st_1 (t_1_st_0_obj0); // { dg-error "" } + t_1_st_1_obj0 = t_1_st_0_obj0; // { dg-error "no match" } + t_1_st_1_obj1 = t_1_st_1 (t_1_st_0_obj0); // { dg-error "no match" } } void t_1_local_init () { - t_1_st_1 t_1_st_1_obj0 = t_1_st_0_obj0; // { dg-error "" } + t_1_st_1 t_1_st_1_obj0 = t_1_st_0_obj0; // { dg-error "ambiguous" } t_1_st_1 t_1_st_1_obj1 = t_1_st_1 (t_1_st_0_obj0); } @@ -86,14 +86,14 @@ struct t_2_st_0; struct t_2_st_1 { int member; - t_2_st_1 (t_2_st_0); // { dg-error "" } candidate + t_2_st_1 (t_2_st_0); // { dg-message "note" } t_2_st_1 (); }; struct t_2_st_0 { int member; - operator t_2_st_1 (); // { dg-error "" } candidate + operator t_2_st_1 (); // { dg-message "candidate" } }; t_2_st_0 t_2_st_0_obj0; @@ -104,12 +104,12 @@ void t_2_assignment () t_2_st_1 t_2_st_1_obj1; t_2_st_1 t_2_st_1_obj2; - t_2_st_1_obj0 = t_2_st_0_obj0; // { dg-error "" } caught + t_2_st_1_obj0 = t_2_st_0_obj0; // { dg-error "ambiguous" } caught t_2_st_1_obj1 = t_2_st_1 (t_2_st_0_obj0); } void t_2_local_init () { - t_2_st_1 t_2_st_1_obj0 = t_2_st_0_obj0; // { dg-error "" } + t_2_st_1 t_2_st_1_obj0 = t_2_st_0_obj0; // { dg-error "ambiguous" } t_2_st_1 t_2_st_1_obj1 = t_2_st_1 (t_2_st_0_obj0); } diff --git a/gcc/testsuite/g++.old-deja/g++.eh/ctor1.C b/gcc/testsuite/g++.old-deja/g++.eh/ctor1.C index 6071d7ee27f..ac2f24f60ce 100644 --- a/gcc/testsuite/g++.old-deja/g++.eh/ctor1.C +++ b/gcc/testsuite/g++.old-deja/g++.eh/ctor1.C @@ -2,7 +2,7 @@ struct A { A(); - A(A&); // { dg-error "" } referenced below + A(A&); // { dg-message "candidates" } referenced below }; int @@ -10,7 +10,8 @@ main () { try { - throw A(); // { dg-error "" } can't copy + throw A(); // { dg-error "no matching" "match" } can't copy +// { dg-error "thrown expression" "expr" { target *-*-* } 13 } } catch (...) { } } diff --git a/gcc/testsuite/g++.old-deja/g++.eh/spec6.C b/gcc/testsuite/g++.old-deja/g++.eh/spec6.C index b9ccd6e8369..b6e7f264552 100644 --- a/gcc/testsuite/g++.old-deja/g++.eh/spec6.C +++ b/gcc/testsuite/g++.old-deja/g++.eh/spec6.C @@ -25,7 +25,7 @@ template<class T> void fnx(T *) throw(T){} // { dg-error "" } invalid use of vo void fx() { fnx((int *)0); - fnx((void *)0); // { dg-error "" } instantiated from here + fnx((void *)0); // { dg-message "instantiated from here" } } // [except.spec] 2, exception specifiers must be the same set of types (but diff --git a/gcc/testsuite/g++.old-deja/g++.ext/overload1.C b/gcc/testsuite/g++.old-deja/g++.ext/overload1.C index e72916355b7..f7c8018ecdd 100644 --- a/gcc/testsuite/g++.old-deja/g++.ext/overload1.C +++ b/gcc/testsuite/g++.old-deja/g++.ext/overload1.C @@ -11,10 +11,10 @@ struct X { X (int); }; -void Foo (int, float, bool); // { dg-warning "" } candidate -void Foo (float, int, X); // { dg-warning "" } candidate +void Foo (int, float, bool); // { dg-message "candidate" } +void Foo (float, int, X); // { dg-message "candidate" } void Baz () { - Foo (1, 1, 0); // { dg-warning "" } least worse + Foo (1, 1, 0); // { dg-warning "worst" } } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/conversion11.C b/gcc/testsuite/g++.old-deja/g++.jason/conversion11.C index 368dcbc140a..78e46e1cd38 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/conversion11.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/conversion11.C @@ -14,14 +14,14 @@ public: class Something { public: - void DoSomething(Ding A); // { dg-error "" } referred to + void DoSomething(Ding A); // { dg-message "candidates" } referred to }; void DoSomething(Ding A); void foo(Something* pX) { - DoSomething(1); // { dg-error "" } - pX->DoSomething(1); // { dg-error "" } - (*pX).DoSomething(1); // { dg-error "" } + DoSomething(1); // { dg-error "conversion" } + pX->DoSomething(1); // { dg-error "no matching" } + (*pX).DoSomething(1); // { dg-error "no matching" } } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/crash11.C b/gcc/testsuite/g++.old-deja/g++.jason/crash11.C index 5cc8e5f3d6b..1883e175a6a 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/crash11.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/crash11.C @@ -6,4 +6,4 @@ struct A { }; const char foo[] = "bar"; const A a = { foo }; -extern const A* ap = &a; //{ dg-warning "warning: 'ap' initialized and declared 'extern'" } +extern const A* ap = &a; //{ dg-warning "'ap' initialized and declared 'extern'" } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/crash3.C b/gcc/testsuite/g++.old-deja/g++.jason/crash3.C index 4a3d097d786..5d5b3af9cb4 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/crash3.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/crash3.C @@ -3,11 +3,11 @@ // and fails. struct Node -{ // { dg-error "" } +{ // { dg-message "note" } Node* child[2]; }; void bug(int i) { - Node* q = new Node(i); // { dg-error "" } + Node* q = new Node(i); // { dg-error "no matching" } } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/lineno3.C b/gcc/testsuite/g++.old-deja/g++.jason/lineno3.C index cf39f1c76a4..997267e7244 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/lineno3.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/lineno3.C @@ -8,6 +8,7 @@ template <class T> class A public: # 200 "lineno3.C" int foo () { undef1(); } // { dg-error "" "" { target *-*-* } 200 } + // { dg-message "note" "note" { target *-*-* } 200 } }; template class A<int>; diff --git a/gcc/testsuite/g++.old-deja/g++.jason/lineno4.C b/gcc/testsuite/g++.old-deja/g++.jason/lineno4.C index 272c050d791..caa5bc216cd 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/lineno4.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/lineno4.C @@ -8,6 +8,7 @@ public: # 200 "lineno4.C" int foo () { undef1(); } // { dg-error "" "" { target *-*-* } 200 } + // { dg-message "note" "note" { target *-*-* } 200 } }; template class A<int>; diff --git a/gcc/testsuite/g++.old-deja/g++.jason/opeq3.C b/gcc/testsuite/g++.old-deja/g++.jason/opeq3.C index 8fbda4fc149..7a50abb2567 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/opeq3.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/opeq3.C @@ -11,5 +11,5 @@ void foo () { int one=1, two=2; X a(one), b(two); - a = b; // { dg-error "synthesized" } + a = b; // { dg-message "synthesized" } } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/overload16.C b/gcc/testsuite/g++.old-deja/g++.jason/overload16.C index 13537087836..455376fc881 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/overload16.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/overload16.C @@ -1,7 +1,7 @@ // { dg-do assemble } -void f (int); // { dg-error "" } -void f (long); // { dg-error "" } +void f (int); // { dg-message "candidates" } +void f (long); // { dg-message "note" } int main() { - f (1 & 0xffffff00UL); // { dg-error "" } ambiguous + f (1 & 0xffffff00UL); // { dg-error "ambiguous" } } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/overload28.C b/gcc/testsuite/g++.old-deja/g++.jason/overload28.C index a3dcb8d6a13..46bf918d047 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/overload28.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/overload28.C @@ -2,11 +2,11 @@ // PRMS Id: 6056 struct Foo { - Foo() { } // { dg-error "" } candidate - Foo(int i = 25) { } // { dg-error "" } candidate + Foo() { } // { dg-message "note" } + Foo(int i = 25) { } // { dg-message "note" } }; int main() { - Foo* f1 = new Foo(); // { dg-error "" } ambiguous + Foo* f1 = new Foo(); // { dg-error "ambiguous" } } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/pmf5.C b/gcc/testsuite/g++.old-deja/g++.jason/pmf5.C index a5405243fcc..26fa9432aca 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/pmf5.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/pmf5.C @@ -15,4 +15,5 @@ struct ThingEntry { static ThingEntry KeyWordTable[] = { &Thing::FunctionA, Thing::OverloadFn, -}; // { dg-warning "" } implicit & +}; // { dg-error "assuming" "assuming" } implicit & +// { dg-message "note" "note" { target *-*-* } 18 } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/scoping10.C b/gcc/testsuite/g++.old-deja/g++.jason/scoping10.C index 88411fa993e..d5763748f61 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/scoping10.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/scoping10.C @@ -3,7 +3,7 @@ void f (char *); struct A { - void f (); // { dg-error "" } referred to + void f (); // { dg-message "candidates" } referred to }; struct B : public A { void g (char *); diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template30.C b/gcc/testsuite/g++.old-deja/g++.jason/template30.C index 370bb18a561..e5d194012ea 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/template30.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/template30.C @@ -1,14 +1,14 @@ // { dg-do assemble } template <class T, class U> -int func(U, T); // { dg-error "" } ref below +int func(U, T); // { dg-message "candidates" } template <class T, class U> -int func(T, U) // { dg-error "" } ref below +int func(T, U) // { dg-message "note" } { return 2; } int main () { - func (0, 1); // { dg-error "" } ambiguous + func (0, 1); // { dg-error "ambiguous" } } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/temporary2.C b/gcc/testsuite/g++.old-deja/g++.jason/temporary2.C index 97185d47ac0..efd09fd06b1 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/temporary2.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/temporary2.C @@ -2,9 +2,9 @@ class X // Indentation has been done so to see the similarities. { public: - X() {} // { dg-error "" } referenced below - X(X& x) {x.i=7;} // { dg-error "" } Both functions modify the - void bar(X& x) {x.i=7;} // { dg-error "" } reference parameter x. + X() {} // { dg-message "note" } referenced below + X(X& x) {x.i=7;} // { dg-message "note" } Both functions modify the + void bar(X& x) {x.i=7;} // { dg-message "note" } reference parameter x. int i; }; @@ -12,6 +12,6 @@ X foo() { X x; return x; } int main() { - X x(foo()); // { dg-error "" } Compiler doesn't warn about temporary reference. - x.bar(foo()); // { dg-error "" } The same mistake is warned about in this case. + X x(foo()); // { dg-error "no match" } Compiler doesn't warn about temporary reference. + x.bar(foo()); // { dg-error "no match" } The same mistake is warned about in this case. } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/tredecl4.C b/gcc/testsuite/g++.old-deja/g++.jason/tredecl4.C index c5bb92e1b15..0fa6aef5f2c 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/tredecl4.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/tredecl4.C @@ -2,5 +2,5 @@ // It is illegal to use the name of a class template for anything else, // including another class template. -template <class T> class A { }; // { dg-error "" } -template <class U, class V> class A { }; // { dg-error "" } +template <class T> class A { }; // { dg-message "previous" } +template <class U, class V> class A { }; // { dg-error "redeclared" } diff --git a/gcc/testsuite/g++.old-deja/g++.law/arg1.C b/gcc/testsuite/g++.old-deja/g++.law/arg1.C index 9da5e6e0273..8b117aa8916 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/arg1.C +++ b/gcc/testsuite/g++.old-deja/g++.law/arg1.C @@ -9,14 +9,14 @@ // check the order of declarations class A { public: - void f(double* p) { std::cout << "A(double*)\n"; } // { dg-error "" } candidate - void f(int* p) { std::cout << "A(int*)\n"; } // { dg-error "" } candidate + void f(double* p) { std::cout << "A(double*)\n"; } // { dg-message "candidates" } + void f(int* p) { std::cout << "A(int*)\n"; } // { dg-message "note" } }; class B { public: - void f(int* p) { std::cout << "B(int*)\n"; } // { dg-error "" } candidate - void f(double* p) { std::cout << "B(double*)\n"; } // { dg-error "" } candidate + void f(int* p) { std::cout << "B(int*)\n"; } // { dg-message "candidates" } + void f(double* p) { std::cout << "B(double*)\n"; } // { dg-message "note" } }; int main() @@ -24,7 +24,7 @@ int main() A a; B b; - a.f(0);// { dg-error "" } .* - b.f(0);// { dg-error "" } .* + a.f(0);// { dg-error "ambiguous" } + b.f(0);// { dg-error "ambiguous" } } diff --git a/gcc/testsuite/g++.old-deja/g++.law/arg11.C b/gcc/testsuite/g++.old-deja/g++.law/arg11.C index 3772b07990e..b6a0194f314 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/arg11.C +++ b/gcc/testsuite/g++.old-deja/g++.law/arg11.C @@ -9,14 +9,14 @@ struct String { String(const char*); }; struct Ack { Ack(String); }; -struct S { void method(Ack); }; // { dg-error "" } referenced below +struct S { void method(Ack); }; // { dg-message "candidates" } referenced below void function(Ack); int foo(S *o) { // Neither call has a usable constructor for conversions of char[5] to Ack. - function("adsf");// { dg-error "" } - o->method("adsf");// { dg-error "" } + function("adsf");// { dg-error "conversion" } + o->method("adsf");// { dg-error "no matching" } return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/arm9.C b/gcc/testsuite/g++.old-deja/g++.law/arm9.C index 49232fcd15e..7c7cfea0c8f 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/arm9.C +++ b/gcc/testsuite/g++.old-deja/g++.law/arm9.C @@ -19,11 +19,11 @@ class B : public A { public: void set (f2 f); }; -void B::set (f2 f) { std::cout << "called B\n";} // { dg-error "" } candidate +void B::set (f2 f) { std::cout << "called B\n";} // { dg-message "candidates" } int main() { B b; - b.set(F1); // ARM page 309: should call A.set(f1) and that what g++ does,// { dg-error "" } .* + b.set(F1); // ARM page 309: should call A.set(f1) and that what g++ does,// { dg-error "match" } // but 13.1 of ARM clearly states that it should call B::set() // or generate an error because overloading works only for // functions within the same scope (first page of chapter 13) diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors11.C b/gcc/testsuite/g++.old-deja/g++.law/ctors11.C index 84c95172b6d..39ee76b0ae7 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/ctors11.C +++ b/gcc/testsuite/g++.old-deja/g++.law/ctors11.C @@ -10,12 +10,12 @@ public: inline A(int x){printf("constructing A with %d\n", x);} }; -class B:public A{ // { dg-error "" } non-default constructor +class B:public A{ // { dg-message "note" } non-default constructor private: public: }; int main() { - B(10);// { dg-error "" } B doesn't have a constructor taking int + B(10);// { dg-error "match" } B doesn't have a constructor taking int } diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors17.C b/gcc/testsuite/g++.old-deja/g++.law/ctors17.C index 1cee3082595..3d63d01c0a9 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/ctors17.C +++ b/gcc/testsuite/g++.old-deja/g++.law/ctors17.C @@ -9,13 +9,13 @@ #include <fstream> -class X : public std::ifstream { // { dg-error "" } candidate +class X : public std::ifstream { // { dg-message "note" } candidate public: - X(int a, const char *b) {} // { dg-error "" } candidate + X(int a, const char *b) {} // { dg-message "note" } candidate }; int main() { X *y = new X(10, "123"); // the compiler must reject this constructor call: - X *x = new X("abc");// { dg-error "" } .* + X *x = new X("abc");// { dg-error "match" } } diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors5.C b/gcc/testsuite/g++.old-deja/g++.law/ctors5.C index c9851bf21b7..02c5fb06fe4 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/ctors5.C +++ b/gcc/testsuite/g++.old-deja/g++.law/ctors5.C @@ -6,7 +6,7 @@ // Date: Tue, 1 Sep 92 10:38:44 EDT class X -{ // { dg-error "1: note: X::X\\(const X&\\)" } implicit constructor +{ // { dg-message "1:X::X\\(const X&\\)" } implicit constructor private: int x; public: @@ -14,21 +14,23 @@ class X X( int ); }; -class Y // { dg-error "1: error: new types may not be defined in a return type|1: note: \\(perhaps a semicolon is missing after the definition of 'Y'\\)" } +class Y // { dg-error "1:new types may not be defined in a return type" "err" } + // { dg-message "1:\\(perhaps a semicolon is missing after the definition of 'Y'\\)" "note" { target *-*-* } 17 } { private: X xx; public: Y(); } -X::X( int xi ) // { dg-error "14: error: return type specification for constructor invalid|1: note: candidates are: X::X\\(int\\)" } +X::X( int xi ) // { dg-error "14:return type specification for constructor invalid" "err" } +// { dg-message "1:candidates are: X::X\\(int\\)" "note" { target *-*-* } 25 } { x = xi; } const X X::x0( 0 ); -Y::Y() // { dg-error "6: error: no matching function for call to 'X::X\\(\\)'" } +Y::Y() // { dg-error "6:no matching function for call to 'X::X\\(\\)'" } { xx = X::x0; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors9.C b/gcc/testsuite/g++.old-deja/g++.law/ctors9.C index bc51426459a..17207f6acf5 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/ctors9.C +++ b/gcc/testsuite/g++.old-deja/g++.law/ctors9.C @@ -21,7 +21,7 @@ Foo::Foo(int aa) struct var_Foo: public Foo -{ // { dg-error "" } base.*// ERROR - in class.* +{ // { dg-message "note" } base.*// ERROR - in class.* var_Foo* operator-> () {return this;} }; @@ -32,7 +32,7 @@ int blort(Foo& f) int main() { - var_Foo b(2);// { dg-error "" } + var_Foo b(2);// { dg-error "match" } b->a = 0; int x = blort(b); return x; diff --git a/gcc/testsuite/g++.old-deja/g++.law/enum4.C b/gcc/testsuite/g++.old-deja/g++.law/enum4.C index e41e9f308bc..742f54bc459 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/enum4.C +++ b/gcc/testsuite/g++.old-deja/g++.law/enum4.C @@ -11,7 +11,7 @@ enum Enum {enumerator1, enumerator2}; struct Struct { int i; - int getI(Enum) {return i;} // { dg-error "" } candidates + int getI(Enum) {return i;} // { dg-message "candidates" } }; int funct (Enum) @@ -23,7 +23,7 @@ int main() { Enum e = enumerator1; Struct s; - int x = funct(e+1);// { dg-error "" } .* - int y = s.getI(e+1);// { dg-error "" } .* + int x = funct(e+1);// { dg-error "invalid" } + int y = s.getI(e+1);// { dg-error "match" } return x+y; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C b/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C index a26f456f20a..5f1187a592b 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C +++ b/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C @@ -14,8 +14,10 @@ #undef max #endif -inline int max(int a, int b) {return a > b ? a : b;}; // { dg-error "" } candidate -inline double max(double a, double b) {return a > b ? a : b;}; // { dg-error "" } candidate +inline int max(int a, int b) {return a > b ? a : b;}; // { dg-message "candidate" } + // { dg-error "extra ';'" "extra ;" { target *-*-* } 17 } +inline double max(double a, double b) {return a > b ? a : b;}; // { dg-message "note" } candidate + // { dg-error "extra ';'" "extra ;" { target *-*-* } 19 } int main() { static void foo(int i, int j, double x, double y) ;// { dg-error "" } .* diff --git a/gcc/testsuite/g++.old-deja/g++.law/operators9.C b/gcc/testsuite/g++.old-deja/g++.law/operators9.C index 127aa8cf7b8..8ec6825abfa 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/operators9.C +++ b/gcc/testsuite/g++.old-deja/g++.law/operators9.C @@ -9,11 +9,12 @@ class B { public: - operator=(B &); // { dg-error "" } no type or storage class + operator=(B &); // { dg-error "no type" } + // { dg-message "candidates" "note" { target *-*-* } 12 } }; void test(B &b1, const B &b2) { - b1 = b2;// { dg-error "" } .* + b1 = b2;// { dg-error "match" } } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net2.C b/gcc/testsuite/g++.old-deja/g++.mike/net2.C index c9aff266fdb..f2240ddfc18 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/net2.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/net2.C @@ -3,11 +3,11 @@ class B; -class A { // { dg-error "" } copy ctor candidate +class A { // { dg-message "note" } copy ctor candidate private: - A(B *); // { dg-error "" } + A(B *); // { dg-message "note" } public: - A(long); // { dg-error "" } + A(long); // { dg-message "note" } }; -A a(0); // { dg-error "" } should be ambigious +A a(0); // { dg-error "ambiguous" } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net22.C b/gcc/testsuite/g++.old-deja/g++.mike/net22.C index de39a529e1b..e5e1cb1081d 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/net22.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/net22.C @@ -5,10 +5,10 @@ public: Parent( char *s ) {} }; -class Child : public Parent { // { dg-error "" } called +class Child : public Parent { // { dg-message "note" } called }; int main() { - Child c( "String initializer" ); // { dg-error "" } bad + Child c( "String initializer" ); // { dg-error "match" } bad return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p11110.C b/gcc/testsuite/g++.old-deja/g++.mike/p11110.C index 6be0a08685f..746a57ccfd6 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p11110.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p11110.C @@ -6,7 +6,7 @@ class data; class conatiner { public: virtual void* first (); - virtual data* contents (void* i); // { dg-error "" } candidates + virtual data* contents (void* i); // { dg-message "candidates" } }; class user { @@ -17,5 +17,5 @@ private: }; data* user::data1() const { - return (_c.contents (_c.first)); // { dg-error "" } + return (_c.contents (_c.first)); // { dg-error "match" } } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p1989.C b/gcc/testsuite/g++.old-deja/g++.mike/p1989.C index 807803f0a94..c8664390b4a 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p1989.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p1989.C @@ -196,7 +196,7 @@ Pix List_DLS<T>::search(const T& item) const { for (Pix x=this->first(); 0 != x; this->next(x)) { - if (item == this->operator()(x)) // { dg-error "" } const subversion + if (item == this->operator()(x)) // { dg-error "match" } const subversion return x; } return 0; @@ -485,8 +485,8 @@ class STRLIdentifier { char buf[10]; }; -extern int operator==(vertex<STRLIdentifier*>&, vertex<STRLIdentifier*>&); // { dg-error "" } const subversion -extern int operator==(STRLIdentifier&, STRLIdentifier&); // { dg-error "" } fn ref in err msg +extern int operator==(vertex<STRLIdentifier*>&, vertex<STRLIdentifier*>&); // { dg-message "candidates" } const subversion +extern int operator==(STRLIdentifier&, STRLIdentifier&); // { dg-message "note" } fn ref in err msg extern int x(List_DLSp<STRLIdentifier *>); diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2431.C b/gcc/testsuite/g++.old-deja/g++.mike/p2431.C index 897adfd58a6..1d5b3974f9a 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p2431.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p2431.C @@ -3,7 +3,7 @@ class A { public: - A(A &); // { dg-error "" } candidates are + A(A &); // { dg-message "candidates" } }; class B @@ -18,6 +18,6 @@ class C C() { B b; - A a = b;// { dg-error "" } + A a = b;// { dg-error "match" } } }; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p438.C b/gcc/testsuite/g++.old-deja/g++.mike/p438.C index c2bdce312f6..a08a404aa91 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p438.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p438.C @@ -12,12 +12,12 @@ class C class D { public: - void a(C& b); // { dg-error "" } referenced below + void a(C& b); // { dg-message "candidates" } }; void C::test() const { D d; - d.a(*this); // { dg-error "" } *this is const, so should get error + d.a(*this); // { dg-error "match" } *this is const, so should get error } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p807a.C b/gcc/testsuite/g++.old-deja/g++.mike/p807a.C index 748231c66b8..83879bd7390 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p807a.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p807a.C @@ -10,13 +10,13 @@ class B; class A { public: - A(B&); // { dg-error "" } fn ref in err msg + A(B&); // { dg-message "note" } fn ref in err msg }; class B { public: - operator A(); // { dg-error "" } fn ref in err msg + operator A(); // { dg-message "candidates" } fn ref in err msg }; B b; -A a = b; // { dg-error "" } should fail as it is ambigious. +A a = b; // { dg-error "ambiguous" } should fail as it is ambigious. diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p9068.C b/gcc/testsuite/g++.old-deja/g++.mike/p9068.C index ab2d034b868..aff4a6a7bc7 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p9068.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p9068.C @@ -2,7 +2,7 @@ // prms-id: 9068 struct ostream { - void operator<< (int); // { dg-error "" } fn ref in err msg + void operator<< (int); // { dg-message "candidates" } fn ref in err msg }; class C { @@ -13,7 +13,7 @@ public: void foo (ostream& lhs, const C& rhs) { - lhs << rhs.i; // { dg-error "" } no such i for any opr << () + lhs << rhs.i; // { dg-error "match" } no such i for any opr << () } int& C::i () { diff --git a/gcc/testsuite/g++.old-deja/g++.niklas/t120.C b/gcc/testsuite/g++.old-deja/g++.niklas/t120.C index 89fd8e6fc0e..17eaf0743fc 100644 --- a/gcc/testsuite/g++.old-deja/g++.niklas/t120.C +++ b/gcc/testsuite/g++.old-deja/g++.niklas/t120.C @@ -2,4 +2,5 @@ // GROUPS passed niklas ellipsis typedef void (*T) (...); void f (); -struct S { void g (T); void h() { g(f); } };// { dg-error "" } +struct S { void g (T); void h() { g(f); } };// { dg-error "match" "match" } +// { dg-message "candidates" "note" { target *-*-* } 5 } diff --git a/gcc/testsuite/g++.old-deja/g++.niklas/t121.C b/gcc/testsuite/g++.old-deja/g++.niklas/t121.C index d25c79fb77e..cf3373964a2 100644 --- a/gcc/testsuite/g++.old-deja/g++.niklas/t121.C +++ b/gcc/testsuite/g++.old-deja/g++.niklas/t121.C @@ -1,5 +1,6 @@ // { dg-do assemble } // GROUPS passed niklas ellipsis void f (); -void g1 (void (*) (...)); void h1 () { g1 (f); }// { dg-error "" } .* -struct S { void g2 (void (*) (...)); void h2 () { g2 (f); } };// { dg-error "" } +void g1 (void (*) (...)); void h1 () { g1 (f); }// { dg-error "invalid conversion" } +struct S { void g2 (void (*) (...)); void h2 () { g2 (f); } };// { dg-error "match" "match" } +// { dg-message "candidates" "note" { target *-*-* } 5 } diff --git a/gcc/testsuite/g++.old-deja/g++.niklas/t128.C b/gcc/testsuite/g++.old-deja/g++.niklas/t128.C index 4fe96eb3a68..19e3ca1dab0 100644 --- a/gcc/testsuite/g++.old-deja/g++.niklas/t128.C +++ b/gcc/testsuite/g++.old-deja/g++.niklas/t128.C @@ -1,5 +1,5 @@ // { dg-do assemble } // GROUPS niklas uncaught default-construct struct A { A (int); }; -struct B : A {}; // { dg-error "" } without ctor // ERROR - candidates -void f () { B (0); }// { dg-error "" } .* +struct B : A {}; // { dg-message "note" } without ctor // ERROR - candidates +void f () { B (0); }// { dg-error "match" } .* diff --git a/gcc/testsuite/g++.old-deja/g++.ns/overload2.C b/gcc/testsuite/g++.old-deja/g++.ns/overload2.C index a6ea9439d08..85df6bd694b 100644 --- a/gcc/testsuite/g++.old-deja/g++.ns/overload2.C +++ b/gcc/testsuite/g++.old-deja/g++.ns/overload2.C @@ -1,13 +1,13 @@ // { dg-do assemble } namespace A{ - void f(); // { dg-error "" } .* + void f(); // { dg-message "note" } } using namespace A; -void f(); // { dg-error "" } .* +void f(); // { dg-message "note" } void g() { - f(); // { dg-error "" } ambiguous, ::f or A::f ? + f(); // { dg-error "ambiguous" } ambiguous, ::f or A::f ? } diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template13.C b/gcc/testsuite/g++.old-deja/g++.ns/template13.C index 7059b1949f8..a9559c7153b 100644 --- a/gcc/testsuite/g++.old-deja/g++.ns/template13.C +++ b/gcc/testsuite/g++.old-deja/g++.ns/template13.C @@ -5,7 +5,7 @@ namespace bar // trick it to provide some prior declaration template<class T> void foo(); // { dg-error "definition" } - template<class T>class X; // { dg-error "note: previous declaration" } + template<class T>class X; // { dg-message "note: previous declaration" } } template <typename T> @@ -20,4 +20,4 @@ template<> void bar::foo<int>() // { dg-error "different namespace" } } template<class T,class U> -class bar::X{}; // { dg-error "error: redeclared with 2 template parameter" } +class bar::X{}; // { dg-error "redeclared with 2 template parameter" } diff --git a/gcc/testsuite/g++.old-deja/g++.ns/using12.C b/gcc/testsuite/g++.old-deja/g++.ns/using12.C index 057457c7087..c3425c7f290 100644 --- a/gcc/testsuite/g++.old-deja/g++.ns/using12.C +++ b/gcc/testsuite/g++.old-deja/g++.ns/using12.C @@ -3,17 +3,17 @@ namespace foo { - void x (bool); // { dg-error "" } candidates - void x (char); // { dg-error "" } candidates - void x (int); // { dg-error "" } candidates - void x (double); // { dg-error "" } candidates + void x (bool); // { dg-message "candidates" } + void x (char); // { dg-message "note" } candidates + void x (int); // { dg-message "note" } candidates + void x (double); // { dg-message "note" } candidates } -namespace baz { void x (int); } // { dg-error "" } candidates +namespace baz { void x (int); } // { dg-message "note" } candidates void fn (int i) { using foo::x; using baz::x; - x(i); // { dg-error "" } ambiguous + x(i); // { dg-error "ambiguous" } } diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/delete1.C b/gcc/testsuite/g++.old-deja/g++.oliva/delete1.C index e6ab00b907c..3912dbad5ed 100644 --- a/gcc/testsuite/g++.old-deja/g++.oliva/delete1.C +++ b/gcc/testsuite/g++.old-deja/g++.oliva/delete1.C @@ -29,3 +29,4 @@ struct baz : foo { } baz_; struct bad : baz {} bad_; // { dg-error "" } delete is private in vdtor +// { dg-message "synthesized" "note" { target *-*-* } 31 } diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C b/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C index 5864be7cdb6..91b3b02a439 100644 --- a/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C +++ b/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C @@ -6,18 +6,19 @@ // Based on bug report by JDonner <jdonner@schedsys.com> struct foo { - static int bar(); // { dg-error "" } candidate - void bar(int); // { dg-error "" } candidate + static int bar(); // { dg-error "candidate" } + void bar(int); // { dg-error "foo::bar" } }; /* gcc emits a hard error without -pedantic, and a warning with -pedantic, even in bad1. */ int (*ok1)() = foo::bar; -void (foo::*bad1)(int) = foo::bar; // { dg-error "" } missing & +void (foo::*bad1)(int) = foo::bar; // { dg-error "assuming pointer" } +// { dg-message "note" "note" { target *-*-* } 16 } int (*ok2)() = &foo::bar; // ok -void (*bad2)(int) = foo::bar; // { dg-error "" } overload resolution fails +void (*bad2)(int) = foo::bar; // { dg-error "no matches" } void (foo::*ok3)(int) = &foo::bar; // ok -int (foo::*bad3)() = foo::bar; // { dg-error "" } overload resolution fails +int (foo::*bad3)() = foo::bar; // { dg-error "no matches" } diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/template1.C b/gcc/testsuite/g++.old-deja/g++.oliva/template1.C index 8ac05146866..ce394961804 100644 --- a/gcc/testsuite/g++.old-deja/g++.oliva/template1.C +++ b/gcc/testsuite/g++.old-deja/g++.oliva/template1.C @@ -7,7 +7,7 @@ template<int P = 0> struct foo { - static void bar(double (*)[dim]) {} // { dg-error "" } dim not declared + static void bar(double (*)[dim]) {} // { dg-error "'dim' was not declared" } }; void bar() { diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash24.C b/gcc/testsuite/g++.old-deja/g++.other/crash24.C index 09e9788e26f..9d6af1dfe87 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/crash24.C +++ b/gcc/testsuite/g++.old-deja/g++.other/crash24.C @@ -7,11 +7,12 @@ class foo { friend class __iterator; typedef __iterator const_iterator; virtual ~foo() { } - __iterator begin(); // { dg-error "" } + __iterator begin(); // { dg-message "candidates" } }; static void iteratorTest(const foo &x) { - foo::const_iterator i = x.begin(); // { dg-error "" } + foo::const_iterator i = x.begin(); // { dg-error "incomplete type" "incomplete type" } + // { dg-error "no matching" "no matching" { target *-*-* } 14 } for (; i; ++i) *i; } diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash25.C b/gcc/testsuite/g++.old-deja/g++.other/crash25.C index 517bac2d5d6..5460e03886f 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/crash25.C +++ b/gcc/testsuite/g++.old-deja/g++.other/crash25.C @@ -2,16 +2,17 @@ // { dg-options "-fshow-column" } // Origin: Jakub Jelinek <jakub@redhat.com> -class X { // { dg-error "1: error: new types may not be defined in a return type|1: note: \\(perhaps a semicolon is missing after the definition of 'X'\\)" } +class X { // { dg-error "1:new types may not be defined in a return type" "new types" } +// { dg-message "1:\\(perhaps a semicolon is missing after the definition of 'X'\\)" "note" { target *-*-* } 5 } public: X(); virtual ~X(); } -X::x() // { dg-error "6: error: no 'X X::x\\(\\)' member function declared in class 'X'" } +X::x() // { dg-error "6:no 'X X::x\\(\\)' member function declared in class 'X'" } { } -X::~x() // { dg-error "6: error: expected class-name before '\\(' token" } +X::~x() // { dg-error "6:expected class-name before '\\(' token" } { } diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl3.C b/gcc/testsuite/g++.old-deja/g++.other/decl3.C index a03d2e9d53e..bdcfcb02c6f 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/decl3.C +++ b/gcc/testsuite/g++.old-deja/g++.other/decl3.C @@ -6,14 +6,14 @@ // We should not allow arrays of abstract type. [class.abstract/2] -struct cow_t { // { dg-error "" } note - virtual void f()=0; // { dg-error "" } pure +struct cow_t { // { dg-message "pure" } + virtual void f()=0; // { dg-message "note" } }; int main() { - cow_t cow[2]; // { dg-error "" } abstract class + cow_t cow[2]; // { dg-error "invalid abstract type" } cow[0].f(); return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.other/expr1.C b/gcc/testsuite/g++.old-deja/g++.other/expr1.C index 9471448c21b..1f1f60d19c2 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/expr1.C +++ b/gcc/testsuite/g++.old-deja/g++.other/expr1.C @@ -3,9 +3,9 @@ // Simplified from bug report by Trevor Taylor <ttaylor@powerup.com.au> struct T { - int operator()(int) { } // { dg-error "" } candidate + int operator()(int) { } // { dg-message "candidates" } }; int main() { - T()(); // { dg-error "" } no such operator + T()(); // { dg-error "match" } no such operator } diff --git a/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C b/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C index ef9c1f7823b..9a5c4ca9540 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C +++ b/gcc/testsuite/g++.old-deja/g++.other/overcnv2.C @@ -16,7 +16,9 @@ struct B : public A { int main() { B b; - if ((const char *)b != 0) // { dg-warning "" } surprising overload resolution + if ((const char *)b != 0) // { dg-warning "choosing 'B" "B" } surprising overload resolution + // { dg-warning "for conversion" "conv" { target *-*-* } 19 } + // { dg-message "note" "note" { target *-*-* } 19 } return 1; if ((const char *)(const B)b == 0) return 2; diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload11.C b/gcc/testsuite/g++.old-deja/g++.other/overload11.C index 17b70d406b2..3b0cab79fd9 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/overload11.C +++ b/gcc/testsuite/g++.old-deja/g++.other/overload11.C @@ -22,7 +22,9 @@ void ovl (int); // { dg-error "" } candidate +// { dg-message "int" "int" { target *-*-* } 24 } void ovl (float); // { dg-error "" } candidate +// { dg-message "float" "float" { target *-*-* } 26 } void fn (int); void fna (int); @@ -72,7 +74,7 @@ int main (int argc, char **argv) ptr = (argc ? fna : fn); ptr = (argc ? &fna : &fn); - f; // { dg-warning "" } not a call + f; // { dg-error "" } not a call ovl; // { dg-error "" } not suitable for overload &ovl; // { dg-error "" } not suitable for overload (void)f; // ok diff --git a/gcc/testsuite/g++.old-deja/g++.other/pmf3.C b/gcc/testsuite/g++.old-deja/g++.other/pmf3.C index fa9e92ec998..d8568dd9b1b 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/pmf3.C +++ b/gcc/testsuite/g++.old-deja/g++.other/pmf3.C @@ -3,7 +3,7 @@ // Bug: g++ was crashing after giving errors. template<class T> - void connect_to_method( // { dg-error "candidates are" } + void connect_to_method( // { dg-message "candidates are" } T *receiver, void (T::*method)()) {} @@ -20,6 +20,6 @@ public: Gtk_Base::Gtk_Base() { - connect_to_method(this,&show); // { dg-error "" } invalid pmf expression - connect_to_method(this,&expose); // { dg-error "" } invalid pmf expression + connect_to_method(this,&show); // { dg-error "no match" } invalid pmf expression + connect_to_method(this,&expose); // { dg-error "pointer to member" } invalid pmf expression } diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C index 384885442b5..b04f7e2657c 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C +++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C @@ -20,9 +20,10 @@ struct A void A::foo () { int (A::*ptr1) (int) = &A::ns; - int (A::*ptr2) (int) = A::ns; // { dg-error "" } not ptr mem - int (A::*ptr3) (int) = &ns; // { dg-error "" } not ptr mem - int (A::*ptr4) (int) = ns; // { dg-error "" } not ptr mem + int (A::*ptr2) (int) = A::ns; // { dg-error "pointer to member" "err" } + // { dg-message "pointer to member" "note" { target *-*-* } 23 } + int (A::*ptr3) (int) = &ns; // { dg-error "pointer to member" "err" } + int (A::*ptr4) (int) = ns; // { dg-error "pointer to member" "err" } int (*ptr5) (short) = &A::ns; int (*ptr6) (short) = A::ns; @@ -30,12 +31,12 @@ void A::foo () int (*ptr8) (short) = ns; int (A::*ptr11) (int) = &A::single; - int (A::*ptr12) (int) = A::single; // { dg-error "" } not ptr mem - int (A::*ptr13) (int) = &single; // { dg-error "" } not ptr mem - int (A::*ptr14) (int) = single; // { dg-error "" } not ptr mem + int (A::*ptr12) (int) = A::single; // { dg-error "match" } + int (A::*ptr13) (int) = &single; // { dg-error "pointer to member" } + int (A::*ptr14) (int) = single; // { dg-error "match" } - int (A::*ptr20) (int) = &(A::ns); // { dg-error "" } not ptr mem - int (A::*ptr21) (int) = &(A::single); // { dg-error "" } not ptr mem + int (A::*ptr20) (int) = &(A::ns); // { dg-error "pointer to member" } + int (A::*ptr21) (int) = &(A::single); // { dg-error "pointer to member" } int (*ptr31) (short) = &A::sole; int (*ptr32) (short) = A::sole; diff --git a/gcc/testsuite/g++.old-deja/g++.other/vaarg3.C b/gcc/testsuite/g++.old-deja/g++.other/vaarg3.C index d86d8c1ea32..8ed6df78632 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/vaarg3.C +++ b/gcc/testsuite/g++.old-deja/g++.other/vaarg3.C @@ -9,19 +9,22 @@ struct X {int m;}; struct Y : X {int m;}; -struct Z; // { dg-error "" } forward decl +struct Z; // { dg-error "forward decl" } void fn1(va_list args) { int i = va_arg (args, int); - Y x = va_arg (args, Y); // { dg-warning "" } cannot receive - Y y = va_arg (args, struct Y); // { dg-warning "" } cannot receive - int &r = va_arg (args, int &); // { dg-warning "" } cannot receive + Y x = va_arg (args, Y); // { dg-warning "cannot receive" } + Y y = va_arg (args, struct Y); // { dg-warning "cannot receive" } + int &r = va_arg (args, int &); // { dg-warning "cannot receive" } - Z z1 = va_arg (args, Z); // { dg-error "" } incomplete - const Z &z2 = va_arg (args, Z); // { dg-error "" } incomplete + Z z1 = va_arg (args, Z); // { dg-error "incomplete" } + const Z &z2 = va_arg (args, Z); // { dg-error "incomplete" } - va_arg (args, char); // { dg-error "" } promote - va_arg (args, int []); // { dg-error "" } promote - va_arg (args, int ()); // { dg-error "" } promote - va_arg (args, bool); // { dg-error "" } promote + va_arg (args, char); // { dg-warning "promote" } + // { dg-message "should pass" "pass" { target *-*-* } 23 } + // { dg-message "abort" "abort" { target *-*-* } 23 } + va_arg (args, int []); // { dg-error "array with unspecified bounds" } promote + va_arg (args, int ()); // { dg-warning "non-POD" } promote + va_arg (args, bool); // { dg-warning "promote" "promote" } + // { dg-message "abort" "abort" { target *-*-* } 28 } } diff --git a/gcc/testsuite/g++.old-deja/g++.other/volatile1.C b/gcc/testsuite/g++.old-deja/g++.other/volatile1.C index 32eef6f301f..9e72ea266a1 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/volatile1.C +++ b/gcc/testsuite/g++.old-deja/g++.other/volatile1.C @@ -3,7 +3,8 @@ // compiler. class f_class -{ }; // { dg-error "" } candidates +{ }; // { dg-message "candidates" "candidates" } +// { dg-message "note" "note" { target *-*-* } 6 } volatile f_class ret_v_f_class() @@ -15,6 +16,6 @@ ret_v_f_class() int main(void) { volatile f_class vf; - 0 ? ret_v_f_class() : vf; // { dg-error "" } can't copy volatile lvalue + 0 ? ret_v_f_class() : vf; // { dg-error "match" } can't copy volatile lvalue return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/assign1.C b/gcc/testsuite/g++.old-deja/g++.pt/assign1.C index 9f2a4bf065b..464b7c692d0 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/assign1.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/assign1.C @@ -10,5 +10,5 @@ struct S { // { dg-error "assignment" } void f() { S<const int> s; - s = s; // { dg-error "synthesized" } + s = s; // { dg-message "synthesized" } } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/auto_ptr.C b/gcc/testsuite/g++.old-deja/g++.pt/auto_ptr.C index 51bd79ab975..37af9ca434e 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/auto_ptr.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/auto_ptr.C @@ -9,9 +9,9 @@ template<typename X> struct auto_ptr { typedef X element_type; explicit auto_ptr(X* p =0) throw() : px(p) {} - auto_ptr(auto_ptr& r) throw() : px(r.release()) {} // { dg-error "" } candidate + auto_ptr(auto_ptr& r) throw() : px(r.release()) {} // { dg-message "note" } candidate template<typename Y> - auto_ptr(auto_ptr<Y>& r) throw() : px(r.release()) {}// { dg-error "" } candidate + auto_ptr(auto_ptr<Y>& r) throw() : px(r.release()) {}// { dg-message "note" } candidate auto_ptr& operator=(auto_ptr& r) throw() { reset(r.release()); @@ -30,7 +30,7 @@ template<typename X> struct auto_ptr { X* release() throw() { X* p=px; px=0; return p; } void reset(X* p=0) throw() { if (px != p) delete px, px = p; } - auto_ptr(auto_ptr_ref<X> r) throw() : px(r.py) {} // { dg-error "" } candidate + auto_ptr(auto_ptr_ref<X> r) throw() : px(r.py) {} // { dg-message "candidate" } template<typename Y> operator auto_ptr_ref<Y>() throw() { return auto_ptr_ref<Y>(release()); } @@ -51,5 +51,6 @@ int main() { auto_ptr<Derived> y(f()); x = y; g(f()); - h(f()); // { dg-error "" } no usable copy ctor + h(f()); // { dg-error "match" "match" } no usable copy ctor +// { dg-error "initializing" "init" { target *-*-* } 54 } } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/const2.C b/gcc/testsuite/g++.old-deja/g++.pt/const2.C index cb0e2c7a38d..2666b9bc1f7 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/const2.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/const2.C @@ -1,6 +1,6 @@ // { dg-do link } // This test should get a linker error for the reference to A<int>::i. -// { dg-error "i" "" { target *-*-* } 0 } +// { dg-message "i" "" { target *-*-* } 0 } template <class T> struct B { static const int i = 3; }; template <class T> struct A { static const int i = B<T>::i; }; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash10.C b/gcc/testsuite/g++.old-deja/g++.pt/crash10.C index bd2efc673aa..a66450f4520 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/crash10.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash10.C @@ -3,9 +3,10 @@ template<int M, int N> class GCD { public: - enum { val = (N == 0) ? M : GCD<N, M % N>::val }; // { dg-error "" } division + enum { val = (N == 0) ? M : GCD<N, M % N>::val }; // { dg-warning "division" "division" } +// { dg-error "not a valid" "valid" { target *-*-* } 6 } }; int main() { - GCD< 1, 0 >::val; // { dg-error "" } instantiated + GCD< 1, 0 >::val; // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash20.C b/gcc/testsuite/g++.old-deja/g++.pt/crash20.C index f910294e65c..0a3220921ce 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/crash20.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash20.C @@ -1,7 +1,8 @@ // { dg-do compile } template <class T = int> -struct A { // { dg-error "assignment" } +struct A { // { dg-error "assignment" "assignment" } +// { dg-message "instantiated" "inst" { target *-*-* } 4 } const T x; A() : x(0) { } A(T x) : x(x) { } }; @@ -10,7 +11,7 @@ template <class B> void func () { B y; - y = B(); // { dg-error "synthesized" } + y = B(); // { dg-message "synthesized" } } int main (void) { func< A<> >(); } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash36.C b/gcc/testsuite/g++.old-deja/g++.pt/crash36.C index 13695f9c69b..9bf99d16280 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/crash36.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash36.C @@ -14,7 +14,7 @@ struct iterator { template <class Iterator> struct reverse_iterator : public -iterator<typename iterator_traits<Iterator>::iterator_category> { // { dg-error "" } no type iterator_category +iterator<typename iterator_traits<Iterator>::iterator_category> { // { dg-message "instantiated" } no type iterator_category protected: Iterator current; diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash38.C b/gcc/testsuite/g++.old-deja/g++.pt/crash38.C index a2f1e288d3a..4fc658eb157 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/crash38.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash38.C @@ -3,8 +3,10 @@ template <class T> struct S { - typedef typename T::Y<T>::Z X; // { dg-error "" } No Y in A - X x; // { dg-error "" } No Y in A + typedef typename T::Y<T>::Z X; // { dg-error "non-template" "non-template" } No Y in A +// { dg-message "note" "note" { target *-*-* } 6 } +// { dg-error "does not declare" "not declare" { target *-*-* } 6 } + X x; // { dg-error "does not name a type" } No Y in A }; struct A { diff --git a/gcc/testsuite/g++.old-deja/g++.pt/derived3.C b/gcc/testsuite/g++.old-deja/g++.pt/derived3.C index 806e0f5c99c..2c560492325 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/derived3.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/derived3.C @@ -6,11 +6,11 @@ template<class T> class X { class Y : public T - { // { dg-error "base type .* fails to be" "" } + { // { dg-error "base type .* fails to be" } }; - Y y; // { dg-error "instantiated" "" } + Y y; // { dg-message "instantiated" } }; int main() { - X<int> x; // { dg-error "instantiated" "" } + X<int> x; // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/error2.C b/gcc/testsuite/g++.old-deja/g++.pt/error2.C index 40f7a7cb67f..6cb67ddec6b 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/error2.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/error2.C @@ -4,12 +4,12 @@ template <class RT> class Test { public: - Test(const RT& c = RT()) {} // { dg-error "" } reference to void + Test(const RT& c = RT()) {} // { dg-error "reference to void" } }; void f () { - Test<void> c; // { dg-error "" } instantiated from here + Test<void> c; // { dg-message "instantiated" } } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit34.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit34.C index f90b4becb17..ea32cf6ea9e 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit34.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit34.C @@ -5,7 +5,7 @@ template <class T> void foo(T t); template <> -void foo(int) {}; // { dg-error "6:" } previously defined here. +void foo(int) {}; // { dg-error "6:previously declared here" } template <> -void foo<int>(int) {} // { dg-error "6:" } duplicate specialization. +void foo<int>(int) {} // { dg-error "6:redefinition" } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit70.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit70.C index 387d2d1d08d..5724f6d7d02 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/explicit70.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit70.C @@ -12,14 +12,14 @@ template <class T> T S<T>::t; template void f(int); -template void f(int); // { dg-error "" } duplicate explicit instantiation +template void f(int); // { dg-error "duplicate explicit instantiation" } template int S<int>::t; -template int S<int>::t; // { dg-error "" } duplicate explicit instantiation +template int S<int>::t; // { dg-error "duplicate explicit instantiation" } template class S<double>; -template class S<double>; // { dg-error "" } duplicate explicit instantiation +template class S<double>; // { dg-error "duplicate explicit instantiation" } -extern template void f(double); // { dg-warning "" } extern not allowed -inline template class S<float>; // { dg-warning "" } inline not allowed +extern template void f(double); // { dg-error "extern" } extern not allowed +inline template class S<float>; // { dg-error "inline" } inline not allowed template <class T> struct S<T*> {}; @@ -40,4 +40,5 @@ template void f(long double); // OK - explicit instantiation after template <class T> void g(T); -template void g(int); // { dg-error "" } no definition of g. +template void g(int); // { dg-error "no definition available" "no def" } +// { dg-message "instantiated" "inst" { target *-*-* } 43 } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend23.C b/gcc/testsuite/g++.old-deja/g++.pt/friend23.C index baf1a931cba..93ce72e3025 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/friend23.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/friend23.C @@ -1,6 +1,6 @@ // { dg-do assemble } -template <class T = int> // { dg-error "note: original definition" } +template <class T = int> // { dg-message "note: original definition" } struct S { template <class U = int> diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem10.C b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem10.C index d65f2d10dd4..015566f96a4 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem10.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem10.C @@ -15,13 +15,13 @@ struct A void baz (); }; -template <typename T> void foo (int (*)(T)); // { dg-error "" } candidate -template <typename T> void foo (int (A::*)(T)); // { dg-error "" } candidate +template <typename T> void foo (int (*)(T)); // { dg-message "candidate" } +template <typename T> void foo (int (A::*)(T)); // { dg-message "note" } candidate void A::baz () { - foo (&A::f); // { dg-error "" } ambiguous + foo (&A::f); // { dg-error "ambiguous" } foo (A::f); foo (&(A::f)); foo (f); diff --git a/gcc/testsuite/g++.old-deja/g++.pt/redecl1.C b/gcc/testsuite/g++.old-deja/g++.pt/redecl1.C index 7100988601f..4a580e17742 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/redecl1.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/redecl1.C @@ -1,22 +1,22 @@ // { dg-do assemble } template <class T> -struct S1; // { dg-error "" } previous declaration +struct S1; // { dg-message "previous declaration" } template <class T, class U> -struct S1 {}; // { dg-error "" } used 1 template parameter +struct S1 {}; // { dg-error "redeclared" } used 1 template parameter -template <class T = int> // { dg-error "" } original def of default +template <class T = int> // { dg-message "original definition" } struct S2; template <class T = int> -struct S2; // { dg-error "" } redefinition of default +struct S2; // { dg-error "redefinition of default" } -template <class T> // { dg-error "" } template parameter +template <class T> // { dg-error "template parameter" } struct S3; template <int I> -struct S3; // { dg-error "" } redeclared here +struct S3; // { dg-error "redeclared here" } template <template <class T> class C> -struct S3; // { dg-error "" } redeclared here +struct S3; // { dg-error "redeclared here" } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec35.C b/gcc/testsuite/g++.old-deja/g++.pt/spec35.C index f39dd79ec30..a7e5ea252a9 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/spec35.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/spec35.C @@ -8,24 +8,24 @@ extern "C" int puts (char const *); -template <typename T> int Foo (T); // { dg-error "" } candidate -template <typename T> int Foo (T &); // { dg-error "" } candidate +template <typename T> int Foo (T); // { dg-message "candidate" } +template <typename T> int Foo (T &); // { dg-message "note" } candidate -template <typename T> int Qux (T); // { dg-error "" } candidate -template <typename T> int Qux (T const &); // { dg-error "" } candidate +template <typename T> int Qux (T); // { dg-message "candidate" } +template <typename T> int Qux (T const &); // { dg-message "note" } candidate -template <typename T> int Bar (T const *const &); // { dg-error "" } candidate -template <typename T> int Bar (T *const &); // { dg-error "" } candidate -template <typename T> int Bar (T *); // { dg-error "" } candidate +template <typename T> int Bar (T const *const &); // { dg-message "candidate" } +template <typename T> int Bar (T *const &); // { dg-message "note" } candidate +template <typename T> int Bar (T *); // { dg-message "note" } candidate -template <typename T> int Baz (T *const &); // { dg-error "" } candidate -template <typename T> int Baz (T *); // { dg-error "" } candidate +template <typename T> int Baz (T *const &); // { dg-message "candidate" } +template <typename T> int Baz (T *); // { dg-message "note" } candidate int Baz (int const *ptr, int *ptr2) { - Baz (ptr2); // { dg-error "" } ambiguous - Bar (ptr2); // { dg-error "" } ambiguous - Foo (ptr2); // { dg-error "" } ambiguous - Qux (ptr2); // { dg-error "" } ambiguous + Baz (ptr2); // { dg-error "ambiguous" } + Bar (ptr2); // { dg-error "ambiguous" } + Foo (ptr2); // { dg-error "ambiguous" } + Qux (ptr2); // { dg-error "ambiguous" } return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/t05.C b/gcc/testsuite/g++.old-deja/g++.pt/t05.C index 9e69cbcc8de..38488d2c0ac 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/t05.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/t05.C @@ -1,9 +1,9 @@ // { dg-do assemble } -template <class A> class B { // { dg-error "" } candidates +template <class A> class B { // { dg-message "note" } A a; public: - B(A&aa); // { dg-error "" } near match + B(A&aa); // { dg-message "candidates" } ~B(); }; -static B<int> b_int (3); // { dg-error "" } no matching function +static B<int> b_int (3); // { dg-error "no matching function" } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/typename3.C b/gcc/testsuite/g++.old-deja/g++.pt/typename3.C index 931b212b8b7..9b412756b42 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/typename3.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/typename3.C @@ -11,10 +11,11 @@ struct A template <class U> struct B : public A<U> { - A_Type Func(); // { dg-warning "" } implicit typename + A_Type Func(); // { dg-error "does not name a type" "err" } implicit typename + // { dg-message "note" "note" { target *-*-* } 14 } }; template <class U> -B<U>::A_Type B<U>::Func() { // { dg-warning "" } implicit typename +B<U>::A_Type B<U>::Func() { // { dg-error "expected" } implicit typename } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/typename6.C b/gcc/testsuite/g++.old-deja/g++.pt/typename6.C index 34e356b57ea..27944795ae2 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/typename6.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/typename6.C @@ -10,10 +10,11 @@ struct A template <class U> struct B : public A<U> { - A_Type Func(); // { dg-error "" } declaration + A_Type Func(); // { dg-error "does not name a type" "err" } + // { dg-message "note" "note" { target *-*-* } 13 } }; template <class U> -A<U>::A_Type B<U>::Func() // { dg-error "" } function +A<U>::A_Type B<U>::Func() // { dg-error "expected" } function { } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/unify8.C b/gcc/testsuite/g++.old-deja/g++.pt/unify8.C index cc89c69bcaa..92cd191deb0 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/unify8.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/unify8.C @@ -10,11 +10,11 @@ template <typename T> void Foo (T const **); template <typename T> void Bar (T const * const *); -void Foo (int); // { dg-error "" } candidate -void Foo (float); // { dg-error "" } candidate +void Foo (int); // { dg-message "candidate" } +void Foo (float); // { dg-message "note" } candidate void baz (int **p1) { - Foo (p1); // { dg-error "" } no such function + Foo (p1); // { dg-error "match" } no such function Bar (p1); // OK } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C b/gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C index a542b447e6e..dced89d17ab 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C @@ -14,13 +14,14 @@ void PrintArgs (Type somearg, ...) va_list argp; va_start (argp, somearg); Type value; -value = va_arg (argp, Type); // { dg-error "" } cannot pass non-POD +value = va_arg (argp, Type); // { dg-warning "non-POD" } cannot pass non-POD va_end (argp); } int main (void) { A dummy; -PrintArgs (dummy, dummy); // { dg-error "" } cannot pass non-POD +PrintArgs (dummy, dummy); // { dg-warning "non-POD" } cannot pass non-POD +// { dg-message "instantiated" "inst" { target *-*-* } 24 } return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C index e72ebc47a22..5a70e194439 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C @@ -20,7 +20,7 @@ inline istream& operator>>(istream& is, Empty& ) { return is;} template<class VertexType, class EdgeType> class Graph -{ // { dg-error "" } candidates +{ // { dg-message "note" } candidates public: // public type interface typedef std::map<int, EdgeType > Successor; @@ -42,18 +42,18 @@ template<class VertexType, class EdgeType> ostream& operator<<(ostream& os, Graph<VertexType,EdgeType>& G) { // display of vertices with successors - for(int i = 0; i < G.size(); ++i) // { dg-error "" } no size function + for(int i = 0; i < G.size(); ++i) // { dg-error "no member" } no size function { - os << G[i].first << " <"; // { dg-error "" } no index operator + os << G[i].first << " <"; // { dg-error "no match" } no index operator // The compiler does not like this line!!!!!! typename Graph<VertexType, EdgeType>::Successor::iterator - startN = G[i].second.begin(), // { dg-error "" } no index operator - endN = G[i].second.end(); // { dg-error "" } no index operator + startN = G[i].second.begin(), // { dg-error "no match" } no index operator + endN = G[i].second.end(); // { dg-error "no match" } no index operator while(startN != endN) { - os << G[(*startN).first].first << ' ' // { dg-error "" } no index operator + os << G[(*startN).first].first << ' ' // { dg-error "no match" } no index operator << (*startN).second << ' '; ++startN; } @@ -65,7 +65,7 @@ ostream& operator<<(ostream& os, Graph<VertexType,EdgeType>& G) int main() { // no edge weighting, therefore type Empty: - Graph<std::string, Empty> V(true); // { dg-error "" } no bool constructor + Graph<std::string, Empty> V(true); // { dg-error "no match" } no bool constructor // ReadGraph(V, "gra1.dat"); // display of vertices with successors diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C index 75aab60a8dd..75341d4148a 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C @@ -10,11 +10,11 @@ struct a { void bar( double ); void bar( float ); - void foo( void (a::*member)(float) ); // { dg-error "" } candidate + void foo( void (a::*member)(float) ); // { dg-message "candidate" } }; a::a() { - foo( &junk ); // { dg-error "" } junk is an unqualified-id. - foo( &bar ); // { dg-error "" } bar is an unqualified-id. + foo( &junk ); // { dg-error "match" } junk is an unqualified-id. + foo( &bar ); // { dg-error "match" } bar is an unqualified-id. } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb22.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb22.C index b969d686624..28953b05b4e 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb22.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb22.C @@ -11,17 +11,18 @@ public: operator int() const {return 2;} }; -bool operator==(const MyInt& a, const int& b) // { dg-error "" } candidate +bool operator==(const MyInt& a, const int& b) // { dg-message "note" } candidate { return (int)a == b; } -bool operator==(const MyInt& a, const MyInt& b) // { dg-error "" } candidate +bool operator==(const MyInt& a, const MyInt& b) // { dg-message "note" } candidate { return (int)a == (int)b; } bool f() { - return 3 == MyInt(); // { dg-error "" } ambiguous + return 3 == MyInt(); // { dg-error "ambiguous" "err" } + // { dg-message "candidates" "note" { target *-*-* } 26 } } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C index f47d3dbf7a0..5f82e1fc926 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C @@ -7,7 +7,7 @@ class some_base { public: class base_func_args; - virtual void func(base_func_args &) = 0; // { dg-error "" } referenced below + virtual void func(base_func_args &) = 0; // { dg-message "note" } referenced below }; class some_base::base_func_args @@ -17,7 +17,7 @@ public: }; class some_derived : public some_base - { // { dg-error "" } note + { // { dg-message "note" } public: class derived_func_args; void func(derived_func_args &); @@ -30,7 +30,8 @@ public: float f; }; -class some_derived::func(derived_func_args &a) // { dg-error "" } illegal member syntax +class some_derived::func(derived_func_args &a) // { dg-error "does not name a type" "type" } illegal member syntax +// { dg-error "expected" "exp" { target *-*-* } 33 } { std::cout << a.i << ' ' << a.f << std::endl; } @@ -38,12 +39,12 @@ class some_derived::func(derived_func_args &a) // { dg-error "" } illegal membe int main() { - some_derived d; // { dg-error "" } abstract class - some_derived::derived_func_args dfa; // { dg-error "" } incomplete class + some_derived d; // { dg-error "abstract type" } + some_derived::derived_func_args dfa; // { dg-error "incomplete type" } some_base *b = &d; dfa.i = 10; dfa.f = 20; - b->func(dfs); // { dg-error "" } dfs not declared + b->func(dfs); // { dg-error "'dfs' was not declared" } return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C index 314ec9d2426..a7e61804cb1 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C @@ -14,7 +14,8 @@ using namespace std; template <class T> class Vector { - friend ostream& operator<< (ostream& out, const Vector<T> & vec); // { dg-warning "" } + friend ostream& operator<< (ostream& out, const Vector<T> & vec); // { dg-warning "non-template" "warn" } + // { dg-message "note" "note" { target *-*-* } 17 } }; template <class T> diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C index 5d3f7e6bbf1..74051a148ad 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C @@ -5,13 +5,14 @@ int r = 0; -struct foo { // { dg-error "" } candidate - foo(int x) { r = 1; } // { dg-error "" } candidate +struct foo { // { dg-message "note" } candidate + foo(int x) { r = 1; } // { dg-message "candidate" } }; struct bar : foo { typedef int an_int; - bar() : bar::an_int(3) {} // { dg-error "" } not a base + bar() : bar::an_int(3) {} // { dg-error "match" "match" } not a base + // { dg-message "expected" "exp" { target *-*-* } 14 } }; int diff --git a/gcc/testsuite/gcc.c-torture/compile/pr11832.c b/gcc/testsuite/gcc.c-torture/compile/pr11832.c index 2d6e5ba7012..3be76363299 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr11832.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr11832.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* Currently ICEs for IA64, HPPA, MIPS, CRIS and PowerPC; see PR33642. */ -/* { dg-xfail-if "PR33642" { hppa*-*-* mips*-*-* powerpc*-*-linux* cris-*-* crisv32-*-* ia64-*-* } { "*" } { "" } } */ +/* Currently ICEs for IA64, HPPA, MIPS, CRIS, Xtensa and PowerPC; see PR33642. */ +/* { dg-xfail-if "PR33642" { hppa*-*-* mips*-*-* powerpc*-*-linux* cris-*-* crisv32-*-* ia64-*-* xtensa*-*-* } { "*" } { "" } } */ /* Currently ICEs for (x86 && ilp32 && pic). */ /* { dg-xfail-if "PR33642/36240" { { i?86-*-* x86_64-*-* } && { ilp32 && { ! nonpic } } } { "*" } { "" } } */ /* { dg-prune-output ".*internal compiler error.*" } diff --git a/gcc/testsuite/gcc.c-torture/compile/pr33009.c b/gcc/testsuite/gcc.c-torture/compile/pr33009.c index a9856b3fbd1..a897c36bdd7 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr33009.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr33009.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* Currently ICEs for IA64, HPPA, MIPS, CRIS and PowerPC; see PR33642. */ -/* { dg-xfail-if "PR33642" { hppa*-*-* mips*-*-* powerpc*-*-linux* cris-*-* crisv32-*-* ia64-*-* } { "*" } { "" } } */ +/* Currently ICEs for IA64, HPPA, MIPS, CRIS, Xtensa and PowerPC; see PR33642. */ +/* { dg-xfail-if "PR33642" { hppa*-*-* mips*-*-* powerpc*-*-linux* cris-*-* crisv32-*-* ia64-*-* xtensa*-*-* } { "*" } { "" } } */ /* Currently ICEs for (x86 && ilp32 && pic). */ /* { dg-xfail-if "PR33642/36240" { { i?86-*-* x86_64-*-* } && { ilp32 && { ! nonpic } } } { "*" } { "" } } */ /* { dg-prune-output ".*internal compiler error.*" } diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37258.c b/gcc/testsuite/gcc.c-torture/compile/pr37258.c new file mode 100644 index 00000000000..5091d980bfd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr37258.c @@ -0,0 +1,58 @@ +typedef signed char int8_t; +typedef short int int16_t; +typedef int int32_t; +__extension__ typedef long long int int64_t; +typedef unsigned short int uint16_t; +typedef unsigned int uint32_t; +static inline unsigned int +lshift_u_s (unsigned int left, int right) +{ + if ((right) || (right >= sizeof (unsigned int) * 8) + || (left > (4294967295U >> right))) + return left; +} +static inline unsigned long int +div_rhs (long int rhs) +{ + if (rhs == 0) + return 1; + return rhs; +} + +uint32_t g_230; +int8_t g_294; +uint16_t g_316; +uint32_t g_334; +int32_t g_375; +int64_t g_380; +int32_t func_99 (int16_t p_100, int32_t p_101, int32_t p_102, int32_t p_103, + int64_t p_105, int32_t p_106, int32_t p_107, int16_t p_108, + int16_t p_109); +int32_t +func_77 (int64_t p_79) +{ + int16_t l_397; + if (mod_rhs (p_79)) + p_79 = 1; + else + for (p_79 = 0; 0; p_79 += 1) + { + } + if (lshift_s_s (1, func_112 (2L, (lshift_u_s (g_334, p_79))))) + { + int8_t l_384; + int64_t l_414; + if (lshift_u_s (g_375, 1)) + { + func_23 (func_99 (1, 1, 1, 1, g_230, p_79, 1, g_334, 1), 1); + for (p_79 = 0; 0; ++p_79) + { + } + } + if (div_rhs (func_82 (1, 1, g_380, 1, l_397, 1, 1))) + func_99 ((func_82 + (1, g_334, g_294, func_112 (1, (p_79 & 1)), g_316, 1, 1)), + 1, (0xFBA25CA382A8CA74LL), l_384, l_414, 0L, 1, 1, 1); + } +} + diff --git a/gcc/testsuite/gcc.c-torture/execute/20060420-1.c b/gcc/testsuite/gcc.c-torture/execute/20060420-1.c index fe62f6bf0ee..53393d17093 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20060420-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20060420-1.c @@ -50,9 +50,11 @@ main (void) { int i; float *dst, *src[2]; + char *cptr; - dst = buffer; - dst += (-(long int) buffer & (16 * sizeof (float) - 1)) / sizeof (float); + cptr = (char *)buffer; + cptr += (-(long int) buffer & (16 * sizeof (float) - 1)); + dst = (float *)cptr; src[0] = dst + 16; src[1] = dst + 32; for (i = 0; i < 16; ++i) diff --git a/gcc/testsuite/gcc.c-torture/execute/pr37102.c b/gcc/testsuite/gcc.c-torture/execute/pr37102.c new file mode 100644 index 00000000000..32c18ba88a1 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr37102.c @@ -0,0 +1,25 @@ +extern void abort (void); + +unsigned int a, b = 1, c; + +void __attribute__ ((noinline)) +foo (int x) +{ + if (x != 5) + abort (); +} + +int +main () +{ + unsigned int d, e; + for (d = 1; d < 5; d++) + if (c) + a = b; + a = b; + e = a << 1; + if (e) + e = (e << 1) ^ 1; + foo (e); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/builtin-redefine.c b/gcc/testsuite/gcc.dg/builtin-redefine.c new file mode 100644 index 00000000000..f94d3f3d83d --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-redefine.c @@ -0,0 +1,79 @@ +/* Test -Wno-builtin-macro-redefined warnings. */ + +/* { dg-do compile } */ +/* { dg-options "-Wno-builtin-macro-redefined -U__DATE__ -D__TIME__=X" } */ + +/* Check date, time, and datestamp built-ins warnings may be suppressed. */ + +#if defined(__DATE__) +#error "__DATE__ is defined, but should not be (-U command line error)" +/* { dg-bogus "__DATE__ is defined" "" { target *-*-* } 9 } */ +#endif + +#if __TIME__ != X +#error "__TIME__ is not defined as expected (-D command line error)" +/* { dg-bogus "__TIME__ is not defined" "" { target *-*-* } 14 } */ +#endif + +#if !defined(__TIMESTAMP__) +#error "__TIMESTAMP__ is not defined (built-in macro expectation error)" +/* { dg-bogus "__TIMESTAMP__ is not defined" "" { target *-*-* } 19 } */ +#endif + + +#undef __TIME__ /* Undefine while defined. */ +#undef __TIME__ /* Undefine while already undefined. */ + +#define __TIME__ "X" /* Define while undefined. */ +#define __TIME__ "X" /* Re-define while defined. */ + +#define __TIME__ "Y" /* { dg-warning "\"__TIME__\" redefined" } */ +/* { dg-warning "previous definition" "" { target *-*-* } 28 } */ + +#undef __TIME__ /* Undefine while defined. */ + + +#undef __DATE__ /* Undefine while already undefined. */ + +#define __DATE__ "X" /* Define while undefined. */ +#define __DATE__ "X" /* Re-define while defined. */ + +#define __DATE__ "Y" /* { dg-warning "\"__DATE__\" redefined" } */ +/* { dg-warning "previous definition" "" { target *-*-* } 39 } */ + +#undef __DATE__ /* Undefine while defined. */ + + +#define __TIMESTAMP__ "X" /* Define while already defined. */ +#define __TIMESTAMP__ "X" /* Re-define while defined. */ + +#define __TIMESTAMP__ "Y" /* { dg-warning "\"__TIMESTAMP__\" redefined" } */ +/* { dg-warning "previous definition" "" { target *-*-* } 48 } */ + +#undef __TIMESTAMP__ /* Undefine while defined. */ + + +/* Check other built-ins with warnings that may be suppressed. */ + +#if !defined(__FILE__) || !defined(__BASE_FILE__) +#error "Expected built-in is not defined (built-in macro expectation error)" +/* { dg-bogus "Expected built-in is not defined" "" { target *-*-* } 59 } */ +#endif + +#define __FILE__ "X" /* Define while already defined. */ +#define __BASE_FILE__ "X" /* Define while already defined. */ + + +/* Check selected built-ins not affected by warning suppression. */ + +#if !defined(__LINE__) || !defined(__INCLUDE_LEVEL__) || !defined(__COUNTER__) +#error "Expected built-in is not defined (built-in macro expectation error)" +/* { dg-bogus "Expected built-in is not defined" "" { target *-*-* } 70 } */ +#endif + +#define __LINE__ 0 /* { dg-warning "\"__LINE__\" redef" } */ +#define __INCLUDE_LEVEL__ 0 /* { dg-warning "\"__INCLUDE_LEVEL__\" redef" } */ +#define __COUNTER__ 0 /* { dg-warning "\"__COUNTER__\" redef" } */ + + +int unused; /* Silence `ISO C forbids an empty translation unit' warning. */ diff --git a/gcc/testsuite/gcc.dg/pr37544.c b/gcc/testsuite/gcc.dg/pr37544.c new file mode 100644 index 00000000000..6393d2f89d8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr37544.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ +/* { dg-options "-O2 -msse2 -mtune=core2 -mfpmath=387" { target { i?86-*-* x86_64-*-* } } } */ + +#ifdef __i386__ +#include "cpuid.h" +#endif + +extern void abort (void); + +int main(void) +{ + double arr[1000]; + double a, b; + + int i; + +#ifdef __i386__ + unsigned int eax, ebx, ecx, edx; + + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) + return 0; + + /* Run SSE2 test only if host has SSE2 support. */ + if (!(edx & bit_SSE2)) + return 0; +#endif + + for (i = 0; i < 1000; i++) + arr[i] = 4294967296.0 + (double)i; + + a = arr[0]; + b = (unsigned int)((unsigned long long int)a % 4294967296ULL); + + if (b >= 4294967296.0) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/utf-array.c b/gcc/testsuite/gcc.dg/utf-array.c index 50a29fe9375..2db8e51012b 100644 --- a/gcc/testsuite/gcc.dg/utf-array.c +++ b/gcc/testsuite/gcc.dg/utf-array.c @@ -5,8 +5,8 @@ #include <wchar.h> -typedef short unsigned int char16_t; -typedef unsigned int char32_t; +typedef __CHAR16_TYPE__ char16_t; +typedef __CHAR32_TYPE__ char32_t; const char s_0[] = "ab"; const char s_1[] = u"ab"; /* { dg-error "from wide string" } */ @@ -16,7 +16,7 @@ const char s_3[] = L"ab"; /* { dg-error "from wide string" } */ const char16_t s16_0[] = "ab"; /* { dg-error "from non-wide" } */ const char16_t s16_1[] = u"ab"; const char16_t s16_2[] = U"ab"; /* { dg-error "from incompatible" } */ -const char16_t s16_3[] = L"ab"; /* { dg-error "from incompatible" } */ +const char16_t s16_3[] = L"ab"; /* { dg-error "from incompatible" { target !wchar_t_char16_t_compatible } } */ const char16_t s16_4[0] = u"ab"; /* { dg-warning "chars is too long" } */ const char16_t s16_5[1] = u"ab"; /* { dg-warning "chars is too long" } */ @@ -27,7 +27,7 @@ const char16_t s16_8[4] = u"ab"; const char32_t s32_0[] = "ab"; /* { dg-error "from non-wide" } */ const char32_t s32_1[] = u"ab"; /* { dg-error "from incompatible" } */ const char32_t s32_2[] = U"ab"; -const char32_t s32_3[] = L"ab"; /* { dg-error "from incompatible" } */ +const char32_t s32_3[] = L"ab"; /* { dg-error "from incompatible" { target !wchar_t_char32_t_compatible } } */ const char32_t s32_4[0] = U"ab"; /* { dg-warning "chars is too long" } */ const char32_t s32_5[1] = U"ab"; /* { dg-warning "chars is too long" } */ @@ -36,6 +36,6 @@ const char32_t s32_7[3] = U"ab"; const char32_t s32_8[4] = U"ab"; const wchar_t sw_0[] = "ab"; /* { dg-error "from non-wide" } */ -const wchar_t sw_1[] = u"ab"; /* { dg-error "from incompatible" } */ -const wchar_t sw_2[] = U"ab"; /* { dg-error "from incompatible" } */ +const wchar_t sw_1[] = u"ab"; /* { dg-error "from incompatible" { target !wchar_t_char16_t_compatible } } */ +const wchar_t sw_2[] = U"ab"; /* { dg-error "from incompatible" { target !wchar_t_char32_t_compatible } } */ const wchar_t sw_3[] = L"ab"; diff --git a/gcc/testsuite/gfortran.dg/access_spec_3.f90 b/gcc/testsuite/gfortran.dg/access_spec_3.f90 new file mode 100644 index 00000000000..9a076b66c54 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/access_spec_3.f90 @@ -0,0 +1,34 @@ +! { dg-do compile } +! +! Tests the fix for PR36454, where the PUBLIC declaration for +! aint and bint was rejected because the access was already set. +! +! Contributed by Thomas Orgis <thomas.orgis@awi.de> + +module base + integer :: baseint +end module + +module a + use base, ONLY: aint => baseint +end module + +module b + use base, ONLY: bint => baseint +end module + +module c + use a + use b + private + public :: aint, bint +end module + +program user + use c, ONLY: aint, bint + + aint = 3 + bint = 8 + write(*,*) aint +end program +! { dg-final { cleanup-modules "base a b c" } } diff --git a/gcc/testsuite/gfortran.dg/allocate_error_1.f90 b/gcc/testsuite/gfortran.dg/allocate_error_1.f90 new file mode 100644 index 00000000000..42a12159e28 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/allocate_error_1.f90 @@ -0,0 +1,14 @@ +! { dg-do run } +! { dg-shouldfail "runtime error" } +! { dg-output "At line 13.*Attempting to allocate .* 'arr'" } + +! PR fortran/37507 +! Check that locus is printed for ALLOCATE errors. + +PROGRAM main + IMPLICIT NONE + INTEGER, ALLOCATABLE :: arr(:) + + ALLOCATE (arr(5)) + ALLOCATE (arr(6)) +END PROGRAM main diff --git a/gcc/testsuite/gfortran.dg/ambiguous_specific_2.f90 b/gcc/testsuite/gfortran.dg/ambiguous_specific_2.f90 new file mode 100644 index 00000000000..4597b3c8630 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/ambiguous_specific_2.f90 @@ -0,0 +1,42 @@ +! { dg-do compile } +! Checks the fix for PR33542 does not throw an error if there is no +! ambiguity in the specific interfaces of foo. +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> +! +MODULE M1 + INTERFACE FOO + MODULE PROCEDURE FOO + END INTERFACE +CONTAINS + SUBROUTINE FOO(I) + INTEGER, INTENT(IN) :: I + WRITE(*,*) 'INTEGER' + END SUBROUTINE FOO +END MODULE M1 + +MODULE M2 + INTERFACE FOO + MODULE PROCEDURE FOOFOO + END INTERFACE +CONTAINS + SUBROUTINE FOOFOO(R) + REAL, INTENT(IN) :: R + WRITE(*,*) 'REAL' + END SUBROUTINE FOOFOO +END MODULE M2 + +PROGRAM P + USE M1 + USE M2 + implicit none + external bar + CALL FOO(10) + CALL FOO(10.) + call bar (foo) +END PROGRAM P + +SUBROUTINE bar (arg) + EXTERNAL arg +END SUBROUTINE bar +! { dg-final { cleanup-modules "m1 m2" } } diff --git a/gcc/testsuite/gfortran.dg/deallocate_error_1.f90 b/gcc/testsuite/gfortran.dg/deallocate_error_1.f90 new file mode 100644 index 00000000000..98ffdb3b91a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/deallocate_error_1.f90 @@ -0,0 +1,15 @@ +! { dg-do run } +! { dg-shouldfail "runtime error" } +! { dg-output "At line 14.*Attempt to DEALLOCATE unallocated 'arr'" } + +! PR fortran/37507 +! Check that locus is printed for DEALLOCATE errors. + +PROGRAM main + IMPLICIT NONE + INTEGER, ALLOCATABLE :: arr(:) + + ALLOCATE (arr(5)) + DEALLOCATE (arr) + DEALLOCATE (arr) +END PROGRAM main diff --git a/gcc/testsuite/gfortran.dg/deallocate_error_2.f90 b/gcc/testsuite/gfortran.dg/deallocate_error_2.f90 new file mode 100644 index 00000000000..bda1adff514 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/deallocate_error_2.f90 @@ -0,0 +1,16 @@ +! { dg-do run } +! { dg-shouldfail "runtime error" } +! { dg-output "At line 15.*Attempt to DEALLOCATE unallocated 'ptr'" } + +! PR fortran/37507 +! Check that locus is printed for DEALLOCATE errors. + +PROGRAM main + IMPLICIT NONE + INTEGER, POINTER :: ptr + INTEGER, ALLOCATABLE :: arr(:) + + ALLOCATE (ptr, arr(5)) + DEALLOCATE (ptr) + DEALLOCATE (arr, ptr) +END PROGRAM main diff --git a/gcc/testsuite/gfortran.dg/generic_17.f90 b/gcc/testsuite/gfortran.dg/generic_17.f90 new file mode 100644 index 00000000000..968d9c10c37 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/generic_17.f90 @@ -0,0 +1,40 @@ +! { dg-do compile } +! Test the patch for PR36374 in which the different +! symbols for 'foobar' would be incorrectly flagged as +! ambiguous in foo_mod. +! +! Contributed by Salvatore Filippone <sfilippone@uniroma2.it> +! +module s_foo_mod
+ type s_foo_type
+ real(kind(1.e0)) :: v
+ end type s_foo_type
+ interface foobar
+ subroutine s_foobar(x)
+ import
+ type(s_foo_type), intent (inout) :: x
+ end subroutine s_foobar
+ end interface
+end module s_foo_mod
+
+module d_foo_mod
+ type d_foo_type
+ real(kind(1.d0)) :: v
+ end type d_foo_type
+ interface foobar
+ subroutine d_foobar(x)
+ import
+ type(d_foo_type), intent (inout) :: x
+ end subroutine d_foobar
+ end interface
+end module d_foo_mod
+
+module foo_mod
+ use s_foo_mod
+ use d_foo_mod
+end module foo_mod
+
+subroutine s_foobar(x)
+ use foo_mod
+end subroutine s_foobar
+! { dg-final { cleanup-modules "s_foo_mod d_foo_mod foo_mod" } } diff --git a/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 b/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 index 978f64d0951..9cf0d8eb004 100644 --- a/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 +++ b/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 @@ -2,11 +2,14 @@ ! Tests fix for PR20886 in which the passing of a generic procedure as ! an actual argument was not detected. ! +! The second module and the check that CALCULATION2 is a good actual +! argument was added following the fix for PR26374. +! ! Contributed by Joost VandeVondele <jv244@cam.ac.uk> ! MODULE TEST INTERFACE CALCULATION - MODULE PROCEDURE C1,C2 + MODULE PROCEDURE C1, C2 END INTERFACE CONTAINS SUBROUTINE C1(r) @@ -16,11 +19,27 @@ SUBROUTINE C2(r) REAL :: r END SUBROUTINE END MODULE TEST + +MODULE TEST2 +INTERFACE CALCULATION2 + MODULE PROCEDURE CALCULATION2, C3 +END INTERFACE +CONTAINS +SUBROUTINE CALCULATION2(r) + INTEGER :: r +END SUBROUTINE +SUBROUTINE C3(r) + REAL :: r +END SUBROUTINE +END MODULE TEST2 USE TEST -CALL F(CALCULATION) ! { dg-error "GENERIC procedure" } +USE TEST2 +CALL F(CALCULATION) ! { dg-error "GENERIC procedure" } + +CALL F(CALCULATION2) ! OK because there is a same name specific END SUBROUTINE F() END SUBROUTINE -! { dg-final { cleanup-modules "TEST" } } +! { dg-final { cleanup-modules "TEST TEST2" } } diff --git a/gcc/testsuite/gfortran.dg/host_assoc_call_2.f90 b/gcc/testsuite/gfortran.dg/host_assoc_call_2.f90 new file mode 100644 index 00000000000..a74f37343bb --- /dev/null +++ b/gcc/testsuite/gfortran.dg/host_assoc_call_2.f90 @@ -0,0 +1,18 @@ +! { dg-do compile } +! Tests the fix for PR36700, in which the call to the function would +! cause an ICE. +! +! Contributed by <terry@chem.gu.se> +! +module Diatoms + implicit none +contains + function InitialDiatomicX () result(v4) ! { dg-error "has a type" } + real(kind = 8), dimension(4) :: v4 + v4 = 1 + end function InitialDiatomicX + subroutine FindDiatomicPeriod + call InitialDiatomicX () ! { dg-error "which is not consistent with the CALL" } + end subroutine FindDiatomicPeriod +end module Diatoms +! { dg-final { cleanup-modules "Diatoms" } } diff --git a/gcc/testsuite/gfortran.dg/host_assoc_types_2.f90 b/gcc/testsuite/gfortran.dg/host_assoc_types_2.f90 new file mode 100644 index 00000000000..824a4959217 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/host_assoc_types_2.f90 @@ -0,0 +1,69 @@ +! { dg-do compile } +! Tests the fix for PR33945, the host association of overloaded_type_s +! would be incorrectly blocked by the use associated overloaded_type. +! +! Contributed by Jonathan Hogg <J.Hogg@rl.ac.uk> +! +module dtype
+ implicit none
+
+ type overloaded_type
+ double precision :: part
+ end type
+
+ interface overloaded_sub
+ module procedure overloaded_sub_d
+ end interface
+
+contains
+ subroutine overloaded_sub_d(otype)
+ type(overloaded_type), intent(in) :: otype
+
+ print *, "d type = ", otype%part
+ end subroutine
+end module
+
+module stype
+ implicit none
+
+ type overloaded_type
+ real :: part
+ end type
+
+ interface overloaded_sub
+ module procedure overloaded_sub_s
+ end interface
+
+contains
+ subroutine overloaded_sub_s(otype)
+ type(overloaded_type), intent(in) :: otype
+
+ print *, "s type = ", otype%part
+ end subroutine
+end module
+
+program test
+ use stype, overloaded_type_s => overloaded_type
+ use dtype, overloaded_type_d => overloaded_type
+ implicit none
+
+ type(overloaded_type_s) :: sval
+ type(overloaded_type_d) :: dval
+
+ sval%part = 1
+ dval%part = 2
+
+ call fred(sval, dval)
+
+contains
+ subroutine fred(sval, dval)
+ use stype
+
+ type(overloaded_type_s), intent(in) :: sval ! This caused an error
+ type(overloaded_type_d), intent(in) :: dval
+
+ call overloaded_sub(sval)
+ call overloaded_sub(dval)
+ end subroutine
+end program
+! { dg-final { cleanup-modules "stype dtype" } }
diff --git a/gcc/testsuite/gfortran.dg/used_types_22.f90 b/gcc/testsuite/gfortran.dg/used_types_22.f90 new file mode 100644 index 00000000000..2a5ae451a3d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/used_types_22.f90 @@ -0,0 +1,294 @@ +! { dg-do compile } +! Tests the fix for PR37274 a regression in which the derived type, +! 'vector' of the function results contained in 'class_motion' is +! private and is incorrectly detected to be ambiguous in 'smooth_mesh'. +! +! Contributed by Salvatore Filippone <sfilippone@uniroma2.it> +! +module class_vector
+
+ implicit none
+
+ private ! Default
+ public :: vector
+ public :: vector_
+
+ type vector
+ private
+ real(kind(1.d0)) :: x
+ real(kind(1.d0)) :: y
+ real(kind(1.d0)) :: z
+ end type vector
+
+contains
+ ! ----- Constructors -----
+
+ ! Public default constructor
+ elemental function vector_(x,y,z)
+ type(vector) :: vector_
+ real(kind(1.d0)), intent(in) :: x, y, z
+
+ vector_ = vector(x,y,z)
+
+ end function vector_
+
+end module class_vector
+
+module class_dimensions
+
+ implicit none
+
+ private ! Default
+ public :: dimensions
+
+ type dimensions
+ private
+ integer :: l
+ integer :: m
+ integer :: t
+ integer :: theta
+ end type dimensions
+
+
+end module class_dimensions
+
+module tools_math
+
+ implicit none
+
+
+ interface lin_interp
+ function lin_interp_s(f1,f2,fac)
+ real(kind(1.d0)) :: lin_interp_s
+ real(kind(1.d0)), intent(in) :: f1, f2
+ real(kind(1.d0)), intent(in) :: fac
+ end function lin_interp_s
+
+ function lin_interp_v(f1,f2,fac)
+ use class_vector
+ type(vector) :: lin_interp_v
+ type(vector), intent(in) :: f1, f2
+ real(kind(1.d0)), intent(in) :: fac
+ end function lin_interp_v
+ end interface
+
+
+ interface pwl_deriv
+ subroutine pwl_deriv_x_s(dydx,x,y_data,x_data)
+ real(kind(1.d0)), intent(out) :: dydx
+ real(kind(1.d0)), intent(in) :: x
+ real(kind(1.d0)), intent(in) :: y_data(:)
+ real(kind(1.d0)), intent(in) :: x_data(:)
+ end subroutine pwl_deriv_x_s
+
+ subroutine pwl_deriv_x_v(dydx,x,y_data,x_data)
+ real(kind(1.d0)), intent(out) :: dydx(:)
+ real(kind(1.d0)), intent(in) :: x
+ real(kind(1.d0)), intent(in) :: y_data(:,:)
+ real(kind(1.d0)), intent(in) :: x_data(:)
+ end subroutine pwl_deriv_x_v
+
+ subroutine pwl_deriv_x_vec(dydx,x,y_data,x_data)
+ use class_vector
+ type(vector), intent(out) :: dydx
+ real(kind(1.d0)), intent(in) :: x
+ type(vector), intent(in) :: y_data(:)
+ real(kind(1.d0)), intent(in) :: x_data(:)
+ end subroutine pwl_deriv_x_vec
+ end interface
+
+end module tools_math
+
+module class_motion
+
+ use class_vector
+
+ implicit none
+
+ private
+ public :: motion
+ public :: get_displacement, get_velocity
+
+ type motion
+ private
+ integer :: surface_motion
+ integer :: vertex_motion
+ !
+ integer :: iml
+ real(kind(1.d0)), allocatable :: law_x(:)
+ type(vector), allocatable :: law_y(:)
+ end type motion
+
+contains
+
+
+ function get_displacement(mot,x1,x2)
+ use tools_math
+
+ type(vector) :: get_displacement
+ type(motion), intent(in) :: mot
+ real(kind(1.d0)), intent(in) :: x1, x2
+ !
+ integer :: i1, i2, i3, i4
+ type(vector) :: p1, p2, v_A, v_B, v_C, v_D
+ type(vector) :: i_trap_1, i_trap_2, i_trap_3
+
+ get_displacement = vector_(0.d0,0.d0,0.d0)
+
+ end function get_displacement
+
+
+ function get_velocity(mot,x)
+ use tools_math
+
+ type(vector) :: get_velocity
+ type(motion), intent(in) :: mot
+ real(kind(1.d0)), intent(in) :: x
+ !
+ type(vector) :: v
+
+ get_velocity = vector_(0.d0,0.d0,0.d0)
+
+ end function get_velocity
+
+
+
+end module class_motion
+
+module class_bc_math
+
+ implicit none
+
+ private
+ public :: bc_math
+
+ type bc_math
+ private
+ integer :: id
+ integer :: nbf
+ real(kind(1.d0)), allocatable :: a(:)
+ real(kind(1.d0)), allocatable :: b(:)
+ real(kind(1.d0)), allocatable :: c(:)
+ end type bc_math
+
+
+end module class_bc_math
+
+module class_bc
+
+ use class_bc_math
+ use class_motion
+
+ implicit none
+
+ private
+ public :: bc_poly
+ public :: get_abc, &
+ & get_displacement, get_velocity
+
+ type bc_poly
+ private
+ integer :: id
+ type(motion) :: mot
+ type(bc_math), pointer :: math => null()
+ end type bc_poly
+
+
+ interface get_displacement
+ module procedure get_displacement, get_bc_motion_displacement
+ end interface
+
+ interface get_velocity
+ module procedure get_velocity, get_bc_motion_velocity
+ end interface
+
+ interface get_abc
+ module procedure get_abc_s, get_abc_v
+ end interface
+
+contains
+
+
+ subroutine get_abc_s(bc,dim,id,a,b,c)
+ use class_dimensions
+
+ type(bc_poly), intent(in) :: bc
+ type(dimensions), intent(in) :: dim
+ integer, intent(out) :: id
+ real(kind(1.d0)), intent(inout) :: a(:)
+ real(kind(1.d0)), intent(inout) :: b(:)
+ real(kind(1.d0)), intent(inout) :: c(:)
+
+
+ end subroutine get_abc_s
+
+
+ subroutine get_abc_v(bc,dim,id,a,b,c)
+ use class_dimensions
+ use class_vector
+
+ type(bc_poly), intent(in) :: bc
+ type(dimensions), intent(in) :: dim
+ integer, intent(out) :: id
+ real(kind(1.d0)), intent(inout) :: a(:)
+ real(kind(1.d0)), intent(inout) :: b(:)
+ type(vector), intent(inout) :: c(:)
+
+
+ end subroutine get_abc_v
+
+
+
+ function get_bc_motion_displacement(bc,x1,x2)result(res)
+ use class_vector
+ type(vector) :: res
+ type(bc_poly), intent(in) :: bc
+ real(kind(1.d0)), intent(in) :: x1, x2
+
+ res = get_displacement(bc%mot,x1,x2)
+
+ end function get_bc_motion_displacement
+
+
+ function get_bc_motion_velocity(bc,x)result(res)
+ use class_vector
+ type(vector) :: res
+ type(bc_poly), intent(in) :: bc
+ real(kind(1.d0)), intent(in) :: x
+
+ res = get_velocity(bc%mot,x)
+
+ end function get_bc_motion_velocity
+
+
+end module class_bc
+
+module tools_mesh_basics
+
+ implicit none
+
+ interface
+ function geom_tet_center(v1,v2,v3,v4)
+ use class_vector
+ type(vector) :: geom_tet_center
+ type(vector), intent(in) :: v1, v2, v3, v4
+ end function geom_tet_center
+ end interface
+
+
+end module tools_mesh_basics
+
+
+subroutine smooth_mesh
+
+ use class_bc
+ use class_vector
+ use tools_mesh_basics
+
+ implicit none
+
+ type(vector) :: new_pos ! the new vertex position, after smoothing
+
+end subroutine smooth_mesh
+! { dg-final { cleanup-modules "class_vector class_dimensions tools_math" } } +! { dg-final { cleanup-modules "class_motion class_bc_math class_bc tools_mesh_basics" } } diff --git a/gcc/testsuite/gfortran.dg/used_types_23.f90 b/gcc/testsuite/gfortran.dg/used_types_23.f90 new file mode 100644 index 00000000000..7374223693f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/used_types_23.f90 @@ -0,0 +1,29 @@ +! { dg-do compile } +! Tests the fix for PR37274 comment 4 in which the use associated 'vector' was
+! passed up from the interface to the module 'tools_math'. +! +! Contributed by Mikael Morin <mikael.morin@tele2.fr> +! +module class_vector
+ implicit none
+ type vector
+ end type vector
+end module class_vector
+
+module tools_math
+ implicit none
+ interface lin_interp
+ function lin_interp_v()
+ use class_vector
+ type(vector) :: lin_interp_v
+ end function lin_interp_v
+ end interface
+end module tools_math
+
+module smooth_mesh
+ use tools_math
+ implicit none
+ type(vector ) :: new_pos ! { dg-error "used before it is defined" }
+end module smooth_mesh
+
+! { dg-final { cleanup-modules "class_vector tools_math smooth_mesh" } } diff --git a/gcc/testsuite/gnat.dg/specs/static_initializer3.ads b/gcc/testsuite/gnat.dg/specs/static_initializer3.ads new file mode 100644 index 00000000000..42994f2e1c5 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/static_initializer3.ads @@ -0,0 +1,27 @@ +with Unchecked_Conversion; + +package Static_Initializer3 is + + type Byte is range 0 .. 16#FF#; + for Byte'Size use 8; + + type Word is range 0 .. 16#FFFF# ; + for Word'Size use 16; + + type R is record + b1 : Boolean; + b2 : Boolean; + end record; + for R use record + b1 at 0 range 0..3; + b2 at 0 range 4..7; + end record; + for R'Size use 8; + + function Conv is new Unchecked_Conversion (R, Byte); + + C1 : constant Byte := Conv ((true, false)); + + C2 : constant Word := Word(C1); + +end Static_Initializer3; diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 7ca5b739781..07f1c504eb2 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -185,6 +185,8 @@ proc g++_init { args } { global GXX_UNDER_TEST global TESTING_IN_BUILD_TREE global target_triplet + global gcc_warning_prefix + global gcc_error_prefix # We set LC_ALL and LANG to C so that we get the same error messages as expected. setenv LC_ALL C @@ -247,6 +249,9 @@ proc g++_init { args } { # error-message parsing machinery. lappend ALWAYS_CXXFLAGS "additional_flags=-fmessage-length=0" + set gcc_warning_prefix "warning:" + set gcc_error_prefix "error:" + if { [string match "*-*-darwin*" $target_triplet] } { lappend ALWAYS_CXXFLAGS "ldflags=-multiply_defined suppress" } diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 296506484ad..72117c64b91 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2592,3 +2592,23 @@ proc check_effective_target_avx { } { } } "-O2 -mavx" ] } + +# Return 1 if C wchar_t type is compatible with char16_t. + +proc check_effective_target_wchar_t_char16_t_compatible { } { + return [check_no_compiler_messages wchar_t_char16_t object { + __WCHAR_TYPE__ wc; + __CHAR16_TYPE__ *p16 = &wc; + char t[(((__CHAR16_TYPE__) -1) < 0 == ((__WCHAR_TYPE__) -1) < 0) ? 1 : -1]; + }] +} + +# Return 1 if C wchar_t type is compatible with char32_t. + +proc check_effective_target_wchar_t_char32_t_compatible { } { + return [check_no_compiler_messages wchar_t_char32_t object { + __WCHAR_TYPE__ wc; + __CHAR32_TYPE__ *p32 = &wc; + char t[(((__CHAR32_TYPE__) -1) < 0 == ((__WCHAR_TYPE__) -1) < 0) ? 1 : -1]; + }] +} diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 4b253bf7899..e9f315c53a2 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -1997,6 +1997,18 @@ remove_useless_stmts_1 (gimple_stmt_iterator *gsi, struct rus_data *data) } break; + case GIMPLE_CHANGE_DYNAMIC_TYPE: + /* If we do not optimize remove GIMPLE_CHANGE_DYNAMIC_TYPE as + expansion is confused about them and we only remove them + during alias computation otherwise. */ + if (!optimize) + { + data->last_was_goto = false; + gsi_remove (gsi, false); + break; + } + /* Fallthru. */ + default: data->last_was_goto = false; gsi_next (gsi); @@ -3035,14 +3047,17 @@ verify_types_in_gimple_min_lval (tree expr) if (is_gimple_id (expr)) return false; - if (TREE_CODE (expr) != INDIRECT_REF - && TREE_CODE (expr) != ALIGN_INDIRECT_REF - && TREE_CODE (expr) != MISALIGNED_INDIRECT_REF) + if (!INDIRECT_REF_P (expr) + && TREE_CODE (expr) != TARGET_MEM_REF) { error ("invalid expression for min lvalue"); return true; } + /* TARGET_MEM_REFs are strange beasts. */ + if (TREE_CODE (expr) == TARGET_MEM_REF) + return false; + op = TREE_OPERAND (expr, 0); if (!is_gimple_val (op)) { @@ -3131,6 +3146,9 @@ verify_types_in_gimple_reference (tree expr) /* For VIEW_CONVERT_EXPRs which are allowed here, too, there is nothing to verify. Gross mismatches at most invoke undefined behavior. */ + if (TREE_CODE (expr) == VIEW_CONVERT_EXPR + && !handled_component_p (op)) + return false; expr = op; } @@ -3257,45 +3275,50 @@ verify_gimple_comparison (tree type, tree op0, tree op1) return false; } -/* Verify the contents of a GIMPLE_ASSIGN STMT. Returns true when there - is a problem, otherwise false. - - Verify that the types of the LHS and the RHS operands are - compatible. This verification largely depends on what kind of - operation is done on the RHS of the assignment. It is not always - the case that all the types of the operands must match (e.g., 'a = - (unsigned long) b' or 'ptr = ptr + 1'). */ +/* Verify a gimple assignment statement STMT with an unary rhs. + Returns true if anything is wrong. */ static bool -verify_types_in_gimple_assign (gimple stmt) +verify_gimple_assign_unary (gimple stmt) { enum tree_code rhs_code = gimple_assign_rhs_code (stmt); tree lhs = gimple_assign_lhs (stmt); - tree rhs1 = gimple_assign_rhs1 (stmt); - tree rhs2 = (gimple_num_ops (stmt) == 3) ? gimple_assign_rhs2 (stmt) : NULL; tree lhs_type = TREE_TYPE (lhs); + tree rhs1 = gimple_assign_rhs1 (stmt); tree rhs1_type = TREE_TYPE (rhs1); - tree rhs2_type = (rhs2) ? TREE_TYPE (rhs2) : NULL; - /* Special codes we cannot handle via their class. */ + if (!is_gimple_reg (lhs) + && !(optimize == 0 + && TREE_CODE (lhs_type) == COMPLEX_TYPE)) + { + error ("non-register as LHS of unary operation"); + return true; + } + + if (!is_gimple_val (rhs1)) + { + error ("invalid operand in unary operation"); + return true; + } + + /* First handle conversions. */ switch (rhs_code) { CASE_CONVERT: { - if (!is_gimple_val (rhs1)) - { - error ("invalid operand in conversion"); - return true; - } - /* Allow conversions between integral types and pointers only if - there is no sign or zero extension involved. */ - if (((POINTER_TYPE_P (lhs_type) && INTEGRAL_TYPE_P (rhs1_type)) - || (POINTER_TYPE_P (rhs1_type) && INTEGRAL_TYPE_P (lhs_type))) - && (TYPE_PRECISION (lhs_type) == TYPE_PRECISION (rhs1_type) - /* For targets were the precision of sizetype doesn't - match that of pointers we need the following. */ - || lhs_type == sizetype || rhs1_type == sizetype)) + there is no sign or zero extension involved. + For targets were the precision of sizetype doesn't match that + of pointers we need to allow arbitrary conversions from and + to sizetype. */ + if ((POINTER_TYPE_P (lhs_type) + && INTEGRAL_TYPE_P (rhs1_type) + && (TYPE_PRECISION (lhs_type) >= TYPE_PRECISION (rhs1_type) + || rhs1_type == sizetype)) + || (POINTER_TYPE_P (rhs1_type) + && INTEGRAL_TYPE_P (lhs_type) + && (TYPE_PRECISION (rhs1_type) >= TYPE_PRECISION (lhs_type) + || lhs_type == sizetype))) return false; /* Allow conversion from integer to offset type and vice versa. */ @@ -3320,12 +3343,6 @@ verify_types_in_gimple_assign (gimple stmt) case FIXED_CONVERT_EXPR: { - if (!is_gimple_val (rhs1)) - { - error ("invalid operand in conversion"); - return true; - } - if (!valid_fixed_convert_types_p (lhs_type, rhs1_type) && !valid_fixed_convert_types_p (rhs1_type, lhs_type)) { @@ -3340,12 +3357,6 @@ verify_types_in_gimple_assign (gimple stmt) case FLOAT_EXPR: { - if (!is_gimple_val (rhs1)) - { - error ("invalid operand in int to float conversion"); - return true; - } - if (!INTEGRAL_TYPE_P (rhs1_type) || !SCALAR_FLOAT_TYPE_P (lhs_type)) { error ("invalid types in conversion to floating point"); @@ -3359,12 +3370,6 @@ verify_types_in_gimple_assign (gimple stmt) case FIX_TRUNC_EXPR: { - if (!is_gimple_val (rhs1)) - { - error ("invalid operand in float to int conversion"); - return true; - } - if (!INTEGRAL_TYPE_P (lhs_type) || !SCALAR_FLOAT_TYPE_P (rhs1_type)) { error ("invalid types in conversion to integer"); @@ -3376,18 +3381,79 @@ verify_types_in_gimple_assign (gimple stmt) return false; } - case COMPLEX_EXPR: + case TRUTH_NOT_EXPR: { - if (!is_gimple_val (rhs1) || !is_gimple_val (rhs2)) - { - error ("invalid operands in complex expression"); - return true; - } + } + + case NEGATE_EXPR: + case ABS_EXPR: + case BIT_NOT_EXPR: + case PAREN_EXPR: + case NON_LVALUE_EXPR: + case CONJ_EXPR: + case REDUC_MAX_EXPR: + case REDUC_MIN_EXPR: + case REDUC_PLUS_EXPR: + case VEC_UNPACK_HI_EXPR: + case VEC_UNPACK_LO_EXPR: + case VEC_UNPACK_FLOAT_HI_EXPR: + case VEC_UNPACK_FLOAT_LO_EXPR: + break; + + default: + gcc_unreachable (); + } + + /* For the remaining codes assert there is no conversion involved. */ + if (!useless_type_conversion_p (lhs_type, rhs1_type)) + { + error ("non-trivial conversion in unary operation"); + debug_generic_expr (lhs_type); + debug_generic_expr (rhs1_type); + return true; + } + + return false; +} + +/* Verify a gimple assignment statement STMT with a binary rhs. + Returns true if anything is wrong. */ + +static bool +verify_gimple_assign_binary (gimple stmt) +{ + enum tree_code rhs_code = gimple_assign_rhs_code (stmt); + tree lhs = gimple_assign_lhs (stmt); + tree lhs_type = TREE_TYPE (lhs); + tree rhs1 = gimple_assign_rhs1 (stmt); + tree rhs1_type = TREE_TYPE (rhs1); + tree rhs2 = gimple_assign_rhs2 (stmt); + tree rhs2_type = TREE_TYPE (rhs2); + + if (!is_gimple_reg (lhs) + && !(optimize == 0 + && TREE_CODE (lhs_type) == COMPLEX_TYPE)) + { + error ("non-register as LHS of binary operation"); + return true; + } - if (!TREE_CODE (lhs_type) == COMPLEX_TYPE - || !(TREE_CODE (rhs1_type) == INTEGER_TYPE + if (!is_gimple_val (rhs1) + || !is_gimple_val (rhs2)) + { + error ("invalid operands in binary operation"); + return true; + } + + /* First handle operations that involve different types. */ + switch (rhs_code) + { + case COMPLEX_EXPR: + { + if (TREE_CODE (lhs_type) != COMPLEX_TYPE + || !(INTEGRAL_TYPE_P (rhs1_type) || SCALAR_FLOAT_TYPE_P (rhs1_type)) - || !(TREE_CODE (rhs2_type) == INTEGER_TYPE + || !(INTEGRAL_TYPE_P (rhs2_type) || SCALAR_FLOAT_TYPE_P (rhs2_type))) { error ("type mismatch in complex expression"); @@ -3400,26 +3466,13 @@ verify_types_in_gimple_assign (gimple stmt) return false; } - case CONSTRUCTOR: - { - /* In this context we know that we are on the RHS of an - assignment, so CONSTRUCTOR operands are OK. */ - /* FIXME: verify constructor arguments. */ - return false; - } - case LSHIFT_EXPR: case RSHIFT_EXPR: case LROTATE_EXPR: case RROTATE_EXPR: { - if (!is_gimple_val (rhs1) || !is_gimple_val (rhs2)) - { - error ("invalid operands in shift expression"); - return true; - } - - if (!TREE_CODE (rhs1_type) == INTEGER_TYPE + if (!INTEGRAL_TYPE_P (rhs1_type) + || !INTEGRAL_TYPE_P (rhs2_type) || !useless_type_conversion_p (lhs_type, rhs1_type)) { error ("type mismatch in shift expression"); @@ -3432,28 +3485,28 @@ verify_types_in_gimple_assign (gimple stmt) return false; } - case PLUS_EXPR: - case MINUS_EXPR: + case VEC_LSHIFT_EXPR: + case VEC_RSHIFT_EXPR: { - if (POINTER_TYPE_P (lhs_type) - || POINTER_TYPE_P (rhs1_type) - || POINTER_TYPE_P (rhs2_type)) + if (TREE_CODE (rhs1_type) != VECTOR_TYPE + || !INTEGRAL_TYPE_P (TREE_TYPE (rhs1_type)) + || (!INTEGRAL_TYPE_P (rhs2_type) + && (TREE_CODE (rhs2_type) != VECTOR_TYPE + || !INTEGRAL_TYPE_P (TREE_TYPE (rhs2_type)))) + || !useless_type_conversion_p (lhs_type, rhs1_type)) { - error ("invalid (pointer) operands to plus/minus"); + error ("type mismatch in vector shift expression"); + debug_generic_expr (lhs_type); + debug_generic_expr (rhs1_type); + debug_generic_expr (rhs2_type); return true; } - /* Continue with generic binary expression handling. */ - break; + return false; } case POINTER_PLUS_EXPR: { - if (!is_gimple_val (rhs1) || !is_gimple_val (rhs2)) - { - error ("invalid operands in pointer plus expression"); - return true; - } if (!POINTER_TYPE_P (rhs1_type) || !useless_type_conversion_p (lhs_type, rhs1_type) || !useless_type_conversion_p (sizetype, rhs2_type)) @@ -3468,30 +3521,6 @@ verify_types_in_gimple_assign (gimple stmt) return false; } - case ADDR_EXPR: - { - tree op = TREE_OPERAND (rhs1, 0); - if (!is_gimple_addressable (op)) - { - error ("invalid operand in unary expression"); - return true; - } - - if (!one_pointer_to_useless_type_conversion_p (lhs_type, TREE_TYPE (op)) - /* FIXME: a longstanding wart, &a == &a[0]. */ - && (TREE_CODE (TREE_TYPE (op)) != ARRAY_TYPE - || !one_pointer_to_useless_type_conversion_p (lhs_type, - TREE_TYPE (TREE_TYPE (op))))) - { - error ("type mismatch in address expression"); - debug_generic_stmt (lhs_type); - debug_generic_stmt (TYPE_POINTER_TO (TREE_TYPE (op))); - return true; - } - - return verify_types_in_gimple_reference (TREE_OPERAND (rhs1, 0)); - } - case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: gcc_unreachable (); @@ -3500,12 +3529,6 @@ verify_types_in_gimple_assign (gimple stmt) case TRUTH_OR_EXPR: case TRUTH_XOR_EXPR: { - if (!is_gimple_val (rhs1) || !is_gimple_val (rhs2)) - { - error ("invalid operands in truth expression"); - return true; - } - /* We allow any kind of integral typed argument and result. */ if (!INTEGRAL_TYPE_P (rhs1_type) || !INTEGRAL_TYPE_P (rhs2_type) @@ -3521,108 +3544,226 @@ verify_types_in_gimple_assign (gimple stmt) return false; } - case TRUTH_NOT_EXPR: - { - if (!is_gimple_val (rhs1)) - { - error ("invalid operand in unary not"); - return true; - } + case LT_EXPR: + case LE_EXPR: + case GT_EXPR: + case GE_EXPR: + case EQ_EXPR: + case NE_EXPR: + case UNORDERED_EXPR: + case ORDERED_EXPR: + case UNLT_EXPR: + case UNLE_EXPR: + case UNGT_EXPR: + case UNGE_EXPR: + case UNEQ_EXPR: + case LTGT_EXPR: + /* Comparisons are also binary, but the result type is not + connected to the operand types. */ + return verify_gimple_comparison (lhs_type, rhs1, rhs2); - /* For TRUTH_NOT_EXPR we can have any kind of integral - typed arguments and results. */ - if (!INTEGRAL_TYPE_P (rhs1_type) - || !INTEGRAL_TYPE_P (lhs_type)) + case PLUS_EXPR: + case MINUS_EXPR: + { + if (POINTER_TYPE_P (lhs_type) + || POINTER_TYPE_P (rhs1_type) + || POINTER_TYPE_P (rhs2_type)) { - error ("type mismatch in not expression"); - debug_generic_expr (lhs_type); - debug_generic_expr (rhs1_type); + error ("invalid (pointer) operands to plus/minus"); return true; } - return false; + /* Continue with generic binary expression handling. */ + break; } - /* After gimplification we should not have any of these. */ - case ASM_EXPR: - case BIND_EXPR: - case CALL_EXPR: - case COND_EXPR: - case TREE_LIST: - case COMPOUND_EXPR: - case MODIFY_EXPR: - case INIT_EXPR: - case GOTO_EXPR: - case LABEL_EXPR: - case RETURN_EXPR: - case TRY_FINALLY_EXPR: - case TRY_CATCH_EXPR: - case EH_FILTER_EXPR: - case STATEMENT_LIST: - { - error ("tree node that should already be gimple."); - return true; - } + case MULT_EXPR: + case TRUNC_DIV_EXPR: + case CEIL_DIV_EXPR: + case FLOOR_DIV_EXPR: + case ROUND_DIV_EXPR: + case TRUNC_MOD_EXPR: + case CEIL_MOD_EXPR: + case FLOOR_MOD_EXPR: + case ROUND_MOD_EXPR: + case RDIV_EXPR: + case EXACT_DIV_EXPR: + case MIN_EXPR: + case MAX_EXPR: + case BIT_IOR_EXPR: + case BIT_XOR_EXPR: + case BIT_AND_EXPR: + case WIDEN_SUM_EXPR: + case WIDEN_MULT_EXPR: + case VEC_WIDEN_MULT_HI_EXPR: + case VEC_WIDEN_MULT_LO_EXPR: + case VEC_PACK_TRUNC_EXPR: + case VEC_PACK_SAT_EXPR: + case VEC_PACK_FIX_TRUNC_EXPR: + case VEC_EXTRACT_EVEN_EXPR: + case VEC_EXTRACT_ODD_EXPR: + case VEC_INTERLEAVE_HIGH_EXPR: + case VEC_INTERLEAVE_LOW_EXPR: + /* Continue with generic binary expression handling. */ + break; - case OBJ_TYPE_REF: - /* FIXME. */ - return false; + default: + gcc_unreachable (); + } - default:; + if (!useless_type_conversion_p (lhs_type, rhs1_type) + || !useless_type_conversion_p (lhs_type, rhs2_type)) + { + error ("type mismatch in binary expression"); + debug_generic_stmt (lhs_type); + debug_generic_stmt (rhs1_type); + debug_generic_stmt (rhs2_type); + return true; + } + + return false; +} + +/* Verify a gimple assignment statement STMT with a single rhs. + Returns true if anything is wrong. */ + +static bool +verify_gimple_assign_single (gimple stmt) +{ + enum tree_code rhs_code = gimple_assign_rhs_code (stmt); + tree lhs = gimple_assign_lhs (stmt); + tree lhs_type = TREE_TYPE (lhs); + tree rhs1 = gimple_assign_rhs1 (stmt); + tree rhs1_type = TREE_TYPE (rhs1); + bool res = false; + + if (!useless_type_conversion_p (lhs_type, rhs1_type)) + { + error ("non-trivial conversion at assignment"); + debug_generic_expr (lhs_type); + debug_generic_expr (rhs1_type); + return true; } - /* Generic handling via classes. */ - switch (TREE_CODE_CLASS (rhs_code)) + if (handled_component_p (lhs)) + res |= verify_types_in_gimple_reference (lhs); + + /* Special codes we cannot handle via their class. */ + switch (rhs_code) { - case tcc_exceptional: /* for SSA_NAME */ - case tcc_unary: - if (!useless_type_conversion_p (lhs_type, rhs1_type)) - { - error ("non-trivial conversion at assignment"); - debug_generic_expr (lhs_type); - debug_generic_expr (rhs1_type); - return true; - } - break; + case ADDR_EXPR: + { + tree op = TREE_OPERAND (rhs1, 0); + if (!is_gimple_addressable (op)) + { + error ("invalid operand in unary expression"); + return true; + } - case tcc_binary: - if (!is_gimple_val (rhs1) || !is_gimple_val (rhs2)) - { - error ("invalid operands in binary expression"); - return true; - } - if (!useless_type_conversion_p (lhs_type, rhs1_type) - || !useless_type_conversion_p (lhs_type, rhs2_type)) + if (!one_pointer_to_useless_type_conversion_p (lhs_type, TREE_TYPE (op)) + /* FIXME: a longstanding wart, &a == &a[0]. */ + && (TREE_CODE (TREE_TYPE (op)) != ARRAY_TYPE + || !one_pointer_to_useless_type_conversion_p (lhs_type, + TREE_TYPE (TREE_TYPE (op))))) + { + error ("type mismatch in address expression"); + debug_generic_stmt (lhs_type); + debug_generic_stmt (TYPE_POINTER_TO (TREE_TYPE (op))); + return true; + } + + return verify_types_in_gimple_reference (op); + } + + /* tcc_reference */ + case COMPONENT_REF: + case BIT_FIELD_REF: + case INDIRECT_REF: + case ALIGN_INDIRECT_REF: + case MISALIGNED_INDIRECT_REF: + case ARRAY_REF: + case ARRAY_RANGE_REF: + case VIEW_CONVERT_EXPR: + case REALPART_EXPR: + case IMAGPART_EXPR: + case TARGET_MEM_REF: + if (!is_gimple_reg (lhs) + && is_gimple_reg_type (TREE_TYPE (lhs))) { - error ("type mismatch in binary expression"); - debug_generic_stmt (lhs_type); - debug_generic_stmt (rhs1_type); - debug_generic_stmt (rhs2_type); + error ("invalid rhs for gimple memory store"); + debug_generic_stmt (lhs); + debug_generic_stmt (rhs1); return true; } - break; + return res || verify_types_in_gimple_reference (rhs1); - case tcc_reference: - /* All tcc_reference trees are GIMPLE_SINGLE_RHS. Verify that - no implicit type change happens here. */ - if (!useless_type_conversion_p (lhs_type, rhs1_type)) + /* tcc_constant */ + case SSA_NAME: + case INTEGER_CST: + case REAL_CST: + case FIXED_CST: + case COMPLEX_CST: + case VECTOR_CST: + case STRING_CST: + return res; + + /* tcc_declaration */ + case CONST_DECL: + return res; + case VAR_DECL: + case PARM_DECL: + if (!is_gimple_reg (lhs) + && !is_gimple_reg (rhs1) + && is_gimple_reg_type (TREE_TYPE (lhs))) { - error ("non-trivial conversion at assignment"); - debug_generic_expr (lhs_type); - debug_generic_expr (rhs1_type); + error ("invalid rhs for gimple memory store"); + debug_generic_stmt (lhs); + debug_generic_stmt (rhs1); return true; } - return verify_types_in_gimple_reference (rhs1); + return res; - case tcc_comparison: - return verify_gimple_comparison (lhs_type, rhs1, rhs2); + case COND_EXPR: + case CONSTRUCTOR: + case OBJ_TYPE_REF: + case ASSERT_EXPR: + case WITH_SIZE_EXPR: + case EXC_PTR_EXPR: + case FILTER_EXPR: + case POLYNOMIAL_CHREC: + case DOT_PROD_EXPR: + case VEC_COND_EXPR: + case REALIGN_LOAD_EXPR: + /* FIXME. */ + return res; default:; } - return false; + return res; } +/* Verify the contents of a GIMPLE_ASSIGN STMT. Returns true when there + is a problem, otherwise false. */ + +static bool +verify_gimple_assign (gimple stmt) +{ + switch (gimple_assign_rhs_class (stmt)) + { + case GIMPLE_SINGLE_RHS: + return verify_gimple_assign_single (stmt); + + case GIMPLE_UNARY_RHS: + return verify_gimple_assign_unary (stmt); + + case GIMPLE_BINARY_RHS: + return verify_gimple_assign_binary (stmt); + + default: + gcc_unreachable (); + } +} /* Verify the contents of a GIMPLE_RETURN STMT. Returns true when there is a problem, otherwise false. */ @@ -3719,7 +3860,10 @@ verify_gimple_phi (gimple stmt) for (i = 0; i < gimple_phi_num_args (stmt); i++) { tree arg = gimple_phi_arg_def (stmt, i); - if (!is_gimple_val (arg)) + if ((is_gimple_reg (gimple_phi_result (stmt)) + && !is_gimple_val (arg)) + || (!is_gimple_reg (gimple_phi_result (stmt)) + && !is_gimple_addressable (arg))) { error ("Invalid PHI argument"); debug_generic_stmt (arg); @@ -3758,7 +3902,7 @@ verify_types_in_gimple_stmt (gimple stmt) switch (gimple_code (stmt)) { case GIMPLE_ASSIGN: - return verify_types_in_gimple_assign (stmt); + return verify_gimple_assign (stmt); case GIMPLE_LABEL: return TREE_CODE (gimple_label_label (stmt)) != LABEL_DECL; @@ -3784,7 +3928,7 @@ verify_types_in_gimple_stmt (gimple stmt) return false; case GIMPLE_CHANGE_DYNAMIC_TYPE: - return (!is_gimple_reg (gimple_cdt_location (stmt)) + return (!is_gimple_val (gimple_cdt_location (stmt)) || !POINTER_TYPE_P (TREE_TYPE (gimple_cdt_location (stmt)))); case GIMPLE_PHI: diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index 7f3c0dddeb5..fe649dda972 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -418,11 +418,6 @@ struct static_var_ann_d GTY(()) struct function_ann_d GTY(()) { struct tree_ann_common_d common; - - /* Pointer to the structure that contains the sets of global - variables modified by function calls. This field is only used - for FUNCTION_DECLs. */ - ipa_reference_vars_info_t GTY ((skip)) reference_vars_info; }; @@ -508,7 +503,7 @@ typedef struct immediate_use_iterator_d { FOR_EACH_IMM_USE_ON_STMT (use_p, iter) { - SET_USE (use_p) = blah; + SET_USE (use_p, blah); } update_stmt (stmt); } */ diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index ebc8b32916b..69f0c80c094 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2594,6 +2594,7 @@ inlinable_function_p (tree fn) /* We only warn for functions declared `inline' by the user. */ do_warning = (warn_inline && DECL_DECLARED_INLINE_P (fn) + && !DECL_NO_INLINE_WARNING_P (fn) && !DECL_IN_SYSTEM_HEADER (fn)); always_inline = lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)); diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c index 58aed883007..82cc0ffea59 100644 --- a/gcc/tree-outof-ssa.c +++ b/gcc/tree-outof-ssa.c @@ -606,25 +606,69 @@ replace_def_variable (var_map map, def_operand_p def_p, tree *expr) } -/* Remove any PHI node which is a virtual PHI. */ +/* Remove each argument from PHI. If an arg was the last use of an SSA_NAME, + check to see if this allows another PHI node to be removed. */ static void -eliminate_virtual_phis (void) +remove_gimple_phi_args (gimple phi) +{ + use_operand_p arg_p; + ssa_op_iter iter; + + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "Removing Dead PHI definition: "); + print_gimple_stmt (dump_file, phi, 0, TDF_SLIM); + } + + FOR_EACH_PHI_ARG (arg_p, phi, iter, SSA_OP_USE) + { + tree arg = USE_FROM_PTR (arg_p); + if (TREE_CODE (arg) == SSA_NAME) + { + /* Remove the reference to the existing argument. */ + SET_USE (arg_p, NULL_TREE); + if (has_zero_uses (arg)) + { + gimple stmt; + gimple_stmt_iterator gsi; + + stmt = SSA_NAME_DEF_STMT (arg); + + /* Also remove the def if it is a PHI node. */ + if (gimple_code (stmt) == GIMPLE_PHI) + { + remove_gimple_phi_args (stmt); + gsi = gsi_for_stmt (stmt); + remove_phi_node (&gsi, true); + } + + } + } + } +} + +/* Remove any PHI node which is a virtual PHI, or a PHI with no uses. */ + +static void +eliminate_useless_phis (void) { basic_block bb; gimple_stmt_iterator gsi; + tree result; FOR_EACH_BB (bb) { for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); ) { gimple phi = gsi_stmt (gsi); - if (!is_gimple_reg (SSA_NAME_VAR (gimple_phi_result (phi)))) + result = gimple_phi_result (phi); + if (!is_gimple_reg (SSA_NAME_VAR (result))) { #ifdef ENABLE_CHECKING size_t i; - /* There should be no arguments of this PHI which are in - the partition list, or we get incorrect results. */ + /* There should be no arguments which are not virtual, or the + results will be incorrect. */ for (i = 0; i < gimple_phi_num_args (phi); i++) { tree arg = PHI_ARG_DEF (phi, i); @@ -642,7 +686,16 @@ eliminate_virtual_phis (void) remove_phi_node (&gsi, true); } else - gsi_next (&gsi); + { + /* Also remove real PHIs with no uses. */ + if (has_zero_uses (result)) + { + remove_gimple_phi_args (phi); + remove_phi_node (&gsi, true); + } + else + gsi_next (&gsi); + } } } } @@ -1443,7 +1496,9 @@ rewrite_out_of_ssa (void) copies into the loop itself. */ insert_backedge_copies (); - eliminate_virtual_phis (); + + /* Eliminate PHIs which are of no use, such as virtual or dead phis. */ + eliminate_useless_phis (); if (dump_file && (dump_flags & TDF_DETAILS)) gimple_dump_cfg (dump_file, dump_flags & ~TDF_DETAILS); diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 801d2debabb..96241889538 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1653,8 +1653,8 @@ add_call_clobber_ops (gimple stmt, tree callee ATTRIBUTE_UNUSED) /* Get info for local and module level statics. There is a bit set for each static if the call being processed does not read or write that variable. */ - not_read_b = callee ? ipa_reference_get_not_read_global (callee) : NULL; - not_written_b = callee ? ipa_reference_get_not_written_global (callee) : NULL; + not_read_b = callee ? ipa_reference_get_not_read_global (cgraph_node (callee)) : NULL; + not_written_b = callee ? ipa_reference_get_not_written_global (cgraph_node (callee)) : NULL; /* Add a VDEF operand for every call clobbered variable. */ EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, u, bi) @@ -1705,7 +1705,7 @@ add_call_read_ops (gimple stmt, tree callee ATTRIBUTE_UNUSED) if (gimple_call_flags (stmt) & ECF_CONST) return; - not_read_b = callee ? ipa_reference_get_not_read_global (callee) : NULL; + not_read_b = callee ? ipa_reference_get_not_read_global (cgraph_node (callee)) : NULL; /* For pure functions we compute non-escaped uses separately. */ if (gimple_call_flags (stmt) & ECF_PURE) diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index e4e7db69d2e..bfe909d6738 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -859,8 +859,20 @@ build_and_add_sum (tree tmpvar, tree op1, tree op2, enum tree_code opcode) } else { - gsi = gsi_for_stmt (op2def); - gsi_insert_after (&gsi, sum, GSI_NEW_STMT); + if (!stmt_ends_bb_p (op2def)) + { + gsi = gsi_for_stmt (op2def); + gsi_insert_after (&gsi, sum, GSI_NEW_STMT); + } + else + { + edge e; + edge_iterator ei; + + FOR_EACH_EDGE (e, ei, gimple_bb (op2def)->succs) + if (e->flags & EDGE_FALLTHRU) + gsi_insert_on_edge_immediate (e, sum); + } } } else @@ -872,8 +884,20 @@ build_and_add_sum (tree tmpvar, tree op1, tree op2, enum tree_code opcode) } else { - gsi = gsi_for_stmt (op1def); - gsi_insert_after (&gsi, sum, GSI_NEW_STMT); + if (!stmt_ends_bb_p (op1def)) + { + gsi = gsi_for_stmt (op1def); + gsi_insert_after (&gsi, sum, GSI_NEW_STMT); + } + else + { + edge e; + edge_iterator ei; + + FOR_EACH_EDGE (e, ei, gimple_bb (op1def)->succs) + if (e->flags & EDGE_FALLTHRU) + gsi_insert_on_edge_immediate (e, sum); + } } } update_stmt (sum); diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 09b2ee8fffd..dbffff5aa2b 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1402,9 +1402,17 @@ vn_phi_compute_hash (vn_phi_t vp1) hashval_t result = 0; int i; tree phi1op; + tree type; result = vp1->block->index; + /* If all PHI arguments are constants we need to distinguish + the PHI node via its type. */ + type = TREE_TYPE (VEC_index (tree, vp1->phiargs, 0)); + result += (INTEGRAL_TYPE_P (type) + + (INTEGRAL_TYPE_P (type) + ? TYPE_PRECISION (type) + TYPE_UNSIGNED (type) : 0)); + for (i = 0; VEC_iterate (tree, vp1->phiargs, i, phi1op); i++) { if (phi1op == VN_TOP) @@ -1437,6 +1445,12 @@ vn_phi_eq (const void *p1, const void *p2) int i; tree phi1op; + /* If the PHI nodes do not have compatible types + they are not the same. */ + if (!types_compatible_p (TREE_TYPE (VEC_index (tree, vp1->phiargs, 0)), + TREE_TYPE (VEC_index (tree, vp2->phiargs, 0)))) + return false; + /* Any phi in the same block will have it's arguments in the same edge order, because of how we store phi nodes. */ for (i = 0; VEC_iterate (tree, vp1->phiargs, i, phi1op); i++) diff --git a/gcc/tree.c b/gcc/tree.c index 71267bdb82c..3d2f3e1fe3d 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -3584,7 +3584,7 @@ set_expr_locus (tree node, source_location *loc) void protected_set_expr_location (tree t, location_t loc) { - if (t && t != error_mark_node && CAN_HAVE_LOCATION_P (t)) + if (t && CAN_HAVE_LOCATION_P (t)) SET_EXPR_LOCATION (t, loc); } @@ -6770,9 +6770,8 @@ get_callee_fndecl (const_tree call) && TREE_CODE (TREE_OPERAND (addr, 0)) == FUNCTION_DECL) return TREE_OPERAND (addr, 0); - /* We couldn't figure out what was being called. Maybe the front - end has some idea. */ - return lang_hooks.lang_get_callee_fndecl (call); + /* We couldn't figure out what was being called. */ + return NULL_TREE; } /* Print debugging information about tree nodes generated during the compile, diff --git a/gcc/tree.def b/gcc/tree.def index e9c891754bb..ef103cdba50 100644 --- a/gcc/tree.def +++ b/gcc/tree.def @@ -1137,7 +1137,7 @@ DEFTREECODE (VEC_INTERLEAVE_LOW_EXPR, "vec_interleavelow_expr", tcc_binary, 2) outcome (0 for not taken and 1 for taken). Once the profile is guessed all conditional branches leading to execution paths executing the PREDICT_EXPR will get predicted by the specified predictor. */ -DEFTREECODE (PREDICT_EXPR, "predict_expr", tcc_unary, 1) +DEFTREECODE (PREDICT_EXPR, "predict_expr", tcc_expression, 1) /* OPTIMIZATION_NODE. Node to store the optimization options. */ DEFTREECODE (OPTIMIZATION_NODE, "optimization_node", tcc_exceptional, 0) diff --git a/gcc/tree.h b/gcc/tree.h index 2dc3e6b9ec1..4c046c29d64 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -3235,17 +3235,17 @@ struct tree_decl_non_common GTY(()) #define DECL_POSSIBLY_INLINED(DECL) \ FUNCTION_DECL_CHECK (DECL)->function_decl.possibly_inlined -/* Nonzero in a FUNCTION_DECL means this function can be substituted - where it is called. */ -#define DECL_INLINE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.inline_flag) - /* Nonzero in a FUNCTION_DECL means that this function was declared inline, such as via the `inline' keyword in C/C++. This flag controls the linkage - semantics of 'inline'; whether or not the function is inlined is - controlled by DECL_INLINE. */ + semantics of 'inline' */ #define DECL_DECLARED_INLINE_P(NODE) \ (FUNCTION_DECL_CHECK (NODE)->function_decl.declared_inline_flag) +/* Nonzero in a FUNCTION_DECL means this function should not get + -Winline warnings. */ +#define DECL_NO_INLINE_WARNING_P(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.no_inline_warning_flag) + /* Nonzero in a FUNCTION_DECL that should be always inlined by the inliner disregarding size and cost heuristics. This is equivalent to using the always_inline attribute without the required diagnostics if the @@ -3314,7 +3314,7 @@ struct tree_function_decl GTY(()) unsigned declared_inline_flag : 1; unsigned regdecl_flag : 1; - unsigned inline_flag : 1; + unsigned no_inline_warning_flag : 1; unsigned no_instrument_function_entry_exit : 1; unsigned no_limit_stack : 1; unsigned disregard_inline_limits : 1; diff --git a/gcc/varasm.c b/gcc/varasm.c index 5728d195e09..e74adaed983 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -4205,19 +4205,36 @@ initializer_constant_valid_p (tree value, tree endtype) return op0; } - case VIEW_CONVERT_EXPR: case NON_LVALUE_EXPR: return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype); - CASE_CONVERT: + case VIEW_CONVERT_EXPR: { - tree src; - tree src_type; - tree dest_type; + tree src = TREE_OPERAND (value, 0); + tree src_type = TREE_TYPE (src); + tree dest_type = TREE_TYPE (value); + + /* Allow view-conversions from aggregate to non-aggregate type only + if the bit pattern is fully preserved afterwards; otherwise, the + RTL expander won't be able to apply a subsequent transformation + to the underlying constructor. */ + if (AGGREGATE_TYPE_P (src_type) && !AGGREGATE_TYPE_P (dest_type)) + { + if (TYPE_MODE (endtype) == TYPE_MODE (dest_type)) + return initializer_constant_valid_p (src, endtype); + else + return NULL_TREE; + } + + /* Allow all other kinds of view-conversion. */ + return initializer_constant_valid_p (src, endtype); + } - src = TREE_OPERAND (value, 0); - src_type = TREE_TYPE (src); - dest_type = TREE_TYPE (value); + CASE_CONVERT: + { + tree src = TREE_OPERAND (value, 0); + tree src_type = TREE_TYPE (src); + tree dest_type = TREE_TYPE (value); /* Allow conversions between pointer types, floating-point types, and offset types. */ diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 49efadc94c6..39be98972ae 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,18 @@ +2008-09-18 Simon Baldwin <simonb@google.com> + + * include/cpplib.h (struct cpp_options): Add new boolean flag + warn_builtin_macro_redefined. + * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined. + * (struct builtin_operator): Split out from previous struct builtin, + enhance extra const correctness. + * (struct builtin_macro): Split out from previous struct builtin, add + new always_warn_if_redefined flag, enhance const correctness. + * (mark_named_operators): Use struct builtin_operator. + * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN + to builtins selectively. + * macro.c (warn_of_redefinition): Return false if a builtin macro + is not flagged with NODE_WARN. + 2008-07-31 Jakub Jelinek <jakub@redhat.com> PR preprocessor/36649 diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index a79c26dd6b8..4f073f99433 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -349,6 +349,10 @@ struct cpp_options Presumably the usage is protected by the appropriate #ifdef. */ unsigned char warn_variadic_macros; + /* Nonzero means warn about builtin macros that are redefined or + explicitly undefined. */ + unsigned char warn_builtin_macro_redefined; + /* Nonzero means turn warnings into errors. */ unsigned char warnings_are_errors; diff --git a/libcpp/init.c b/libcpp/init.c index 040bf2a0489..0db167c133c 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -163,6 +163,7 @@ cpp_create_reader (enum c_lang lang, hash_table *table, CPP_OPTION (pfile, dollars_in_ident) = 1; CPP_OPTION (pfile, warn_dollars) = 1; CPP_OPTION (pfile, warn_variadic_macros) = 1; + CPP_OPTION (pfile, warn_builtin_macro_redefined) = 1; CPP_OPTION (pfile, warn_normalize) = normalized_C; /* Default CPP arithmetic to something sensible for the host for the @@ -303,31 +304,41 @@ cpp_destroy (cpp_reader *pfile) altered through #define, and #if recognizes them as operators. In C, these are not entered into the hash table at all (but see <iso646.h>). The value is a token-type enumerator. */ -struct builtin +struct builtin_macro { - const uchar *name; - unsigned short len; - unsigned short value; + const uchar *const name; + const unsigned short len; + const unsigned short value; + const bool always_warn_if_redefined; }; -#define B(n, t) { DSC(n), t } -static const struct builtin builtin_array[] = +#define B(n, t, f) { DSC(n), t, f } +static const struct builtin_macro builtin_array[] = { - B("__TIMESTAMP__", BT_TIMESTAMP), - B("__TIME__", BT_TIME), - B("__DATE__", BT_DATE), - B("__FILE__", BT_FILE), - B("__BASE_FILE__", BT_BASE_FILE), - B("__LINE__", BT_SPECLINE), - B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL), - B("__COUNTER__", BT_COUNTER), + B("__TIMESTAMP__", BT_TIMESTAMP, false), + B("__TIME__", BT_TIME, false), + B("__DATE__", BT_DATE, false), + B("__FILE__", BT_FILE, false), + B("__BASE_FILE__", BT_BASE_FILE, false), + B("__LINE__", BT_SPECLINE, true), + B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL, true), + B("__COUNTER__", BT_COUNTER, true), /* Keep builtins not used for -traditional-cpp at the end, and update init_builtins() if any more are added. */ - B("_Pragma", BT_PRAGMA), - B("__STDC__", BT_STDC), + B("_Pragma", BT_PRAGMA, true), + B("__STDC__", BT_STDC, true), +}; +#undef B + +struct builtin_operator +{ + const uchar *const name; + const unsigned short len; + const unsigned short value; }; -static const struct builtin operator_array[] = +#define B(n, t) { DSC(n), t } +static const struct builtin_operator operator_array[] = { B("and", CPP_AND_AND), B("and_eq", CPP_AND_EQ), @@ -347,7 +358,7 @@ static const struct builtin operator_array[] = static void mark_named_operators (cpp_reader *pfile) { - const struct builtin *b; + const struct builtin_operator *b; for (b = operator_array; b < (operator_array + ARRAY_SIZE (operator_array)); @@ -363,7 +374,7 @@ mark_named_operators (cpp_reader *pfile) void cpp_init_special_builtins (cpp_reader *pfile) { - const struct builtin *b; + const struct builtin_macro *b; size_t n = ARRAY_SIZE (builtin_array); if (CPP_OPTION (pfile, traditional)) @@ -376,7 +387,10 @@ cpp_init_special_builtins (cpp_reader *pfile) { cpp_hashnode *hp = cpp_lookup (pfile, b->name, b->len); hp->type = NT_MACRO; - hp->flags |= NODE_BUILTIN | NODE_WARN; + hp->flags |= NODE_BUILTIN; + if (b->always_warn_if_redefined + || CPP_OPTION (pfile, warn_builtin_macro_redefined)) + hp->flags |= NODE_WARN; hp->value.builtin = (enum builtin_type) b->value; } } diff --git a/libcpp/macro.c b/libcpp/macro.c index 9a470ef460b..8122648ea39 100644 --- a/libcpp/macro.c +++ b/libcpp/macro.c @@ -1392,6 +1392,10 @@ warn_of_redefinition (cpp_reader *pfile, const cpp_hashnode *node, if (node->flags & NODE_WARN) return true; + /* Suppress warnings for builtins that lack the NODE_WARN flag. */ + if (node->flags & NODE_BUILTIN) + return false; + /* Redefinitions of conditional (context-sensitive) macros, on the other hand, must be allowed silently. */ if (node->flags & NODE_CONDITIONAL) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3c2d291778e..99340ec117c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,45 @@ +2008-09-19 Johannes Singler <singler@ira.uka.de> + + PR libstdc++/37470 + * include/parallel/base.h: Rename log2 to __log2. + (__log2) Avoid infinite loop for n <= 0, return 0. + * include/parallel/losertree.h: Rename log2 to __log2. + * include/parallel/multiseq_selection.h: Likewise. + * include/parallel/random_shuffle.h: Likewise. + +2008-09-18 Paolo Carlini <paolo.carlini@oracle.com> + + * include/bits/shared_ptr.h (__shared_count<>:: + __shared_count(_Ptr, _Deleter), __shared_count<>:: + __shared_count(_Ptr, _Deleter, _Alloc), __shared_count<>:: + __shared_count(_Sp_make_shared_tag, _Tp*, _Alloc, _Args&&...)): + Qualify new with ::. + +2008-09-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR libstdc++/37547 + * include/bits/stl_algo.h (min(initializer_list<>), + min(initializer_list<>, Compare), max(initializer_list<>), + max(initializer_list<>, Compare), minmax(initializer_list<>), + minmax(initializer_list<>, Compare)): Fix return type. + * include/bits/algorithmfwd.h: Adjust. + * testsuite/25_algorithms/headers/algorithm/synopsis.cc: Likewise. + * testsuite/25_algorithms/max/requirements/explicit_instantiation/3.cc: + Likewise. + * testsuite/25_algorithms/max/requirements/explicit_instantiation/ + pod2.cc: Likewise. + * testsuite/25_algorithms/min/requirements/explicit_instantiation/3.cc: + Likewise. + * testsuite/25_algorithms/min/requirements/explicit_instantiation/ + pod2.cc: Likewise. + * testsuite/25_algorithms/minmax/requirements/explicit_instantiation/ + 3.cc: Likewise. + * testsuite/25_algorithms/minmax/requirements/explicit_instantiation/ + pod2.cc: Likewise. + * testsuite/25_algorithms/max/37547.cc: New. + * testsuite/25_algorithms/min/37547.cc: Likewise. + * testsuite/25_algorithms/minmax/37547.cc: Likewise. + 2008-09-16 Chris Fairles <chris.fairles@gmail.com> * testsuite/25_algorithms/min/requirements/explicit_instantiation/3.cc: diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h index 95ff72b79d5..0e2e2c0e277 100644 --- a/libstdc++-v3/include/bits/algorithmfwd.h +++ b/libstdc++-v3/include/bits/algorithmfwd.h @@ -319,27 +319,27 @@ _GLIBCXX_BEGIN_NAMESPACE(std) minmax_element(_FIter, _FIter, _Compare); template<typename _Tp> - const _Tp& + _Tp min(initializer_list<_Tp>); template<typename _Tp, typename _Compare> - const _Tp& + _Tp min(initializer_list<_Tp>, _Compare); template<typename _Tp> - const _Tp& + _Tp max(initializer_list<_Tp>); template<typename _Tp, typename _Compare> - const _Tp& + _Tp max(initializer_list<_Tp>, _Compare); template<typename _Tp> - pair<const _Tp&, const _Tp&> + pair<_Tp, _Tp> minmax(initializer_list<_Tp>); template<typename _Tp, typename _Compare> - pair<const _Tp&, const _Tp&> + pair<_Tp, _Tp> minmax(initializer_list<_Tp>, _Compare); #endif diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h index 964797b140a..2d7cf24c043 100644 --- a/libstdc++-v3/include/bits/shared_ptr.h +++ b/libstdc++-v3/include/bits/shared_ptr.h @@ -249,7 +249,7 @@ namespace std try { _M_pi = __a2.allocate(1); - new(static_cast<void*>(_M_pi)) _Sp_cd_type(__p, __d); + ::new(static_cast<void*>(_M_pi)) _Sp_cd_type(__p, __d); } catch(...) { @@ -269,7 +269,7 @@ namespace std try { _M_pi = __a2.allocate(1); - new(static_cast<void*>(_M_pi)) _Sp_cd_type(__p, __d, __a); + ::new(static_cast<void*>(_M_pi)) _Sp_cd_type(__p, __d, __a); } catch(...) { @@ -290,8 +290,8 @@ namespace std try { _M_pi = __a2.allocate(1); - new(static_cast<void*>(_M_pi)) _Sp_cp_type(__a, - std::forward<_Args>(__args)...); + ::new(static_cast<void*>(_M_pi)) _Sp_cp_type(__a, + std::forward<_Args>(__args)...); } catch(...) { diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index 42ada9986f3..373881c7f1b 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -4094,38 +4094,38 @@ _GLIBCXX_BEGIN_NAMESPACE(std) return std::make_pair(__min, __max); } - // N2722. + // N2722 + fixes. template<typename _Tp> - inline const _Tp& + inline _Tp min(initializer_list<_Tp> __l) { return *std::min_element(__l.begin(), __l.end()); } template<typename _Tp, typename _Compare> - inline const _Tp& + inline _Tp min(initializer_list<_Tp> __l, _Compare __comp) { return *std::min_element(__l.begin(), __l.end(), __comp); } template<typename _Tp> - inline const _Tp& + inline _Tp max(initializer_list<_Tp> __l) { return *std::max_element(__l.begin(), __l.end()); } template<typename _Tp, typename _Compare> - inline const _Tp& + inline _Tp max(initializer_list<_Tp> __l, _Compare __comp) { return *std::max_element(__l.begin(), __l.end(), __comp); } template<typename _Tp> - inline pair<const _Tp&, const _Tp&> + inline pair<_Tp, _Tp> minmax(initializer_list<_Tp> __l) { pair<const _Tp*, const _Tp*> __p = std::minmax_element(__l.begin(), __l.end()); - return std::make_pair(*__p.first, *__p.second); + return std::pair<_Tp, _Tp>(*__p.first, *__p.second); } template<typename _Tp, typename _Compare> - inline pair<const _Tp&, const _Tp&> + inline pair<_Tp, _Tp> minmax(initializer_list<_Tp> __l, _Compare __comp) { pair<const _Tp*, const _Tp*> __p = diff --git a/libstdc++-v3/include/parallel/base.h b/libstdc++-v3/include/parallel/base.h index 45c3327f5af..2a5dc297ec4 100644 --- a/libstdc++-v3/include/parallel/base.h +++ b/libstdc++-v3/include/parallel/base.h @@ -105,14 +105,14 @@ namespace __gnu_parallel /** @brief Calculates the rounded-down logarithm of @c n for base 2. * @param n Argument. - * @return Returns 0 for argument 0. + * @return Returns 0 for any argument <1. */ template<typename Size> inline Size - log2(Size n) + __log2(Size n) { Size k; - for (k = 0; n != 1; n >>= 1) + for (k = 0; n > 1; n >>= 1) ++k; return k; } diff --git a/libstdc++-v3/include/parallel/losertree.h b/libstdc++-v3/include/parallel/losertree.h index 7e50bb13d50..84d5be7a05d 100644 --- a/libstdc++-v3/include/parallel/losertree.h +++ b/libstdc++-v3/include/parallel/losertree.h @@ -105,7 +105,7 @@ public: ik = _k; // Compute log_2{k} for the Loser Tree - _M_log_k = log2(ik - 1) + 1; + _M_log_k = __log2(ik - 1) + 1; // Next greater power of 2. k = 1 << _M_log_k; @@ -368,7 +368,7 @@ public: ik = _k; // Next greater power of 2. - k = 1 << (log2(ik - 1) + 1); + k = 1 << (__log2(ik - 1) + 1); offset = k; losers = new Loser[k * 2]; for (unsigned int i = ik - 1; i < k; i++) @@ -579,7 +579,7 @@ public: ik = _k; // Next greater power of 2. - k = 1 << (log2(ik - 1) + 1); + k = 1 << (__log2(ik - 1) + 1); offset = k; // Avoid default-constructing losers[].key losers = static_cast<Loser*>(::operator new(2 * k * sizeof(Loser))); @@ -815,7 +815,7 @@ public: ik = _k; // Next greater power of 2. - k = 1 << (log2(ik - 1) + 1); + k = 1 << (__log2(ik - 1) + 1); offset = k; // Avoid default-constructing losers[].key losers = new Loser[2 * k]; diff --git a/libstdc++-v3/include/parallel/multiseq_selection.h b/libstdc++-v3/include/parallel/multiseq_selection.h index ee9214f4a22..79078af996c 100644 --- a/libstdc++-v3/include/parallel/multiseq_selection.h +++ b/libstdc++-v3/include/parallel/multiseq_selection.h @@ -183,7 +183,7 @@ namespace __gnu_parallel nmax = std::max(nmax, ns[i]); } - r = log2(nmax) + 1; + r = __log2(nmax) + 1; // Pad all lists to this length, at least as long as any ns[i], // equality iff nmax = 2^k - 1. @@ -429,7 +429,7 @@ namespace __gnu_parallel nmax = std::max(nmax, ns[i]); } - r = log2(nmax) + 1; + r = __log2(nmax) + 1; // Pad all lists to this length, at least as long as any ns[i], // equality iff nmax = 2^k - 1 diff --git a/libstdc++-v3/include/parallel/random_shuffle.h b/libstdc++-v3/include/parallel/random_shuffle.h index e6ce95d489d..5e875b4fb4a 100644 --- a/libstdc++-v3/include/parallel/random_shuffle.h +++ b/libstdc++-v3/include/parallel/random_shuffle.h @@ -249,7 +249,7 @@ template<typename T> if (x <= 1) return 1; else - return (T)1 << (log2(x - 1) + 1); + return (T)1 << (__log2(x - 1) + 1); } /** @brief Main parallel random shuffle step. @@ -352,7 +352,7 @@ template<typename RandomAccessIterator, typename RandomNumberGenerator> starts = sd.starts = new difference_type[num_threads + 1]; int bin_cursor = 0; sd.num_bins = num_bins; - sd.num_bits = log2(num_bins); + sd.num_bits = __log2(num_bins); difference_type chunk_length = n / num_threads, split = n % num_threads, start = 0; @@ -450,7 +450,7 @@ template<typename RandomAccessIterator, typename RandomNumberGenerator> } #endif - int num_bits = log2(num_bins); + int num_bits = __log2(num_bins); if (num_bins > 1) { diff --git a/libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc b/libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc index 3bc8eb2a764..aa4496b907b 100644 --- a/libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc +++ b/libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc @@ -533,27 +533,27 @@ namespace std minmax_element(_FIter, _FIter, _Compare); template<typename _Tp> - const _Tp& + _Tp min(initializer_list<_Tp>); template<typename _Tp, typename _Compare> - const _Tp& + _Tp min(initializer_list<_Tp>, _Compare); template<typename _Tp> - const _Tp& + _Tp max(initializer_list<_Tp>); template<typename _Tp, typename _Compare> - const _Tp& + _Tp max(initializer_list<_Tp>, _Compare); template<typename _Tp> - pair<const _Tp&, const _Tp&> + pair<_Tp, _Tp> minmax(initializer_list<_Tp>); template<typename _Tp, typename _Compare> - pair<const _Tp&, const _Tp&> + pair<_Tp, _Tp> minmax(initializer_list<_Tp>, _Compare); #endif diff --git a/libstdc++-v3/testsuite/25_algorithms/max/37547.cc b/libstdc++-v3/testsuite/25_algorithms/max/37547.cc new file mode 100644 index 00000000000..233804c4254 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/max/37547.cc @@ -0,0 +1,40 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2008 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +#include <algorithm> +#include <vector> +#include <testsuite_hooks.h> + +// libstdc++/37547 +int test01() +{ + bool test __attribute__((unused)) = true; + + std::vector<int> v{1,2,3,4,5}; + + auto p = std::max({v}); + VERIFY ( p == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/max/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/25_algorithms/max/requirements/explicit_instantiation/3.cc index e4ac6cb607b..1f242c9af39 100644 --- a/libstdc++-v3/testsuite/25_algorithms/max/requirements/explicit_instantiation/3.cc +++ b/libstdc++-v3/testsuite/25_algorithms/max/requirements/explicit_instantiation/3.cc @@ -42,6 +42,6 @@ namespace std typedef value_type* iterator_type; typedef std::less<value_type> compare_type; - template const value_type& max(initializer_list<value_type>); - template const value_type& max(initializer_list<value_type>, compare_type); + template value_type max(initializer_list<value_type>); + template value_type max(initializer_list<value_type>, compare_type); } diff --git a/libstdc++-v3/testsuite/25_algorithms/max/requirements/explicit_instantiation/pod2.cc b/libstdc++-v3/testsuite/25_algorithms/max/requirements/explicit_instantiation/pod2.cc index 55f2eae6545..0e623e2e637 100644 --- a/libstdc++-v3/testsuite/25_algorithms/max/requirements/explicit_instantiation/pod2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/max/requirements/explicit_instantiation/pod2.cc @@ -42,6 +42,6 @@ namespace std typedef value_type* iterator_type; typedef std::less<value_type> compare_type; - template const value_type& max(initializer_list<value_type>); - template const value_type& max(initializer_list<value_type>, compare_type); + template value_type max(initializer_list<value_type>); + template value_type max(initializer_list<value_type>, compare_type); } diff --git a/libstdc++-v3/testsuite/25_algorithms/min/37547.cc b/libstdc++-v3/testsuite/25_algorithms/min/37547.cc new file mode 100644 index 00000000000..5d0ffd47649 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/min/37547.cc @@ -0,0 +1,40 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2008 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +#include <algorithm> +#include <vector> +#include <testsuite_hooks.h> + +// libstdc++/37547 +int test01() +{ + bool test __attribute__((unused)) = true; + + std::vector<int> v{1,2,3,4,5}; + + auto p = std::min({v}); + VERIFY ( p == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/min/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/25_algorithms/min/requirements/explicit_instantiation/3.cc index 1d6e7aedeb8..7faea37947c 100644 --- a/libstdc++-v3/testsuite/25_algorithms/min/requirements/explicit_instantiation/3.cc +++ b/libstdc++-v3/testsuite/25_algorithms/min/requirements/explicit_instantiation/3.cc @@ -42,6 +42,6 @@ namespace std typedef value_type* iterator_type; typedef std::less<value_type> compare_type; - template const value_type& min(initializer_list<value_type>); - template const value_type& min(initializer_list<value_type>, compare_type); + template value_type min(initializer_list<value_type>); + template value_type min(initializer_list<value_type>, compare_type); } diff --git a/libstdc++-v3/testsuite/25_algorithms/min/requirements/explicit_instantiation/pod2.cc b/libstdc++-v3/testsuite/25_algorithms/min/requirements/explicit_instantiation/pod2.cc index 98c8413c2a6..4800c1bd1c5 100644 --- a/libstdc++-v3/testsuite/25_algorithms/min/requirements/explicit_instantiation/pod2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/min/requirements/explicit_instantiation/pod2.cc @@ -42,6 +42,6 @@ namespace std typedef value_type* iterator_type; typedef std::less<value_type> compare_type; - template const value_type& min(initializer_list<value_type>); - template const value_type& min(initializer_list<value_type>, compare_type); + template value_type min(initializer_list<value_type>); + template value_type min(initializer_list<value_type>, compare_type); } diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax/37547.cc b/libstdc++-v3/testsuite/25_algorithms/minmax/37547.cc new file mode 100644 index 00000000000..21de3907b3e --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/minmax/37547.cc @@ -0,0 +1,40 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2008 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +#include <algorithm> +#include <vector> +#include <testsuite_hooks.h> + +// libstdc++/37547 +int test01() +{ + bool test __attribute__((unused)) = true; + + std::vector<int> v{1,2,3,4,5}; + + auto p = std::minmax({v}); + VERIFY ( p.first == v ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/3.cc index 71fab66fddd..a6506ca764c 100644 --- a/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/3.cc +++ b/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/3.cc @@ -42,8 +42,7 @@ namespace std typedef value_type* iterator_type; typedef std::less<value_type> compare_type; - template pair<const value_type&, const value_type&> - minmax(initializer_list<value_type>); - template pair<const value_type&, const value_type&> - minmax(initializer_list<value_type>, compare_type); + template pair<value_type, value_type> minmax(initializer_list<value_type>); + template pair<value_type, value_type> minmax(initializer_list<value_type>, + compare_type); } diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/pod2.cc b/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/pod2.cc index d5285930ddf..b31d38d3c89 100644 --- a/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/pod2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/pod2.cc @@ -42,8 +42,7 @@ namespace std typedef value_type* iterator_type; typedef std::less<value_type> compare_type; - template pair<const value_type&, const value_type&> - minmax(initializer_list<value_type>); - template pair<const value_type&, const value_type&> - minmax(initializer_list<value_type>, compare_type); + template pair<value_type, value_type> minmax(initializer_list<value_type>); + template pair<value_type, value_type> minmax(initializer_list<value_type>, + compare_type); } |