diff -Nrcpad gcc-4.5.3/gcc/cp/ChangeLog gcc-4.5.4/gcc/cp/ChangeLog *** gcc-4.5.3/gcc/cp/ChangeLog Thu Apr 28 14:12:32 2011 --- gcc-4.5.4/gcc/cp/ChangeLog Mon Jul 2 09:28:25 2012 *************** *** 1,3 **** --- 1,83 ---- + 2012-07-02 Release Manager + + * GCC 4.5.4 released. + + 2012-01-19 Kai Tietz + + PR c++/51344 + * decl2.c (save_template_attributes): Use merge_attributes + instead of chaining up via TREE_CHAIN. + + 2011-12-20 Dodji Seketeli + + PR debug/49951 + * decl.c (cxx_maybe_build_cleanup): Don't set location of the call + to the destructor. + + 2011-12-13 Jason Merrill + + PR c++/51406 + PR c++/51161 + * typeck.c (build_static_cast_1): Fix cast of lvalue to + base rvalue reference. + + 2011-10-19 Jason Merrill + + PR c++/50793 + * tree.c (bot_manip): Propagate AGGR_INIT_ZERO_FIRST. + + 2011-10-13 Jason Merrill + + PR c++/50618 + * init.c (expand_aggr_init_1): Don't zero-initialize virtual + bases of a base subobject. + + 2011-10-11 Janis Johnson + + PR c++/44473 + * mangle.c (write_type): Handle CV qualifiers for decimal classes. + + 2011-07-19 Jakub Jelinek + + Backport from mainline + 2011-07-07 Jakub Jelinek + + PR c/49644 + * typeck.c (cp_build_binary_op): For MULT_EXPR and TRUNC_DIV_EXPR with + one non-complex and one complex argument, call save_expr on both + operands. + + 2011-06-23 Jason Merrill + + PR c++/49440 + * class.c (set_linkage_according_to_type): Hand off to + determine_visibility. + + 2011-05-31 Duncan Sands + + Backported from 4.6 branch + 2011-03-09 Martin Jambor + + PR tree-optimization/47714 + * method.c (use_thunk): Clear addressable flag of thunk arguments. + + 2011-05-20 Jason Merrill + + PR c++/48873 + * tree.c (stabilize_expr): Don't make gratuitous copies of classes. + + 2011-05-09 Jason Merrill + + PR c++/48936 + * decl2.c (mark_used): Instantiate constant variables even + in unevaluated context. + + 2011-04-27 Jason Merrill + + PR c++/48046 + * parser.c (cp_parser_diagnose_invalid_type_name): Commit + to tentative parse sooner. + 2011-04-28 Release Manager * GCC 4.5.3 released. diff -Nrcpad gcc-4.5.3/gcc/cp/class.c gcc-4.5.4/gcc/cp/class.c *** gcc-4.5.3/gcc/cp/class.c Fri Jul 9 19:50:25 2010 --- gcc-4.5.4/gcc/cp/class.c Mon Jun 27 01:13:33 2011 *************** get_vtable_name (tree type) *** 681,701 **** the abstract. */ void ! set_linkage_according_to_type (tree type, tree decl) { ! /* If TYPE involves a local class in a function with internal ! linkage, then DECL should have internal linkage too. Other local ! classes have no linkage -- but if their containing functions ! have external linkage, it makes sense for DECL to have external ! linkage too. That will allow template definitions to be merged, ! for example. */ ! if (no_linkage_check (type, /*relaxed_p=*/true)) ! { ! TREE_PUBLIC (decl) = 0; ! DECL_INTERFACE_KNOWN (decl) = 1; ! } ! else ! TREE_PUBLIC (decl) = 1; } /* Create a VAR_DECL for a primary or secondary vtable for CLASS_TYPE. --- 681,690 ---- the abstract. */ void ! set_linkage_according_to_type (tree type ATTRIBUTE_UNUSED, tree decl) { ! TREE_PUBLIC (decl) = 1; ! determine_visibility (decl); } /* Create a VAR_DECL for a primary or secondary vtable for CLASS_TYPE. diff -Nrcpad gcc-4.5.3/gcc/cp/decl.c gcc-4.5.4/gcc/cp/decl.c *** gcc-4.5.3/gcc/cp/decl.c Wed Apr 20 00:06:19 2011 --- gcc-4.5.4/gcc/cp/decl.c Mon Jan 2 17:08:48 2012 *************** cxx_maybe_build_cleanup (tree decl) *** 12877,12884 **** --- 12877,12893 ---- cleanup = call; } + /* build_delete sets the location of the destructor call to the + current location, even though the destructor is going to be + called later, at the end of the current scope. This can lead to + a "jumpy" behaviour for users of debuggers when they step around + the end of the block. So let's unset the location of the + destructor call instead. */ + if (cleanup != NULL && EXPR_P (cleanup)) + SET_EXPR_LOCATION (cleanup, UNKNOWN_LOCATION); return cleanup; } + /* When a stmt has been parsed, this function is called. */ diff -Nrcpad gcc-4.5.3/gcc/cp/decl2.c gcc-4.5.4/gcc/cp/decl2.c *** gcc-4.5.3/gcc/cp/decl2.c Thu Apr 21 02:56:39 2011 --- gcc-4.5.4/gcc/cp/decl2.c Thu Jan 19 22:57:31 2012 *************** save_template_attributes (tree *attr_p, *** 1189,1197 **** old_attrs = *q; ! /* Place the late attributes at the beginning of the attribute list. */ ! TREE_CHAIN (tree_last (late_attrs)) = *q; *q = late_attrs; if (!DECL_P (*decl_p) && *decl_p == TYPE_MAIN_VARIANT (*decl_p)) --- 1189,1197 ---- old_attrs = *q; ! /* Merge the late attributes at the beginning with the attribute list. */ ! late_attrs = merge_attributes (late_attrs, *q); *q = late_attrs; if (!DECL_P (*decl_p) && *decl_p == TYPE_MAIN_VARIANT (*decl_p)) *************** possibly_inlined_p (tree decl) *** 3991,3998 **** void mark_used (tree decl) { - HOST_WIDE_INT saved_processing_template_decl = 0; - /* If DECL is a BASELINK for a single function, then treat it just like the DECL for the function. Otherwise, if the BASELINK is for an overloaded function, we don't know which function was --- 3991,3996 ---- *************** mark_used (tree decl) *** 4029,4037 **** error ("used here"); return; } - /* If we don't need a value, then we don't need to synthesize DECL. */ - if (cp_unevaluated_operand != 0) - return; /* We can only check DECL_ODR_USED on variables or functions with DECL_LANG_SPECIFIC set, and these are also the only decls that we --- 4027,4032 ---- *************** mark_used (tree decl) *** 4059,4067 **** DECL. However, if DECL is a static data member initialized with a constant, we need the value right now because a reference to such a data member is not value-dependent. */ ! if (TREE_CODE (decl) == VAR_DECL ! && DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) ! && DECL_CLASS_SCOPE_P (decl)) { /* Don't try to instantiate members of dependent types. We cannot just use dependent_type_p here because this function --- 4054,4063 ---- DECL. However, if DECL is a static data member initialized with a constant, we need the value right now because a reference to such a data member is not value-dependent. */ ! if (DECL_INTEGRAL_CONSTANT_VAR_P (decl) ! && !DECL_INITIAL (decl) ! && DECL_LANG_SPECIFIC (decl) ! && DECL_TEMPLATE_INSTANTIATION (decl)) { /* Don't try to instantiate members of dependent types. We cannot just use dependent_type_p here because this function *************** mark_used (tree decl) *** 4071,4082 **** if (CLASSTYPE_TEMPLATE_INFO ((DECL_CONTEXT (decl))) && uses_template_parms (CLASSTYPE_TI_ARGS (DECL_CONTEXT (decl)))) return; ! /* Pretend that we are not in a template, even if we are, so ! that the static data member initializer will be processed. */ ! saved_processing_template_decl = processing_template_decl; ! processing_template_decl = 0; } if (processing_template_decl) return; --- 4067,4080 ---- if (CLASSTYPE_TEMPLATE_INFO ((DECL_CONTEXT (decl))) && uses_template_parms (CLASSTYPE_TI_ARGS (DECL_CONTEXT (decl)))) return; ! instantiate_decl (decl, /*defer_ok=*/false, ! /*expl_inst_class_mem_p=*/false); } + /* If we don't need a value, then we don't need to synthesize DECL. */ + if (cp_unevaluated_operand != 0) + return; + if (processing_template_decl) return; *************** mark_used (tree decl) *** 4149,4156 **** need. Therefore, we always try to defer instantiation. */ instantiate_decl (decl, /*defer_ok=*/true, /*expl_inst_class_mem_p=*/false); - - processing_template_decl = saved_processing_template_decl; } #include "gt-cp-decl2.h" --- 4147,4152 ---- diff -Nrcpad gcc-4.5.3/gcc/cp/init.c gcc-4.5.4/gcc/cp/init.c *** gcc-4.5.3/gcc/cp/init.c Mon Apr 18 14:02:22 2011 --- gcc-4.5.4/gcc/cp/init.c Thu Oct 13 18:02:27 2011 *************** expand_aggr_init_1 (tree binfo, tree tru *** 1460,1466 **** zero out the object first. */ else if (TYPE_NEEDS_CONSTRUCTING (type)) { ! init = build_zero_init (type, NULL_TREE, /*static_storage_p=*/false); init = build2 (INIT_EXPR, type, exp, init); finish_expr_stmt (init); /* And then call the constructor. */ --- 1460,1471 ---- zero out the object first. */ else if (TYPE_NEEDS_CONSTRUCTING (type)) { ! tree field_size = NULL_TREE; ! if (exp != true_exp && CLASSTYPE_AS_BASE (type) != type) ! /* Don't clobber already initialized virtual bases. */ ! field_size = TYPE_SIZE (CLASSTYPE_AS_BASE (type)); ! init = build_zero_init_1 (type, NULL_TREE, /*static_storage_p=*/false, ! field_size); init = build2 (INIT_EXPR, type, exp, init); finish_expr_stmt (init); /* And then call the constructor. */ diff -Nrcpad gcc-4.5.3/gcc/cp/mangle.c gcc-4.5.4/gcc/cp/mangle.c *** gcc-4.5.3/gcc/cp/mangle.c Tue Mar 8 17:40:27 2011 --- gcc-4.5.4/gcc/cp/mangle.c Tue Oct 11 16:58:59 2011 *************** write_type (tree type) *** 1778,1788 **** if (find_substitution (type)) return; - /* According to the C++ ABI, some library classes are passed the - same as the scalar type of their single member and use the same - mangling. */ - if (TREE_CODE (type) == RECORD_TYPE && TYPE_TRANSPARENT_AGGR (type)) - type = TREE_TYPE (first_field (type)); if (write_CV_qualifiers_for_type (type) > 0) /* If TYPE was CV-qualified, we just wrote the qualifiers; now --- 1778,1783 ---- *************** write_type (tree type) *** 1802,1807 **** --- 1797,1808 ---- /* See through any typedefs. */ type = TYPE_MAIN_VARIANT (type); + /* According to the C++ ABI, some library classes are passed the + same as the scalar type of their single member and use the same + mangling. */ + if (TREE_CODE (type) == RECORD_TYPE && TYPE_TRANSPARENT_AGGR (type)) + type = TREE_TYPE (first_field (type)); + if (TYPE_PTRMEM_P (type)) write_pointer_to_member_type (type); else diff -Nrcpad gcc-4.5.3/gcc/cp/method.c gcc-4.5.4/gcc/cp/method.c *** gcc-4.5.3/gcc/cp/method.c Sat Mar 20 08:55:32 2010 --- gcc-4.5.4/gcc/cp/method.c Tue May 31 07:03:53 2011 *************** use_thunk (tree thunk_fndecl, bool emit_ *** 374,379 **** --- 374,380 ---- DECL_CONTEXT (x) = thunk_fndecl; SET_DECL_RTL (x, NULL_RTX); DECL_HAS_VALUE_EXPR_P (x) = 0; + TREE_ADDRESSABLE (x) = 0; t = x; } a = nreverse (t); diff -Nrcpad gcc-4.5.3/gcc/cp/parser.c gcc-4.5.4/gcc/cp/parser.c *** gcc-4.5.3/gcc/cp/parser.c Wed Apr 27 05:20:46 2011 --- gcc-4.5.4/gcc/cp/parser.c Thu Apr 28 15:02:17 2011 *************** cp_parser_diagnose_invalid_type_name (cp *** 2333,2338 **** --- 2333,2339 ---- location_t location) { tree decl, old_scope; + cp_parser_commit_to_tentative_parse (parser); /* Try to lookup the identifier. */ old_scope = parser->scope; parser->scope = scope; *************** cp_parser_diagnose_invalid_type_name (cp *** 2423,2429 **** else gcc_unreachable (); } - cp_parser_commit_to_tentative_parse (parser); } /* Check for a common situation where a type-name should be present, --- 2424,2429 ---- diff -Nrcpad gcc-4.5.3/gcc/cp/tree.c gcc-4.5.4/gcc/cp/tree.c *** gcc-4.5.3/gcc/cp/tree.c Sun Feb 27 17:11:19 2011 --- gcc-4.5.4/gcc/cp/tree.c Wed Oct 19 22:22:25 2011 *************** bot_manip (tree* tp, int* walk_subtrees, *** 1732,1738 **** tree u; if (TREE_CODE (TREE_OPERAND (t, 1)) == AGGR_INIT_EXPR) ! u = build_cplus_new (TREE_TYPE (t), TREE_OPERAND (t, 1)); else u = build_target_expr_with_type (TREE_OPERAND (t, 1), TREE_TYPE (t)); --- 1732,1742 ---- tree u; if (TREE_CODE (TREE_OPERAND (t, 1)) == AGGR_INIT_EXPR) ! { ! u = build_cplus_new (TREE_TYPE (t), TREE_OPERAND (t, 1)); ! if (AGGR_INIT_ZERO_FIRST (TREE_OPERAND (t, 1))) ! AGGR_INIT_ZERO_FIRST (TREE_OPERAND (u, 1)) = true; ! } else u = build_target_expr_with_type (TREE_OPERAND (t, 1), TREE_TYPE (t)); *************** stabilize_expr (tree exp, tree* initp) *** 2954,2960 **** if (!TREE_SIDE_EFFECTS (exp)) init_expr = NULL_TREE; else if (!real_lvalue_p (exp) ! || !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (exp))) { init_expr = get_target_expr (exp); exp = TARGET_EXPR_SLOT (init_expr); --- 2958,2965 ---- if (!TREE_SIDE_EFFECTS (exp)) init_expr = NULL_TREE; else if (!real_lvalue_p (exp) ! || (!TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (exp)) ! && !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (exp)))) { init_expr = get_target_expr (exp); exp = TARGET_EXPR_SLOT (init_expr); diff -Nrcpad gcc-4.5.3/gcc/cp/typeck.c gcc-4.5.4/gcc/cp/typeck.c *** gcc-4.5.3/gcc/cp/typeck.c Wed Apr 20 06:31:07 2011 --- gcc-4.5.4/gcc/cp/typeck.c Wed Dec 14 16:03:37 2011 *************** cp_build_binary_op (location_t location, *** 4297,4302 **** --- 4297,4303 ---- { case MULT_EXPR: case TRUNC_DIV_EXPR: + op1 = save_expr (op1); imag = build2 (resultcode, real_type, imag, op1); /* Fall through. */ case PLUS_EXPR: *************** cp_build_binary_op (location_t location, *** 4315,4320 **** --- 4316,4322 ---- switch (code) { case MULT_EXPR: + op0 = save_expr (op0); imag = build2 (resultcode, real_type, op0, imag); /* Fall through. */ case PLUS_EXPR: *************** build_static_cast_1 (tree type, tree exp *** 5672,5679 **** && reference_related_p (TREE_TYPE (type), intype) && (c_cast_p || at_least_as_qualified_p (TREE_TYPE (type), intype))) { ! expr = build_typed_address (expr, type); ! return convert_from_reference (expr); } orig = expr; --- 5674,5691 ---- && reference_related_p (TREE_TYPE (type), intype) && (c_cast_p || at_least_as_qualified_p (TREE_TYPE (type), intype))) { ! /* Handle the lvalue case here by casting to lvalue reference and ! then changing it to an rvalue reference. Casting an xvalue to ! rvalue reference will be handled by the main code path. */ ! tree lref = cp_build_reference_type (TREE_TYPE (type), false); ! result = (perform_direct_initialization_if_possible ! (lref, expr, c_cast_p, complain)); ! result = cp_fold_convert (type, result); ! /* Make sure we don't fold back down to a named rvalue reference, ! because that would be an lvalue. */ ! if (DECL_P (result)) ! result = build1 (NON_LVALUE_EXPR, type, result); ! return convert_from_reference (result); } orig = expr; diff -Nrcpad gcc-4.5.3/libstdc++-v3/ChangeLog gcc-4.5.4/libstdc++-v3/ChangeLog *** gcc-4.5.3/libstdc++-v3/ChangeLog Thu Apr 28 14:09:18 2011 --- gcc-4.5.4/libstdc++-v3/ChangeLog Mon Jul 2 09:25:10 2012 *************** *** 1,3 **** --- 1,17 ---- + 2012-07-02 Release Manager + + * GCC 4.5.4 released. + + 2011-07-24 Uros Bizjak + + Backport from mainline + 2011-06-07 Paolo Carlini + + PR libstdc++/49293 + * testsuite/22_locale/time_get/get_weekday/char/38081-1.cc: Tweak + for glibc 2.14. + * testsuite/22_locale/time_get/get_weekday/char/38081-2.cc: Likewise. + 2011-04-28 Release Manager * GCC 4.5.3 released. diff -Nrcpad gcc-4.5.3/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc gcc-4.5.4/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc *** gcc-4.5.3/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc Tue Jan 5 20:05:20 2010 --- gcc-4.5.4/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-1.cc Sun Jul 24 21:50:48 2011 *************** *** 1,6 **** // { dg-require-namedlocale "" } ! // Copyright (C) 2010 Free Software Foundation // // 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 --- 1,6 ---- // { dg-require-namedlocale "" } ! // Copyright (C) 2010, 2011 Free Software Foundation // // 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 *************** void test01() *** 49,55 **** --- 49,59 ---- // get_weekday(iter_type, iter_type, ios_base&, // ios_base::iostate&, tm*) const + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 14) + iss.str("\xbf\xdd\x2e"); + #else iss.str("\xbf\xdd\xd4"); + #endif iterator_type is_it01(iss); tm time01; memset(&time01, -1, sizeof(tm)); *************** void test01() *** 67,73 **** --- 71,81 ---- VERIFY( time02.tm_wday == 1 ); VERIFY( errorstate == ios_base::eofbit ); + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 14) + iss.str("\xbf\xdd\x2e\xd5\xd4\xd5\xdb\xec\xdd\xd8\xda"); + #else iss.str("\xbf\xdd\xd4\xd5\xd4\xd5\xdb\xec\xdd\xd8\xda"); + #endif iterator_type is_it03(iss); tm time03; memset(&time03, -1, sizeof(tm)); diff -Nrcpad gcc-4.5.3/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc gcc-4.5.4/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc *** gcc-4.5.3/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc Mon Jan 25 18:02:41 2010 --- gcc-4.5.4/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/38081-2.cc Sun Jul 24 21:50:48 2011 *************** *** 2,8 **** // 2010-01-05 Paolo Carlini ! // Copyright (C) 2010 Free Software Foundation // // 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 --- 2,8 ---- // 2010-01-05 Paolo Carlini ! // Copyright (C) 2010, 2011 Free Software Foundation // // 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 *************** void test01() *** 50,55 **** --- 50,64 ---- // get_weekday(iter_type, iter_type, ios_base&, // ios_base::iostate&, tm*) const + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 14) + const char* awdays[7] = { "\u0412\u0441\u002E", + "\u041F\u043D\u002E", + "\u0412\u0442\u002E", + "\u0421\u0440\u002E", + "\u0427\u0442\u002E", + "\u041F\u0442\u002E", + "\u0421\u0431\u002E" }; + #else const char* awdays[7] = { "\u0412\u0441\u043A", "\u041F\u043D\u0434", "\u0412\u0442\u0440", *************** void test01() *** 57,62 **** --- 66,72 ---- "\u0427\u0442\u0432", "\u041F\u0442\u043D", "\u0421\u0431\u0442" }; + #endif for (int i = 0; i < 7; ++i) {