aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-02-13 00:26:37 -0500
committerJason Merrill <jason@gcc.gnu.org>2015-02-13 00:26:37 -0500
commit785f21af82139f512eb12f3318899c9f967409e6 (patch)
tree744efbe1acbab7ac37dd08aff6192b4ea5985c38
parent6a1e352e1efbdf33a3df892dadd725f0b09c70c9 (diff)
downloadgcc-785f21af82139f512eb12f3318899c9f967409e6.zip
gcc-785f21af82139f512eb12f3318899c9f967409e6.tar.gz
gcc-785f21af82139f512eb12f3318899c9f967409e6.tar.bz2
re PR c++/64956 (__GXX_ABI_VERSION needs a proper definition for the 5.x releases)
PR c++/64956 * c-opts.c (c_common_post_options): Change flag_abi_version from 0 to the current highest version. * c-cppbuiltin.c (c_cpp_builtins): Assert that it isn't 0. From-SVN: r220675
-rw-r--r--gcc/c-family/ChangeLog7
-rw-r--r--gcc/c-family/c-cppbuiltin.c10
-rw-r--r--gcc/c-family/c-opts.c5
-rw-r--r--gcc/common.opt6
-rw-r--r--gcc/testsuite/g++.dg/abi/macro0.C3
5 files changed, 20 insertions, 11 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 6e4553a..c63384b 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,10 @@
+2015-02-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/64956
+ * c-opts.c (c_common_post_options): Change flag_abi_version from 0
+ to the current highest version.
+ * c-cppbuiltin.c (c_cpp_builtins): Assert that it isn't 0.
+
2015-02-04 Jakub Jelinek <jakub@redhat.com>
PR c/64824
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 1936592..60c2d7f 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -891,14 +891,8 @@ c_cpp_builtins (cpp_reader *pfile)
/* Represents the C++ ABI version, always defined so it can be used while
preprocessing C and assembler. */
if (flag_abi_version == 0)
- /* Use a very large value so that:
-
- #if __GXX_ABI_VERSION >= <value for version X>
-
- will work whether the user explicitly says "-fabi-version=x" or
- "-fabi-version=0". Do not use INT_MAX because that will be
- different from system to system. */
- builtin_define_with_int_value ("__GXX_ABI_VERSION", 999999);
+ /* We should have set this to something real in c_common_post_options. */
+ gcc_unreachable ();
else if (flag_abi_version == 1)
/* Due to a historical accident, this version had the value
"102". */
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index d10e5bd..1a67b5a 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -886,6 +886,11 @@ c_common_post_options (const char **pfilename)
warn_abi = false;
}
+ /* Change flag_abi_version to be the actual current ABI level for the
+ benefit of c_cpp_builtins. */
+ if (flag_abi_version == 0)
+ flag_abi_version = 8;
+
if (cxx_dialect >= cxx11)
{
/* If we're allowing C++0x constructs, don't warn about C++98
diff --git a/gcc/common.opt b/gcc/common.opt
index 87f2e1f..0c60e84 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -806,7 +806,8 @@ Driver Undocumented
;
; 1: The version of the ABI first used in G++ 3.2. No longer selectable.
;
-; 2: The version of the ABI first used in G++ 3.4 (and current default).
+; 2: The version of the ABI first used in G++ 3.4, and the default
+; until GCC 4.9.
;
; 3: The version of the ABI that fixes the missing underscore
; in template non-type arguments of pointer type.
@@ -831,7 +832,8 @@ Driver Undocumented
;
; 8: The version of the ABI that corrects the substitution behavior of
; function types with function-cv-qualifiers.
-; First selectable in G++ 4.9.
+; First selectable in G++ 4.9 and default in G++ 5
+; (set in c_common_post_options).
;
; Additional positive integers will be assigned as new versions of
; the ABI become the default version of the ABI.
diff --git a/gcc/testsuite/g++.dg/abi/macro0.C b/gcc/testsuite/g++.dg/abi/macro0.C
index 6c391e6..fbcbb2c 100644
--- a/gcc/testsuite/g++.dg/abi/macro0.C
+++ b/gcc/testsuite/g++.dg/abi/macro0.C
@@ -1,5 +1,6 @@
+// This testcase will need to be kept in sync with c_common_post_options.
// { dg-options "-fabi-version=0" }
-#if __GXX_ABI_VERSION != 999999
+#if __GXX_ABI_VERSION != 1008
#error "Incorrect value of __GXX_ABI_VERSION"
#endif