aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-12-22 09:30:23 -0500
committerJason Merrill <jason@gcc.gnu.org>2009-12-22 09:30:23 -0500
commit5dd65e227a6091dbe81b46e484a242f6a58f5cd9 (patch)
treecde08b7486c98e370adc902038bb467b4933cdac /gcc
parent6be8006d35fa0a235786df00b1b500422e7866fa (diff)
downloadgcc-5dd65e227a6091dbe81b46e484a242f6a58f5cd9.zip
gcc-5dd65e227a6091dbe81b46e484a242f6a58f5cd9.tar.gz
gcc-5dd65e227a6091dbe81b46e484a242f6a58f5cd9.tar.bz2
mangle.c (write_member_name): Move abi-version=1 code back to...
* mangle.c (write_member_name): Move abi-version=1 code back to... (write_expression): ...here. From-SVN: r155399
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/mangle.c27
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle14.C1
4 files changed, 23 insertions, 14 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ab9c0df..ed0aeeb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-21 Jason Merrill <jason@redhat.com>
+
+ * mangle.c (write_member_name): Move abi-version=1 code back to...
+ (write_expression): ...here.
+
2009-12-21 Brian Hackett <bhackett1024@gmail.com>
* decl.c (finish_function): Rename pre-genericize event.
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index d673c6e..13b0ed4 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -2299,12 +2299,7 @@ write_member_name (tree member)
if (TREE_CODE (member) == IDENTIFIER_NODE)
write_source_name (member);
else if (DECL_P (member))
- {
- /* G++ 3.2 incorrectly put out both the "sr" code and
- the nested name of the qualified name. */
- G.need_abi_warning = 1;
- write_unqualified_name (member);
- }
+ write_unqualified_name (member);
else if (TREE_CODE (member) == TEMPLATE_ID_EXPR)
{
tree name = TREE_OPERAND (member, 0);
@@ -2401,17 +2396,27 @@ write_expression (tree expr)
write_string ("at");
write_type (TREE_OPERAND (expr, 0));
}
- else if (abi_version_at_least (2) && TREE_CODE (expr) == SCOPE_REF)
+ else if (TREE_CODE (expr) == SCOPE_REF)
{
tree scope = TREE_OPERAND (expr, 0);
tree member = TREE_OPERAND (expr, 1);
+ if (!abi_version_at_least (2))
+ {
+ write_string ("sr");
+ write_type (scope);
+ /* G++ 3.2 incorrectly put out both the "sr" code and
+ the nested name of the qualified name. */
+ G.need_abi_warning = 1;
+ write_encoding (member);
+ }
+
/* If the MEMBER is a real declaration, then the qualifying
scope was not dependent. Ideally, we would not have a
SCOPE_REF in those cases, but sometimes we do. If the second
argument is a DECL, then the name must not have been
dependent. */
- if (DECL_P (member))
+ else if (DECL_P (member))
write_expression (member);
else
{
@@ -2576,12 +2581,6 @@ write_expression (tree expr)
sorry ("mangling new-expression");
break;
- /* Handle pointers-to-members specially. */
- case SCOPE_REF:
- write_type (TREE_OPERAND (expr, 0));
- write_member_name (TREE_OPERAND (expr, 1));
- break;
-
default:
for (i = 0; i < TREE_OPERAND_LENGTH (expr); ++i)
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b31b4a1..0245226 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2009-12-21 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/abi/mangle14.C: Add expected mangling.
+
2009-12-21 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
* gcc.dg/pr36901.h: AVR must support address zero.
diff --git a/gcc/testsuite/g++.dg/abi/mangle14.C b/gcc/testsuite/g++.dg/abi/mangle14.C
index 1205ac4..2b38255 100644
--- a/gcc/testsuite/g++.dg/abi/mangle14.C
+++ b/gcc/testsuite/g++.dg/abi/mangle14.C
@@ -1,5 +1,6 @@
// { dg-do compile }
// { dg-options "-Wabi -fabi-version=1" }
+// { dg-final { scan-assembler "_Z1g1SIXadsr1ANS0_1fIiEEivEE" } }
struct A {
template <typename T> int f ();