From 60696c53ecd1b353fc34dc0fd373495963329a89 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 19 Jan 2001 10:12:33 -0500 Subject: [PATCH] decl2.c (arg_assoc_class): Fix double iteration logic. * decl2.c (arg_assoc_class): Fix double iteration logic. * init.c (build_delete): Always call convert_force to strip cv-quals. * decl2.c (flag_new_abi): Depend on ENABLE_NEW_GXX_ABI. * lang-specs.h: Default ABI depends on ENABLE_NEW_GXX_ABI. * g++spec.c: Don't look at ENABLE_NEW_GXX_ABI. From-SVN: r39133 --- gcc/cp/ChangeLog | 12 ++++++++++++ gcc/cp/decl2.c | 10 +++++++--- gcc/cp/g++spec.c | 11 ----------- gcc/cp/init.c | 7 ++----- gcc/cp/lang-specs.h | 23 ++++++++++++++++++++++- 5 files changed, 43 insertions(+), 20 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b12874f9391..661e6922b6b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,15 @@ +2001-01-19 Ute Pelkmann + + * decl2.c (arg_assoc_class): Fix double iteration logic. + +2001-01-19 Jason Merrill + + * init.c (build_delete): Always call convert_force to strip cv-quals. + + * decl2.c (flag_new_abi): Depend on ENABLE_NEW_GXX_ABI. + * lang-specs.h: Default ABI depends on ENABLE_NEW_GXX_ABI. + * g++spec.c: Don't look at ENABLE_NEW_GXX_ABI. + 2001-01-19 Nathan Sidwell * search.c (get_vbase_1): Count only virtual bases. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 3f15b38be1f..18b864b730c 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -417,7 +417,11 @@ int flag_weak = 1; /* Nonzero to enable experimental ABI changes. */ +#if ENABLE_NEW_GXX_ABI +int flag_new_abi = 1; +#else int flag_new_abi; +#endif /* Nonzero to use __cxa_atexit, rather than atexit, to register destructors for local statics and global objects. */ @@ -4846,9 +4850,9 @@ arg_assoc_class (k, type) friends = TREE_CHAIN (friends)) /* Only interested in global functions with potentially hidden (i.e. unqualified) declarations. */ - if (TREE_PURPOSE (list) == error_mark_node && TREE_VALUE (list) - && decl_namespace (TREE_VALUE (list)) == context) - if (add_function (k, TREE_VALUE (list))) + if (TREE_PURPOSE (friends) == error_mark_node && TREE_VALUE (friends) + && decl_namespace (TREE_VALUE (friends)) == context) + if (add_function (k, TREE_VALUE (friends))) return 1; /* Process template arguments. */ diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c index 63787b9f9b1..1d18a081f96 100644 --- a/gcc/cp/g++spec.c +++ b/gcc/cp/g++spec.c @@ -94,10 +94,6 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) /* The total number of arguments with the new stuff. */ int num_args = 1; -#if ENABLE_NEW_GXX_ABI - added++; -#endif - argc = *in_argc; argv = *in_argv; added_libraries = *in_added_libraries; @@ -211,13 +207,6 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) /* Copy the 0th argument, i.e., the name of the program itself. */ arglist[i++] = argv[j++]; -#if ENABLE_NEW_GXX_ABI - /* If we should use the new ABI by default, add the appropriate flag - to cc1plus here. We put this first so that it can be overridden - by other command-line options. */ - arglist[j++] = "-fnew-abi"; -#endif - /* NOTE: We start at 1 now, not 0. */ while (i < argc) { diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 1516d69103e..3105ff7c9c0 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -3228,10 +3228,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete) if (TREE_SIDE_EFFECTS (addr)) addr = save_expr (addr); - if (TREE_CONSTANT (addr)) - addr = convert_pointer_to (type, addr); - else - addr = convert_force (build_pointer_type (type), addr, 0); + addr = convert_force (build_pointer_type (type), addr, 0); ref = build_indirect_ref (addr, NULL_PTR); } @@ -3240,7 +3237,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete) if (TYPE_HAS_TRIVIAL_DESTRUCTOR (type)) { - if (auto_delete == sfk_base_destructor) + if (auto_delete != sfk_deleting_destructor) return void_zero_node; return build_op_delete_call diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h index 716a93bd6dc..210255e3e8b 100644 --- a/gcc/cp/lang-specs.h +++ b/gcc/cp/lang-specs.h @@ -31,6 +31,25 @@ Boston, MA 02111-1307, USA. */ {"@c++", /* cc1plus has an integrated ISO C preprocessor. We should invoke the external preprocessor if -save-temps is given. */ +#if ENABLE_NEW_GXX_ABI + "%{E|M|MM:cpp0 -lang-c++ -D_GNU_SOURCE %{!no-gcc:-D__GNUG__=%v1}\ + %{!fno-new-abi:-D__GXX_ABI_VERSION=100}\ + %{ansi:-D__STRICT_ANSI__ -trigraphs -$} %(cpp_options)}\ + %{!E:%{!M:%{!MM:\ + %{save-temps:cpp0 -lang-c++ -D_GNU_SOURCE \ + %{!no-gcc:-D__GNUG__=%v1}\ + %{!fno-new-abi:-D__GXX_ABI_VERSION=100}\ + %{ansi:-D__STRICT_ANSI__ -trigraphs -$}\ + %(cpp_options) %b.ii \n}\ + cc1plus %{save-temps:-fpreprocessed %b.ii}\ + %{!save-temps:%(cpp_options)\ + %{!no-gcc:-D__GNUG__=%v1} -D_GNU_SOURCE \ + %{!fno-new-abi:-D__GXX_ABI_VERSION=100}\ + %{ansi:-D__STRICT_ANSI__}}\ + %{ansi:-trigraphs -$}\ + %(cc1_options) %2 %{+e1*}\ + %{!fsyntax-only:%(invoke_as)}}}}" +#else "%{E|M|MM:cpp0 -lang-c++ %{!no-gcc:-D__GNUG__=%v1}\ %{fnew-abi:-D__GXX_ABI_VERSION=100}\ %{ansi:-D__STRICT_ANSI__ -trigraphs -$} %(cpp_options)}\ @@ -47,7 +66,9 @@ Boston, MA 02111-1307, USA. */ %{ansi:-D__STRICT_ANSI__}}\ %{ansi:-trigraphs -$}\ %(cc1_options) %2 %{+e*}\ - %{!fsyntax-only:%(invoke_as)}}}}"}, + %{!fsyntax-only:%(invoke_as)}}}}" +#endif + }, {".ii", "@c++-cpp-output"}, {"@c++-cpp-output", "%{!M:%{!MM:%{!E:\ -- 2.30.2