diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-12-16 00:23:40 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-12-16 00:23:40 +0000 |
commit | 38b8bf768a13a88cfc0311aacc17782b1b2b10ae (patch) | |
tree | bd0015db7635dbc061ea3fe5ed9aa50127e50c0d | |
parent | f6898dfcdf24ace4c9014d838eebb14ec2af8dfc (diff) | |
parent | 426bcc95cbaed399329579feb14f776d4c2e4525 (diff) | |
download | gcc-38b8bf768a13a88cfc0311aacc17782b1b2b10ae.zip gcc-38b8bf768a13a88cfc0311aacc17782b1b2b10ae.tar.gz gcc-38b8bf768a13a88cfc0311aacc17782b1b2b10ae.tar.bz2 |
Merge from trunk revision 218764.
From-SVN: r218773
89 files changed, 1465 insertions, 212 deletions
@@ -1,3 +1,9 @@ +2014-12-15 Thomas Schwinge <thomas@codesourcery.com> + + * configure.ac (--enable-as-accelerator-for): Don't set + ENABLE_AS_ACCELERATOR_FOR. Update all users. + * configure: Regenerate. + 2014-12-13 Jakub Jelinek <jakub@redhat.com> PR bootstrap/64023 @@ -2893,9 +2893,7 @@ esac # Check whether --enable-as-accelerator-for was given. if test "${enable_as_accelerator_for+set}" = set; then : - enableval=$enable_as_accelerator_for; ENABLE_AS_ACCELERATOR_FOR=$enableval -else - ENABLE_AS_ACCELERATOR_FOR=no + enableval=$enable_as_accelerator_for; fi @@ -3094,7 +3092,7 @@ if test "${enable_liboffloadmic+set}" = set; then : as_fn_error "--enable-liboffloadmic=no/host/target" "$LINENO" 5 ;; esac else - if test "${ENABLE_AS_ACCELERATOR_FOR}" != "no"; then + if test x"$enable_as_accelerator_for" != x; then case "${target}" in *-intelmic-* | *-intelmicemul-*) enable_liboffloadmic=target diff --git a/configure.ac b/configure.ac index fd1bdf0..91c9a72 100644 --- a/configure.ac +++ b/configure.ac @@ -289,9 +289,7 @@ esac AC_ARG_ENABLE(as-accelerator-for, [AS_HELP_STRING([--enable-as-accelerator-for=ARG], [build as offload target compiler. - Specify offload host triple by ARG])], -ENABLE_AS_ACCELERATOR_FOR=$enableval, -ENABLE_AS_ACCELERATOR_FOR=no) + Specify offload host triple by ARG])]) AC_ARG_ENABLE(offload-targets, [AS_HELP_STRING([--enable-offload-targets=LIST], @@ -470,7 +468,7 @@ AC_HELP_STRING([[--enable-liboffloadmic[=ARG]]], *) AC_MSG_ERROR([--enable-liboffloadmic=no/host/target]) ;; esac], -[if test "${ENABLE_AS_ACCELERATOR_FOR}" != "no"; then +[if test x"$enable_as_accelerator_for" != x; then case "${target}" in *-intelmic-* | *-intelmicemul-*) enable_liboffloadmic=target diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index 54945b5..571b6d1 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,8 @@ +2014-12-15 Uros Bizjak <ubizjak@gmail.com> + + * server.c (server_setup): Check return value of + getcwd and in case of error set buff[0] to 0. + 2014-10-21 Uros Bizjak <ubizjak@gmail.com> * inclhack.def (glibc_c99_inline_4): Add pthread.h to files. diff --git a/fixincludes/server.c b/fixincludes/server.c index 1e50efc..f1b93a0 100644 --- a/fixincludes/server.c +++ b/fixincludes/server.c @@ -192,7 +192,8 @@ server_setup (void) fputs ("trap : 1\n", server_pair.pf_write); fflush (server_pair.pf_write); - getcwd (buff, MAXPATHLEN + 1); + if (getcwd (buff, MAXPATHLEN + 1) == NULL) + buff[0] = 0; p_cur_dir = xstrdup (buff); } diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e5de2c6..07aa48c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,110 @@ +2014-12-15 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/64316 + * simplify-rtx.c (simplify_relational_operation_1): For + (eq/ne (and x y) x) and (eq/ne (and x y) y) optimizations use + CONST0_RTX instead of const0_rtx. + +2014-12-15 Vladimir Makarov <vmakarov@redhat.com> + + PR target/62642 + * ira.c (rtx_moveable_p): Prevent UNSPEC_VOLATILE moves. + +2014-12-15 Vladimir Makarov <vmakarov@redhat.com> + + * ira-int.h (ira_prohibited_class_mode_regs): Remove. + (struct target_ira_int): Move x_ira_prohibited_class_mode_regs to + ... + * ira.h (struct target_ira): ... here. + (ira_prohibited_class_mode_regs): Define. + * lra-constraints.c (process_alt_operands): Add one more condition + to refuse alternative when reload pseudo of given class can not + hold value of given mode. + +2014-12-15 Richard Biener <rguenther@suse.de> + + PR tree-optimization/64312 + * tree-ssa-sccvn.c (vn_reference_lookup_pieces): Use + vuse_ssa_val as callback to walk_non_aliased_vuses. + (vn_reference_lookup): Likewise. + +2014-12-15 Segher Boessenkool <segher@kernel.crashing.org> + + * gcc/config/rs6000/rs6000.md (*add>mode>3_imm_dot, + *add<mode>3_imm_dot2): Change the constraint for the second + alternative for operand 1 from "r" to "b". + +2014-12-15 Richard Biener <rguenther@suse.de> + + * vec.h (vec::safe_grow): Guard against a grow to zero size. + +2014-12-15 Richard Biener <rguenther@suse.de> + + PR middle-end/64295 + * match.pd (X / CST -> X * (1 / CST): Use const_binop instead of + fold_binary to compute the constant to multiply with. + +2014-12-15 Richard Biener <rguenther@suse.de> + + PR middle-end/64246 + * cfgloop.c (mark_loop_for_removal): Make safe against multiple + invocations on the same loop. + +2014-12-15 Marek Polacek <polacek@redhat.com> + + PR middle-end/64292 + * fold-const.c (negate_expr_p): Add INTEGRAL_TYPE_P check. + +2014-12-15 Renlin Li <renlin.li@arm.com> + + * config/aarch64/aarch64.h (CLZ_DEFINED_VALUE_AT_ZERO): Return 2. + (CTZ_DEFINED_VALUE_AT_ZERO): Update to support more modes. + +2014-12-15 Jakub Jelinek <jakub@redhat.com> + + PR sanitizer/64265 + * tsan.c (instrument_func_entry): Insert __tsan_func_entry + call on edge from entry block to single succ instead + of after labels of single succ of entry block. + +2014-12-15 Richard Biener <rguenther@suse.de> + + PR tree-optimization/64284 + * tree-ssa-threadupdate.c (duplicate_seme_region): Mark + the loop for removal if we copied the loop header. + +2014-12-14 Jan Hubicka <hubicka@ucw.cz> + + * ipa.c (process_references): Fix conditoinal on flag_optimize + +2014-12-14 Jan Hubicka <hubicka@ucw.cz> + + PR ipa/61558 + * symtab.c (symbol_table::insert_to_assembler_name_hash + symbol_table::unlink_from_assembler_name_hash): Do not ICE when + DECL_ASSEMBLER_NAME is NULL. + +2014-12-14 Jan Hubicka <hubicka@ucw.cz> + + * cgraphunit.c (analyze_functions): Always analyze targets of aliases. + +2014-12-14 Jan Hubicka <hubicka@ucw.cz> + + PR lto/64043 + * tree.c (virtual_method_call_p): Return false when OTR type has + no BINFO. + +2014-12-14 Jan Hubicka <hubicka@ucw.cz> + + * cgraphunit.c (analyze_functions): Do not analyze extern inline + funtions when not optimizing; skip comdat locals. + +2014-12-14 H.J. Lu <hongjiu.lu@intel.com> + + PR rtl-optimization/64037 + * combine.c (setup_incoming_promotions): Pass the argument + before any promotions happen to promote_function_mode. + 2014-12-12 Thomas Schwinge <thomas@codesourcery.com> * config/nvptx/nvptx.h (ASM_OUTPUT_ALIGN): Define as a C statment. diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 853cae0..29f652f 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20141214 +20141215 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index f064370..2d0c2fe 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,10 @@ +2014-12-15 Jason Merrill <jason@redhat.com> + + * c.opt (-fsized-deallocation, -Wc++14-compat): New. + (-Wsized-deallocation): New. + * c-opts.c (c_common_post_options): -fsized-deallocation defaults + to on in C++14 and up. + 2014-12-11 Jason Merrill <jason@redhat.com> * c-cppbuiltin.c (c_cpp_builtins): Enable C++14 __cpp_constexpr. diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 08a36f0..dbb9912 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -889,6 +889,10 @@ c_common_post_options (const char **pfilename) else if (warn_narrowing == -1) warn_narrowing = 0; + /* Global sized deallocation is new in C++14. */ + if (flag_sized_deallocation == -1) + flag_sized_deallocation = (cxx_dialect >= cxx14); + if (flag_extern_tls_init) { #if !defined (ASM_OUTPUT_DEF) || !SUPPORTS_WEAK diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index b9f7c65..1676f65 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -315,6 +315,10 @@ Wc++11-compat C++ ObjC++ Warning Alias(Wc++0x-compat) Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 2011 +Wc++14-compat +C++ ObjC++ Var(warn_cxx14_compat) Warning LangEnabledBy(C++ ObjC++,Wall) +Warn about C++ constructs whose meaning differs between ISO C++ 2011 and ISO C++ 2014 + Wcast-qual C ObjC C++ ObjC++ Var(warn_cast_qual) Warning Warn about casts which discard qualifiers @@ -554,6 +558,10 @@ Wmissing-field-initializers C ObjC C++ ObjC++ Var(warn_missing_field_initializers) Warning EnabledBy(Wextra) Warn about missing fields in struct initializers +Wsized-deallocation +C++ ObjC++ Var(warn_sized_deallocation) Warning EnabledBy(Wextra) +Warn about missing sized deallocation functions + Wsizeof-pointer-memaccess C ObjC C++ ObjC++ Var(warn_sizeof_pointer_memaccess) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) Warn about suspicious length parameters to certain string functions if the argument uses sizeof @@ -1341,6 +1349,10 @@ fsigned-char C ObjC C++ ObjC++ LTO Var(flag_signed_char) Make \"char\" signed by default +fsized-deallocation +C++ ObjC++ Var(flag_sized_deallocation) Init(-1) +Enable C++14 sized deallocation support + fsquangle C++ ObjC++ Ignore Warn(switch %qs is no longer supported) diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index 5c5cedc..40fb5a1 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -1928,9 +1928,10 @@ bb_loop_depth (const_basic_block bb) void mark_loop_for_removal (loop_p loop) { + if (loop->header == NULL) + return; loop->former_header = loop->header; loop->header = NULL; loop->latch = NULL; loops_state_set (LOOPS_NEED_FIXUP); } - diff --git a/gcc/cgraph.h b/gcc/cgraph.h index a2fc563..fbb9922 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -2188,7 +2188,7 @@ void record_references_in_initializer (tree, bool); /* In ipa.c */ void cgraph_build_static_cdtor (char which, tree body, int priority); -void ipa_discover_readonly_nonaddressable_vars (void); +bool ipa_discover_readonly_nonaddressable_vars (void); /* In varpool.c */ tree ctor_for_folding (tree); diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 53abd17..b0f78ef 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -225,6 +225,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-chkp.h" #include "lto-section-names.h" #include "omp-low.h" +#include "print-tree.h" /* Queue of cgraph nodes scheduled to be added into cgraph. This is a secondary queue used during optimization to accommodate passes that @@ -263,7 +264,7 @@ symtab_node::needed_p (void) if (forced_by_abi && TREE_PUBLIC (decl)) return true; - /* Keep constructors, destructors and virtual functions. */ + /* Keep constructors, destructors and virtual functions. */ if (TREE_CODE (decl) == FUNCTION_DECL && (DECL_STATIC_CONSTRUCTOR (decl) || DECL_STATIC_DESTRUCTOR (decl))) return true; @@ -1000,7 +1001,20 @@ analyze_functions (void) cnode->analyze (); for (edge = cnode->callees; edge; edge = edge->next_callee) - if (edge->callee->definition) + if (edge->callee->definition + && (!DECL_EXTERNAL (edge->callee->decl) + /* When not optimizing, do not try to analyze extern + inline functions. Doing so is pointless. */ + || opt_for_fn (edge->callee->decl, optimize) + /* Weakrefs needs to be preserved. */ + || edge->callee->alias + /* always_inline functions are inlined aven at -O0. */ + || lookup_attribute + ("always_inline", + DECL_ATTRIBUTES (edge->callee->decl)) + /* Multiversioned functions needs the dispatcher to + be produced locally even for extern functions. */ + || edge->callee->function_version ())) enqueue_node (edge->callee); if (opt_for_fn (cnode->decl, optimize) && opt_for_fn (cnode->decl, flag_devirtualize)) @@ -1040,10 +1054,18 @@ analyze_functions (void) for (next = node->same_comdat_group; next != node; next = next->same_comdat_group) - enqueue_node (next); + if (!next->comdat_local_p ()) + enqueue_node (next); } for (i = 0; node->iterate_reference (i, ref); i++) - if (ref->referred->definition) + if (ref->referred->definition + && (!DECL_EXTERNAL (ref->referred->decl) + || ((TREE_CODE (ref->referred->decl) != FUNCTION_DECL + && optimize) + || (TREE_CODE (ref->referred->decl) == FUNCTION_DECL + && opt_for_fn (ref->referred->decl, optimize)) + || node->alias + || ref->referred->alias))) enqueue_node (ref->referred); symtab->process_new_functions (); } diff --git a/gcc/combine.c b/gcc/combine.c index c95b493..ee7b3f9 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1579,8 +1579,8 @@ setup_incoming_promotions (rtx_insn *first) uns3 = TYPE_UNSIGNED (DECL_ARG_TYPE (arg)); /* The mode and signedness of the argument as it is actually passed, - after any TARGET_PROMOTE_FUNCTION_ARGS-driven ABI promotions. */ - mode3 = promote_function_mode (DECL_ARG_TYPE (arg), mode2, &uns3, + see assign_parm_setup_reg in function.c. */ + mode3 = promote_function_mode (TREE_TYPE (arg), mode1, &uns3, TREE_TYPE (cfun->decl), 0); /* The mode of the register in which the argument is being passed. */ diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 8ed1f84..b05eae8 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -804,9 +804,9 @@ do { \ : reverse_condition (CODE)) #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ - ((VALUE) = GET_MODE_UNIT_BITSIZE (MODE)) + ((VALUE) = GET_MODE_UNIT_BITSIZE (MODE), 2) #define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \ - ((VALUE) = ((MODE) == SImode ? 32 : 64), 2) + ((VALUE) = GET_MODE_UNIT_BITSIZE (MODE), 2) #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, LR_REGNUM) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index c017842..5209c51 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -1569,7 +1569,7 @@ (define_insn_and_split "*add<mode>3_imm_dot" [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,r") + (compare:CC (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,b") (match_operand:GPR 2 "short_cint_operand" "I,I")) (const_int 0))) (clobber (match_scratch:GPR 0 "=r,r")) @@ -1592,7 +1592,7 @@ (define_insn_and_split "*add<mode>3_imm_dot2" [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,r") + (compare:CC (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,b") (match_operand:GPR 2 "short_cint_operand" "I,I")) (const_int 0))) (set (match_operand:GPR 0 "gpc_reg_operand" "=r,r") diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 576610d..afb2483 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,30 @@ +2014-12-15 Jason Merrill <jason@redhat.com> + + PR c++/64297 + * typeck.c (apply_memfn_quals): Correct wrong TYPE_CANONICAL. + + N3778: Sized Deallocation + * call.c (non_placement_deallocation_fn_p): A global sized + operator delete is not a usual deallocation function until C++14. + (build_op_delete_call): Choose the global sized op delete if we + know the size. + * cp-tree.h: Declare non_placement_deallocation_fn_p. + (enum cp_tree_index): Remove CPTI_GLOBAL_DELETE_FNDECL. + (global_delete_fndecl): Remove. + * decl.c (cxx_init_decl_processing): Also declare sized op deletes. + (grok_op_properties): Warn about sized dealloc without the flag. + * init.c (build_builtin_delete_call): Remove. + (build_vec_delete_1, build_delete): Don't call it. + * decl2.c (maybe_warn_sized_delete): New. + (cp_write_global_declarations): Call it. + +2014-12-15 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/58882 + * decl.c (check_array_designated_initializer): Diagnose gracefully + C99 designators which aren't integral constant-expressions; allow + constexpr user-defined type conversion operators. + 2014-12-12 Paolo Carlini <paolo.carlini@oracle.com> PR c++/59628 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 312dfdf..86c78ab 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5733,7 +5733,7 @@ build_new_op (location_t loc, enum tree_code code, int flags, /* Returns true iff T, an element of an OVERLOAD chain, is a usual deallocation function (3.7.4.2 [basic.stc.dynamic.deallocation]). */ -static bool +bool non_placement_deallocation_fn_p (tree t) { /* A template instance is never a usual deallocation function, @@ -5749,9 +5749,11 @@ non_placement_deallocation_fn_p (tree t) function named operator delete with exactly two parameters, the second of which has type std::size_t (18.2), then this function is a usual deallocation function. */ + bool global = DECL_NAMESPACE_SCOPE_P (t); t = FUNCTION_ARG_CHAIN (t); if (t == void_list_node || (t && same_type_p (TREE_VALUE (t), size_type_node) + && (!global || flag_sized_deallocation) && TREE_CHAIN (t) == void_list_node)) return true; return false; @@ -5883,9 +5885,39 @@ build_op_delete_call (enum tree_code code, tree addr, tree size, which has type std::size_t (18.2), then this function is a usual deallocation function." - So (void*) beats (void*, size_t). */ - if (FUNCTION_ARG_CHAIN (fn) == void_list_node) - break; + So in a class (void*) beats (void*, size_t). */ + if (DECL_CLASS_SCOPE_P (fn)) + { + if (FUNCTION_ARG_CHAIN (fn) == void_list_node) + break; + } + /* At global scope (in C++14 and above) the rules are different: + + If deallocation function lookup finds both a usual + deallocation function with only a pointer parameter and a + usual deallocation function with both a pointer parameter + and a size parameter, the function to be called is selected + as follows: + + * If the type is complete and if, for the second alternative + (delete array) only, the operand is a pointer to a class + type with a non-trivial destructor or a (possibly + multi-dimensional) array thereof, the function with two + parameters is selected. + + * Otherwise, it is unspecified which of the two deallocation + functions is selected. */ + else + { + bool want_size = COMPLETE_TYPE_P (type); + if (code == VEC_DELETE_EXPR + && !TYPE_VEC_NEW_USES_COOKIE (type)) + /* We need a cookie to determine the array size. */ + want_size = false; + bool have_size = (FUNCTION_ARG_CHAIN (fn) != void_list_node); + if (want_size == have_size) + break; + } } } diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index e851660..e0e7690 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -891,7 +891,6 @@ enum cp_tree_index CPTI_CONST_TYPE_INFO_TYPE, CPTI_TYPE_INFO_PTR_TYPE, CPTI_ABORT_FNDECL, - CPTI_GLOBAL_DELETE_FNDECL, CPTI_AGGR_TAG, CPTI_CTOR_IDENTIFIER, @@ -962,7 +961,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; #define const_type_info_type_node cp_global_trees[CPTI_CONST_TYPE_INFO_TYPE] #define type_info_ptr_type cp_global_trees[CPTI_TYPE_INFO_PTR_TYPE] #define abort_fndecl cp_global_trees[CPTI_ABORT_FNDECL] -#define global_delete_fndecl cp_global_trees[CPTI_GLOBAL_DELETE_FNDECL] #define current_aggr cp_global_trees[CPTI_AGGR_TAG] #define nullptr_node cp_global_trees[CPTI_NULLPTR] #define nullptr_type_node cp_global_trees[CPTI_NULLPTR_TYPE] @@ -5185,6 +5183,7 @@ extern tree build_new_op (location_t, enum tree_code, tsubst_flags_t); extern tree build_op_call (tree, vec<tree, va_gc> **, tsubst_flags_t); +extern bool non_placement_deallocation_fn_p (tree); extern tree build_op_delete_call (enum tree_code, tree, tree, bool, tree, tree, tsubst_flags_t); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 5ed9b2c..bbaf3d6 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -159,10 +159,6 @@ static void expand_static_init (tree, tree); tree abort_fndecl; - The FUNCTION_DECL for the default `::operator delete'. - - tree global_delete_fndecl; - Used by RTTI tree type_info_type_node, tinfo_decl_id, tinfo_decl_type; tree tinfo_var_id; */ @@ -3954,8 +3950,22 @@ cxx_init_decl_processing (void) opnew = push_cp_library_fn (VEC_NEW_EXPR, newtype, 0); DECL_IS_MALLOC (opnew) = 1; DECL_IS_OPERATOR_NEW (opnew) = 1; - global_delete_fndecl = push_cp_library_fn (DELETE_EXPR, deltype, ECF_NOTHROW); + push_cp_library_fn (DELETE_EXPR, deltype, ECF_NOTHROW); push_cp_library_fn (VEC_DELETE_EXPR, deltype, ECF_NOTHROW); + if (flag_sized_deallocation) + { + /* Also push the sized deallocation variants: + void operator delete(void*, std::size_t) throw(); + void operator delete[](void*, std::size_t) throw(); */ + tree void_ftype_ptr_size + = build_function_type_list (void_type_node, ptr_type_node, + size_type_node, NULL_TREE); + deltype = cp_build_type_attribute_variant (void_ftype_ptr_size, + extvisattr); + deltype = build_exception_variant (deltype, empty_except_spec); + push_cp_library_fn (DELETE_EXPR, deltype, ECF_NOTHROW); + push_cp_library_fn (VEC_DELETE_EXPR, deltype, ECF_NOTHROW); + } nullptr_type_node = make_node (NULLPTR_TYPE); TYPE_SIZE (nullptr_type_node) = bitsize_int (GET_MODE_BITSIZE (ptr_mode)); @@ -4996,18 +5006,22 @@ check_array_designated_initializer (constructor_elt *ce, return false; } - ce->index = cxx_constant_value (ce->index); - - if (TREE_CODE (ce->index) == INTEGER_CST) + tree ce_index = build_expr_type_conversion (WANT_INT | WANT_ENUM, + ce->index, true); + if (ce_index + && INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (ce_index)) + && (TREE_CODE (ce_index = maybe_constant_value (ce_index)) + == INTEGER_CST)) { /* A C99 designator is OK if it matches the current index. */ - if (wi::eq_p (ce->index, index)) + if (wi::eq_p (ce_index, index)) return true; else sorry ("non-trivial designated initializers not supported"); } else - gcc_unreachable (); + error ("C99 designator %qE is not an integral constant-expression", + ce->index); return false; } @@ -11741,6 +11755,16 @@ grok_op_properties (tree decl, bool complain) error ("%qD may not be declared as static", decl); return false; } + if (!flag_sized_deallocation && warn_cxx14_compat) + { + tree parm = FUNCTION_ARG_CHAIN (decl); + if (parm && same_type_p (TREE_VALUE (parm), size_type_node) + && TREE_CHAIN (parm) == void_list_node) + warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wc__14_compat, + "%qD is a usual (non-placement) deallocation " + "function in C++14 (or with -fsized-deallocation)", + decl); + } } } diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index f3b94a9..07bdd92 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -4308,6 +4308,47 @@ dump_tu (void) } } +/* Check the deallocation functions for CODE to see if we want to warn that + only one was defined. */ + +static void +maybe_warn_sized_delete (enum tree_code code) +{ + tree sized = NULL_TREE; + tree unsized = NULL_TREE; + + for (tree ovl = IDENTIFIER_GLOBAL_VALUE (ansi_opname (code)); + ovl; ovl = OVL_NEXT (ovl)) + { + tree fn = OVL_CURRENT (ovl); + /* We're only interested in usual deallocation functions. */ + if (!non_placement_deallocation_fn_p (fn)) + continue; + if (FUNCTION_ARG_CHAIN (fn) == void_list_node) + unsized = fn; + else + sized = fn; + } + if (DECL_INITIAL (unsized) && !DECL_INITIAL (sized)) + warning_at (DECL_SOURCE_LOCATION (unsized), OPT_Wsized_deallocation, + "the program should also define %qD", sized); + else if (!DECL_INITIAL (unsized) && DECL_INITIAL (sized)) + warning_at (DECL_SOURCE_LOCATION (sized), OPT_Wsized_deallocation, + "the program should also define %qD", unsized); +} + +/* Check the global deallocation functions to see if we want to warn about + defining unsized without sized (or vice versa). */ + +static void +maybe_warn_sized_delete () +{ + if (!flag_sized_deallocation || !warn_sized_deallocation) + return; + maybe_warn_sized_delete (DELETE_EXPR); + maybe_warn_sized_delete (VEC_DELETE_EXPR); +} + /* This routine is called at the end of compilation. Its job is to create all the code needed to initialize and destroy the global aggregates. We do the destruction @@ -4638,6 +4679,8 @@ cp_write_global_declarations (void) FOR_EACH_VEC_SAFE_ELT (no_linkage_decls, i, decl) no_linkage_error (decl); + maybe_warn_sized_delete (); + /* Then, do the Objective-C stuff. This is where all the Objective-C module stuff gets generated (symtab, class/protocol/selector lists etc). This must be done after C++ diff --git a/gcc/cp/init.c b/gcc/cp/init.c index b987ef1..8a7dca3 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -39,7 +39,6 @@ static void construct_virtual_base (tree, tree); static void expand_aggr_init_1 (tree, tree, tree, tree, int, tsubst_flags_t); static void expand_default_init (tree, tree, tree, tree, int, tsubst_flags_t); static void perform_member_init (tree, tree); -static tree build_builtin_delete_call (tree); static int member_init_ok_or_else (tree, tree, tree); static void expand_virtual_init (tree, tree); static tree sort_mem_initializers (tree, tree); @@ -2094,15 +2093,6 @@ decl_constant_value (tree decl) } /* Common subroutines of build_new and build_vec_delete. */ - -/* Call the global __builtin_delete to delete ADDR. */ - -static tree -build_builtin_delete_call (tree addr) -{ - mark_used (global_delete_fndecl); - return build_call_n (global_delete_fndecl, 1, addr); -} /* Build and return a NEW_EXPR. If NELTS is non-NULL, TYPE[NELTS] is the type of the object being allocated; otherwise, it's just TYPE. @@ -3211,7 +3201,9 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, "class-specific operator delete [] will be called, " "even if they are declared when the class is defined"); } - return build_builtin_delete_call (base); + /* This size won't actually be used. */ + size_exp = size_one_node; + goto no_destructor; } size_exp = size_in_bytes (type); @@ -3967,8 +3959,6 @@ build_delete (tree otype, tree addr, special_function_kind auto_delete, if (TYPE_PTR_P (otype)) { - bool complete_p = true; - addr = mark_rvalue_use (addr); /* We don't want to warn about delete of void*, only other @@ -3993,7 +3983,6 @@ build_delete (tree otype, tree addr, special_function_kind auto_delete, "operator delete will be called, even if they are " "declared when the class is defined"); } - complete_p = false; } else if (auto_delete == sfk_deleting_destructor && warn_delnonvdtor && MAYBE_CLASS_TYPE_P (type) && !CLASSTYPE_FINAL (type) @@ -4016,9 +4005,6 @@ build_delete (tree otype, tree addr, special_function_kind auto_delete, } } } - if (VOID_TYPE_P (type) || !complete_p || !MAYBE_CLASS_TYPE_P (type)) - /* Call the builtin operator delete. */ - return build_builtin_delete_call (addr); if (TREE_SIDE_EFFECTS (addr)) addr = save_expr (addr); @@ -4079,7 +4065,13 @@ build_delete (tree otype, tree addr, special_function_kind auto_delete, addr = save_expr (addr); head = get_target_expr (build_headof (addr)); /* Delete the object. */ - do_delete = build_builtin_delete_call (head); + do_delete = build_op_delete_call (DELETE_EXPR, + head, + cxx_sizeof_nowarn (type), + /*global_p=*/true, + /*placement=*/NULL_TREE, + /*alloc_fn=*/NULL_TREE, + complain); /* Otherwise, treat this like a complete object destructor call. */ auto_delete = sfk_complete_destructor; diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 7b39816..9368b49 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -8945,6 +8945,12 @@ apply_memfn_quals (tree type, cp_cv_quals memfn_quals, cp_ref_qualifier rqual) /* This should really have a different TYPE_MAIN_VARIANT, but that gets complex. */ tree result = build_qualified_type (type, memfn_quals); + if (tree canon = TYPE_CANONICAL (result)) + if (canon != result) + /* check_qualified_type doesn't check the ref-qualifier, so make sure + TYPE_CANONICAL is correct. */ + TYPE_CANONICAL (result) + = build_ref_qualified_type (canon, type_memfn_rqual (result)); result = build_exception_variant (result, TYPE_RAISES_EXCEPTIONS (type)); return build_ref_qualified_type (result, rqual); } diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index eb9a64d..19422d7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -187,7 +187,8 @@ in the following sections. -fno-nonansi-builtins -fnothrow-opt -fno-operator-names @gol -fno-optional-diags -fpermissive @gol -fno-pretty-templates @gol --frepo -fno-rtti -fstats -ftemplate-backtrace-limit=@var{n} @gol +-frepo -fno-rtti -fsized-deallocation @gol +-fstats -ftemplate-backtrace-limit=@var{n} @gol -ftemplate-depth=@var{n} @gol -fno-threadsafe-statics -fuse-cxa-atexit @gol -fno-weak -nostdinc++ @gol @@ -243,7 +244,7 @@ Objective-C and Objective-C++ Dialects}. -Wbool-compare @gol -Wno-attributes -Wno-builtin-macro-redefined @gol -Wc90-c99-compat -Wc99-c11-compat @gol --Wc++-compat -Wc++11-compat -Wcast-align -Wcast-qual @gol +-Wc++-compat -Wc++11-compat -Wc++14-compat -Wcast-align -Wcast-qual @gol -Wchar-subscripts -Wclobbered -Wcomment -Wconditionally-supported @gol -Wconversion -Wcoverage-mismatch -Wdate-time -Wdelete-incomplete -Wno-cpp @gol -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init @gol @@ -2304,6 +2305,19 @@ needed. The @samp{dynamic_cast} operator can still be used for casts that do not require run-time type information, i.e.@: casts to @code{void *} or to unambiguous base classes. +@item -fsized-deallocation +@opindex fsized-deallocation +Enable the built-in global declarations +@smallexample +void operator delete (void *, std::size_t) noexcept; +void operator delete[] (void *, std::size_t) noexcept; +@end smallexample +as introduced in C++14. This is useful for user-defined replacement +deallocation functions that, for example, use the size of the object +to make deallocation faster. Enabled by default under +@samp{-std=c++14} and above. The flag @option{-Wsized-deallocation} will +warn about places that might want to add a definition. + @item -fstats @opindex fstats Emit statistics about front-end processing at the end of the compilation. @@ -3356,7 +3370,7 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}. @gccoptlist{-Waddress @gol -Warray-bounds @r{(only with} @option{-O2}@r{)} @gol --Wc++11-compat @gol +-Wc++11-compat -Wc++14-compat@gol -Wchar-subscripts @gol -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol -Wimplicit-int @r{(C and Objective-C only)} @gol @@ -4608,6 +4622,10 @@ and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords in ISO C++ 2011. This warning turns on @option{-Wnarrowing} and is enabled by @option{-Wall}. +@item -Wc++14-compat @r{(C++ and Objective-C++ only)} +Warn about C++ constructs whose meaning differs between ISO C++ 2011 +and ISO C++ 2014. This warning is enabled by @option{-Wall}. + @item -Wcast-qual @opindex Wcast-qual @opindex Wno-cast-qual @@ -4767,6 +4785,22 @@ This includes conversions from real to integer, and from higher precision real to lower precision real values. This option is also enabled by @option{-Wconversion}. +@item -Wsized-deallocation @r{(C++ and Objective-C++ only)} +@opindex Wsized-deallocation +@opindex -Wno-sized-deallocation +Warn about a definition of an unsized deallocation function +@smallexample +void operator delete (void *) noexcept; +void operator delete[] (void *) noexcept; +@end smallexample +without a definition of the corresponding sized deallocation function +@smallexample +void operator delete (void *, std::size_t) noexcept; +void operator delete[] (void *, std::size_t) noexcept; +@end smallexample +or vice versa. Enabled by @option{-Wextra} along with +@option{-fsized-deallocation}. + @item -Wsizeof-pointer-memaccess @opindex Wsizeof-pointer-memaccess @opindex Wno-sizeof-pointer-memaccess diff --git a/gcc/fold-const.c b/gcc/fold-const.c index d71fa94..07da71a 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -400,7 +400,7 @@ negate_expr_p (tree t) switch (TREE_CODE (t)) { case INTEGER_CST: - if (TYPE_OVERFLOW_WRAPS (type)) + if (INTEGRAL_TYPE_P (type) && TYPE_OVERFLOW_WRAPS (type)) return true; /* Check that -CST will not overflow type. */ diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4d99f18..83f2aba 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,36 @@ +2014-12-15 Steven Bosscher <steven@gcc.gnu.org> + + PR fortran/61669 + * gfortran.h (struct gfc_namespace): Add OLD_DATA field. + * decl.c (gfc_reject_data): New function. + * parse.c *use_modules): Record roll-back point. + (next_statement): Likewise. + (reject_statement): Roll back to last accepted DATA. + +2014-12-15 Janus Weil <janus@gcc.gnu.org> + + PR fortran/63727 + * resolve.c (resolve_actual_arglist): Check for elemental procedure + pointer components. + +2014-12-15 Janus Weil <janus@gcc.gnu.org> + + PR fortran/63674 + * resolve.c (check_pure_function): Rewording in error message. + +2014-12-14 Janus Weil <janus@gcc.gnu.org> + + PR fortran/63674 + * resolve.c (pure_function): Treat procedure-pointer components. + (check_pure_function): New function. + (resolve_function): Use it. + (pure_subroutine): Return a bool to indicate success and modify + arguments. + (resolve_generic_s0,resolve_specific_s0,resolve_unknown_s): Use return + value of 'pure_subroutine'. + (resolve_ppc_call): Call 'pure_subroutine'. + (resolve_expr_ppc): Call 'check_pure_function'. + 2014-12-13 Tobias Burnus <burnus@net-b.de> Manuel López-Ibáñez <manu@gcc.gnu.org> diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 1c64873..28a7aca 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -178,6 +178,20 @@ gfc_free_data_all (gfc_namespace *ns) } } +/* Reject data parsed since the last restore point was marked. */ + +void +gfc_reject_data (gfc_namespace *ns) +{ + gfc_data *d; + + while (ns->data && ns->data != ns->old_data) + { + d = ns->data->next; + free (ns->data); + ns->data = d; + } +} static match var_element (gfc_data_variable *); diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 42ed8eb..e0e5838 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1627,7 +1627,7 @@ typedef struct gfc_namespace gfc_st_label *st_labels; /* This list holds information about all the data initializers in this namespace. */ - struct gfc_data *data; + struct gfc_data *data, *old_data; gfc_charlen *cl_list, *old_cl_list; @@ -2929,6 +2929,7 @@ void gfc_free_omp_namelist (gfc_omp_namelist *); void gfc_free_equiv (gfc_equiv *); void gfc_free_equiv_until (gfc_equiv *, gfc_equiv *); void gfc_free_data (gfc_data *); +void gfc_reject_data (gfc_namespace *); void gfc_free_case_list (gfc_case *); /* matchexp.c -- FIXME too? */ diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index ad3137b..54c0cdc 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -119,6 +119,7 @@ use_modules (void) gfc_warning_check (); gfc_current_ns->old_cl_list = gfc_current_ns->cl_list; gfc_current_ns->old_equiv = gfc_current_ns->equiv; + gfc_current_ns->old_data = gfc_current_ns->data; last_was_use_stmt = false; } @@ -1098,6 +1099,7 @@ next_statement (void) gfc_current_ns->old_cl_list = gfc_current_ns->cl_list; gfc_current_ns->old_equiv = gfc_current_ns->equiv; + gfc_current_ns->old_data = gfc_current_ns->data; for (;;) { gfc_statement_label = NULL; @@ -2043,6 +2045,8 @@ reject_statement (void) gfc_free_equiv_until (gfc_current_ns->equiv, gfc_current_ns->old_equiv); gfc_current_ns->equiv = gfc_current_ns->old_equiv; + gfc_reject_data (gfc_current_ns); + gfc_new_block = NULL; gfc_undo_symbols (); gfc_clear_warning (); diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index d47bb7b..ab13dc9 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -1740,6 +1740,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype, gfc_symbol *sym; gfc_symtree *parent_st; gfc_expr *e; + gfc_component *comp; int save_need_full_assumed_size; bool return_value = false; bool actual_arg_sav = actual_arg, first_actual_arg_sav = first_actual_arg; @@ -1967,6 +1968,14 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype, } } + comp = gfc_get_proc_ptr_comp(e); + if (comp && comp->attr.elemental) + { + gfc_error ("ELEMENTAL procedure pointer component %qs is not " + "allowed as an actual argument at %L", comp->name, + &e->where); + } + /* Fortran 2008, C1237. */ if (e->expr_type == EXPR_VARIABLE && gfc_is_coindexed (e) && gfc_has_ultimate_pointer (e)) @@ -2746,6 +2755,7 @@ static int pure_function (gfc_expr *e, const char **name) { int pure; + gfc_component *comp; *name = NULL; @@ -2754,7 +2764,13 @@ pure_function (gfc_expr *e, const char **name) && e->symtree->n.sym->attr.proc == PROC_ST_FUNCTION) return pure_stmt_function (e, e->symtree->n.sym); - if (e->value.function.esym) + comp = gfc_get_proc_ptr_comp (e); + if (comp) + { + pure = gfc_pure (comp->ts.interface); + *name = comp->name; + } + else if (e->value.function.esym) { pure = gfc_pure (e->value.function.esym); *name = e->value.function.esym->name; @@ -2801,6 +2817,39 @@ pure_stmt_function (gfc_expr *e, gfc_symbol *sym) } +/* Check if an impure function is allowed in the current context. */ + +static bool check_pure_function (gfc_expr *e) +{ + const char *name = NULL; + if (!pure_function (e, &name) && name) + { + if (forall_flag) + { + gfc_error ("Reference to impure function %qs at %L inside a " + "FORALL %s", name, &e->where, + forall_flag == 2 ? "mask" : "block"); + return false; + } + else if (gfc_do_concurrent_flag) + { + gfc_error ("Reference to impure function %qs at %L inside a " + "DO CONCURRENT %s", name, &e->where, + gfc_do_concurrent_flag == 2 ? "mask" : "block"); + return false; + } + else if (gfc_pure (NULL)) + { + gfc_error ("Reference to impure function %qs at %L " + "within a PURE procedure", name, &e->where); + return false; + } + gfc_unset_implicit_pure (NULL); + } + return true; +} + + /* Resolve a function call, which means resolving the arguments, then figuring out which entity the name refers to. */ @@ -2809,7 +2858,6 @@ resolve_function (gfc_expr *expr) { gfc_actual_arglist *arg; gfc_symbol *sym; - const char *name; bool t; int temp; procedure_type p = PROC_INTRINSIC; @@ -2982,33 +3030,9 @@ resolve_function (gfc_expr *expr) #undef GENERIC_ID need_full_assumed_size = temp; - name = NULL; - if (!pure_function (expr, &name) && name) - { - if (forall_flag) - { - gfc_error ("Reference to non-PURE function %qs at %L inside a " - "FORALL %s", name, &expr->where, - forall_flag == 2 ? "mask" : "block"); - t = false; - } - else if (gfc_do_concurrent_flag) - { - gfc_error ("Reference to non-PURE function %qs at %L inside a " - "DO CONCURRENT %s", name, &expr->where, - gfc_do_concurrent_flag == 2 ? "mask" : "block"); - t = false; - } - else if (gfc_pure (NULL)) - { - gfc_error ("Function reference to %qs at %L is to a non-PURE " - "procedure within a PURE procedure", name, &expr->where); - t = false; - } - - gfc_unset_implicit_pure (NULL); - } + if (!check_pure_function(expr)) + t = false; /* Functions without the RECURSIVE attribution are not allowed to * call themselves. */ @@ -3056,23 +3080,32 @@ resolve_function (gfc_expr *expr) /************* Subroutine resolution *************/ -static void -pure_subroutine (gfc_code *c, gfc_symbol *sym) +static bool +pure_subroutine (gfc_symbol *sym, const char *name, locus *loc) { if (gfc_pure (sym)) - return; + return true; if (forall_flag) - gfc_error ("Subroutine call to %qs in FORALL block at %L is not PURE", - sym->name, &c->loc); + { + gfc_error ("Subroutine call to %qs in FORALL block at %L is not PURE", + name, loc); + return false; + } else if (gfc_do_concurrent_flag) - gfc_error ("Subroutine call to %qs in DO CONCURRENT block at %L is not " - "PURE", sym->name, &c->loc); + { + gfc_error ("Subroutine call to %qs in DO CONCURRENT block at %L is not " + "PURE", name, loc); + return false; + } else if (gfc_pure (NULL)) - gfc_error ("Subroutine call to %qs at %L is not PURE", sym->name, - &c->loc); + { + gfc_error ("Subroutine call to %qs at %L is not PURE", name, loc); + return false; + } gfc_unset_implicit_pure (NULL); + return true; } @@ -3087,7 +3120,8 @@ resolve_generic_s0 (gfc_code *c, gfc_symbol *sym) if (s != NULL) { c->resolved_sym = s; - pure_subroutine (c, s); + if (!pure_subroutine (s, s->name, &c->loc)) + return MATCH_ERROR; return MATCH_YES; } @@ -3190,7 +3224,8 @@ found: gfc_procedure_use (sym, &c->ext.actual, &c->loc); c->resolved_sym = sym; - pure_subroutine (c, sym); + if (!pure_subroutine (sym, sym->name, &c->loc)) + return MATCH_ERROR; return MATCH_YES; } @@ -3260,9 +3295,7 @@ found: c->resolved_sym = sym; - pure_subroutine (c, sym); - - return true; + return pure_subroutine (sym, sym->name, &c->loc); } @@ -6036,6 +6069,9 @@ resolve_ppc_call (gfc_code* c) && comp->ts.interface->formal))) return false; + if (!pure_subroutine (comp->ts.interface, comp->name, &c->expr1->where)) + return false; + gfc_ppc_use (comp, &c->expr1->value.compcall.actual, &c->expr1->where); return true; @@ -6074,6 +6110,9 @@ resolve_expr_ppc (gfc_expr* e) if (!update_ppc_arglist (e)) return false; + if (!check_pure_function(e)) + return false; + gfc_ppc_use (comp, &e->value.compcall.actual, &e->where); return true; diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 21f6cd6..f6d4381 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -6552,13 +6552,7 @@ class Builtin_call_expression : public Call_expression do_check_types(Gogo*); Expression* - do_copy() - { - return new Builtin_call_expression(this->gogo_, this->fn()->copy(), - this->args()->copy(), - this->is_varargs(), - this->location()); - } + do_copy(); Bexpression* do_get_backend(Translate_context*); @@ -6627,6 +6621,8 @@ class Builtin_call_expression : public Call_expression // Used to stop endless loops when the length of an array uses len // or cap of the array itself. mutable bool seen_; + // Whether the argument is set for calls to BUILTIN_RECOVER. + bool recover_arg_is_set_; }; Builtin_call_expression::Builtin_call_expression(Gogo* gogo, @@ -6635,7 +6631,8 @@ Builtin_call_expression::Builtin_call_expression(Gogo* gogo, bool is_varargs, Location location) : Call_expression(fn, args, is_varargs, location), - gogo_(gogo), code_(BUILTIN_INVALID), seen_(false) + gogo_(gogo), code_(BUILTIN_INVALID), seen_(false), + recover_arg_is_set_(false) { Func_expression* fnexp = this->fn()->func_expression(); go_assert(fnexp != NULL); @@ -6701,6 +6698,7 @@ Builtin_call_expression::do_set_recover_arg(Expression* arg) Expression_list* new_args = new Expression_list(); new_args->push_back(arg); this->set_args(new_args); + this->recover_arg_is_set_ = true; } // Lower a builtin call expression. This turns new and make into @@ -7841,7 +7839,9 @@ Builtin_call_expression::do_check_types(Gogo*) break; case BUILTIN_RECOVER: - if (this->args() != NULL && !this->args()->empty()) + if (this->args() != NULL + && !this->args()->empty() + && !this->recover_arg_is_set_) this->report_error(_("too many arguments")); break; @@ -7980,6 +7980,20 @@ Builtin_call_expression::do_check_types(Gogo*) } } +Expression* +Builtin_call_expression::do_copy() +{ + Call_expression* bce = + new Builtin_call_expression(this->gogo_, this->fn()->copy(), + this->args()->copy(), + this->is_varargs(), + this->location()); + + if (this->varargs_are_lowered()) + bce->set_varargs_are_lowered(); + return bce; +} + // Return the backend representation for a builtin function. Bexpression* @@ -9120,6 +9134,21 @@ Call_expression::do_check_types(Gogo*) } } +Expression* +Call_expression::do_copy() +{ + Call_expression* call = + Expression::make_call(this->fn_->copy(), + (this->args_ == NULL + ? NULL + : this->args_->copy()), + this->is_varargs_, this->location()); + + if (this->varargs_are_lowered_) + call->set_varargs_are_lowered(); + return call; +} + // Return whether we have to use a temporary variable to ensure that // we evaluate this call expression in order. If the call returns no // results then it will inevitably be executed last. @@ -10731,7 +10760,7 @@ Field_reference_expression::do_lower(Gogo* gogo, Named_object* function, return this; // References from functions generated by the compiler don't count. - if (function->func_value()->is_type_specific_function()) + if (function != NULL && function->func_value()->is_type_specific_function()) return this; // We have found a reference to a tracked field. Build a call to diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index 398709e..cbac504 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -1683,6 +1683,11 @@ class Call_expression : public Expression is_varargs() const { return this->is_varargs_; } + // Return whether varargs have already been lowered. + bool + varargs_are_lowered() const + { return this->varargs_are_lowered_; } + // Note that varargs have already been lowered. void set_varargs_are_lowered() @@ -1738,14 +1743,7 @@ class Call_expression : public Expression do_check_types(Gogo*); Expression* - do_copy() - { - return Expression::make_call(this->fn_->copy(), - (this->args_ == NULL - ? NULL - : this->args_->copy()), - this->is_varargs_, this->location()); - } + do_copy(); bool do_must_eval_in_order() const; diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index 8e3aa3b..3b5ede5 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -5031,6 +5031,16 @@ Parse::send_or_recv_stmt(bool* is_send, Expression** channel, Expression** val, e = Expression::make_receive(*channel, (*channel)->location()); } + if (!saw_comma && this->peek_token()->is_op(OPERATOR_COMMA)) + { + this->advance_token(); + // case v, e = <-c: + if (!e->is_sink_expression()) + *val = e; + e = this->expression(PRECEDENCE_NORMAL, true, true, NULL, NULL); + saw_comma = true; + } + if (this->peek_token()->is_op(OPERATOR_EQ)) { if (!this->advance_token()->is_op(OPERATOR_CHANOP)) diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index b046f9e..714a0ee 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -676,11 +676,12 @@ propagate (void) XCNEWVEC (struct cgraph_node *, symtab->cgraph_count); int order_pos; int i; + bool remove_p; if (dump_file) cgraph_node::dump_cgraph (dump_file); - ipa_discover_readonly_nonaddressable_vars (); + remove_p = ipa_discover_readonly_nonaddressable_vars (); generate_summary (); /* Propagate the local information through the call graph to produce @@ -867,7 +868,7 @@ propagate (void) if (dump_file) splay_tree_delete (reference_vars_to_consider); reference_vars_to_consider = NULL; - return 0; + return remove_p ? TODO_remove_functions : 0; } /* Return true if we need to write summary of NODE. */ @@ -128,8 +128,10 @@ process_references (symtab_node *snode, if (node->definition && !node->in_other_partition && ((!DECL_EXTERNAL (node->decl) || node->alias) || (((before_inlining_p - && (TREE_CODE (node->decl) != FUNCTION_DECL - || opt_for_fn (body->decl, optimize) + && ((TREE_CODE (node->decl) != FUNCTION_DECL + && optimize) + || (TREE_CODE (node->decl) == FUNCTION_DECL + && opt_for_fn (body->decl, optimize)) || (symtab->state < IPA_SSA && lookup_attribute ("always_inline", @@ -712,14 +714,18 @@ set_readonly_bit (varpool_node *vnode, void *data ATTRIBUTE_UNUSED) /* Set writeonly bit and clear the initalizer, since it will not be needed. */ bool -set_writeonly_bit (varpool_node *vnode, void *data ATTRIBUTE_UNUSED) +set_writeonly_bit (varpool_node *vnode, void *data) { vnode->writeonly = true; if (optimize) { DECL_INITIAL (vnode->decl) = NULL; if (!vnode->alias) - vnode->remove_all_references (); + { + if (vnode->num_references ()) + *(bool *)data = true; + vnode->remove_all_references (); + } } return false; } @@ -737,15 +743,18 @@ clear_addressable_bit (varpool_node *vnode, void *data ATTRIBUTE_UNUSED) /* Discover variables that have no longer address taken or that are read only and update their flags. + Return true when unreachable symbol removan should be done. + FIXME: This can not be done in between gimplify and omp_expand since readonly flag plays role on what is shared and what is not. Currently we do this transformation as part of whole program visibility and re-do at ipa-reference pass (to take into account clonning), but it would make sense to do it before early optimizations. */ -void +bool ipa_discover_readonly_nonaddressable_vars (void) { + bool remove_p = false; varpool_node *vnode; if (dump_file) fprintf (dump_file, "Clearing variable flags:"); @@ -760,14 +769,16 @@ ipa_discover_readonly_nonaddressable_vars (void) bool read = false; bool explicit_refs = true; - process_references (vnode, &written, &address_taken, &read, &explicit_refs); + process_references (vnode, &written, &address_taken, &read, + &explicit_refs); if (!explicit_refs) continue; if (!address_taken) { if (TREE_ADDRESSABLE (vnode->decl) && dump_file) fprintf (dump_file, " %s (non-addressable)", vnode->name ()); - vnode->call_for_node_and_aliases (clear_addressable_bit, NULL, true); + vnode->call_for_node_and_aliases (clear_addressable_bit, NULL, + true); } if (!address_taken && !written /* Making variable in explicit section readonly can cause section @@ -783,11 +794,13 @@ ipa_discover_readonly_nonaddressable_vars (void) { if (dump_file) fprintf (dump_file, " %s (write-only)", vnode->name ()); - vnode->call_for_node_and_aliases (set_writeonly_bit, NULL, true); + vnode->call_for_node_and_aliases (set_writeonly_bit, &remove_p, + true); } } if (dump_file) fprintf (dump_file, "\n"); + return remove_p; } /* Free inline summary. */ diff --git a/gcc/ira-int.h b/gcc/ira-int.h index b5d00e5..0799b1e 100644 --- a/gcc/ira-int.h +++ b/gcc/ira-int.h @@ -843,11 +843,6 @@ struct target_ira_int { unavailable for the allocation. */ short x_ira_class_hard_reg_index[N_REG_CLASSES][FIRST_PSEUDO_REGISTER]; - /* Array whose values are hard regset of hard registers available for - the allocation of given register class whose HARD_REGNO_MODE_OK - values for given mode are zero. */ - HARD_REG_SET x_ira_prohibited_class_mode_regs[N_REG_CLASSES][NUM_MACHINE_MODES]; - /* Index [CL][M] contains R if R appears somewhere in a register of the form: (reg:M R'), R' not in x_ira_prohibited_class_mode_regs[CL][M] @@ -939,8 +934,6 @@ extern struct target_ira_int *this_target_ira_int; (this_target_ira_int->x_ira_non_ordered_class_hard_regs) #define ira_class_hard_reg_index \ (this_target_ira_int->x_ira_class_hard_reg_index) -#define ira_prohibited_class_mode_regs \ - (this_target_ira_int->x_ira_prohibited_class_mode_regs) #define ira_useful_class_mode_regs \ (this_target_ira_int->x_ira_useful_class_mode_regs) #define ira_important_classes_num \ @@ -4358,6 +4358,12 @@ rtx_moveable_p (rtx *loc, enum op_type type) case CLOBBER: return rtx_moveable_p (&SET_DEST (x), OP_OUT); + case UNSPEC_VOLATILE: + /* It is a bad idea to consider insns with with such rtl + as moveable ones. The insn scheduler also considers them as barrier + for a reason. */ + return false; + default: break; } @@ -110,6 +110,11 @@ struct target_ira /* Function specific hard registers can not be used for the register allocation. */ HARD_REG_SET x_ira_no_alloc_regs; + + /* Array whose values are hard regset of hard registers available for + the allocation of given register class whose HARD_REGNO_MODE_OK + values for given mode are zero. */ + HARD_REG_SET x_ira_prohibited_class_mode_regs[N_REG_CLASSES][NUM_MACHINE_MODES]; }; extern struct target_ira default_target_ira; @@ -155,6 +160,8 @@ extern struct target_ira *this_target_ira; (this_target_ira->x_ira_class_singleton) #define ira_no_alloc_regs \ (this_target_ira->x_ira_no_alloc_regs) +#define ira_prohibited_class_mode_regs \ + (this_target_ira->x_ira_prohibited_class_mode_regs) /* Major structure describing equivalence info for a pseudo. */ struct ira_reg_equiv_s diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index e0d4c19..a108b84 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -2269,17 +2269,25 @@ process_alt_operands (int only_alternative) /* Alternative loses if it required class pseudo can not hold value of required mode. Such insns can be - described by insn definitions with mode iterators. - Don't use ira_prohibited_class_mode_regs here as it - is common practice for constraints to use a class - which does not have actually enough regs to hold the - value (e.g. x86 AREG for mode requiring more one - general reg). */ + described by insn definitions with mode iterators. */ if (GET_MODE (*curr_id->operand_loc[nop]) != VOIDmode && ! hard_reg_set_empty_p (this_alternative_set) + /* It is common practice for constraints to use a + class which does not have actually enough regs to + hold the value (e.g. x86 AREG for mode requiring + more one general reg). Therefore we have 2 + conditions to check that the reload pseudo can + not hold the mode value. */ && ! HARD_REGNO_MODE_OK (ira_class_hard_regs [this_alternative][0], - GET_MODE (*curr_id->operand_loc[nop]))) + GET_MODE (*curr_id->operand_loc[nop])) + /* The above condition is not enough as the first + reg in ira_class_hard_regs can be not aligned for + multi-words mode values. */ + && hard_reg_set_subset_p (this_alternative_set, + ira_prohibited_class_mode_regs + [this_alternative] + [GET_MODE (*curr_id->operand_loc[nop])])) { if (lra_dump_file != NULL) fprintf diff --git a/gcc/match.pd b/gcc/match.pd index 4ccb41a..083d65f 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -186,7 +186,7 @@ along with GCC; see the file COPYING3. If not see (if (flag_reciprocal_math && !real_zerop (@1)) (with - { tree tem = fold_binary (RDIV_EXPR, type, build_one_cst (type), @1); } + { tree tem = const_binop (RDIV_EXPR, type, build_one_cst (type), @1); } (if (tem) (mult @0 { tem; } )))) (if (cst != COMPLEX_CST) diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 8ec416e..277288a 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -4561,7 +4561,8 @@ simplify_relational_operation_1 (enum rtx_code code, machine_mode mode, rtx not_y = simplify_gen_unary (NOT, cmp_mode, XEXP (op0, 1), cmp_mode); rtx lhs = simplify_gen_binary (AND, cmp_mode, not_y, XEXP (op0, 0)); - return simplify_gen_relational (code, mode, cmp_mode, lhs, const0_rtx); + return simplify_gen_relational (code, mode, cmp_mode, lhs, + CONST0_RTX (cmp_mode)); } /* Likewise for (eq/ne (and x y) y). */ @@ -4573,7 +4574,8 @@ simplify_relational_operation_1 (enum rtx_code code, machine_mode mode, rtx not_x = simplify_gen_unary (NOT, cmp_mode, XEXP (op0, 0), cmp_mode); rtx lhs = simplify_gen_binary (AND, cmp_mode, not_x, XEXP (op0, 1)); - return simplify_gen_relational (code, mode, cmp_mode, lhs, const0_rtx); + return simplify_gen_relational (code, mode, cmp_mode, lhs, + CONST0_RTX (cmp_mode)); } /* (eq/ne (bswap x) C1) simplifies to (eq/ne x C2) with C2 swapped. */ diff --git a/gcc/symtab.c b/gcc/symtab.c index 101bc25..37e4a94 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -168,6 +168,11 @@ symbol_table::insert_to_assembler_name_hash (symtab_node *node, tree name = DECL_ASSEMBLER_NAME (node->decl); + /* C++ FE can produce decls without associated assembler name and insert + them to symtab to hold section or TLS information. */ + if (!name) + return; + hashval_t hash = decl_assembler_name_hash (name); aslot = assembler_name_hash->find_slot_with_hash (name, hash, INSERT); gcc_assert (*aslot != node); @@ -209,6 +214,10 @@ symbol_table::unlink_from_assembler_name_hash (symtab_node *node, { tree name = DECL_ASSEMBLER_NAME (node->decl); symtab_node **slot; + + if (!name) + return; + hashval_t hash = decl_assembler_name_hash (name); slot = assembler_name_hash->find_slot_with_hash (name, hash, NO_INSERT); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a4e64b0..2299c78 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,109 @@ +2014-12-15 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/64316 + * gcc.dg/pr64316.c: New test. + + PR rtl-optimization/63804 + * gcc.dg/pr63804.c: New test. + +2014-12-15 Steven Bosscher <steven@gcc.gnu.org> + Jakub Jelinek <jakub@redhat.com> + + PR fortran/61669 + * gfortran.dg/pr61669.f90: New test. + +2014-12-15 Richard Biener <rguenther@suse.de> + + PR tree-optimization/64312 + * g++.dg/torture/pr64312.C: New testcase. + +2014-12-15 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/58882 + * g++.dg/ext/desig8.C: New. + * g++.dg/cpp0x/desig1.C: Likewise. + +2014-12-15 Janus Weil <janus@gcc.gnu.org> + + PR fortran/63727 + * gfortran.dg/coarray_collectives_14.f90: Address FIXME item. + +2014-12-15 Richard Biener <rguenther@suse.de> + + PR middle-end/64295 + * gcc.dg/pr64295.c: New testcase. + +2014-12-15 Richard Biener <rguenther@suse.de> + + PR middle-end/64246 + * gnat.dg/opt46.adb: New testcase. + * gnat.dg/opt46.ads: Likewise. + * gnat.dg/opt46_pkg.adb: Likewise. + * gnat.dg/opt46_pkg.ads: Likewise. + +2014-12-15 Jakub Jelinek <jakub@redhat.com> + + PR target/64210 + * gcc.target/i386/avx512f-broadcast-gpr-1.c: Use %(?:e|r\[0-9\]+d) + instead of %e in regexps trying to match 32-bit GPR. + * gcc.target/i386/avx512f-vpbroadcastd-1.c: Likewise. + * gcc.target/i386/avx512vl-vpbroadcastd-1.c: Likewise. + * gcc.target/i386/avx512vl-vmovdqa64-1.c: Restrict some + scan-assembler-times lines to nonpic targets only. + Fix up \[^\n^x^y\] to \[^\nxy\]. + +2014-12-15 Paolo Carlini <paolo.carlini@oracle.com> + + * g++.dg/cpp1y/pr63996.C: Fix. + +2014-12-15 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/63551 + * gcc.dg/ipa/pr63551.c (fn2): Use 4294967286U instead of + 4294967286 to avoid warnings. + +2014-12-15 Janus Weil <janus@gcc.gnu.org> + + PR fortran/63674 + * gfortran.dg/forall_5.f90: Modified error message. + * gfortran.dg/proc_ptr_comp_39.f90: Ditto. + * gfortran.dg/pure_dummy_length_1.f90: Ditto. + * gfortran.dg/stfunc_6.f90: Ditto. + * gfortran.dg/typebound_operator_4.f90: Ditto. + +2014-12-15 Richard Biener <rguenther@suse.de> + + PR tree-optimization/64284 + * gcc.dg/torture/pr64284.c: New testcase. + +2014-12-14 Jan Hubicka <hubicka@ucw.cz> + + PR ipa/61602 + * gcc.dg/torture/pr61602.c: New testcase. + +2014-12-14 Jan Hubicka <hubicka@ucw.cz> + + PR ipa/61558 + * g++.dg/torture/pr61558.C: New testcase. + +2014-12-14 Jan Hubicka <hubicka@ucw.cz> + + PR lto/64043 + * g++.dg/lto/pr64043_0.C: New testcase. + +2014-12-14 H.J. Lu <hongjiu.lu@intel.com> + + PR rtl-optimization/64037 + * g++.dg/pr64037.C: New test. + +2014-12-14 Janus Weil <janus@gcc.gnu.org> + + PR fortran/63674 + * gfortran.dg/proc_ptr_comp_39.f90: New. + * gfortran.dg/pure_dummy_length_1.f90: Modified error message. + * gfortran.dg/stfunc_6.f90: Ditto. + * gfortran.dg/typebound_operator_4.f90: Ditto. + 2014-12-13 Oleg Endo <olegendo@gcc.gnu.org> PR target/53513 diff --git a/gcc/testsuite/g++.dg/cpp0x/desig1.C b/gcc/testsuite/g++.dg/cpp0x/desig1.C new file mode 100644 index 0000000..cc52730 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/desig1.C @@ -0,0 +1,27 @@ +// PR c++/58882 +// { dg-do compile { target c++11 } } + +struct A +{ + constexpr operator int() const { return 0; } +}; + +int a[] = { [A()] = 0 }; + +enum E { e0 }; + +struct B +{ + constexpr operator E() const { return E::e0; } +}; + +int b[] = { [B()] = 0 }; + +enum class SE { se0 }; + +struct C +{ + constexpr operator SE() const { return SE::se0; } +}; + +int c[] = { [C()] = 0 }; // { dg-error "integral constant-expression" } diff --git a/gcc/testsuite/g++.dg/cpp0x/ref-qual16.C b/gcc/testsuite/g++.dg/cpp0x/ref-qual16.C new file mode 100644 index 0000000..1d7650b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/ref-qual16.C @@ -0,0 +1,12 @@ +// PR c++/64297 +// { dg-do compile { target c++11 } } + +struct A { + typedef int X; + template <int> X m_fn1() const; +}; +template <typename> struct is_function {}; +is_function<int() const &> i; +struct D { + template <typename Y, typename = is_function<Y>> D(Y); +} b(&A::m_fn1<0>); diff --git a/gcc/testsuite/g++.dg/cpp1y/pr63996.C b/gcc/testsuite/g++.dg/cpp1y/pr63996.C index c89d542..d0bf9b5 100644 --- a/gcc/testsuite/g++.dg/cpp1y/pr63996.C +++ b/gcc/testsuite/g++.dg/cpp1y/pr63996.C @@ -3,7 +3,7 @@ constexpr int foo (int i) { - int a[i] = { }; + int a[i] = { }; // { dg-error "forbids variable length" } } constexpr int j = foo (1); // { dg-error "is not a constant expression" } diff --git a/gcc/testsuite/g++.dg/cpp1y/sized-dealloc1.C b/gcc/testsuite/g++.dg/cpp1y/sized-dealloc1.C new file mode 100644 index 0000000..846fce6 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/sized-dealloc1.C @@ -0,0 +1,75 @@ +// Test for C++14 sized deallocation. The operators delete defined below +// should be called only in C++14 mode and above. +// { dg-do run } + +extern "C" void abort(); +typedef __SIZE_TYPE__ size_t; +#include <new> + +bool called; +void operator delete[] (void *p, size_t s) throw() +{ + called = true; + operator delete[] (p); +} + +void operator delete (void *p, size_t s) throw() +{ + called = true; + operator delete (p); +} + +void operator delete[] (void *p, size_t s, const std::nothrow_t &) throw() +{ + called = true; + operator delete[] (p); +} + +void operator delete (void *p, size_t s, const std::nothrow_t &) throw() +{ + called = true; + operator delete (p); +} + +struct A { ~A(){} }; + +struct B { }; + +struct C; + +struct D { ~D(){}; D() { throw 1; } }; + +int main() +{ + /* * If the type is complete and if, for the second alternative (delete + array) only, the operand is a pointer to a class type with a + non-trivial destructor or a (possibly multi-dimensional) array + thereof, the function with two parameters is selected. + + * Otherwise, it is unspecified which of the two deallocation functions + is selected. */ + delete new int; + if (called != (__cplusplus >= 201402L)) abort(); called = false; + + delete new A; + if (called != (__cplusplus >= 201402L)) abort(); called = false; + + delete[] new A[2]; + if (called != (__cplusplus >= 201402L)) abort(); called = false; + + delete new B; + if (called != (__cplusplus >= 201402L)) abort(); called = false; + + /* N3778 added the sized placement deallocation functions, but the core + language rules don't provide any way they would be called. */ + try { new (std::nothrow) D; } catch (int) {} + if (called) abort(); + + try { new (std::nothrow) D[2]; } catch (int) {} + if (called) abort(); + + /* Make sure we don't try to use the size of an array that doesn't have a + cookie. */ + delete[] new B[2]; + if (called) abort(); +} diff --git a/gcc/testsuite/g++.dg/cpp1y/sized-dealloc2.C b/gcc/testsuite/g++.dg/cpp1y/sized-dealloc2.C new file mode 100644 index 0000000..a3ab64c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/sized-dealloc2.C @@ -0,0 +1,5 @@ +// Test that -Wc++14-compat warns about the change in meaning. +// { dg-options "-Wall" } + +typedef __SIZE_TYPE__ size_t; +void operator delete[] (void *p, size_t s) throw(); // { dg-warning "usual" "" { target { ! c++14 } } } diff --git a/gcc/testsuite/g++.dg/cpp1y/sized-dealloc3.C b/gcc/testsuite/g++.dg/cpp1y/sized-dealloc3.C new file mode 100644 index 0000000..e5bfe7c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/sized-dealloc3.C @@ -0,0 +1,3 @@ +// { dg-options "-Wsized-deallocation" } + +void operator delete (void *p) throw() { __builtin_free(p); } // { dg-warning "sized" "" { target c++14 } } diff --git a/gcc/testsuite/g++.dg/ext/desig8.C b/gcc/testsuite/g++.dg/ext/desig8.C new file mode 100644 index 0000000..98e7bfd --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/desig8.C @@ -0,0 +1,3 @@ +// PR c++/58882 + +int a[] = { [0.] = 0 }; // { dg-error "integral constant-expression" } diff --git a/gcc/testsuite/g++.dg/lto/pr64043_0.C b/gcc/testsuite/g++.dg/lto/pr64043_0.C new file mode 100644 index 0000000..9cc5596 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr64043_0.C @@ -0,0 +1,14 @@ +// { dg-lto-do link } +// { dg-lto-options { { -flto -std=c++11 } } } +// { dg-extra-ld-options "-r -nostdlib -O2" } +class Validator +{ +public: + virtual ~Validator (); +}; +class FooWriter +{ + Validator *validator; + ~FooWriter (); +}; +FooWriter::~FooWriter () { delete validator; } diff --git a/gcc/testsuite/g++.dg/pr64037.C b/gcc/testsuite/g++.dg/pr64037.C new file mode 100644 index 0000000..e5cd0e2 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr64037.C @@ -0,0 +1,27 @@ +// { dg-do run { target i?86-*-* x86_64-*-* } } +// { dg-options "-std=c++11 -Os" } + +enum class X : unsigned char { + V = 2, +}; + +static void +__attribute__((noinline,noclone)) +foo(unsigned &out, unsigned a, X b) +{ + out = static_cast<unsigned>(b); +} + +int main() +{ + unsigned deadbeef = 0xDEADBEEF; + asm volatile ("" : "+d" (deadbeef), "+c" (deadbeef)); + + unsigned out; + foo(out, 2, X::V); + + if (out != 2) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/g++.dg/torture/pr61558.C b/gcc/testsuite/g++.dg/torture/pr61558.C new file mode 100644 index 0000000..1e398e9 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr61558.C @@ -0,0 +1,6 @@ +// { dg-do compile } +static __typeof 0 a __attribute__ ((__weakref__ (""))); +template <typename> class A +{ + static __thread int b; +}; diff --git a/gcc/testsuite/g++.dg/torture/pr64312.C b/gcc/testsuite/g++.dg/torture/pr64312.C new file mode 100644 index 0000000..dc3e95d --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr64312.C @@ -0,0 +1,123 @@ +// { dg-do compile } + +template <typename C> struct A +{ + typedef typename C::iterator type; +}; +template <typename T2> struct B +{ + typedef T2 type; +}; +template <typename F2> struct L +{ + typedef typename B<F2>::type::type type; +}; +template <typename C> struct M +{ + typedef typename L<A<C> >::type type; +}; +class C +{ +public: + typedef int iterator; +}; +template <class IteratorT> class D +{ +public: + typedef IteratorT iterator; + template <class Iterator> D (Iterator p1, Iterator) : m_Begin (p1), m_End (0) + { + } + IteratorT m_Begin; + IteratorT m_End; +}; +template <class IteratorT> class I : public D<IteratorT> +{ +protected: + template <class Iterator> + I (Iterator p1, Iterator p2) + : D<IteratorT> (p1, p2) + { + } +}; +class F +{ +public: + int elems[]; + int * + m_fn1 () + { + return elems; + } +}; +class G +{ +public: + void * + m_fn2 (int) + { + return m_buffer.m_fn1 (); + } + F m_buffer; +}; +struct any_incrementable_iterator_interface +{ + virtual ~any_incrementable_iterator_interface () {} +}; +class J : public any_incrementable_iterator_interface +{ +public: + J (int) : m_it () {} + int m_it; +}; +void *operator new(__SIZE_TYPE__, void *p2) { return p2; } +template <class T> typename M<T>::type begin (T) { return 0; } +template <class T> typename M<T>::type end (T) {} +template <class> class any_iterator +{ +public: + template <class WrappedIterator> any_iterator (WrappedIterator) + { + void *ptr = m_buffer.m_fn2 (0); + m_impl = new (ptr) J (0); + } + ~any_iterator () + { + if (m_impl) + m_impl->~any_incrementable_iterator_interface (); + } + G m_buffer; + any_incrementable_iterator_interface *m_impl; +}; +template <class Reference> class K : public I<any_iterator<Reference> > +{ +public: + template <class WrappedRange> + K (WrappedRange p1) + : I<any_iterator<Reference> > (begin (p1), end (p1)) + { + } +}; +template <class Reference> struct H +{ + typedef K<Reference> type; +}; +template <class, class, class, class, class, class TargetReference> +void +mix_values_impl () +{ + C test_data; + H<int>::type source_data (test_data); + typename H<TargetReference>::type t2 = source_data; +} +template <class> +void +mix_values_driver () +{ + mix_values_impl<int, int, int, int, int, int &> (); +} +void +mix_values () +{ + mix_values_driver<int> (); +} diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr61034.C b/gcc/testsuite/g++.dg/tree-ssa/pr61034.C index fe09df3..9ec3995 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr61034.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr61034.C @@ -5,6 +5,8 @@ inline void* operator new(__SIZE_TYPE__ n){ return __builtin_malloc(n); } inline void operator delete(void *p) { __builtin_free(p); } +// C++14 sized deallocation function +inline void operator delete(void *p, __SIZE_TYPE__) { __builtin_free(p); } struct O { double num; int count; diff --git a/gcc/testsuite/gcc.dg/ipa/pr63551.c b/gcc/testsuite/gcc.dg/ipa/pr63551.c index 676c2c2..48b020a 100644 --- a/gcc/testsuite/gcc.dg/ipa/pr63551.c +++ b/gcc/testsuite/gcc.dg/ipa/pr63551.c @@ -21,7 +21,7 @@ void fn2 () { d = 0; - union U b = { 4294967286 }; + union U b = { 4294967286U }; fn1 (b); } diff --git a/gcc/testsuite/gcc.dg/pr63804.c b/gcc/testsuite/gcc.dg/pr63804.c new file mode 100644 index 0000000..f0a02f2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr63804.c @@ -0,0 +1,52 @@ +/* PR rtl-optimization/63804 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -g" } */ + +struct A { int gen; } e; +int a, d; +long b; +enum B { C }; +struct D +{ + enum B type : 1; + int nr : 1; + struct { unsigned ud; } dw1; +}; +enum B c; + +void +fn1 (int p1) +{ + b = p1 & a; +} + +int fn2 (); +void fn3 (); + +void +fn4 (struct D p1, unsigned p2, int p3) +{ + struct D f, g, h, j = p1, l, m = l; + struct A i = e; + if (i.gen) + p2 = 0; + j.type = c; + g = j; + p1 = g; + fn3 (); + int k = p2, v = p1.nr, p = v; + m.dw1.ud = k; + f = m; + h = f; + struct D n = h; + fn3 (n); + { + d = fn2 (); + int o = d; + fn1 (o); + } + if (i.gen) + fn3 (p1); + b = p & a; + fn3 (p3); +} diff --git a/gcc/testsuite/gcc.dg/pr64295.c b/gcc/testsuite/gcc.dg/pr64295.c new file mode 100644 index 0000000..4882f32 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr64295.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O -frounding-math -funsafe-math-optimizations" } */ + +double +f (double g) +{ + return g / 3; +} diff --git a/gcc/testsuite/gcc.dg/pr64316.c b/gcc/testsuite/gcc.dg/pr64316.c new file mode 100644 index 0000000..f478aa6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr64316.c @@ -0,0 +1,42 @@ +/* PR rtl-optimization/64316 */ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ +/* { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } } */ + +struct S +{ + unsigned int s; + unsigned long w[]; +}; + +struct S **s; + +int +foo (struct S *x, struct S *y, struct S *z) +{ + unsigned int i; + unsigned long *a, *b, *c; + int r = 0; + for (a = x->w, b = y->w, c = z->w, i = 0; i < x->s; i++, a++) + { + unsigned long d = *b++ & *c++; + if (*a != d) + { + r = 1; + *a = d; + } + } + return r; +} + +void +bar (int x) +{ + int p = x - 1; + do + { + foo (s[x], s[x], s[p]); + p--; + } + while (p > 0); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr61602.c b/gcc/testsuite/gcc.dg/torture/pr61602.c new file mode 100644 index 0000000..51a6755 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr61602.c @@ -0,0 +1,8 @@ +int a; +int *b = &a, **c = &b; +int +main () +{ + int **d = &b; + *d = 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr64284.c b/gcc/testsuite/gcc.dg/torture/pr64284.c new file mode 100644 index 0000000..4254381 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr64284.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ + +int *a; +int b; +int +fn1() { + enum { QSTRING } c = 0; + while (1) { + switch (*a) { + case '\'': + c = 0; + default: + switch (c) + case 0: + if (b) + return 0; + c = 1; + } + a++; + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx512f-broadcast-gpr-1.c b/gcc/testsuite/gcc.target/i386/avx512f-broadcast-gpr-1.c index 7238c6a..6b85c42 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-broadcast-gpr-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-broadcast-gpr-1.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-mavx512f -O2" } */ /* { dg-final { scan-assembler-times "vpbroadcastq\[ \\t\]+%r\[^\n\]+%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 { target { ! { ia32 } } } } } */ -/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%e\[^\n\]+%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 { target { ! { ia32 } } } } } */ +/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%(?:e|r\[0-9\]+d)\[^\n\]+%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 { target { ! { ia32 } } } } } */ /* { dg-final { scan-assembler-times "vpbroadcastq\[ \\t\]+\[^\n\]+%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 { target ia32 } } } */ /* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+\[^\n\]+%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 { target ia32 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-1.c b/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-1.c index 5d37f12..bd111b0 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpbroadcastd-1.c @@ -3,9 +3,9 @@ /* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 2 } } */ -/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%e\[^\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%e\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%e\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c index 94f7946..6930f79 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c @@ -4,14 +4,14 @@ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\\(\[^\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\\(\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\\(\[^\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 { target nonpic } } } */ +/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\\(\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 { target nonpic } } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*\\)\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n^x^y\]*\\(.{5}(?:\n|\[ \\t\]+#)" 1 } } */ -/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n^x^y\]*\\((?:\n|\[ \\t\]+#)" 1 { xfail *-*-* } } } */ +/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\nxy\]*\\(.{5}(?:\n|\[ \\t\]+#)" 1 { target nonpic } } } */ +/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\nxy\]*\\((?:\n|\[ \\t\]+#)" 1 { xfail *-*-* } } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*\\)\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*\\)\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-vpbroadcastd-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-vpbroadcastd-1.c index d6b30ef..68d6247 100644 --- a/gcc/testsuite/gcc.target/i386/avx512vl-vpbroadcastd-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512vl-vpbroadcastd-1.c @@ -4,10 +4,10 @@ /* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ /* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 2 } } */ -/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%e\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 { target { ! { ia32 } } } } } */ -/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%e\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 { target { ! { ia32 } } } } } */ -/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%e\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 { target { ! { ia32 } } } } } */ -/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%e\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 { target { ! { ia32 } } } } } */ +/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 { target { ! { ia32 } } } } } */ +/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 { target { ! { ia32 } } } } } */ +/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 { target { ! { ia32 } } } } } */ +/* { dg-final { scan-assembler-times "vpbroadcastd\[ \\t\]+%(?:e|r\[0-9\]+d)\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 { target { ! { ia32 } } } } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gfortran.dg/coarray_collectives_14.f90 b/gcc/testsuite/gfortran.dg/coarray_collectives_14.f90 index c2f1939..6d53411 100644 --- a/gcc/testsuite/gfortran.dg/coarray_collectives_14.f90 +++ b/gcc/testsuite/gfortran.dg/coarray_collectives_14.f90 @@ -62,7 +62,7 @@ program test call co_reduce(caf, arg3) ! { dg-error "shall have two arguments" } call co_reduce(caf, dt%arg3) ! { dg-error "shall have two arguments" } call co_reduce(caf, elem) ! { dg-error "ELEMENTAL non-INTRINSIC procedure 'elem' is not allowed as an actual argument" } - call co_reduce(caf, dt%elem) ! { FIXME: "ELEMENTAL non-INTRINSIC procedure 'elem' is not allowed as an actual argument" } + call co_reduce(caf, dt%elem) ! { dg-error "ELEMENTAL procedure pointer component 'elem' is not allowed as an actual argument" } call co_reduce(caf, realo) ! { dg-error "A argument at .1. has type INTEGER.4. but the function passed as OPERATOR at .2. returns REAL.4." } call co_reduce(caf, dt%realo) ! { dg-error "A argument at .1. has type INTEGER.4. but the function passed as OPERATOR at .2. returns REAL.4." } call co_reduce(caf, int8) ! { dg-error "A argument at .1. has type INTEGER.4. but the function passed as OPERATOR at .2. returns INTEGER.8." } diff --git a/gcc/testsuite/gfortran.dg/forall_5.f90 b/gcc/testsuite/gfortran.dg/forall_5.f90 index 43ed2b5..55491f5 100644 --- a/gcc/testsuite/gfortran.dg/forall_5.f90 +++ b/gcc/testsuite/gfortran.dg/forall_5.f90 @@ -18,14 +18,14 @@ end module foo logical :: s(n) a = 0 - forall (i=1:n, foot (i)) a(i) = i ! { dg-error "non-PURE" } + forall (i=1:n, foot (i)) a(i) = i ! { dg-error "impure" } if (any (a .ne. (/0,2,3,0/))) call abort () - forall (i=1:n, s (i) .or. t(i)) a(i) = i ! { dg-error "non-PURE|LOGICAL" } + forall (i=1:n, s (i) .or. t(i)) a(i) = i ! { dg-error "impure|LOGICAL" } if (any (a .ne. (/0,3,2,1/))) call abort () a = 0 - forall (i=1:n, mod (i, 2) == 0) a(i) = w (i) ! { dg-error "non-PURE" } + forall (i=1:n, mod (i, 2) == 0) a(i) = w (i) ! { dg-error "impure" } if (any (a .ne. (/0,2,0,4/))) call abort () contains diff --git a/gcc/testsuite/gfortran.dg/pr61669.f90 b/gcc/testsuite/gfortran.dg/pr61669.f90 new file mode 100644 index 0000000..5bceafd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr61669.f90 @@ -0,0 +1,7 @@ +! { dg-do compile } + write (*,"(a)") char(12) + CHARACTER*80 A /"A"/ ! { dg-error "Unexpected data declaration statement" } + REAL*4 B ! { dg-error "Unexpected data declaration statement" } + write (*,"(a)") char(12) + DATA B / 0.02 / ! { dg-warning "Obsolescent feature: DATA statement" } + END diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_39.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_39.f90 new file mode 100644 index 0000000..8294ddc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_39.f90 @@ -0,0 +1,32 @@ +! { dg-do compile } +! +! PR 63674: [F03] procedure pointer and non/pure procedure +! +! Contributed by Valery Weber <valeryweber@hotmail.com> + +program prog + interface + integer function nf() + end function + pure integer function pf() + end function + subroutine ns() + end subroutine + pure subroutine ps() + end subroutine + end interface + type :: t + procedure(nf), nopass, pointer :: nf => NULL() ! non-pure function + procedure(pf), nopass, pointer :: pf => NULL() ! pure function + procedure(ns), nopass, pointer :: ns => NULL() ! non-pure subroutine + procedure(ps), nopass, pointer :: ps => NULL() ! pure subroutine + end type +contains + pure integer function eval(a) + type(t), intent(in) :: a + eval = a%pf() + eval = a%nf() ! { dg-error "Reference to impure function" } + call a%ps() + call a%ns() ! { dg-error "is not PURE" } + end function +end diff --git a/gcc/testsuite/gfortran.dg/pure_dummy_length_1.f90 b/gcc/testsuite/gfortran.dg/pure_dummy_length_1.f90 index c1bc172..407780d 100644 --- a/gcc/testsuite/gfortran.dg/pure_dummy_length_1.f90 +++ b/gcc/testsuite/gfortran.dg/pure_dummy_length_1.f90 @@ -24,6 +24,6 @@ character(*), intent(in) :: string
integer(4), intent(in) :: ignore_case
integer i
- if (end > impure (self)) & ! { dg-error "non-PURE procedure" }
+ if (end > impure (self)) & ! { dg-error "impure function" }
return
end function
diff --git a/gcc/testsuite/gfortran.dg/stfunc_6.f90 b/gcc/testsuite/gfortran.dg/stfunc_6.f90 index 482d125..37137fb 100644 --- a/gcc/testsuite/gfortran.dg/stfunc_6.f90 +++ b/gcc/testsuite/gfortran.dg/stfunc_6.f90 @@ -17,12 +17,12 @@ FORALL(i=1:4) a(i) = u (a(i)) - a(i)** 2 if (any (a .ne. 0)) call abort () if (i .ne. 99) call abort () - FORALL (i=1:4) a(i) = st3 (i) ! { dg-error "non-PURE function" "non-PURE reference in FORALL" { xfail *-*-*} } - FORALL (i=1:4) a(i) = v(i) ! { dg-error "non-PURE function" } + FORALL (i=1:4) a(i) = st3 (i) ! { dg-error "impure function" "impure reference in FORALL" { xfail *-*-*} } + FORALL (i=1:4) a(i) = v(i) ! { dg-error "impure function" } contains pure integer function u (x) integer,intent(in) :: x - st2 (i) = i * v(i) ! { dg-error "non-PURE procedure" } + st2 (i) = i * v(i) ! { dg-error "impure function" } u = st2(x) end function integer function v (x) diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_4.f03 b/gcc/testsuite/gfortran.dg/typebound_operator_4.f03 index 6ede14e..f9a2612 100644 --- a/gcc/testsuite/gfortran.dg/typebound_operator_4.f03 +++ b/gcc/testsuite/gfortran.dg/typebound_operator_4.f03 @@ -63,8 +63,8 @@ CONTAINS TYPE(myint) :: x x = 0 ! { dg-bogus "is not PURE" } - x = x + 42 ! { dg-bogus "to a non-PURE procedure" } - x = x .PLUS. 5 ! { dg-bogus "to a non-PURE procedure" } + x = x + 42 ! { dg-bogus "to a impure procedure" } + x = x .PLUS. 5 ! { dg-bogus "to a impure procedure" } END SUBROUTINE iampure END MODULE m @@ -75,8 +75,8 @@ PURE SUBROUTINE iampure2 () TYPE(myreal) :: x x = 0.0 ! { dg-error "is not PURE" } - x = x + 42.0 ! { dg-error "to a non-PURE procedure" } - x = x .PLUS. 5.0 ! { dg-error "to a non-PURE procedure" } + x = x + 42.0 ! { dg-error "impure function" } + x = x .PLUS. 5.0 ! { dg-error "impure function" } END SUBROUTINE iampure2 PROGRAM main diff --git a/gcc/testsuite/gnat.dg/opt46.adb b/gcc/testsuite/gnat.dg/opt46.adb new file mode 100644 index 0000000..64e0b63 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt46.adb @@ -0,0 +1,45 @@ +-- { dg-do compile } +-- { dg-options "-O" } + +with Ada.Unchecked_Deallocation; + +with Opt46_Pkg; + +package body Opt46 is + + type Pattern is abstract tagged null record; + + type Pattern_Access is access Pattern'Class; + + procedure Free is new Ada.Unchecked_Deallocation + (Pattern'Class, Pattern_Access); + + type Action is abstract tagged null record; + + type Action_Access is access Action'Class; + + procedure Free is new Ada.Unchecked_Deallocation + (Action'Class, Action_Access); + + type Pattern_Action is record + Pattern : Pattern_Access; + Action : Action_Access; + end record; + + package Pattern_Action_Table is new Opt46_Pkg (Pattern_Action, Natural, 1); + + type Session_Data is record + Filters : Pattern_Action_Table.Instance; + end record; + + procedure Close (Session : Session_Type) is + Filters : Pattern_Action_Table.Instance renames Session.Data.Filters; + begin + for F in 1 .. Pattern_Action_Table.Last (Filters) loop + Free (Filters.Table (F).Pattern); + Free (Filters.Table (F).Action); + end loop; + + end Close; + +end Opt46; diff --git a/gcc/testsuite/gnat.dg/opt46.ads b/gcc/testsuite/gnat.dg/opt46.ads new file mode 100644 index 0000000..5a5175d --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt46.ads @@ -0,0 +1,16 @@ +package Opt46 is + + type Session_Type is limited private; + + procedure Close (Session : Session_Type); + +private + + type Session_Data; + type Session_Data_Access is access Session_Data; + + type Session_Type is record + Data : Session_Data_Access; + end record; + +end Opt46; diff --git a/gcc/testsuite/gnat.dg/opt46_pkg.adb b/gcc/testsuite/gnat.dg/opt46_pkg.adb new file mode 100644 index 0000000..26f67cc --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt46_pkg.adb @@ -0,0 +1,8 @@ +package body Opt46_Pkg is + + function Last (T : Instance) return Table_Index_Type is + begin + return Table_Index_Type (T.P.Last_Val); + end Last; + +end Opt46_Pkg; diff --git a/gcc/testsuite/gnat.dg/opt46_pkg.ads b/gcc/testsuite/gnat.dg/opt46_pkg.ads new file mode 100644 index 0000000..1309315 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt46_pkg.ads @@ -0,0 +1,31 @@ +generic + type Table_Component_Type is private; + type Table_Index_Type is range <>; + + Table_Low_Bound : Table_Index_Type; + +package Opt46_Pkg is + + type Table_Type is + array (Table_Index_Type range <>) of Table_Component_Type; + subtype Big_Table_Type is + Table_Type (Table_Low_Bound .. Table_Index_Type'Last); + + type Table_Ptr is access all Big_Table_Type; + + type Table_Private is private; + + type Instance is record + Table : aliased Table_Ptr := null; + P : Table_Private; + end record; + + function Last (T : Instance) return Table_Index_Type; + +private + + type Table_Private is record + Last_Val : Integer; + end record; + +end Opt46_Pkg; diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index d7a4742..9902723 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -2161,7 +2161,7 @@ vn_reference_lookup_pieces (tree vuse, alias_set_type set, tree type, (vn_reference_t)walk_non_aliased_vuses (&r, vr1.vuse, vn_reference_lookup_2, vn_reference_lookup_3, - vn_valueize, &vr1); + vuse_ssa_val, &vr1); gcc_checking_assert (vr1.operands == shared_lookup_references); } @@ -2214,7 +2214,7 @@ vn_reference_lookup (tree op, tree vuse, vn_lookup_kind kind, (vn_reference_t)walk_non_aliased_vuses (&r, vr1.vuse, vn_reference_lookup_2, vn_reference_lookup_3, - vn_valueize, &vr1); + vuse_ssa_val, &vr1); gcc_checking_assert (vr1.operands == shared_lookup_references); if (wvnresult) { diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index 12f83ba..c7a476a 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -2364,7 +2364,7 @@ duplicate_seme_region (edge entry, edge exit, basic_block *region_copy) { unsigned i; - bool free_region_copy = false, copying_header = false; + bool free_region_copy = false; struct loop *loop = entry->dest->loop_father; edge exit_copy; edge redirected; @@ -2388,10 +2388,7 @@ duplicate_seme_region (edge entry, edge exit, initialize_original_copy_tables (); - if (copying_header) - set_loop_copy (loop, loop_outer (loop)); - else - set_loop_copy (loop, loop); + set_loop_copy (loop, loop); if (!region_copy) { @@ -2453,6 +2450,8 @@ duplicate_seme_region (edge entry, edge exit, } /* Redirect the entry and add the phi node arguments. */ + if (entry->dest == loop->header) + mark_loop_for_removal (loop); redirected = redirect_edge_and_branch (entry, get_bb_copy (entry->dest)); gcc_assert (redirected != NULL); flush_pending_stmts (entry); @@ -11864,12 +11864,17 @@ virtual_method_call_p (tree target) { if (TREE_CODE (target) != OBJ_TYPE_REF) return false; - target = TREE_TYPE (target); - gcc_checking_assert (TREE_CODE (target) == POINTER_TYPE); - target = TREE_TYPE (target); - if (TREE_CODE (target) == FUNCTION_TYPE) + tree t = TREE_TYPE (target); + gcc_checking_assert (TREE_CODE (t) == POINTER_TYPE); + t = TREE_TYPE (t); + if (TREE_CODE (t) == FUNCTION_TYPE) + return false; + gcc_checking_assert (TREE_CODE (t) == METHOD_TYPE); + /* If we do not have BINFO associated, it means that type was built + without devirtualization enabled. Do not consider this a virtual + call. */ + if (!TYPE_BINFO (obj_type_ref_class (target))) return false; - gcc_checking_assert (TREE_CODE (target) == METHOD_TYPE); return true; } @@ -652,25 +652,24 @@ instrument_memory_accesses (void) static void instrument_func_entry (void) { - basic_block succ_bb; - gimple_stmt_iterator gsi; tree ret_addr, builtin_decl; gimple g; - - succ_bb = single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun)); - gsi = gsi_after_labels (succ_bb); + gimple_seq seq = NULL; builtin_decl = builtin_decl_implicit (BUILT_IN_RETURN_ADDRESS); g = gimple_build_call (builtin_decl, 1, integer_zero_node); ret_addr = make_ssa_name (ptr_type_node); gimple_call_set_lhs (g, ret_addr); gimple_set_location (g, cfun->function_start_locus); - gsi_insert_before (&gsi, g, GSI_SAME_STMT); + gimple_seq_add_stmt_without_update (&seq, g); - builtin_decl = builtin_decl_implicit (BUILT_IN_TSAN_FUNC_ENTRY); + builtin_decl = builtin_decl_implicit (BUILT_IN_TSAN_FUNC_ENTRY); g = gimple_build_call (builtin_decl, 1, ret_addr); gimple_set_location (g, cfun->function_start_locus); - gsi_insert_before (&gsi, g, GSI_SAME_STMT); + gimple_seq_add_stmt_without_update (&seq, g); + + edge e = single_succ_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun)); + gsi_insert_seq_on_edge_immediate (e, seq); } /* Instruments function exits. */ @@ -1574,7 +1574,10 @@ vec<T, va_heap, vl_ptr>::safe_grow (unsigned len MEM_STAT_DECL) unsigned oldlen = length (); gcc_checking_assert (oldlen <= len); reserve_exact (len - oldlen PASS_MEM_STAT); - m_vec->quick_grow (len); + if (m_vec) + m_vec->quick_grow (len); + else + gcc_checking_assert (len == 0); } diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 285832a..0ce1a7a 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,10 @@ +2014-12-15 Uros Bizjak <ubizjak@gmail.com> + + PR libgcc/63832 + * crtstuff.c (__do_global_dtors_aux) [HIDDEN_DTOR_LIST_END]: Use + func_ptr *dtor_list temporary variable to avoid "array subscript + is above array bounds" warnings. + 2014-12-09 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> * Makefile.in (with_aix_soname): Define. @@ -809,7 +816,7 @@ PR libgcc/60472 * crtstuff.c (frame_dummy): Use void **jcr_list temporary - variable to avoid array subscript is above array bounds warnings. + variable to avoid "array subscript is above array bounds" warnings. Use __builtin_expect when checking *jcr_list for NULL. 2014-03-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c index 62a4b42..0432794 100644 --- a/libgcc/crtstuff.c +++ b/libgcc/crtstuff.c @@ -393,13 +393,11 @@ __do_global_dtors_aux (void) extern func_ptr __DTOR_END__[] __attribute__((visibility ("hidden"))); static size_t dtor_idx; const size_t max_idx = __DTOR_END__ - __DTOR_LIST__ - 1; - func_ptr f; + func_ptr *dtor_list; + __asm ("" : "=g" (dtor_list) : "0" (__DTOR_LIST__)); while (dtor_idx < max_idx) - { - f = __DTOR_LIST__[++dtor_idx]; - f (); - } + dtor_list[++dtor_idx] (); } #else /* !defined (FINI_ARRAY_SECTION_ASM_OP) */ { diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4e79925..2f8c54b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2014-12-15 Jason Merrill <jason@redhat.com> + + * libsupc++/del_ops.cc: New. + * libsupc++/del_opvs.cc: New. + * libsupc++/Makefile.am: Add them. + * libsupc++/Makefile.in: Regenerate. + * config/abi/pre/gnu.ver: Export _ZdlPvm and _ZdaPvm. + 2014-12-13 Tim Shen <timshen@google.com> PR libstdc++/64239 diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver index c73ebe7..9b51659 100644 --- a/libstdc++-v3/config/abi/pre/gnu.ver +++ b/libstdc++-v3/config/abi/pre/gnu.ver @@ -1733,6 +1733,11 @@ CXXABI_1.3.9 { _ZTSP[no]; _ZTSPK[no]; + # operator delete(void*, std::size_t) + _ZdlPvm; + # operator delete[](void*, std::size_t) + _ZdaPvm; + } CXXABI_1.3.8; # Symbols in the support library (libsupc++) supporting transactional memory. diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am index 679d717..2e60f652 100644 --- a/libstdc++-v3/libsupc++/Makefile.am +++ b/libstdc++-v3/libsupc++/Makefile.am @@ -55,8 +55,10 @@ sources = \ bad_typeid.cc \ class_type_info.cc \ del_op.cc \ + del_ops.cc \ del_opnt.cc \ del_opv.cc \ + del_opvs.cc \ del_opvnt.cc \ dyncast.cc \ eh_alloc.cc \ diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in index 88b237e..1c7270a 100644 --- a/libstdc++-v3/libsupc++/Makefile.in +++ b/libstdc++-v3/libsupc++/Makefile.in @@ -93,17 +93,18 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) libsupc___la_LIBADD = am__objects_1 = array_type_info.lo atexit_arm.lo atexit_thread.lo \ bad_alloc.lo bad_array_length.lo bad_array_new.lo bad_cast.lo \ - bad_typeid.lo class_type_info.lo del_op.lo del_opnt.lo \ - del_opv.lo del_opvnt.lo dyncast.lo eh_alloc.lo eh_arm.lo \ - eh_aux_runtime.lo eh_call.lo eh_catch.lo eh_exception.lo \ - eh_globals.lo eh_personality.lo eh_ptr.lo eh_term_handler.lo \ - eh_terminate.lo eh_tm.lo eh_throw.lo eh_type.lo \ - eh_unex_handler.lo enum_type_info.lo function_type_info.lo \ - fundamental_type_info.lo guard.lo guard_error.lo hash_bytes.lo \ - nested_exception.lo new_handler.lo new_op.lo new_opnt.lo \ - new_opv.lo new_opvnt.lo pbase_type_info.lo pmem_type_info.lo \ - pointer_type_info.lo pure.lo si_class_type_info.lo tinfo.lo \ - tinfo2.lo vec.lo vmi_class_type_info.lo vterminate.lo + bad_typeid.lo class_type_info.lo del_op.lo del_ops.lo \ + del_opnt.lo del_opv.lo del_opvs.lo del_opvnt.lo dyncast.lo \ + eh_alloc.lo eh_arm.lo eh_aux_runtime.lo eh_call.lo eh_catch.lo \ + eh_exception.lo eh_globals.lo eh_personality.lo eh_ptr.lo \ + eh_term_handler.lo eh_terminate.lo eh_tm.lo eh_throw.lo \ + eh_type.lo eh_unex_handler.lo enum_type_info.lo \ + function_type_info.lo fundamental_type_info.lo guard.lo \ + guard_error.lo hash_bytes.lo nested_exception.lo \ + new_handler.lo new_op.lo new_opnt.lo new_opv.lo new_opvnt.lo \ + pbase_type_info.lo pmem_type_info.lo pointer_type_info.lo \ + pure.lo si_class_type_info.lo tinfo.lo tinfo2.lo vec.lo \ + vmi_class_type_info.lo vterminate.lo @GLIBCXX_HOSTED_TRUE@am__objects_2 = cp-demangle.lo @ENABLE_VTABLE_VERIFY_TRUE@am__objects_3 = vtv_stubs.lo am_libsupc___la_OBJECTS = $(am__objects_1) $(am__objects_2) \ @@ -381,8 +382,10 @@ sources = \ bad_typeid.cc \ class_type_info.cc \ del_op.cc \ + del_ops.cc \ del_opnt.cc \ del_opv.cc \ + del_opvs.cc \ del_opvnt.cc \ dyncast.cc \ eh_alloc.cc \ diff --git a/libstdc++-v3/libsupc++/del_ops.cc b/libstdc++-v3/libsupc++/del_ops.cc new file mode 100644 index 0000000..d97815e --- /dev/null +++ b/libstdc++-v3/libsupc++/del_ops.cc @@ -0,0 +1,33 @@ +// Boilerplate support routines for -*- C++ -*- dynamic memory management. + +// Copyright (C) 1997-2014 Free Software Foundation, Inc. +// +// This file is part of GCC. +// +// GCC 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 3, or (at your option) +// any later version. +// +// GCC 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. +// +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// <http://www.gnu.org/licenses/>. + +#include <bits/c++config.h> +#include "new" + +_GLIBCXX_WEAK_DEFINITION void +operator delete(void* ptr, std::size_t) _GLIBCXX_USE_NOEXCEPT +{ + ::operator delete (ptr); +} diff --git a/libstdc++-v3/libsupc++/del_opvs.cc b/libstdc++-v3/libsupc++/del_opvs.cc new file mode 100644 index 0000000..11bae1e --- /dev/null +++ b/libstdc++-v3/libsupc++/del_opvs.cc @@ -0,0 +1,33 @@ +// Boilerplate support routines for -*- C++ -*- dynamic memory management. + +// Copyright (C) 1997-2014 Free Software Foundation, Inc. +// +// This file is part of GCC. +// +// GCC 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 3, or (at your option) +// any later version. +// +// GCC 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. +// +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// <http://www.gnu.org/licenses/>. + +#include <bits/c++config.h> +#include "new" + +_GLIBCXX_WEAK_DEFINITION void +operator delete[] (void *ptr, std::size_t) _GLIBCXX_USE_NOEXCEPT +{ + ::operator delete[] (ptr); +} |