Date: Tue, 29 Mar 2011 20:53:51 +0000 (UTC) From: Martin Matuska <mm@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r220150 - in head: contrib/gcc contrib/gcc/config/mips contrib/gcc/config/rs6000 contrib/gcc/config/s390 contrib/gcc/cp contrib/gcc/doc contrib/libstdc++ contrib/libstdc++/include/std c... Message-ID: <201103292053.p2TKrpP5040638@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mm Date: Tue Mar 29 20:53:51 2011 New Revision: 220150 URL: http://svn.freebsd.org/changeset/base/220150 Log: Upgrade of base gcc and libstdc++ to the last GPLv2-licensed revision (rev. 127959 of gcc-4_2-branch). Resolved GCC bugs: c++: 17763, 29365, 30535, 30917, 31337, 31941, 32108, 32112, 32346, 32898, 32992 debug: 32610, 32914 libstdc++: 33084, 33128 middle-end: 32563 rtl-optimization: 33148 tree-optimization: 25413, 32723 target: 32218 Tested by: pointyhat (miwi) Obtained from: gcc (gcc-4_2-branch up to rev. 127959) PR: gnu/153298, gnu/153959, gnu/154385 MFC after: 1 month Modified: head/contrib/gcc/BASE-VER head/contrib/gcc/ChangeLog head/contrib/gcc/DATESTAMP head/contrib/gcc/DEV-PHASE head/contrib/gcc/config/mips/predicates.md head/contrib/gcc/config/rs6000/rs6000.c head/contrib/gcc/config/s390/s390.md head/contrib/gcc/cp/ChangeLog head/contrib/gcc/cp/call.c head/contrib/gcc/cp/cp-tree.h head/contrib/gcc/cp/cxx-pretty-print.c head/contrib/gcc/cp/decl.c head/contrib/gcc/cp/decl2.c head/contrib/gcc/cp/error.c head/contrib/gcc/cp/lex.c head/contrib/gcc/cp/name-lookup.c head/contrib/gcc/cp/pt.c head/contrib/gcc/cp/semantics.c head/contrib/gcc/cp/typeck.c head/contrib/gcc/doc/contrib.texi head/contrib/gcc/dwarf2out.c head/contrib/gcc/expr.c head/contrib/gcc/fold-const.c head/contrib/gcc/gimplify.c head/contrib/gcc/reload1.c head/contrib/gcc/simplify-rtx.c head/contrib/gcc/target-def.h head/contrib/gcc/target.h head/contrib/gcc/targhooks.c head/contrib/gcc/targhooks.h head/contrib/gcc/tree-if-conv.c head/contrib/gcc/tree-ssa-structalias.c head/contrib/gcc/tree-vect-analyze.c head/contrib/gcc/tree-vect-patterns.c head/contrib/gcc/tree.c head/contrib/gcc/tree.h head/contrib/libstdc++/ChangeLog head/contrib/libstdc++/include/std/std_valarray.h head/contrib/libstdc++/include/tr1/random head/sys/sys/param.h Directory Properties: head/contrib/gcc/ (props changed) head/contrib/libstdc++/ (props changed) Modified: head/contrib/gcc/BASE-VER ============================================================================== --- head/contrib/gcc/BASE-VER Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/BASE-VER Tue Mar 29 20:53:51 2011 (r220150) @@ -1 +1 @@ -4.2.1 +4.2.2 Modified: head/contrib/gcc/ChangeLog ============================================================================== --- head/contrib/gcc/ChangeLog Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/ChangeLog Tue Mar 29 20:53:51 2011 (r220150) @@ -1,3 +1,121 @@ +2007-08-31 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/33148 + * simplify-rtx.c (simplify_unary_operation_1): Only optimize + (neg (lt X 0)) if X has scalar int mode. + + PR debug/32914 + * dwarf2out.c (rtl_for_decl_init): If vector decl has CONSTRUCTOR + initializer, use build_vector_from_ctor if possible to create + VECTOR_CST out of it. If vector initializer is not VECTOR_CST + even after this, return NULL. + +2007-08-27 Jason Merrill <jason@redhat.com> + + PR c++/31337 + * gimplify.c (gimplify_modify_expr): Discard the assignment of + zero-sized types after calling gimplify_modify_expr_rhs. + +2007-08-24 Jakub Jelinek <jakub@redhat.com> + + PR debug/32610 + * dwarf2out.c (gen_decl_die): Don't call + gen_tagged_type_instantiation_die if decl doesn't have tagged type. + +2007-08-24 Richard Guenther <rguenther@suse.de> + + * expr.c (get_inner_reference): Remove unused variable. + +2007-08-24 Richard Guenther <rguenther@suse.de> + + * expr.c (get_inner_reference): Do computation of bitoffset + from offset in a way we can detect overflow reliably. + +2007-08-22 Richard Guenther <rguenther@suse.de> + + PR middle-end/32563 + * tree.c (host_integerp): Treat sizetype as signed as it is + sign-extended. + +2007-08-20 Adam Nemet <anemet@caviumnetworks.com> + + * config/mips/predicates.md (const_call_insn_operand): Invoke + SYMBOL_REF_LONG_CALL_P only on SYMBOL_REFs. + +2007-08-17 Chen liqin <liqin@sunnorth.com.cn> + + * config/score/score.md : Update pattern tablejump. + * config/score/score.c : Update score_initialize_trampoline + function. + * config/score/score.h (TRAMPOLINE_TEMPLATE): Added macro. + (TRAMPOLINE_INSNS, TRAMPOLINE_SIZE) Update macro. + * doc/contrib.texi: Add my entry. + +2007-08-02 Andreas Krebbel <krebbel1@de.ibm.com> + + * config/s390/s390.md ("*xordi3_cconly"): Change xr to xg. + +2007-08-01 Andreas Krebbel <krebbel1@de.ibm.com> + + * config/s390/s390.md (TF in GPR splitter): Change operand_subword + parameter to TFmode. + +2007-07-30 Mark Mitchell <mark@codesourcery.com> + + * BASE-VER: Bump. + * DEV-PHASE: Mark as prerelease. + +2007-07-25 Steve Ellcey <sje@cup.hp.com> + + PR target/32218 + * tree-vect-patterns.c (vect_pattern_recog_1): Check for valid type. + +2007-07-25 Dorit Nuzman <dorit@il.ibm.com> + Devang Patel <dpatel@apple.com> + + PR tree-optimization/25413 + * targhooks.c (default_builtin_vector_alignment_reachable): New. + * targhooks.h (default_builtin_vector_alignment_reachable): New. + * tree.h (contains_packed_reference): New. + * expr.c (contains_packed_reference): New. + * tree-vect-analyze.c (vector_alignment_reachable_p): New. + (vect_enhance_data_refs_alignment): Call + vector_alignment_reachable_p. + * target.h (vector_alignment_reachable): New builtin. + * target-def.h (TARGET_VECTOR_ALIGNMENT_REACHABLE): New. + * config/rs6000/rs6000.c (rs6000_vector_alignment_reachable): New. + (TARGET_VECTOR_ALIGNMENT_REACHABLE): Define. + +2007-07-24 Richard Guenther <rguenther@suse.de> + + Backport from mainline: + 2007-07-16 Richard Guenther <rguenther@suse.de> + Uros Bizjak <ubizjak@gmail.com> + + * tree-if-conv.c (find_phi_replacement_condition): Unshare "*cond" + before forcing it to gimple operand. + +2007-07-24 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/32723 + Backport from mainline: + 2007-03-09 Daniel Berlin <dberlin@dberlin.org> + + * tree-ssa-structalias.c (shared_bitmap_info_t): New structure. + (shared_bitmap_table): New variable. + (shared_bitmap_hash): New function. + (shared_bitmap_eq): Ditto + (shared_bitmap_lookup): Ditto. + (shared_bitmap_add): Ditto. + (find_what_p_points_to): Rewrite to use shared bitmap hashtable. + (init_alias_vars): Init shared bitmap hashtable. + (delete_points_to_sets): Delete shared bitmap hashtable. + +2007-07-23 Bernd Schmidt <bernd.schmidt@analog.com> + + * reload1.c (choose_reload_regs): Set reload_spill_index for regs + chosen during find_reloads. + 2007-07-19 Release Manager * GCC 4.2.1 released. Modified: head/contrib/gcc/DATESTAMP ============================================================================== --- head/contrib/gcc/DATESTAMP Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/DATESTAMP Tue Mar 29 20:53:51 2011 (r220150) @@ -1 +1 @@ -20070719 +20070831 Modified: head/contrib/gcc/DEV-PHASE ============================================================================== --- head/contrib/gcc/DEV-PHASE Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/DEV-PHASE Tue Mar 29 20:53:51 2011 (r220150) @@ -0,0 +1 @@ +prerelease Modified: head/contrib/gcc/config/mips/predicates.md ============================================================================== --- head/contrib/gcc/config/mips/predicates.md Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/config/mips/predicates.md Tue Mar 29 20:53:51 2011 (r220150) @@ -116,7 +116,9 @@ /* If -mlong-calls, force all calls to use register addressing. Also, if this function has the long_call attribute, we must use register addressing. */ - return !TARGET_LONG_CALLS && !SYMBOL_REF_LONG_CALL_P (op); + return (!TARGET_LONG_CALLS + && !(GET_CODE (op) == SYMBOL_REF + && SYMBOL_REF_LONG_CALL_P (op))); case SYMBOL_GOT_GLOBAL: /* Without explicit relocs, there is no special syntax for Modified: head/contrib/gcc/config/rs6000/rs6000.c ============================================================================== --- head/contrib/gcc/config/rs6000/rs6000.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/config/rs6000/rs6000.c Tue Mar 29 20:53:51 2011 (r220150) @@ -664,6 +664,7 @@ static int rs6000_use_sched_lookahead (v static tree rs6000_builtin_mask_for_load (void); static void def_builtin (int, const char *, tree, int); +static bool rs6000_vector_alignment_reachable (tree, bool); static void rs6000_init_builtins (void); static rtx rs6000_expand_unop_builtin (enum insn_code, tree, rtx); static rtx rs6000_expand_binop_builtin (enum insn_code, tree, rtx); @@ -915,6 +916,9 @@ static const char alt_reg_names[][8] = #undef TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD #define TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD rs6000_builtin_mask_for_load +#undef TARGET_VECTOR_ALIGNMENT_REACHABLE +#define TARGET_VECTOR_ALIGNMENT_REACHABLE rs6000_vector_alignment_reachable + #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS rs6000_init_builtins @@ -1584,6 +1588,37 @@ rs6000_builtin_mask_for_load (void) return 0; } + +/* Return true iff, data reference of TYPE can reach vector alignment (16) + after applying N number of iterations. This routine does not determine + how may iterations are required to reach desired alignment. */ + +static bool +rs6000_vector_alignment_reachable (tree type ATTRIBUTE_UNUSED, bool is_packed) +{ + if (is_packed) + return false; + + if (TARGET_32BIT) + { + if (rs6000_alignment_flags == MASK_ALIGN_NATURAL) + return true; + + if (rs6000_alignment_flags == MASK_ALIGN_POWER) + return true; + + return false; + } + else + { + if (TARGET_MACHO) + return false; + + /* Assuming that all other types are naturally aligned. CHECKME! */ + return true; + } +} + /* Handle generic options of the form -mfoo=yes/no. NAME is the option name. VALUE is the option value. Modified: head/contrib/gcc/config/s390/s390.md ============================================================================== --- head/contrib/gcc/config/s390/s390.md Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/config/s390/s390.md Tue Mar 29 20:53:51 2011 (r220150) @@ -1500,7 +1500,7 @@ && !s_operand (operands[1], VOIDmode)" [(set (match_dup 0) (match_dup 1))] { - rtx addr = operand_subword (operands[0], 1, 0, DFmode); + rtx addr = operand_subword (operands[0], 1, 0, TFmode); s390_load_address (addr, XEXP (operands[1], 0)); operands[1] = replace_equiv_address (operands[1], addr); }) @@ -5624,7 +5624,7 @@ "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT" "@ xgr\t%0,%2 - xr\t%0,%2" + xg\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) (define_insn "*xordi3_extimm" Modified: head/contrib/gcc/cp/ChangeLog ============================================================================== --- head/contrib/gcc/cp/ChangeLog Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/cp/ChangeLog Tue Mar 29 20:53:51 2011 (r220150) @@ -1,3 +1,66 @@ +2007-08-24 Jakub Jelinek <jakub@redhat.com> + + PR c++/31941 + * error.c (resolve_virtual_fun_from_obj_type_ref): Handle + TARGET_VTABLE_USES_DESCRIPTORS targets properly. + + PR c++/32898 + * name-lookup.c (set_decl_namespace): lookup_qualified_name failure + is error_mark_node rather than NULL_TREE. + * pt.c (check_explicit_specialization): Likewise. + +2007-08-22 Jason Merrill <jason@redhat.com> + + PR c++/29365 + * pt.c (outermost_tinst_level): New function. + * lex.c (in_main_input_context): New function. + * cp-tree.h: Declare it. + * decl2.c (constrain_class_visibility): Use it to avoid warning + about uses of the anonymous namespace in the main input file. + +2007-08-20 Jakub Jelinek <jakub@redhat.com> + + PR c++/32992 + * typeck.c (check_return_expr): Don't NRV optimize vars in + anonymous unions. + * decl.c (finish_function): Comment fix. + +2007-08-18 Paolo Carlini <pcarlini@suse.de> + + PR c++/32112 + * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE. + * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise. + +2007-08-10 Paolo Carlini <pcarlini@suse.de> + + PR c++/17763 + * error.c (dump_expr): Consistently use the *_cxx_* + variants of the pretty-print functions. + +2007-07-30 Paolo Carlini <pcarlini@suse.de> + + PR c++/32108 + * semantics.c (finish_label_stmt): Reject the __label__ + extension outside function scopes. + +2007-07-28 Simon Martin <simartin@users.sourceforge.net> + Mark Mitchell <mark@codesourcery.com> + + PR c++/30917 + * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be + hidden due to friend declarations in local classes. + +2007-07-27 Mark Mitchell <mark@codesourcery.com> + + PR c++/32346 + * call.c (convert_for_arg_passing): Only widen bitfields to their + declared types if necessary. + +2007-07-24 Paolo Carlini <pcarlini@suse.de> + + PR c++/30535 + * pt.c (unify): Never pass error_mark_node to template_decl_level. + 2007-07-19 Release Manager * GCC 4.2.1 released. Modified: head/contrib/gcc/cp/call.c ============================================================================== --- head/contrib/gcc/cp/call.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/cp/call.c Tue Mar 29 20:53:51 2011 (r220150) @@ -4674,7 +4674,27 @@ type_passed_as (tree type) tree convert_for_arg_passing (tree type, tree val) { - val = convert_bitfield_to_declared_type (val); + tree bitfield_type; + + /* If VAL is a bitfield, then -- since it has already been converted + to TYPE -- it cannot have a precision greater than TYPE. + + If it has a smaller precision, we must widen it here. For + example, passing "int f:3;" to a function expecting an "int" will + not result in any conversion before this point. + + If the precision is the same we must not risk widening. For + example, the COMPONENT_REF for a 32-bit "long long" bitfield will + often have type "int", even though the C++ type for the field is + "long long". If the value is being passed to a function + expecting an "int", then no conversions will be required. But, + if we call convert_bitfield_to_declared_type, the bitfield will + be converted to "long long". */ + bitfield_type = is_bitfield_expr_with_lowered_type (val); + if (bitfield_type + && TYPE_PRECISION (TREE_TYPE (val)) < TYPE_PRECISION (type)) + val = convert_to_integer (TYPE_MAIN_VARIANT (bitfield_type), val); + if (val == error_mark_node) ; /* Pass classes with copy ctors by invisible reference. */ Modified: head/contrib/gcc/cp/cp-tree.h ============================================================================== --- head/contrib/gcc/cp/cp-tree.h Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/cp/cp-tree.h Tue Mar 29 20:53:51 2011 (r220150) @@ -4079,6 +4079,7 @@ extern void yyerror (const char *); extern void yyhook (int); extern bool cxx_init (void); extern void cxx_finish (void); +extern bool in_main_input_context (void); /* in method.c */ extern void init_method (void); @@ -4161,6 +4162,7 @@ extern tree build_non_dependent_args (t extern bool reregister_specialization (tree, tree, tree); extern tree fold_non_dependent_expr (tree); extern bool explicit_class_specialization_p (tree); +extern tree outermost_tinst_level (void); /* in repo.c */ extern void init_repo (void); Modified: head/contrib/gcc/cp/cxx-pretty-print.c ============================================================================== --- head/contrib/gcc/cp/cxx-pretty-print.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/cp/cxx-pretty-print.c Tue Mar 29 20:53:51 2011 (r220150) @@ -204,6 +204,10 @@ pp_cxx_unqualified_id (cxx_pretty_printe pp_cxx_unqualified_id (pp, TEMPLATE_PARM_DECL (t)); break; + case UNBOUND_CLASS_TEMPLATE: + pp_cxx_unqualified_id (pp, TYPE_NAME (t)); + break; + default: pp_unsupported_tree (pp, t); break; Modified: head/contrib/gcc/cp/decl.c ============================================================================== --- head/contrib/gcc/cp/decl.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/cp/decl.c Tue Mar 29 20:53:51 2011 (r220150) @@ -11273,7 +11273,7 @@ finish_function (int flags) gcc_assert (stmts_are_full_exprs_p ()); /* Set up the named return value optimization, if we can. Candidate - variables are selected in check_return_value. */ + variables are selected in check_return_expr. */ if (current_function_return_value) { tree r = current_function_return_value; Modified: head/contrib/gcc/cp/decl2.c ============================================================================== --- head/contrib/gcc/cp/decl2.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/cp/decl2.c Tue Mar 29 20:53:51 2011 (r220150) @@ -1860,9 +1860,12 @@ constrain_class_visibility (tree type) int subvis = type_visibility (ftype); if (subvis == VISIBILITY_ANON) - warning (0, "\ + { + if (!in_main_input_context ()) + warning (0, "\ %qT has a field %qD whose type uses the anonymous namespace", type, t); + } else if (IS_AGGR_TYPE (ftype) && vis < VISIBILITY_HIDDEN && subvis >= VISIBILITY_HIDDEN) @@ -1877,9 +1880,12 @@ constrain_class_visibility (tree type) int subvis = type_visibility (TREE_TYPE (t)); if (subvis == VISIBILITY_ANON) - warning (0, "\ + { + if (!in_main_input_context()) + warning (0, "\ %qT has a base %qT whose type uses the anonymous namespace", type, TREE_TYPE (t)); + } else if (vis < VISIBILITY_HIDDEN && subvis >= VISIBILITY_HIDDEN) warning (OPT_Wattributes, "\ Modified: head/contrib/gcc/cp/error.c ============================================================================== --- head/contrib/gcc/cp/error.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/cp/error.c Tue Mar 29 20:53:51 2011 (r220150) @@ -901,6 +901,10 @@ dump_decl (tree t, int flags) pp_type_id (cxx_pp, t); break; + case UNBOUND_CLASS_TEMPLATE: + dump_type (t, flags); + break; + default: pp_unsupported_tree (cxx_pp, t); /* Fall through to error. */ @@ -1301,10 +1305,14 @@ static tree resolve_virtual_fun_from_obj_type_ref (tree ref) { tree obj_type = TREE_TYPE (OBJ_TYPE_REF_OBJECT (ref)); - int index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1); + HOST_WIDE_INT index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1); tree fun = BINFO_VIRTUALS (TYPE_BINFO (TREE_TYPE (obj_type))); - while (index--) + while (index) + { fun = TREE_CHAIN (fun); + index -= (TARGET_VTABLE_USES_DESCRIPTORS + ? TARGET_VTABLE_USES_DESCRIPTORS : 1); + } return BV_FN (fun); } @@ -1420,13 +1428,13 @@ dump_expr (tree t, int flags) if (TREE_CODE (ob) == ADDR_EXPR) { dump_expr (TREE_OPERAND (ob, 0), flags | TFF_EXPR_IN_PARENS); - pp_dot (cxx_pp); + pp_cxx_dot (cxx_pp); } else if (TREE_CODE (ob) != PARM_DECL || strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this")) { dump_expr (ob, flags | TFF_EXPR_IN_PARENS); - pp_arrow (cxx_pp); + pp_cxx_arrow (cxx_pp); } args = TREE_CHAIN (args); } Modified: head/contrib/gcc/cp/lex.c ============================================================================== --- head/contrib/gcc/cp/lex.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/cp/lex.c Tue Mar 29 20:53:51 2011 (r220150) @@ -827,3 +827,18 @@ make_aggr_type (enum tree_code code) return t; } + +/* Returns true if we are currently in the main source file, or in a + template instantiation started from the main source file. */ + +bool +in_main_input_context (void) +{ + tree tl = outermost_tinst_level(); + + if (tl) + return strcmp (main_input_filename, + LOCATION_FILE (TINST_LOCATION (tl))) == 0; + else + return strcmp (main_input_filename, input_filename) == 0; +} Modified: head/contrib/gcc/cp/name-lookup.c ============================================================================== --- head/contrib/gcc/cp/name-lookup.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/cp/name-lookup.c Tue Mar 29 20:53:51 2011 (r220150) @@ -2924,7 +2924,7 @@ set_decl_namespace (tree decl, tree scop /* See whether this has been declared in the namespace. */ old = lookup_qualified_name (scope, DECL_NAME (decl), false, true); - if (!old) + if (old == error_mark_node) /* No old declaration at all. */ goto complain; if (!is_overloaded_fn (decl)) @@ -3996,8 +3996,49 @@ lookup_name_real (tree name, int prefer_ if (binding) { - /* Only namespace-scope bindings can be hidden. */ - gcc_assert (!hidden_name_p (binding)); + if (hidden_name_p (binding)) + { + /* A non namespace-scope binding can only be hidden if + we are in a local class, due to friend declarations. + In particular, consider: + + void f() { + struct A { + friend struct B; + void g() { B* b; } // error: B is hidden + } + struct B {}; + } + + The standard says that "B" is a local class in "f" + (but not nested within "A") -- but that name lookup + for "B" does not find this declaration until it is + declared directly with "f". + + In particular: + + [class.friend] + + If a friend declaration appears in a local class and + the name specified is an unqualified name, a prior + declaration is looked up without considering scopes + that are outside the innermost enclosing non-class + scope. For a friend class declaration, if there is no + prior declaration, the class that is specified + belongs to the innermost enclosing non-class scope, + but if it is subsequently referenced, its name is not + found by name lookup until a matching declaration is + provided in the innermost enclosing nonclass scope. + */ + gcc_assert (current_class_type && + LOCAL_CLASS_P (current_class_type)); + + /* This binding comes from a friend declaration in the local + class. The standard (11.4.8) states that the lookup can + only succeed if there is a non-hidden declaration in the + current scope, which is not the case here. */ + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE); + } val = binding; break; } Modified: head/contrib/gcc/cp/pt.c ============================================================================== --- head/contrib/gcc/cp/pt.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/cp/pt.c Tue Mar 29 20:53:51 2011 (r220150) @@ -1971,7 +1971,7 @@ check_explicit_specialization (tree decl context. */ fns = lookup_qualified_name (CP_DECL_CONTEXT (decl), dname, false, true); - if (!fns || !is_overloaded_fn (fns)) + if (fns == error_mark_node || !is_overloaded_fn (fns)) { error ("%qD is not a template function", dname); fns = error_mark_node; @@ -5288,6 +5288,15 @@ reopen_tinst_level (tree level) pop_tinst_level (); } +/* Returns the TINST_LEVEL which gives the original instantiation + context. */ + +tree +outermost_tinst_level (void) +{ + return tree_last (current_tinst_level); +} + /* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL. ARGS is the vector of template arguments, as for tsubst. @@ -10453,6 +10462,8 @@ unify (tree tparms, tree targs, tree par case TEMPLATE_TEMPLATE_PARM: case BOUND_TEMPLATE_TEMPLATE_PARM: tparm = TREE_VALUE (TREE_VEC_ELT (tparms, 0)); + if (tparm == error_mark_node) + return 1; if (TEMPLATE_TYPE_LEVEL (parm) != template_decl_level (tparm)) Modified: head/contrib/gcc/cp/semantics.c ============================================================================== --- head/contrib/gcc/cp/semantics.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/cp/semantics.c Tue Mar 29 20:53:51 2011 (r220150) @@ -1320,8 +1320,13 @@ finish_label_stmt (tree name) void finish_label_decl (tree name) { - tree decl = declare_local_label (name); - add_decl_expr (decl); + if (!at_function_scope_p ()) + { + error ("__label__ declarations are only allowed in function scopes"); + return; + } + + add_decl_expr (declare_local_label (name)); } /* When DECL goes out of scope, make sure that CLEANUP is executed. */ Modified: head/contrib/gcc/cp/typeck.c ============================================================================== --- head/contrib/gcc/cp/typeck.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/cp/typeck.c Tue Mar 29 20:53:51 2011 (r220150) @@ -6604,6 +6604,7 @@ check_return_expr (tree retval, bool *no && TREE_CODE (retval) == VAR_DECL && DECL_CONTEXT (retval) == current_function_decl && ! TREE_STATIC (retval) + && ! DECL_ANON_UNION_VAR_P (retval) && (DECL_ALIGN (retval) >= DECL_ALIGN (DECL_RESULT (current_function_decl))) && same_type_p ((TYPE_MAIN_VARIANT Modified: head/contrib/gcc/doc/contrib.texi ============================================================================== --- head/contrib/gcc/doc/contrib.texi Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/doc/contrib.texi Tue Mar 29 20:53:51 2011 (r220150) @@ -514,6 +514,10 @@ patches. Robert Lipe for OpenServer support, new testsuites, testing, etc. @item +Chen Liqin for various S+core related fixes/improvement, and for +maintaining the S+core port. + +@item Weiwen Liu for testing and various bug fixes. @item Modified: head/contrib/gcc/dwarf2out.c ============================================================================== --- head/contrib/gcc/dwarf2out.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/dwarf2out.c Tue Mar 29 20:53:51 2011 (r220150) @@ -10065,6 +10065,43 @@ rtl_for_decl_init (tree init, tree type) else if (initializer_constant_valid_p (init, type) && ! walk_tree (&init, reference_to_unused, NULL, NULL)) { + /* Convert vector CONSTRUCTOR initializers to VECTOR_CST if + possible. */ + if (TREE_CODE (type) == VECTOR_TYPE) + switch (TREE_CODE (init)) + { + case VECTOR_CST: + break; + case CONSTRUCTOR: + if (TREE_CONSTANT (init)) + { + VEC(constructor_elt,gc) *elts = CONSTRUCTOR_ELTS (init); + bool constant_p = true; + tree value; + unsigned HOST_WIDE_INT ix; + + /* Even when ctor is constant, it might contain non-*_CST + elements (e.g. { 1.0/0.0 - 1.0/0.0, 0.0 }) and those don't + belong into VECTOR_CST nodes. */ + FOR_EACH_CONSTRUCTOR_VALUE (elts, ix, value) + if (!CONSTANT_CLASS_P (value)) + { + constant_p = false; + break; + } + + if (constant_p) + { + init = build_vector_from_ctor (type, elts); + break; + } + } + /* FALLTHRU */ + + default: + return NULL; + } + rtl = expand_expr (init, NULL_RTX, VOIDmode, EXPAND_INITIALIZER); /* If expand_expr returns a MEM, it wasn't immediate. */ @@ -13197,7 +13234,8 @@ gen_decl_die (tree decl, dw_die_ref cont was generated within the original definition of an inline function) we have to generate a special (abbreviated) DW_TAG_structure_type, DW_TAG_union_type, or DW_TAG_enumeration_type DIE here. */ - if (TYPE_DECL_IS_STUB (decl) && decl_ultimate_origin (decl) != NULL_TREE) + if (TYPE_DECL_IS_STUB (decl) && decl_ultimate_origin (decl) != NULL_TREE + && is_tagged_type (TREE_TYPE (decl))) { gen_tagged_type_instantiation_die (TREE_TYPE (decl), context_die); break; Modified: head/contrib/gcc/expr.c ============================================================================== --- head/contrib/gcc/expr.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/expr.c Tue Mar 29 20:53:51 2011 (r220150) @@ -5654,7 +5654,6 @@ get_inner_reference (tree exp, HOST_WIDE enum machine_mode mode = VOIDmode; tree offset = size_zero_node; tree bit_offset = bitsize_zero_node; - tree tem; /* First get the mode, signedness, and size. We do this from just the outermost expression. */ @@ -5690,6 +5689,8 @@ get_inner_reference (tree exp, HOST_WIDE *pbitsize = tree_low_cst (size_tree, 1); } + *pmode = mode; + /* Compute cumulative bit-offset for nested component-refs and array-refs, and find the ultimate containing object. */ while (1) @@ -5774,21 +5775,69 @@ get_inner_reference (tree exp, HOST_WIDE done: /* If OFFSET is constant, see if we can return the whole thing as a - constant bit position. Otherwise, split it up. */ - if (host_integerp (offset, 0) - && 0 != (tem = size_binop (MULT_EXPR, - fold_convert (bitsizetype, offset), - bitsize_unit_node)) - && 0 != (tem = size_binop (PLUS_EXPR, tem, bit_offset)) - && host_integerp (tem, 0)) - *pbitpos = tree_low_cst (tem, 0), *poffset = 0; - else - *pbitpos = tree_low_cst (bit_offset, 0), *poffset = offset; + constant bit position. Make sure to handle overflow during + this conversion. */ + if (host_integerp (offset, 0)) + { + double_int tem = double_int_mul (tree_to_double_int (offset), + uhwi_to_double_int (BITS_PER_UNIT)); + tem = double_int_add (tem, tree_to_double_int (bit_offset)); + if (double_int_fits_in_shwi_p (tem)) + { + *pbitpos = double_int_to_shwi (tem); + *poffset = NULL_TREE; + return exp; + } + } + + /* Otherwise, split it up. */ + *pbitpos = tree_low_cst (bit_offset, 0); + *poffset = offset; - *pmode = mode; return exp; } +/* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF, + look for whether EXP or any nested component-refs within EXP is marked + as PACKED. */ + +bool +contains_packed_reference (tree exp) +{ + bool packed_p = false; + + while (1) + { + switch (TREE_CODE (exp)) + { + case COMPONENT_REF: + { + tree field = TREE_OPERAND (exp, 1); + packed_p = DECL_PACKED (field) + || TYPE_PACKED (TREE_TYPE (field)) + || TYPE_PACKED (TREE_TYPE (exp)); + if (packed_p) + goto done; + } + break; + + case BIT_FIELD_REF: + case ARRAY_REF: + case ARRAY_RANGE_REF: + case REALPART_EXPR: + case IMAGPART_EXPR: + case VIEW_CONVERT_EXPR: + break; + + default: + goto done; + } + exp = TREE_OPERAND (exp, 0); + } + done: + return packed_p; +} + /* Return a tree of sizetype representing the size, in bytes, of the element of EXP, an ARRAY_REF. */ Modified: head/contrib/gcc/fold-const.c ============================================================================== --- head/contrib/gcc/fold-const.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/fold-const.c Tue Mar 29 20:53:51 2011 (r220150) @@ -9387,6 +9387,7 @@ fold_binary (enum tree_code code, tree t /* ~X | X is -1. */ if (TREE_CODE (arg0) == BIT_NOT_EXPR + && INTEGRAL_TYPE_P (TREE_TYPE (arg1)) && operand_equal_p (TREE_OPERAND (arg0, 0), arg1, 0)) { t1 = build_int_cst (type, -1); @@ -9396,6 +9397,7 @@ fold_binary (enum tree_code code, tree t /* X | ~X is -1. */ if (TREE_CODE (arg1) == BIT_NOT_EXPR + && INTEGRAL_TYPE_P (TREE_TYPE (arg0)) && operand_equal_p (arg0, TREE_OPERAND (arg1, 0), 0)) { t1 = build_int_cst (type, -1); @@ -9503,6 +9505,7 @@ fold_binary (enum tree_code code, tree t /* ~X ^ X is -1. */ if (TREE_CODE (arg0) == BIT_NOT_EXPR + && INTEGRAL_TYPE_P (TREE_TYPE (arg1)) && operand_equal_p (TREE_OPERAND (arg0, 0), arg1, 0)) { t1 = build_int_cst (type, -1); @@ -9512,6 +9515,7 @@ fold_binary (enum tree_code code, tree t /* X ^ ~X is -1. */ if (TREE_CODE (arg1) == BIT_NOT_EXPR + && INTEGRAL_TYPE_P (TREE_TYPE (arg0)) && operand_equal_p (arg0, TREE_OPERAND (arg1, 0), 0)) { t1 = build_int_cst (type, -1); Modified: head/contrib/gcc/gimplify.c ============================================================================== --- head/contrib/gcc/gimplify.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/gimplify.c Tue Mar 29 20:53:51 2011 (r220150) @@ -3532,8 +3532,16 @@ gimplify_modify_expr (tree *expr_p, tree gcc_assert (TREE_CODE (*expr_p) == MODIFY_EXPR || TREE_CODE (*expr_p) == INIT_EXPR); - /* For zero sized types only gimplify the left hand side and right hand side - as statements and throw away the assignment. */ + /* See if any simplifications can be done based on what the RHS is. */ + ret = gimplify_modify_expr_rhs (expr_p, from_p, to_p, pre_p, post_p, + want_value); + if (ret != GS_UNHANDLED) + return ret; + + /* For zero sized types only gimplify the left hand side and right hand + side as statements and throw away the assignment. Do this after + gimplify_modify_expr_rhs so we handle TARGET_EXPRs of addressable + types properly. */ if (zero_sized_type (TREE_TYPE (*from_p))) { gimplify_stmt (from_p); @@ -3544,12 +3552,6 @@ gimplify_modify_expr (tree *expr_p, tree return GS_ALL_DONE; } - /* See if any simplifications can be done based on what the RHS is. */ - ret = gimplify_modify_expr_rhs (expr_p, from_p, to_p, pre_p, post_p, - want_value); - if (ret != GS_UNHANDLED) - return ret; - /* If the value being copied is of variable width, compute the length of the copy into a WITH_SIZE_EXPR. Note that we need to do this before gimplifying any of the operands so that we can resolve any Modified: head/contrib/gcc/reload1.c ============================================================================== --- head/contrib/gcc/reload1.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/reload1.c Tue Mar 29 20:53:51 2011 (r220150) @@ -5451,7 +5451,14 @@ choose_reload_regs (struct insn_chain *c for (j = 0; j < n_reloads; j++) { reload_order[j] = j; - reload_spill_index[j] = -1; + if (rld[j].reg_rtx != NULL_RTX) + { + gcc_assert (REG_P (rld[j].reg_rtx) + && HARD_REGISTER_P (rld[j].reg_rtx)); + reload_spill_index[j] = REGNO (rld[j].reg_rtx); + } + else + reload_spill_index[j] = -1; if (rld[j].nregs > 1) { Modified: head/contrib/gcc/simplify-rtx.c ============================================================================== --- head/contrib/gcc/simplify-rtx.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/simplify-rtx.c Tue Mar 29 20:53:51 2011 (r220150) @@ -589,7 +589,8 @@ simplify_unary_operation_1 (enum rtx_cod /* (neg (lt x 0)) is (ashiftrt X C) if STORE_FLAG_VALUE is 1. */ /* (neg (lt x 0)) is (lshiftrt X C) if STORE_FLAG_VALUE is -1. */ if (GET_CODE (op) == LT - && XEXP (op, 1) == const0_rtx) + && XEXP (op, 1) == const0_rtx + && SCALAR_INT_MODE_P (GET_MODE (XEXP (op, 0)))) { enum machine_mode inner = GET_MODE (XEXP (op, 0)); int isize = GET_MODE_BITSIZE (inner); Modified: head/contrib/gcc/target-def.h ============================================================================== --- head/contrib/gcc/target-def.h Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/target-def.h Tue Mar 29 20:53:51 2011 (r220150) @@ -337,9 +337,12 @@ Foundation, 51 Franklin Street, Fifth Fl TARGET_SCHED_SET_SCHED_FLAGS} #define TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD 0 +#define TARGET_VECTOR_ALIGNMENT_REACHABLE \ + default_builtin_vector_alignment_reachable #define TARGET_VECTORIZE \ - {TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD} + {TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD, \ + TARGET_VECTOR_ALIGNMENT_REACHABLE} #define TARGET_DEFAULT_TARGET_FLAGS 0 Modified: head/contrib/gcc/target.h ============================================================================== --- head/contrib/gcc/target.h Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/target.h Tue Mar 29 20:53:51 2011 (r220150) @@ -375,6 +375,10 @@ struct gcc_target by the vectorizer, and return the decl of the target builtin function. */ tree (* builtin_mask_for_load) (void); + + /* Return true if vector alignment is reachable (by peeling N + interations) for the given type. */ + bool (* vector_alignment_reachable) (tree, bool); } vectorize; /* The initial value of target_flags. */ Modified: head/contrib/gcc/targhooks.c ============================================================================== --- head/contrib/gcc/targhooks.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/targhooks.c Tue Mar 29 20:53:51 2011 (r220150) @@ -604,4 +604,20 @@ default_reloc_rw_mask (void) return flag_pic ? 3 : 0; } +bool +default_builtin_vector_alignment_reachable (tree type, bool is_packed) +{ + if (is_packed) + return false; + + /* Assuming that types whose size is > pointer-size are not guaranteed to be + naturally aligned. */ + if (tree_int_cst_compare (TYPE_SIZE (type), bitsize_int (POINTER_SIZE)) > 0) + return false; + + /* Assuming that types whose size is <= pointer-size + are naturally aligned. */ + return true; +} + #include "gt-targhooks.h" Modified: head/contrib/gcc/targhooks.h ============================================================================== --- head/contrib/gcc/targhooks.h Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/targhooks.h Tue Mar 29 20:53:51 2011 (r220150) @@ -57,6 +57,8 @@ extern const char * default_invalid_with extern bool default_narrow_bitfield (void); +extern bool default_builtin_vector_alignment_reachable (tree, bool); + /* These are here, and not in hooks.[ch], because not all users of hooks.h include tm.h, and thus we don't have CUMULATIVE_ARGS. */ Modified: head/contrib/gcc/tree-if-conv.c ============================================================================== --- head/contrib/gcc/tree-if-conv.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/tree-if-conv.c Tue Mar 29 20:53:51 2011 (r220150) @@ -743,7 +743,7 @@ find_phi_replacement_condition (struct l if (TREE_CODE (*cond) == TRUTH_NOT_EXPR) /* We can be smart here and choose inverted condition without switching bbs. */ - *cond = invert_truthvalue (*cond); + *cond = invert_truthvalue (*cond); else /* Select non loop header bb. */ first_edge = second_edge; @@ -762,9 +762,11 @@ find_phi_replacement_condition (struct l /* Create temp. for the condition. Vectorizer prefers to have gimple value as condition. Various targets use different means to communicate - condition in vector compare operation. Using gimple value allows compiler - to emit vector compare and select RTL without exposing compare's result. */ - *cond = force_gimple_operand (*cond, &new_stmts, false, NULL_TREE); + condition in vector compare operation. Using gimple value allows + compiler to emit vector compare and select RTL without exposing + compare's result. */ + *cond = force_gimple_operand (unshare_expr (*cond), &new_stmts, + false, NULL_TREE); if (new_stmts) bsi_insert_before (bsi, new_stmts, BSI_SAME_STMT); if (!is_gimple_reg (*cond) && !is_gimple_condexpr (*cond)) Modified: head/contrib/gcc/tree-ssa-structalias.c ============================================================================== --- head/contrib/gcc/tree-ssa-structalias.c Tue Mar 29 20:23:56 2011 (r220149) +++ head/contrib/gcc/tree-ssa-structalias.c Tue Mar 29 20:53:51 2011 (r220150) @@ -4350,6 +4350,75 @@ intra_create_variable_infos (void) process_constraint (new_constraint (lhs, rhs)); } +/* Structure used to put solution bitmaps in a hashtable so they can + be shared among variables with the same points-to set. */ + +typedef struct shared_bitmap_info +{ + bitmap pt_vars; + hashval_t hashcode; +} *shared_bitmap_info_t; + +static htab_t shared_bitmap_table; + +/* Hash function for a shared_bitmap_info_t */ + +static hashval_t +shared_bitmap_hash (const void *p) +{ + const shared_bitmap_info_t bi = (shared_bitmap_info_t) p; + return bi->hashcode; +} + +/* Equality function for two shared_bitmap_info_t's. */ + +static int +shared_bitmap_eq (const void *p1, const void *p2) +{ + const shared_bitmap_info_t sbi1 = (shared_bitmap_info_t) p1; + const shared_bitmap_info_t sbi2 = (shared_bitmap_info_t) p2; + return bitmap_equal_p (sbi1->pt_vars, sbi2->pt_vars); +} + +/* Lookup a bitmap in the shared bitmap hashtable, and return an already + existing instance if there is one, NULL otherwise. */ + +static bitmap +shared_bitmap_lookup (bitmap pt_vars) +{ + void **slot; + struct shared_bitmap_info sbi; + + sbi.pt_vars = pt_vars; + sbi.hashcode = bitmap_hash (pt_vars); + + slot = htab_find_slot_with_hash (shared_bitmap_table, &sbi, *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103292053.p2TKrpP5040638>