This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH C++] Fix PR77489 -- mangling of discriminator >= 10
- From: Jason Merrill <jason at redhat dot com>
- To: Markus Trippelsdorf <markus at trippelsdorf dot de>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 18 Jan 2017 10:43:09 -0500
- Subject: Re: [PATCH C++] Fix PR77489 -- mangling of discriminator >= 10
- Authentication-results: sourceware.org; auth=none
- References: <20170111114829.GA288@x4> <20170111120330.GM21933@tucnak> <20170112073634.GA301@x4> <CADzB+2=FAJYrQBmgME+VHXn4Fh6GXTyitrf0ekTTLTBHiLV2_A@mail.gmail.com> <20170118085516.GA6668@x4> <CADzB+2me7wywZMgL97UNsZE1d5vZ_gxw8EUn5Sg-yVRYYxLyqw@mail.gmail.com> <20170118142357.GC6668@x4> <CADzB+2kM0n1AvZS_+PH29L7TbCQWRC27VhABkeFeX2kBzLueAQ@mail.gmail.com> <20170118151644.GD6668@x4> <20170118152528.GT1867@tucnak> <20170118153246.GE6668@x4>
On Wed, Jan 18, 2017 at 10:32 AM, Markus Trippelsdorf
<markus@trippelsdorf.de> wrote:
> On 2017.01.18 at 16:25 +0100, Jakub Jelinek wrote:
>> On Wed, Jan 18, 2017 at 04:16:44PM +0100, Markus Trippelsdorf wrote:
>> > No. It appears to work even without the additional condition:
>> >
>> > % g++ -fabi-version=10 -Wabi=11 -Wall -c gcc/testsuite/g++.dg/abi/pr77489.C
>> > gcc/testsuite/g++.dg/abi/pr77489.C:56:16: warning: the mangled name of ‘localVar’ changes between -fabi-version=10 (_ZZ3foovE8localVar_11) and -fabi-version=11 (_ZZ3foovE8localVar__11_) [-Wabi]
>> > static int localVar = 12;
>> > ^~~~~~~~
>> > gcc/testsuite/g++.dg/abi/pr77489.C:52:16: warning: the mangled name of ‘localVar’ changes between -fabi-version=10 (_ZZ3foovE8localVar_10) and -fabi-version=11 (_ZZ3foovE8localVar__10_) [-Wabi]
>> > static int localVar = 11;
>> > ^~~~~~~~
>>
>> But it is less efficient then for the the one digit discriminators.
>> When we set G.need_abi_warning unnecessarily, then mangle_decl has to
>> mangle it again with different ABI flags and compare the two mangled
>> identifiers. If G.need_abi_warning is not set, we avoid that.
>
> Ok, fair enough.
>
> PR c++/77489
> * mangle.c (write_discriminator): Reorganize abi warning check.
OK, thanks.
Jason