This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: PATCHes to SIMD vector mangling (more c++/12909)
- From: Jason Merrill <jason at redhat dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>, Richard Henderson <rth at redhat dot com>, Ulrich Drepper <drepper at redhat dot com>
- Date: Thu, 25 Feb 2010 11:38:55 -0500
- Subject: Re: RFC: PATCHes to SIMD vector mangling (more c++/12909)
- References: <4B857CFF.3070908@redhat.com> <4B85B5AB.7010702@codesourcery.com>
On 02/24/2010 06:26 PM, Mark Mitchell wrote:
Jason Merrill wrote:
The second patch improves forward-compatibility by creating an alias
with the new mangling for any decl that uses the old mangling.
I like this one, and not the other one. Let's get the mangling right
(using the new mangling), and -- if we're using the old ABI -- provide
the old mangling for compatibility. I think you need a test-case or two
with your patch, though. :-)
I was waiting on testcases until I know what I'm testing for. :)
The problem with not having the first patch is that it means that
overloading on vectors of different sizes fails with a multiply-defined
symbol error from the assembler or linker, or even silent wrong code if
the definitions are weak and in different objects. If we don't apply
the first patch, I'd like to turn on -Wabi by default so that people at
least get a warning about it.
Jason
commit 3afab971c3414ddb3fe6b1a17211839dca530895
Author: Jason Merrill <jason@redhat.com>
Date: Tue Feb 23 18:09:18 2010 -0500
* c.opt (Wabi): Default to on.
diff --git a/gcc/c.opt b/gcc/c.opt
index f34dcba..1ff84f0 100644
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -113,7 +113,7 @@ C ObjC C++ ObjC++ Joined Separate
-U<macro> Undefine <macro>
Wabi
-C ObjC C++ ObjC++ LTO Var(warn_abi) Warning
+C ObjC C++ ObjC++ LTO Var(warn_abi) Init(1) Warning
Warn about things that will change when compiling with an ABI-compliant compiler
Wpsabi
diff --git a/gcc/testsuite/g++.dg/abi/mangle19-1.C b/gcc/testsuite/g++.dg/abi/mangle19-1.C
index c7ab2cb..1463d03 100644
--- a/gcc/testsuite/g++.dg/abi/mangle19-1.C
+++ b/gcc/testsuite/g++.dg/abi/mangle19-1.C
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options "-fabi-version=2" }
+// { dg-options "-fabi-version=2 -Wno-abi" }
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 15 Dec 2003 <nathan@codesourcery.com>
diff --git a/gcc/testsuite/g++.dg/abi/mangle23.C b/gcc/testsuite/g++.dg/abi/mangle23.C
index c17f54b..f22347a 100644
--- a/gcc/testsuite/g++.dg/abi/mangle23.C
+++ b/gcc/testsuite/g++.dg/abi/mangle23.C
@@ -1,5 +1,5 @@
// PR c++/16240
-// { dg-options "-fabi-version=2" }
+// { dg-options "-fabi-version=2 -Wno-abi" }
void foo(char);
template<void (&)(char)> struct CB {};
diff --git a/gcc/testsuite/g++.dg/eh/simd-2.C b/gcc/testsuite/g++.dg/eh/simd-2.C
index b4c8690..da7ef49 100644
--- a/gcc/testsuite/g++.dg/eh/simd-2.C
+++ b/gcc/testsuite/g++.dg/eh/simd-2.C
@@ -1,6 +1,6 @@
// Test EH when V4SI SIMD registers are involved.
// Contributed by Aldy Hernandez (aldy@quesejoda.com).
-// { dg-options "-O" }
+// { dg-options "-O -Wno-abi" }
// { dg-options "-O -w" { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
// { dg-options "-O -w" { target powerpc*-*-* } }
// { dg-options "-O -w -maltivec" { target { powerpc*-*-* && vmx_hw } } }
diff --git a/gcc/testsuite/g++.dg/ext/attribute-test-2.C b/gcc/testsuite/g++.dg/ext/attribute-test-2.C
index cb3cb24..1870673 100644
--- a/gcc/testsuite/g++.dg/ext/attribute-test-2.C
+++ b/gcc/testsuite/g++.dg/ext/attribute-test-2.C
@@ -1,5 +1,5 @@
// { dg-do run }
-// { dg-options "" }
+// { dg-options "-Wno-abi" }
// PR c++/9844
extern "C" void abort();
diff --git a/gcc/testsuite/g++.dg/ext/vector14.C b/gcc/testsuite/g++.dg/ext/vector14.C
index febdab9..78109c1 100644
--- a/gcc/testsuite/g++.dg/ext/vector14.C
+++ b/gcc/testsuite/g++.dg/ext/vector14.C
@@ -3,6 +3,7 @@
// { dg-options "-msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
// Ignore warning on some powerpc-linux configurations.
// { dg-prune-output "non-standard ABI extension" }
+// { dg-prune-output "mangled name" }
#define vector __attribute__((vector_size(16)))
diff --git a/gcc/testsuite/g++.dg/other/pr34435.C b/gcc/testsuite/g++.dg/other/pr34435.C
index a9c6878..5352a40 100644
--- a/gcc/testsuite/g++.dg/other/pr34435.C
+++ b/gcc/testsuite/g++.dg/other/pr34435.C
@@ -1,5 +1,5 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-msse2" } */
+/* { dg-options "-msse2 -Wno-abi" } */
#include <emmintrin.h>
diff --git a/gcc/testsuite/g++.dg/template/conv8.C b/gcc/testsuite/g++.dg/template/conv8.C
index 96f3b98..01d415b 100644
--- a/gcc/testsuite/g++.dg/template/conv8.C
+++ b/gcc/testsuite/g++.dg/template/conv8.C
@@ -1,4 +1,4 @@
-// { dg-options "-fabi-version=1" }
+// { dg-options "-fabi-version=1 -Wno-abi" }
template <typename T> struct S {
struct I{};
diff --git a/gcc/testsuite/g++.dg/template/nontype9.C b/gcc/testsuite/g++.dg/template/nontype9.C
index f381240..e16eef6 100644
--- a/gcc/testsuite/g++.dg/template/nontype9.C
+++ b/gcc/testsuite/g++.dg/template/nontype9.C
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-prune-output "mangled name" }
// Contributed by: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
int i;
diff --git a/gcc/testsuite/g++.dg/template/qualttp17.C b/gcc/testsuite/g++.dg/template/qualttp17.C
index 4d79c9a..f492ced 100644
--- a/gcc/testsuite/g++.dg/template/qualttp17.C
+++ b/gcc/testsuite/g++.dg/template/qualttp17.C
@@ -1,7 +1,7 @@
// Copyright (C) 2001 Free Software Foundation
// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
// { dg-do compile }
-// { dg-options "-fno-inline -fabi-version=1" }
+// { dg-options "-fno-inline -fabi-version=1 -Wno-abi" }
struct A
{
diff --git a/gcc/testsuite/g++.dg/template/ref1.C b/gcc/testsuite/g++.dg/template/ref1.C
index 9b001fa..5ac4329 100644
--- a/gcc/testsuite/g++.dg/template/ref1.C
+++ b/gcc/testsuite/g++.dg/template/ref1.C
@@ -1,3 +1,4 @@
+// { dg-prune-output "mangled name" }
class a {} a1;
template <a & p> class b { public: b() { static_cast <a &> (p); } };
int main() { b <a1> b1; }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash68.C b/gcc/testsuite/g++.old-deja/g++.pt/crash68.C
index e665787..9afeae0 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/crash68.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash68.C
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-prune-output "mangled name" }
//
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 25 Jul 2001 <nathan@codesourcery.com>
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ref1.C b/gcc/testsuite/g++.old-deja/g++.pt/ref1.C
index ad46289..cb3ffc4 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ref1.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ref1.C
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-prune-output "mangled name" }
int i;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ref3.C b/gcc/testsuite/g++.old-deja/g++.pt/ref3.C
index 29bf3e8..68372b2 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ref3.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ref3.C
@@ -1,4 +1,5 @@
// { dg-do run }
+// { dg-prune-output "mangled name" }
// Origin: John Wilkinson <jfw@sgi.com>
template <class T, int& Size>
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ref4.C b/gcc/testsuite/g++.old-deja/g++.pt/ref4.C
index 867bae5..d0fbf00 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ref4.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ref4.C
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-prune-output "mangled name" }
//
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 29 Apr 2001 <nathan@codesourcery.com>