From 9f285ccb77a109ba94788f71ac83d4d46299ea9f Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 14 Apr 2016 12:23:06 -0400 Subject: [PATCH] Revert empty class parameter passing ABI changes. From-SVN: r234977 --- gcc/ChangeLog | 4 + gcc/cfgexpand.c | 10 -- gcc/cp/ChangeLog | 5 + gcc/cp/call.c | 107 +----------------- gcc/cp/cp-tree.h | 6 - gcc/cp/decl.c | 24 +--- gcc/cp/error.c | 22 ---- gcc/expr.c | 7 -- gcc/testsuite/g++.dg/abi/empty12.C | 17 --- gcc/testsuite/g++.dg/abi/empty12.h | 9 -- gcc/testsuite/g++.dg/abi/empty12a.c | 6 - gcc/testsuite/g++.dg/abi/empty13.C | 17 --- gcc/testsuite/g++.dg/abi/empty13.h | 9 -- gcc/testsuite/g++.dg/abi/empty13a.c | 6 - gcc/testsuite/g++.dg/abi/empty14.C | 17 --- gcc/testsuite/g++.dg/abi/empty14.h | 10 -- gcc/testsuite/g++.dg/abi/empty14a.c | 6 - gcc/testsuite/g++.dg/abi/empty15.C | 17 --- gcc/testsuite/g++.dg/abi/empty15.h | 30 ----- gcc/testsuite/g++.dg/abi/empty15a.c | 6 - gcc/testsuite/g++.dg/abi/empty16.C | 17 --- gcc/testsuite/g++.dg/abi/empty16.h | 16 --- gcc/testsuite/g++.dg/abi/empty16a.c | 6 - gcc/testsuite/g++.dg/abi/empty17.C | 17 --- gcc/testsuite/g++.dg/abi/empty17.h | 27 ----- gcc/testsuite/g++.dg/abi/empty17a.c | 6 - gcc/testsuite/g++.dg/abi/empty18.C | 17 --- gcc/testsuite/g++.dg/abi/empty18.h | 9 -- gcc/testsuite/g++.dg/abi/empty18a.c | 6 - gcc/testsuite/g++.dg/abi/empty19.C | 17 --- gcc/testsuite/g++.dg/abi/empty19.h | 10 -- gcc/testsuite/g++.dg/abi/empty19a.c | 6 - gcc/testsuite/g++.dg/abi/empty20.C | 25 ---- gcc/testsuite/g++.dg/abi/empty21.C | 21 ---- gcc/testsuite/g++.dg/abi/pr60336-1.C | 17 --- gcc/testsuite/g++.dg/abi/pr60336-10.C | 50 -------- gcc/testsuite/g++.dg/abi/pr60336-11.C | 56 --------- gcc/testsuite/g++.dg/abi/pr60336-12.C | 57 ---------- gcc/testsuite/g++.dg/abi/pr60336-2.C | 48 -------- gcc/testsuite/g++.dg/abi/pr60336-3.C | 15 --- gcc/testsuite/g++.dg/abi/pr60336-4.C | 48 -------- gcc/testsuite/g++.dg/abi/pr60336-5.C | 17 --- gcc/testsuite/g++.dg/abi/pr60336-6.C | 17 --- gcc/testsuite/g++.dg/abi/pr60336-7.C | 17 --- gcc/testsuite/g++.dg/abi/pr60336-8.C | 15 --- gcc/testsuite/g++.dg/abi/pr60336-9.C | 28 ----- gcc/testsuite/g++.dg/abi/pr68355.C | 24 ---- libstdc++-v3/ChangeLog | 4 + libstdc++-v3/include/bits/c++config | 23 +--- libstdc++-v3/include/bits/hashtable.h | 42 ++++--- libstdc++-v3/include/bits/hashtable_policy.h | 4 +- libstdc++-v3/include/bits/shared_ptr.h | 2 - libstdc++-v3/include/bits/shared_ptr_base.h | 6 - libstdc++-v3/include/bits/stl_algo.h | 1 - libstdc++-v3/include/bits/stl_pair.h | 5 - libstdc++-v3/include/bits/uses_allocator.h | 8 -- .../include/ext/pb_ds/assoc_container.hpp | 8 -- .../20_util/scoped_allocator/69293_neg.cc | 2 +- .../20_util/shared_ptr/cons/43820_neg.cc | 2 +- .../20_util/shared_ptr/cons/void_neg.cc | 2 +- .../20_util/uses_allocator/69293_neg.cc | 2 +- .../20_util/uses_allocator/cons_neg.cc | 2 +- .../ext/profile/mutex_extensions_neg.cc | 2 +- 63 files changed, 49 insertions(+), 1010 deletions(-) delete mode 100644 gcc/testsuite/g++.dg/abi/empty12.C delete mode 100644 gcc/testsuite/g++.dg/abi/empty12.h delete mode 100644 gcc/testsuite/g++.dg/abi/empty12a.c delete mode 100644 gcc/testsuite/g++.dg/abi/empty13.C delete mode 100644 gcc/testsuite/g++.dg/abi/empty13.h delete mode 100644 gcc/testsuite/g++.dg/abi/empty13a.c delete mode 100644 gcc/testsuite/g++.dg/abi/empty14.C delete mode 100644 gcc/testsuite/g++.dg/abi/empty14.h delete mode 100644 gcc/testsuite/g++.dg/abi/empty14a.c delete mode 100644 gcc/testsuite/g++.dg/abi/empty15.C delete mode 100644 gcc/testsuite/g++.dg/abi/empty15.h delete mode 100644 gcc/testsuite/g++.dg/abi/empty15a.c delete mode 100644 gcc/testsuite/g++.dg/abi/empty16.C delete mode 100644 gcc/testsuite/g++.dg/abi/empty16.h delete mode 100644 gcc/testsuite/g++.dg/abi/empty16a.c delete mode 100644 gcc/testsuite/g++.dg/abi/empty17.C delete mode 100644 gcc/testsuite/g++.dg/abi/empty17.h delete mode 100644 gcc/testsuite/g++.dg/abi/empty17a.c delete mode 100644 gcc/testsuite/g++.dg/abi/empty18.C delete mode 100644 gcc/testsuite/g++.dg/abi/empty18.h delete mode 100644 gcc/testsuite/g++.dg/abi/empty18a.c delete mode 100644 gcc/testsuite/g++.dg/abi/empty19.C delete mode 100644 gcc/testsuite/g++.dg/abi/empty19.h delete mode 100644 gcc/testsuite/g++.dg/abi/empty19a.c delete mode 100644 gcc/testsuite/g++.dg/abi/empty20.C delete mode 100644 gcc/testsuite/g++.dg/abi/empty21.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr60336-1.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr60336-10.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr60336-11.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr60336-12.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr60336-2.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr60336-3.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr60336-4.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr60336-5.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr60336-6.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr60336-7.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr60336-8.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr60336-9.C delete mode 100644 gcc/testsuite/g++.dg/abi/pr68355.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ca2a9a746008..e56d15bc40de 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2016-04-14 Jason Merrill + + * cfgexpand.c, expr.c: Revert previous change. + 2016-04-14 Cesar Philippidis PR middle-end/70643 diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 4a5cf166869c..1341c14ce2b6 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -73,7 +73,6 @@ along with GCC; see the file COPYING3. If not see #include "builtins.h" #include "tree-chkp.h" #include "rtl-chkp.h" -#include "langhooks.h" /* Some systems use __main in a way incompatible with its use in gcc, in these cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to @@ -6222,15 +6221,6 @@ pass_expand::execute (function *fun) (int) PARAM_VALUE (PARAM_SSP_BUFFER_SIZE)); } - if (warn_abi) - if (tree attr = lookup_attribute ("abi warning", - DECL_ATTRIBUTES (current_function_decl))) - warning_at (DECL_SOURCE_LOCATION (current_function_decl), - OPT_Wabi, "definition of %qs: %s", - identifier_to_locale (lang_hooks.decl_printable_name - (current_function_decl, 1)), - TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (attr)))); - /* Set up parameters and prepare for return, for the function. */ expand_function_start (current_function_decl); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 866b4f2dbba3..4267f65daaa1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2016-04-14 Jason Merrill + + * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty + parameter ABI change. + 2016-04-13 Martin Sebor PR c++/69517 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 687e7bd4dce7..ed234904a63d 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -214,8 +214,6 @@ static void add_candidates (tree, tree, const vec *, tree, tree, tsubst_flags_t); static conversion *merge_conversion_sequences (conversion *, conversion *); static tree build_temp (tree, tree, int, diagnostic_t *, tsubst_flags_t); -static bool pass_as_empty_struct (tree type); -static tree empty_class_arg (tree); /* Returns nonzero iff the destructor name specified in NAME matches BASETYPE. NAME can take many forms... */ @@ -381,31 +379,16 @@ build_call_a (tree function, int n, tree *argarray) /* Don't pass empty class objects by value. This is useful for tags in STL, which are used to control overload resolution. We don't need to handle other cases of copying empty classes. */ - bool warned = false; - if (decl && !TREE_PUBLIC (decl)) - /* Don't warn about the ABI of a function local to this TU. */ - warned = true; - tree empty_arg = NULL_TREE; if (! decl || ! DECL_BUILT_IN (decl)) for (i = 0; i < n; i++) { tree arg = CALL_EXPR_ARG (function, i); - tree type = TREE_TYPE (arg); - if (is_really_empty_class (type) - && ! TREE_ADDRESSABLE (type)) + if (is_empty_class (TREE_TYPE (arg)) + && ! TREE_ADDRESSABLE (TREE_TYPE (arg))) { - empty_arg = arg; - CALL_EXPR_ARG (function, i) = empty_class_arg (arg); - } - /* Warn about ABI changes for a non-final argument. */ - else if (!warned && empty_arg) - { - location_t loc = EXPR_LOC_OR_LOC (empty_arg, input_location); - if (decl && !varargs_function_p (decl)) - mark_for_abi_warning (decl, empty_arg); - else - warn_empty_class_abi (empty_arg, loc); - warned = true; + tree t = build0 (EMPTY_CLASS_EXPR, TREE_TYPE (arg)); + arg = build2 (COMPOUND_EXPR, TREE_TYPE (t), arg, t); + CALL_EXPR_ARG (function, i) = arg; } } @@ -6889,15 +6872,6 @@ build_x_va_arg (source_location loc, tree expr, tree type) expr = build_va_arg (loc, expr, ref); return convert_from_reference (expr); } - else if (is_really_empty_class (type) && !TREE_ADDRESSABLE (type)) - { - /* Do the reverse of empty_class_arg. */ - tree etype = pass_as_empty_struct (type) ? empty_struct_type : type; - expr = build_va_arg (loc, expr, etype); - warn_empty_class_abi (type, loc); - tree ec = build0 (EMPTY_CLASS_EXPR, type); - return build2 (COMPOUND_EXPR, type, expr, ec); - } return build_va_arg (loc, expr, type); } @@ -6994,75 +6968,6 @@ convert_default_arg (tree type, tree arg, tree fn, int parmnum, return arg; } -/* Return true iff TYPE should be passed and returned as a size 0 type rather - than its normal size, for compatibility with C. */ - -static bool -pass_as_empty_struct (tree type) -{ - return (abi_version_at_least (10) - && type != error_mark_node - && COMPLETE_TYPE_P (type) - && !TREE_ADDRESSABLE (type) - && is_really_empty_class (type)); -} - -/* Adjust the value VAL of empty class type TYPE for argument passing. - Keep this synced with build_x_va_arg. */ - -static tree -empty_class_arg (tree val) -{ - /* Don't pass empty class objects by value. This is useful - for tags in STL, which are used to control overload resolution. - We don't need to handle other cases of copying empty classes. */ - tree type = TREE_TYPE (val); - tree etype = pass_as_empty_struct (type) ? empty_struct_type : type; - tree empty = build0 (EMPTY_CLASS_EXPR, etype); - return build2 (COMPOUND_EXPR, etype, val, empty); -} - -/* Generate a message warning about the change in empty class parameter passing - ABI. */ - -static tree -empty_class_msg (tree type) -{ - if (!TYPE_P (type)) - type = TREE_TYPE (type); - - return pp_format_to_string ("empty class %qT parameter passing ABI " - "changes in -fabi-version=10 (GCC 6)", type); -} - -/* Warn immediately about the change in empty class parameter ABI. */ - -void -warn_empty_class_abi (tree arg, location_t loc) -{ - if (!warn_abi || !abi_version_crosses (10)) - return; - - warning_at (loc, OPT_Wabi, "%E", empty_class_msg (arg)); -} - -/* Tack a warning about the change in empty class parameter ABI onto FN, so - that we get a warning if a definition or call is emitted. */ - -void -mark_for_abi_warning (tree fn, tree type) -{ - if (!warn_abi || !abi_version_crosses (10)) - return; - if (lookup_attribute ("abi warning", DECL_ATTRIBUTES (fn))) - return; - - tree msg = empty_class_msg (type); - msg = build_tree_list (NULL_TREE, msg); - DECL_ATTRIBUTES (fn) = tree_cons (get_identifier ("abi warning"), msg, - DECL_ATTRIBUTES (fn)); -} - /* Returns the type which will really be used for passing an argument of type TYPE. */ @@ -7081,8 +6986,6 @@ type_passed_as (tree type) && COMPLETE_TYPE_P (type) && tree_int_cst_lt (TYPE_SIZE (type), TYPE_SIZE (integer_type_node))) type = integer_type_node; - else if (pass_as_empty_struct (type)) - type = empty_struct_type; return type; } diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 87e3ea0b2ee6..baff674dfb7f 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1150,8 +1150,6 @@ enum cp_tree_index CPTI_NULLPTR, CPTI_NULLPTR_TYPE, - CPTI_EMPTY_STRUCT, - CPTI_MAX }; @@ -1187,7 +1185,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; #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] -#define empty_struct_type cp_global_trees[CPTI_EMPTY_STRUCT] /* We cache these tree nodes so as to call get_identifier less frequently. */ @@ -5540,8 +5537,6 @@ extern tree build_addr_func (tree, tsubst_flags_t); extern void set_flags_from_callee (tree); extern tree build_call_a (tree, int, tree*); extern tree build_call_n (tree, int, ...); -extern void mark_for_abi_warning (tree, tree); -extern void warn_empty_class_abi (tree, location_t); extern bool null_ptr_cst_p (tree); extern bool null_member_pointer_value_p (tree); extern bool sufficient_parms_p (const_tree); @@ -5896,7 +5891,6 @@ extern bool pedwarn_cxx98 (location_t, int, const char *, extern location_t location_of (tree); extern void qualified_name_lookup_error (tree, tree, tree, location_t); -extern tree pp_format_to_string (const char *, ...); /* in except.c */ extern void init_exception_processing (void); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 42e853f21908..65b5733b0209 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4180,10 +4180,6 @@ cxx_init_decl_processing (void) nullptr_node = build_int_cst (nullptr_type_node, 0); } - empty_struct_type = make_node (RECORD_TYPE); - finish_builtin_struct (empty_struct_type, "__empty_struct", - NULL_TREE, NULL_TREE); - abort_fndecl = build_library_fn_ptr ("__cxa_pure_virtual", void_ftype, ECF_NORETURN | ECF_NOTHROW); @@ -14375,34 +14371,16 @@ store_parm_decls (tree current_function_parms) they end in the correct forward order. */ specparms = nreverse (specparms); - /* Don't warn about the ABI of a function local to this TU. */ - bool warned = !TREE_PUBLIC (current_function_decl); - bool saw_nonempty = false; for (parm = specparms; parm; parm = next) { next = DECL_CHAIN (parm); if (TREE_CODE (parm) == PARM_DECL) { - tree type = TREE_TYPE (parm); if (DECL_NAME (parm) == NULL_TREE - || !VOID_TYPE_P (type)) + || !VOID_TYPE_P (parm)) pushdecl (parm); else error ("parameter %qD declared void", parm); - /* If this isn't the last parameter, maybe warn about ABI change - in passing empty classes. */ - if (processing_template_decl) - continue; - if (TREE_ADDRESSABLE (type) - || !is_really_empty_class (type)) - saw_nonempty = true; - else if (!warned - && (saw_nonempty - || varargs_function_p (current_function_decl))) - { - mark_for_abi_warning (current_function_decl, type); - warned = true; - } } else { diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 5aaa1773bca7..aa5fd411b28f 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -3718,25 +3718,3 @@ qualified_name_lookup_error (tree scope, tree name, suggest_alternatives_for (location, name); } } - -/* Like error et al, but return the formatted message as a STRING_CST. */ - -tree -pp_format_to_string (const char *msg, ...) -{ - pretty_printer *pp = global_dc->printer; - text_info text; - va_list ap; - - va_start (ap, msg); - text.err_no = errno; - text.args_ptr = ≈ - text.format_spec = msg; - pp_format (pp, &text); - pp_output_formatted_text (pp); - va_end (ap); - const char *fmt = pp_formatted_text (pp); - tree str = build_string (strlen (fmt) + 1, fmt); - pp_clear_output_area (pp); - return str; -} diff --git a/gcc/expr.c b/gcc/expr.c index 5f1118c4f7b3..29d22b07256c 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -10579,13 +10579,6 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode, 0, "%Kcall to %qs declared with attribute warning: %s", exp, identifier_to_locale (lang_hooks.decl_printable_name (fndecl, 1)), TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (attr)))); - if (warn_abi && fndecl - && (attr = lookup_attribute ("abi warning", - DECL_ATTRIBUTES (fndecl))) != NULL) - warning_at (tree_nonartificial_location (exp), - OPT_Wabi, "%Kcall to %qs: %s", - exp, identifier_to_locale (lang_hooks.decl_printable_name (fndecl, 1)), - TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (attr)))); /* Check for a built-in function. */ if (fndecl && DECL_BUILT_IN (fndecl)) diff --git a/gcc/testsuite/g++.dg/abi/empty12.C b/gcc/testsuite/g++.dg/abi/empty12.C deleted file mode 100644 index ce1f6f2ae9c8..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty12.C +++ /dev/null @@ -1,17 +0,0 @@ -// PR c++/60336 -// { dg-do run } -// { dg-options "-Wabi=9 -x c" } -// { dg-additional-sources "empty12a.c" } -// { dg-prune-output "command line option" } - -#include "empty12.h" -extern "C" void fun(struct dummy, struct foo); - -int main() -{ - struct dummy d; - struct foo f = { -1, -2, -3, -4, -5 }; - - fun(d, f); // { dg-warning "empty" } - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/empty12.h b/gcc/testsuite/g++.dg/abi/empty12.h deleted file mode 100644 index c61afcda0fbd..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty12.h +++ /dev/null @@ -1,9 +0,0 @@ -struct dummy { }; -struct foo -{ - int i1; - int i2; - int i3; - int i4; - int i5; -}; diff --git a/gcc/testsuite/g++.dg/abi/empty12a.c b/gcc/testsuite/g++.dg/abi/empty12a.c deleted file mode 100644 index 34a25bad75dc..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty12a.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "empty12.h" -void fun(struct dummy d, struct foo f) -{ - if (f.i1 != -1) - __builtin_abort(); -} diff --git a/gcc/testsuite/g++.dg/abi/empty13.C b/gcc/testsuite/g++.dg/abi/empty13.C deleted file mode 100644 index d1e094685dee..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty13.C +++ /dev/null @@ -1,17 +0,0 @@ -// PR c++/60336 -// { dg-do run } -// { dg-options "-x c -fabi-version=9" } -// { dg-additional-sources "empty13a.c" } -// { dg-prune-output "command line option" } - -#include "empty13.h" -extern "C" void fun(struct dummy, struct foo); - -int main() -{ - struct dummy d; - struct foo f = { -1, -2, -3, -4, -5 }; - - fun(d, f); - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/empty13.h b/gcc/testsuite/g++.dg/abi/empty13.h deleted file mode 100644 index c61afcda0fbd..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty13.h +++ /dev/null @@ -1,9 +0,0 @@ -struct dummy { }; -struct foo -{ - int i1; - int i2; - int i3; - int i4; - int i5; -}; diff --git a/gcc/testsuite/g++.dg/abi/empty13a.c b/gcc/testsuite/g++.dg/abi/empty13a.c deleted file mode 100644 index b4303a638260..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty13a.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "empty13.h" -void fun(struct dummy d, struct foo f) -{ - if (f.i1 == -1) - __builtin_abort(); -} diff --git a/gcc/testsuite/g++.dg/abi/empty14.C b/gcc/testsuite/g++.dg/abi/empty14.C deleted file mode 100644 index 1b9c3975753f..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty14.C +++ /dev/null @@ -1,17 +0,0 @@ -// PR c++/60336 -// { dg-do run } -// { dg-options "-Wabi=9 -x c" } -// { dg-additional-sources "empty14a.c" } -// { dg-prune-output "command line option" } - -#include "empty14.h" -extern "C" void fun(struct dummy, struct foo); - -int main() -{ - struct dummy d; - struct foo f = { -1, -2, -3, -4, -5 }; - - fun(d, f); // { dg-warning "empty" } - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/empty14.h b/gcc/testsuite/g++.dg/abi/empty14.h deleted file mode 100644 index 5842279cf370..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty14.h +++ /dev/null @@ -1,10 +0,0 @@ -struct dummy0 { }; -struct dummy { struct dummy0 d[140]; }; -struct foo -{ - int i1; - int i2; - int i3; - int i4; - int i5; -}; diff --git a/gcc/testsuite/g++.dg/abi/empty14a.c b/gcc/testsuite/g++.dg/abi/empty14a.c deleted file mode 100644 index 8b3d7800c365..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty14a.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "empty14.h" -void fun(struct dummy d, struct foo f) -{ - if (f.i1 != -1) - __builtin_abort(); -} diff --git a/gcc/testsuite/g++.dg/abi/empty15.C b/gcc/testsuite/g++.dg/abi/empty15.C deleted file mode 100644 index ac0a8681dc99..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty15.C +++ /dev/null @@ -1,17 +0,0 @@ -// PR c++/60336 -// { dg-do run } -// { dg-options "-Wabi=9 -x c" } -// { dg-additional-sources "empty15a.c" } -// { dg-prune-output "command line option" } - -#include "empty15.h" -extern "C" void fun(struct dummy, struct foo); - -int main() -{ - struct dummy d; - struct foo f = { -1, -2, -3, -4, -5 }; - - fun(d, f); // { dg-warning "empty" } - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/empty15.h b/gcc/testsuite/g++.dg/abi/empty15.h deleted file mode 100644 index 1c6f26f5ae81..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty15.h +++ /dev/null @@ -1,30 +0,0 @@ -struct A1 {}; -struct A2 {}; -struct B1 { struct A1 a; struct A2 b; }; -struct B2 { struct A1 a; struct A2 b; }; -struct C1 { struct B1 a; struct B2 b; }; -struct C2 { struct B1 a; struct B2 b; }; -struct D1 { struct C1 a; struct C2 b; }; -struct D2 { struct C1 a; struct C2 b; }; -struct E1 { struct D1 a; struct D2 b; }; -struct E2 { struct D1 a; struct D2 b; }; -struct F1 { struct E1 a; struct E2 b; }; -struct F2 { struct E1 a; struct E2 b; }; -struct G1 { struct F1 a; struct F2 b; }; -struct G2 { struct F1 a; struct F2 b; }; -struct H1 { struct G1 a; struct G2 b; }; -struct H2 { struct G1 a; struct G2 b; }; -struct I1 { struct H1 a; struct H2 b; }; -struct I2 { struct H1 a; struct H2 b; }; -struct J1 { struct I1 a; struct I2 b; }; -struct J2 { struct I1 a; struct I2 b; }; -struct dummy { struct J1 a; struct J2 b; }; - -struct foo -{ - int i1; - int i2; - int i3; - int i4; - int i5; -}; diff --git a/gcc/testsuite/g++.dg/abi/empty15a.c b/gcc/testsuite/g++.dg/abi/empty15a.c deleted file mode 100644 index 325b2c5ba09e..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty15a.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "empty15.h" -void fun(struct dummy d, struct foo f) -{ - if (f.i1 != -1) - __builtin_abort(); -} diff --git a/gcc/testsuite/g++.dg/abi/empty16.C b/gcc/testsuite/g++.dg/abi/empty16.C deleted file mode 100644 index de2bf5cd51d8..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty16.C +++ /dev/null @@ -1,17 +0,0 @@ -// PR c++/60336 -// { dg-do run } -// { dg-options "-Wabi=9 -x c" } -// { dg-additional-sources "empty16a.c" } -// { dg-prune-output "command line option" } - -#include "empty16.h" -extern "C" void fun(struct dummy, struct foo); - -int main() -{ - struct dummy d; - struct foo f = { -1, -2, -3, -4, -5 }; - - fun(d, f); // { dg-warning "empty" } - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/empty16.h b/gcc/testsuite/g++.dg/abi/empty16.h deleted file mode 100644 index 7552ae06576b..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty16.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifdef __cplusplus -struct A1 {}; -struct A2 {}; -struct dummy : A1, A2 {} ; -#else -struct dummy {}; -#endif - -struct foo -{ - int i1; - int i2; - int i3; - int i4; - int i5; -}; diff --git a/gcc/testsuite/g++.dg/abi/empty16a.c b/gcc/testsuite/g++.dg/abi/empty16a.c deleted file mode 100644 index 6cb7fbccecc4..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty16a.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "empty16.h" -void fun(struct dummy d, struct foo f) -{ - if (f.i1 != -1) - __builtin_abort(); -} diff --git a/gcc/testsuite/g++.dg/abi/empty17.C b/gcc/testsuite/g++.dg/abi/empty17.C deleted file mode 100644 index c7a37c093d99..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty17.C +++ /dev/null @@ -1,17 +0,0 @@ -// PR c++/60336 -// { dg-do run } -// { dg-options "-Wabi=9 -x c" } -// { dg-additional-sources "empty17a.c" } -// { dg-prune-output "command line option" } - -#include "empty17.h" -extern "C" void fun(struct dummy, struct foo); - -int main() -{ - struct dummy d; - struct foo f = { -1, -2, -3, -4, -5 }; - - fun(d, f); // { dg-warning "empty" } - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/empty17.h b/gcc/testsuite/g++.dg/abi/empty17.h deleted file mode 100644 index 9cf72baca2e1..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty17.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifdef __cplusplus -struct A1 -{ - void foo (void); - unsigned int : 15; -}; -struct A2 -{ - void bar (void); - unsigned int : 15; -}; -struct dummy : A1, A2 -{ - unsigned int : 15; -}; -#else -struct dummy {}; -#endif - -struct foo -{ - int i1; - int i2; - int i3; - int i4; - int i5; -}; diff --git a/gcc/testsuite/g++.dg/abi/empty17a.c b/gcc/testsuite/g++.dg/abi/empty17a.c deleted file mode 100644 index 24408fde09cb..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty17a.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "empty17.h" -void fun(struct dummy d, struct foo f) -{ - if (f.i1 != -1) - __builtin_abort(); -} diff --git a/gcc/testsuite/g++.dg/abi/empty18.C b/gcc/testsuite/g++.dg/abi/empty18.C deleted file mode 100644 index 6cad33c8dd3c..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty18.C +++ /dev/null @@ -1,17 +0,0 @@ -// PR c++/60336 -// { dg-do run } -// { dg-options "-Wabi=9 -x c" } -// { dg-additional-sources "empty18a.c" } -// { dg-prune-output "command line option" } - -#include "empty18.h" -extern "C" void fun(struct dummy, struct foo); - -int main() -{ - struct dummy d; - struct foo f = { -1, -2, -3, -4, -5 }; - - fun(d, f); // { dg-warning "empty" } - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/empty18.h b/gcc/testsuite/g++.dg/abi/empty18.h deleted file mode 100644 index 86e7ecdd2111..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty18.h +++ /dev/null @@ -1,9 +0,0 @@ -struct dummy { int d[0]; }; -struct foo -{ - int i1; - int i2; - int i3; - int i4; - int i5; -}; diff --git a/gcc/testsuite/g++.dg/abi/empty18a.c b/gcc/testsuite/g++.dg/abi/empty18a.c deleted file mode 100644 index 902860bdc01e..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty18a.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "empty18.h" -void fun(struct dummy d, struct foo f) -{ - if (f.i1 != -1) - __builtin_abort(); -} diff --git a/gcc/testsuite/g++.dg/abi/empty19.C b/gcc/testsuite/g++.dg/abi/empty19.C deleted file mode 100644 index e3e855a99bb8..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty19.C +++ /dev/null @@ -1,17 +0,0 @@ -// PR c++/60336 -// { dg-do run } -// { dg-options "-Wabi=9 -x c" } -// { dg-additional-sources "empty19a.c" } -// { dg-prune-output "command line option" } - -#include "empty19.h" -extern "C" void fun(struct dummy, struct foo); - -int main() -{ - struct dummy d; - struct foo f = { -1, -2, -3, -4, -5 }; - - fun(d, f); // { dg-warning "empty" } - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/empty19.h b/gcc/testsuite/g++.dg/abi/empty19.h deleted file mode 100644 index 616b87bdd933..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty19.h +++ /dev/null @@ -1,10 +0,0 @@ -struct dummy0 { }; -struct dummy { struct dummy0 d[0]; }; -struct foo -{ - int i1; - int i2; - int i3; - int i4; - int i5; -}; diff --git a/gcc/testsuite/g++.dg/abi/empty19a.c b/gcc/testsuite/g++.dg/abi/empty19a.c deleted file mode 100644 index 767b1eb73200..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty19a.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "empty19.h" -void fun(struct dummy d, struct foo f) -{ - if (f.i1 != -1) - __builtin_abort(); -} diff --git a/gcc/testsuite/g++.dg/abi/empty20.C b/gcc/testsuite/g++.dg/abi/empty20.C deleted file mode 100644 index be1e826c838f..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty20.C +++ /dev/null @@ -1,25 +0,0 @@ -// { dg-options "-Wabi=9 -O0" } - -struct A { }; - -void f(A, A) { } // No warning, trailing parms all empty -void f(A, A, int) { } // { dg-warning "ABI" } -__attribute__ ((always_inline)) -inline void f(A a, int i) { } // No warning, always inlined -__attribute__ ((always_inline)) -inline void f2(A a, int i) // But the call within the fn gets a warning -{ // when it's inlined into main - f(a,a,i); // { dg-warning "ABI" } -} -inline void f3(A a, int i) // This one is never called -{ - f(a,a,i); -} -int main() -{ - A a; - f(a,a); - f(a,a,42); // { dg-warning "ABI" } - f(a,42); - f2(a,42); -} diff --git a/gcc/testsuite/g++.dg/abi/empty21.C b/gcc/testsuite/g++.dg/abi/empty21.C deleted file mode 100644 index 7538dd80c32b..000000000000 --- a/gcc/testsuite/g++.dg/abi/empty21.C +++ /dev/null @@ -1,21 +0,0 @@ -// { dg-options "-Wabi=9" } - -#include - -struct A { }; - -void f(int i, ...) -{ - va_list ap; - va_start (ap, i); - if (i >= 1) - va_arg (ap, A); // { dg-warning "ABI" } - if (i >= 2) - va_arg (ap, int); -} - -int main() -{ - f(0); - f(2, A(), 42); // { dg-warning "ABI" } -} diff --git a/gcc/testsuite/g++.dg/abi/pr60336-1.C b/gcc/testsuite/g++.dg/abi/pr60336-1.C deleted file mode 100644 index af0863887a04..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr60336-1.C +++ /dev/null @@ -1,17 +0,0 @@ -// { dg-do compile } -// { dg-options "-O2 -std=c++11 -fno-pic" } -// { dg-require-effective-target fpic } - -struct dummy { }; -struct true_type { struct dummy i; }; - -extern true_type y; -extern void xxx (true_type c); - -void -yyy (void) -{ - xxx (y); -} - -// { dg-final { scan-assembler "jmp\[\t \]+\[^\$\]*?_Z3xxx9true_type" { target i?86-*-* x86_64-*-* } } } diff --git a/gcc/testsuite/g++.dg/abi/pr60336-10.C b/gcc/testsuite/g++.dg/abi/pr60336-10.C deleted file mode 100644 index 6c9c990dad6e..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr60336-10.C +++ /dev/null @@ -1,50 +0,0 @@ -// { dg-do run } -// { dg-options "-O2" } - -#include - -struct dummy0 { }; -struct dummy1 { }; -struct dummy : dummy0, dummy1 { }; - -void -test (struct dummy a, int m, ...) -{ - va_list va_arglist; - int i; - int count = 0; - - if (m == 0) - count++; - va_start (va_arglist, m); - i = va_arg (va_arglist, int); - if (i == 1) - count++; - i = va_arg (va_arglist, int); - if (i == 2) - i = va_arg (va_arglist, int); - count++; - if (i == 3) - count++; - i = va_arg (va_arglist, int); - if (i == 4) - count++; - i = va_arg (va_arglist, int); - if (i == 5) - count++; - i = va_arg (va_arglist, int); - if (i == 6) - count++; - va_end (va_arglist); - if (count != 7) - __builtin_abort (); -} - -struct dummy a0; - -int -main () -{ - test (a0, 0, 1, 2, 3, 4, 5, 6); - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/pr60336-11.C b/gcc/testsuite/g++.dg/abi/pr60336-11.C deleted file mode 100644 index c92f3d43a5b0..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr60336-11.C +++ /dev/null @@ -1,56 +0,0 @@ -// { dg-do run } -// { dg-options "-O2" } - -#include - -struct dummy0 -{ - void bar (void); -}; -struct dummy1 -{ - void foo (void); -}; -struct dummy : dummy0, dummy1 { }; - -void -test (struct dummy a, int m, ...) -{ - va_list va_arglist; - int i; - int count = 0; - - if (m == 0) - count++; - va_start (va_arglist, m); - i = va_arg (va_arglist, int); - if (i == 1) - count++; - i = va_arg (va_arglist, int); - if (i == 2) - i = va_arg (va_arglist, int); - count++; - if (i == 3) - count++; - i = va_arg (va_arglist, int); - if (i == 4) - count++; - i = va_arg (va_arglist, int); - if (i == 5) - count++; - i = va_arg (va_arglist, int); - if (i == 6) - count++; - va_end (va_arglist); - if (count != 7) - __builtin_abort (); -} - -struct dummy a0; - -int -main () -{ - test (a0, 0, 1, 2, 3, 4, 5, 6); - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/pr60336-12.C b/gcc/testsuite/g++.dg/abi/pr60336-12.C deleted file mode 100644 index 83a7bb0cfa00..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr60336-12.C +++ /dev/null @@ -1,57 +0,0 @@ -// { dg-do run } -// { dg-options "-O2" } - -#include - -struct dummy0 -{ -}; -struct dummy1 -{ - unsigned : 15; -}; -struct dummy : dummy0, dummy1 -{ -}; - -void -test (struct dummy a, int m, ...) -{ - va_list va_arglist; - int i; - int count = 0; - - if (m == 0) - count++; - va_start (va_arglist, m); - i = va_arg (va_arglist, int); - if (i == 1) - count++; - i = va_arg (va_arglist, int); - if (i == 2) - i = va_arg (va_arglist, int); - count++; - if (i == 3) - count++; - i = va_arg (va_arglist, int); - if (i == 4) - count++; - i = va_arg (va_arglist, int); - if (i == 5) - count++; - i = va_arg (va_arglist, int); - if (i == 6) - count++; - va_end (va_arglist); - if (count != 7) - __builtin_abort (); -} - -struct dummy a0; - -int -main () -{ - test (a0, 0, 1, 2, 3, 4, 5, 6); - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/pr60336-2.C b/gcc/testsuite/g++.dg/abi/pr60336-2.C deleted file mode 100644 index 32eecb32a675..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr60336-2.C +++ /dev/null @@ -1,48 +0,0 @@ -// { dg-do run } -// { dg-options "-O2 -Wabi=9" } - -#include - -struct dummy { }; - -void -test (struct dummy a, int m, ...) // { dg-message "empty" } -{ - va_list va_arglist; - int i; - int count = 0; - - if (m == 0) - count++; - va_start (va_arglist, m); - i = va_arg (va_arglist, int); - if (i == 1) - count++; - i = va_arg (va_arglist, int); - if (i == 2) - i = va_arg (va_arglist, int); - count++; - if (i == 3) - count++; - i = va_arg (va_arglist, int); - if (i == 4) - count++; - i = va_arg (va_arglist, int); - if (i == 5) - count++; - i = va_arg (va_arglist, int); - if (i == 6) - count++; - va_end (va_arglist); - if (count != 7) - __builtin_abort (); -} - -struct dummy a0; - -int -main () -{ - test (a0, 0, 1, 2, 3, 4, 5, 6); // { dg-message "empty" } - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/pr60336-3.C b/gcc/testsuite/g++.dg/abi/pr60336-3.C deleted file mode 100644 index 8ebd4dda0e24..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr60336-3.C +++ /dev/null @@ -1,15 +0,0 @@ -// { dg-do compile } -// { dg-options "-O2 -Wabi=9" } - -struct dummy { struct{}__attribute__((aligned (4))) a[7]; }; - -extern void test1 (struct dummy, ...); -extern void (*test2) (struct dummy, ...); - -void -foo () -{ - struct dummy a0; - test1 (a0, 42); // { dg-message "empty" } - test2 (a0, 42); // { dg-message "empty" } -} diff --git a/gcc/testsuite/g++.dg/abi/pr60336-4.C b/gcc/testsuite/g++.dg/abi/pr60336-4.C deleted file mode 100644 index 8790a663d2bc..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr60336-4.C +++ /dev/null @@ -1,48 +0,0 @@ -// { dg-do run { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } -// { dg-options "-O2 -fabi-version=9" } - -#include - -struct dummy { }; - -void -test (struct dummy a, int m, ...) -{ - va_list va_arglist; - int i; - int count = 0; - - if (m == 0) - count++; - va_start (va_arglist, m); - i = va_arg (va_arglist, int); - if (i == 1) - count++; - i = va_arg (va_arglist, int); - if (i == 2) - i = va_arg (va_arglist, int); - count++; - if (i == 3) - count++; - i = va_arg (va_arglist, int); - if (i == 4) - count++; - i = va_arg (va_arglist, int); - if (i == 5) - count++; - i = va_arg (va_arglist, int); - if (i == 6) - count++; - va_end (va_arglist); - if (count == 7) - __builtin_abort (); -} - -struct dummy a0; - -int -main () -{ - test (a0, 0, 1, 2, 3, 4, 5, 6); - return 0; -} diff --git a/gcc/testsuite/g++.dg/abi/pr60336-5.C b/gcc/testsuite/g++.dg/abi/pr60336-5.C deleted file mode 100644 index b0c76ad5aa2e..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr60336-5.C +++ /dev/null @@ -1,17 +0,0 @@ -// { dg-do compile } -// { dg-options "-O2 -std=c++11 -fno-pic" } -// { dg-require-effective-target fpic } - -struct dummy { }; -struct true_type { struct dummy i; struct dummy j; }; - -extern true_type y; -extern void xxx (true_type c); - -void -yyy (void) -{ - xxx (y); -} - -// { dg-final { scan-assembler "jmp\[\t \]+\[^\$\]*?_Z3xxx9true_type" { target i?86-*-* x86_64-*-* } } } diff --git a/gcc/testsuite/g++.dg/abi/pr60336-6.C b/gcc/testsuite/g++.dg/abi/pr60336-6.C deleted file mode 100644 index 58796519334a..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr60336-6.C +++ /dev/null @@ -1,17 +0,0 @@ -// { dg-do compile } -// { dg-options "-O2 -std=c++11 -fno-pic" } -// { dg-require-effective-target fpic } - -struct dummy { }; -struct true_type { struct dummy i1; struct dummy i2; }; - -extern true_type y; -extern void xxx (true_type c); - -void -yyy (void) -{ - xxx (y); -} - -// { dg-final { scan-assembler "jmp\[\t \]+\[^\$\]*?_Z3xxx9true_type" { target i?86-*-* x86_64-*-* } } } diff --git a/gcc/testsuite/g++.dg/abi/pr60336-7.C b/gcc/testsuite/g++.dg/abi/pr60336-7.C deleted file mode 100644 index 0e5d2ef2f11e..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr60336-7.C +++ /dev/null @@ -1,17 +0,0 @@ -// { dg-do compile } -// { dg-options "-O2 -std=c++11 -fno-pic" } -// { dg-require-effective-target fpic } - -struct dummy { }; -struct true_type { struct dummy i[120]; }; - -extern true_type y; -extern void xxx (true_type c); - -void -yyy (void) -{ - xxx (y); -} - -// { dg-final { scan-assembler "jmp\[\t \]+\[^\$\]*?_Z3xxx9true_type" { target i?86-*-* x86_64-*-* } } } diff --git a/gcc/testsuite/g++.dg/abi/pr60336-8.C b/gcc/testsuite/g++.dg/abi/pr60336-8.C deleted file mode 100644 index fdfc924bfc54..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr60336-8.C +++ /dev/null @@ -1,15 +0,0 @@ -// { dg-do compile } -// { dg-options "-O2 -Wabi=9" } - -struct dummy { struct{} a[7][3]; }; - -extern void test1 (struct dummy, ...); -extern void (*test2) (struct dummy, ...); - -void -foo () -{ - struct dummy a0; - test1 (a0, 42); // { dg-message "empty" } - test2 (a0, 42); // { dg-message "empty" } -} diff --git a/gcc/testsuite/g++.dg/abi/pr60336-9.C b/gcc/testsuite/g++.dg/abi/pr60336-9.C deleted file mode 100644 index 4ad333f6b9ca..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr60336-9.C +++ /dev/null @@ -1,28 +0,0 @@ -// { dg-do compile } -// { dg-options "-O2 -std=c++11 -fno-pic" } -// { dg-require-effective-target fpic } - -struct A1 {}; struct A2 {}; -struct B1 { A1 a; A2 b; }; struct B2 { A1 a; A2 b; }; -struct C1 { B1 a; B2 b; }; struct C2 { B1 a; B2 b; }; -struct D1 { C1 a; C2 b; }; struct D2 { C1 a; C2 b; }; -struct E1 { D1 a; D2 b; }; struct E2 { D1 a; D2 b; }; -struct F1 { E1 a; E2 b; }; struct F2 { E1 a; E2 b; }; -struct G1 { F1 a; F2 b; }; struct G2 { F1 a; F2 b; }; -struct H1 { G1 a; G2 b; }; struct H2 { G1 a; G2 b; }; -struct I1 { H1 a; H2 b; }; struct I2 { H1 a; H2 b; }; -struct J1 { I1 a; I2 b; }; struct J2 { I1 a; I2 b; }; -struct dummy { J1 a; J2 b; }; - -struct true_type { struct dummy i; }; - -extern true_type y; -extern void xxx (true_type c); - -void -yyy (void) -{ - xxx (y); -} - -// { dg-final { scan-assembler "jmp\[\t \]+\[^\$\]*?_Z3xxx9true_type" { target i?86-*-* x86_64-*-* } } } diff --git a/gcc/testsuite/g++.dg/abi/pr68355.C b/gcc/testsuite/g++.dg/abi/pr68355.C deleted file mode 100644 index 1354fc497b55..000000000000 --- a/gcc/testsuite/g++.dg/abi/pr68355.C +++ /dev/null @@ -1,24 +0,0 @@ -// { dg-do compile } -// { dg-options "-O2 -std=c++11 -fno-pic" } -// { dg-require-effective-target fpic } - -template -struct integral_constant -{ - static constexpr _Tp value = __v; - typedef _Tp value_type; - typedef integral_constant<_Tp, __v> type; - constexpr operator value_type() const { return value; } -}; - -typedef integral_constant true_type; -extern void xxx (true_type c); - -void -yyy (void) -{ - true_type y; - xxx (y); -} - -// { dg-final { scan-assembler "jmp\[\t \]+\[^\$\]*?_Z3xxx17integral_constantIbLb1EE" { target i?86-*-* x86_64-*-* } } } diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d31a5d29120f..f63e09145baf 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2016-04-14 Jason Merrill + + Revert Jonathan's empty ABI change from yesterday. + 2016-04-13 Martin Sebor PR c++/69517 diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index bde003c68a03..57024e40ec0d 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -84,32 +84,13 @@ # define _GLIBCXX_DEPRECATED #endif -#if __cplusplus - // Macros for ABI tag attributes. #ifndef _GLIBCXX_ABI_TAG_CXX11 # define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11"))) #endif -#if __GXX_ABI_VERSION >= 1010 -namespace std -{ - inline namespace _V2 { } -} -# define _GLIBCXX_BEGIN_NAMESPACE_EMPTY_TYPES \ - _GLIBCXX_END_NAMESPACE_VERSION \ - namespace _V2 { \ - _GLIBCXX_BEGIN_NAMESPACE_VERSION -# define _GLIBCXX_END_NAMESPACE_EMPTY_TYPES \ - _GLIBCXX_END_NAMESPACE_VERSION \ - } \ - _GLIBCXX_BEGIN_NAMESPACE_VERSION -# define _GLIBCXX_ABI_TAG_EMPTY __attribute ((__abi_tag__ ("cxxempty"))) -#else -# define _GLIBCXX_BEGIN_NAMESPACE_EMPTY_TYPES -# define _GLIBCXX_END_NAMESPACE_EMPTY_TYPES -# define _GLIBCXX_ABI_TAG_EMPTY -#endif + +#if __cplusplus // Macro for constexpr, to support in mixed 03/0x mode. #ifndef _GLIBCXX_CONSTEXPR diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index 22b718761299..5748920cc78b 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -663,26 +663,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_insert_multi_node(__node_type* __hint, __hash_code __code, __node_type* __n); - template - typename enable_if<_Uniq, std::pair>::type - _M_emplace(__bool_constant<_Uniq>, _Args&&... __args); + template + std::pair + _M_emplace(std::true_type, _Args&&... __args); - template - typename enable_if::type - _M_emplace(__bool_constant<_Uniq> __uk, _Args&&... __args) - { - return _M_emplace_hint(cend(), __uk, std::forward<_Args>(__args)...); - } + template + iterator + _M_emplace(std::false_type __uk, _Args&&... __args) + { return _M_emplace(cend(), __uk, std::forward<_Args>(__args)...); } // Emplace with hint, useless when keys are unique. template iterator - _M_emplace_hint(const_iterator, std::true_type __uk, _Args&&... __args) + _M_emplace(const_iterator, std::true_type __uk, _Args&&... __args) { return _M_emplace(__uk, std::forward<_Args>(__args)...).first; } template iterator - _M_emplace_hint(const_iterator, std::false_type, _Args&&... __args); + _M_emplace(const_iterator, std::false_type, _Args&&... __args); template std::pair @@ -714,10 +712,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const _NodeGenerator&, std::false_type); size_type - _M_erase(const key_type&, std::true_type); + _M_erase(std::true_type, const key_type&); size_type - _M_erase(const key_type&, std::false_type); + _M_erase(std::false_type, const key_type&); iterator _M_erase(size_type __bkt, __node_base* __prev_n, __node_type* __n); @@ -733,8 +731,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION iterator emplace_hint(const_iterator __hint, _Args&&... __args) { - return _M_emplace_hint(__hint, __unique_keys(), - std::forward<_Args>(__args)...); + return _M_emplace(__hint, __unique_keys(), + std::forward<_Args>(__args)...); } // Insert member functions via inheritance. @@ -750,7 +748,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION size_type erase(const key_type& __k) - { return _M_erase(__k, __unique_keys()); } + { return _M_erase(__unique_keys(), __k); } iterator erase(const_iterator, const_iterator); @@ -1504,12 +1502,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typename _Alloc, typename _ExtractKey, typename _Equal, typename _H1, typename _H2, typename _Hash, typename _RehashPolicy, typename _Traits> - template + template auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>:: - _M_emplace(__bool_constant<_Uniq>, _Args&&... __args) - -> typename enable_if<_Uniq, pair>::type + _M_emplace(std::true_type, _Args&&... __args) + -> pair { // First build the node to get access to the hash code __node_type* __node = this->_M_allocate_node(std::forward<_Args>(__args)...); @@ -1546,7 +1544,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>:: - _M_emplace_hint(const_iterator __hint, std::false_type, _Args&&... __args) + _M_emplace(const_iterator __hint, std::false_type, _Args&&... __args) -> iterator { // First build the node to get its hash code. @@ -1771,7 +1769,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>:: - _M_erase(const key_type& __k, std::true_type) + _M_erase(std::true_type, const key_type& __k) -> size_type { __hash_code __code = this->_M_hash_code(__k); @@ -1795,7 +1793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION auto _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>:: - _M_erase(const key_type& __k, std::false_type) + _M_erase(std::false_type, const key_type& __k) -> size_type { __hash_code __code = this->_M_hash_code(__k); diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h index ceb78b4d7094..7a2ac92f8390 100644 --- a/libstdc++-v3/include/bits/hashtable_policy.h +++ b/libstdc++-v3/include/bits/hashtable_policy.h @@ -906,8 +906,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION insert(const_iterator __hint, _Pair&& __v) { __hashtable& __h = this->_M_conjure_hashtable(); - return __h._M_emplace_hint(__hint, __unique_keys(), - std::forward<_Pair>(__v)); + return __h._M_emplace(__hint, __unique_keys(), + std::forward<_Pair>(__v)); } }; diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h index f4c27543c7bd..b22477e96b29 100644 --- a/libstdc++-v3/include/bits/shared_ptr.h +++ b/libstdc++-v3/include/bits/shared_ptr.h @@ -166,7 +166,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * __shared_ptr will release __p by calling __d(__p) */ template - _GLIBCXX_ABI_TAG_EMPTY shared_ptr(_Tp1* __p, _Deleter __d, _Alloc __a) : __shared_ptr<_Tp>(__p, __d, std::move(__a)) { } @@ -186,7 +185,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * The last owner will call __d(__p) */ template - _GLIBCXX_ABI_TAG_EMPTY shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a) : __shared_ptr<_Tp>(__p, __d, std::move(__a)) { } diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index 6d523e179861..e844c9c91fe5 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -436,7 +436,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef _Sp_ebo_helper<1, _Alloc> _Alloc_base; public: - _GLIBCXX_ABI_TAG_EMPTY _Impl(_Ptr __p, _Deleter __d, const _Alloc& __a) noexcept : _M_ptr(__p), _Del_base(__d), _Alloc_base(__a) { } @@ -455,7 +454,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : _M_impl(__p, __d, _Alloc()) { } // __d(__p) must not throw. - _GLIBCXX_ABI_TAG_EMPTY _Sp_counted_deleter(_Ptr __p, _Deleter __d, const _Alloc& __a) noexcept : _M_impl(__p, __d, __a) { } @@ -586,7 +584,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { } template - _GLIBCXX_ABI_TAG_EMPTY __shared_count(_Ptr __p, _Deleter __d, _Alloc __a) : _M_pi(0) { typedef _Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp> _Sp_cd_type; @@ -903,7 +900,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } template - _GLIBCXX_ABI_TAG_EMPTY __shared_ptr(_Tp1* __p, _Deleter __d, _Alloc __a) : _M_ptr(__p), _M_refcount(__p, __d, std::move(__a)) { @@ -918,7 +914,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { } template - _GLIBCXX_ABI_TAG_EMPTY __shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a) : _M_ptr(0), _M_refcount(__p, __d, std::move(__a)) { } @@ -1044,7 +1039,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { __shared_ptr(__p, __d).swap(*this); } template - _GLIBCXX_ABI_TAG_EMPTY void reset(_Tp1* __p, _Deleter __d, _Alloc __a) { __shared_ptr(__p, __d, std::move(__a)).swap(*this); } diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index 28e1e3b2331b..fbd03a79e1eb 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -4270,7 +4270,6 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO * is true then the assignment @c *i = @p __new_value is performed. */ template - _GLIBCXX_ABI_TAG_EMPTY void replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value) diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h index e6ff00eec17d..37ee5cc40532 100644 --- a/libstdc++-v3/include/bits/stl_pair.h +++ b/libstdc++-v3/include/bits/stl_pair.h @@ -72,17 +72,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ #if __cplusplus >= 201103L - -_GLIBCXX_BEGIN_NAMESPACE_EMPTY_TYPES - /// piecewise_construct_t struct piecewise_construct_t { explicit piecewise_construct_t() = default; }; /// piecewise_construct constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); -_GLIBCXX_END_NAMESPACE_EMPTY_TYPES - // Forward declarations. template class tuple; diff --git a/libstdc++-v3/include/bits/uses_allocator.h b/libstdc++-v3/include/bits/uses_allocator.h index 86162a8af8a0..b1ff58a294b7 100644 --- a/libstdc++-v3/include/bits/uses_allocator.h +++ b/libstdc++-v3/include/bits/uses_allocator.h @@ -42,15 +42,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using __is_erased_or_convertible = __or_, is_convertible<_Alloc, _Tp>>; -_GLIBCXX_BEGIN_NAMESPACE_EMPTY_TYPES - /// [allocator.tag] struct allocator_arg_t { explicit allocator_arg_t() = default; }; constexpr allocator_arg_t allocator_arg = allocator_arg_t(); -_GLIBCXX_END_NAMESPACE_EMPTY_TYPES - template> struct __uses_allocator_helper : false_type { }; @@ -69,15 +65,11 @@ _GLIBCXX_END_NAMESPACE_EMPTY_TYPES struct __uses_alloc_base { }; -_GLIBCXX_BEGIN_NAMESPACE_EMPTY_TYPES - struct __uses_alloc0 : __uses_alloc_base { struct _Sink { void operator=(const void*) { } } _M_a; }; -_GLIBCXX_END_NAMESPACE_EMPTY_TYPES - template struct __uses_alloc1 : __uses_alloc_base { const _Alloc* _M_a; }; diff --git a/libstdc++-v3/include/ext/pb_ds/assoc_container.hpp b/libstdc++-v3/include/ext/pb_ds/assoc_container.hpp index a6b1e277a306..571d9468d7d4 100644 --- a/libstdc++-v3/include/ext/pb_ds/assoc_container.hpp +++ b/libstdc++-v3/include/ext/pb_ds/assoc_container.hpp @@ -120,44 +120,36 @@ namespace __gnu_pbds basic_hash_table(T0 t0) : base_type(t0) { } template - _GLIBCXX_ABI_TAG_EMPTY basic_hash_table(T0 t0, T1 t1) : base_type(t0, t1) { } template - _GLIBCXX_ABI_TAG_EMPTY basic_hash_table(T0 t0, T1 t1, T2 t2) : base_type(t0, t1, t2) { } template - _GLIBCXX_ABI_TAG_EMPTY basic_hash_table(T0 t0, T1 t1, T2 t2, T3 t3) : base_type(t0, t1, t2, t3) { } template - _GLIBCXX_ABI_TAG_EMPTY basic_hash_table(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4) : base_type(t0, t1, t2, t3, t4) { } template - _GLIBCXX_ABI_TAG_EMPTY basic_hash_table(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) : base_type(t0, t1, t2, t3, t4, t5) { } template - _GLIBCXX_ABI_TAG_EMPTY basic_hash_table(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6) : base_type(t0, t1, t2, t3, t4, t5, t6) { } template - _GLIBCXX_ABI_TAG_EMPTY basic_hash_table(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7) : base_type(t0, t1, t2, t3, t4, t5, t6, t7) { } template - _GLIBCXX_ABI_TAG_EMPTY basic_hash_table(T0 t0, T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8) : base_type(t0, t1, t2, t3, t4, t5, t6, t7, t8) diff --git a/libstdc++-v3/testsuite/20_util/scoped_allocator/69293_neg.cc b/libstdc++-v3/testsuite/20_util/scoped_allocator/69293_neg.cc index 5487b0ac6a1a..f3b2d87ab99b 100644 --- a/libstdc++-v3/testsuite/20_util/scoped_allocator/69293_neg.cc +++ b/libstdc++-v3/testsuite/20_util/scoped_allocator/69293_neg.cc @@ -47,5 +47,5 @@ test01() scoped_alloc sa; auto p = sa.allocate(1); sa.construct(p); // this is required to be ill-formed - // { dg-error "static assertion failed" "" { target *-*-* } 97 } + // { dg-error "static assertion failed" "" { target *-*-* } 89 } } diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc index a0ce1f5a61b6..395094f8bbeb 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc @@ -32,7 +32,7 @@ void test01() { X* px = 0; std::shared_ptr p1(px); // { dg-error "here" } - // { dg-error "incomplete" "" { target *-*-* } 892 } + // { dg-error "incomplete" "" { target *-*-* } 889 } std::shared_ptr p9(ap()); // { dg-error "here" } // { dg-error "incomplete" "" { target *-*-* } 307 } diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/void_neg.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/void_neg.cc index 88036fdcee91..8843ffea429c 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/void_neg.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/void_neg.cc @@ -25,5 +25,5 @@ void test01() { std::shared_ptr p((void*)nullptr); // { dg-error "here" } - // { dg-error "incomplete" "" { target *-*-* } 891 } + // { dg-error "incomplete" "" { target *-*-* } 888 } } diff --git a/libstdc++-v3/testsuite/20_util/uses_allocator/69293_neg.cc b/libstdc++-v3/testsuite/20_util/uses_allocator/69293_neg.cc index 88e1ea10d848..19417fc2cef4 100644 --- a/libstdc++-v3/testsuite/20_util/uses_allocator/69293_neg.cc +++ b/libstdc++-v3/testsuite/20_util/uses_allocator/69293_neg.cc @@ -45,5 +45,5 @@ test01() { alloc_type a; std::tuple t(std::allocator_arg, a); // this is required to be ill-formed - // { dg-error "static assertion failed" "" { target *-*-* } 97 } + // { dg-error "static assertion failed" "" { target *-*-* } 89 } } diff --git a/libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc b/libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc index e4cd2765bf79..b3df4ae9d7d5 100644 --- a/libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc +++ b/libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc @@ -44,4 +44,4 @@ void test01() tuple t(allocator_arg, a, 1); } -// { dg-error "static assertion failed" "" { target *-*-* } 97 } +// { dg-error "static assertion failed" "" { target *-*-* } 89 } diff --git a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc index 8ffdee89f2a9..e59d666307d2 100644 --- a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc +++ b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc @@ -25,7 +25,7 @@ #include -// { dg-error "multiple inlined namespaces" "" { target *-*-* } 343 } +// { dg-error "multiple inlined namespaces" "" { target *-*-* } 324 } // "template argument 1 is invalid" // { dg-prune-output "tuple:993" }