diff mbox

C++ PATCH for c++/44282 (ia32 calling convention attributes and mangling)

Message ID CAFULd4Zy_O08redLf3mmcFF2ZHFVn1+ej4zVkZBfbkG-+1v+tA@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak June 2, 2015, 7:26 a.m. UTC
Hello!

>    PR c++/44282
>    gcc/cp/
>    * mangle.c (attr_strcmp): New.
>    (write_CV_qualifiers_for_type): Also write out attributes that
>    affect type identity.
>    (write_type): Strip all attributes after writing qualifiers.
>    libiberty/
>    * cp-demangle.c (cplus_demangle_type): Handle arguments to vendor
>    extended qualifier.

+++ b/gcc/testsuite/g++.dg/abi/mangle-regparm.C
@@ -0,0 +1,29 @@
+// { dg-do run { target i?86-*-* } }

This should read:

+// { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } }

The test wasn't actually run on x86_64-linux target. I'll commit the
following patch after regtest:

--cut here--
typedef __SIZE_TYPE__ size_t;
--cut here--

Uros.

Comments

Uros Bizjak June 2, 2015, 11:03 a.m. UTC | #1
On Tue, Jun 2, 2015 at 9:26 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
>>    PR c++/44282
>>    gcc/cp/
>>    * mangle.c (attr_strcmp): New.
>>    (write_CV_qualifiers_for_type): Also write out attributes that
>>    affect type identity.
>>    (write_type): Strip all attributes after writing qualifiers.
>>    libiberty/
>>    * cp-demangle.c (cplus_demangle_type): Handle arguments to vendor
>>    extended qualifier.
>
> +++ b/gcc/testsuite/g++.dg/abi/mangle-regparm.C
> @@ -0,0 +1,29 @@
> +// { dg-do run { target i?86-*-* } }
>
> This should read:
>
> +// { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } }
>
> The test wasn't actually run on x86_64-linux target. I'll commit the
> following patch after regtest:

Unfortunately, something is wrong with the testcase itself:

FAIL: g++.dg/abi/mangle-regparm.C  -std=c++98 (test for excess errors)
WARNING: g++.dg/abi/mangle-regparm.C  -std=c++98 compilation failed to
produce executable
FAIL: g++.dg/abi/mangle-regparm.C  -std=c++11 (test for excess errors)
WARNING: g++.dg/abi/mangle-regparm.C  -std=c++11 compilation failed to
produce executable
FAIL: g++.dg/abi/mangle-regparm.C  -std=c++14 (test for excess errors)
WARNING: g++.dg/abi/mangle-regparm.C  -std=c++14 compilation failed to
produce executable

with the following error:

FAIL: g++.dg/abi/mangle-regparm.C  -std=c++98 (test for excess errors)
Excess errors:
/usr/bin/ld: /tmp/ccU8LttY.o: bad reloc symbol index (0x5b550 >= 0x12)
for offset 0x6c in section `.text'
/tmp/ccU8LttY.o: could not read symbols: Bad value

WARNING: g++.dg/abi/mangle-regparm.C  -std=c++98 compilation failed to
produce executable
g++.dg/abi/mangle-regparm.C  -std=c++98 : output file does not exist
UNRESOLVED: g++.dg/abi/mangle-regparm.C  -std=c++98  scan-assembler
_Z18IndirectExternCallIPU7stdcallU7regparmILi3EEFviiEiEvT_T0_S3_

Uros.
Uros Bizjak June 2, 2015, 11:34 a.m. UTC | #2
On Tue, Jun 2, 2015 at 1:03 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Tue, Jun 2, 2015 at 9:26 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> Hello!
>>
>>>    PR c++/44282
>>>    gcc/cp/
>>>    * mangle.c (attr_strcmp): New.
>>>    (write_CV_qualifiers_for_type): Also write out attributes that
>>>    affect type identity.
>>>    (write_type): Strip all attributes after writing qualifiers.
>>>    libiberty/
>>>    * cp-demangle.c (cplus_demangle_type): Handle arguments to vendor
>>>    extended qualifier.
>>
>> +++ b/gcc/testsuite/g++.dg/abi/mangle-regparm.C
>> @@ -0,0 +1,29 @@
>> +// { dg-do run { target i?86-*-* } }
>>
>> This should read:
>>
>> +// { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } }
>>
>> The test wasn't actually run on x86_64-linux target. I'll commit the
>> following patch after regtest:
>
> Unfortunately, something is wrong with the testcase itself:
>
> FAIL: g++.dg/abi/mangle-regparm.C  -std=c++98 (test for excess errors)
> WARNING: g++.dg/abi/mangle-regparm.C  -std=c++98 compilation failed to
> produce executable
> FAIL: g++.dg/abi/mangle-regparm.C  -std=c++11 (test for excess errors)
> WARNING: g++.dg/abi/mangle-regparm.C  -std=c++11 compilation failed to
> produce executable
> FAIL: g++.dg/abi/mangle-regparm.C  -std=c++14 (test for excess errors)
> WARNING: g++.dg/abi/mangle-regparm.C  -std=c++14 compilation failed to
> produce executable
>
> with the following error:
>
> FAIL: g++.dg/abi/mangle-regparm.C  -std=c++98 (test for excess errors)
> Excess errors:
> /usr/bin/ld: /tmp/ccU8LttY.o: bad reloc symbol index (0x5b550 >= 0x12)
> for offset 0x6c in section `.text'
> /tmp/ccU8LttY.o: could not read symbols: Bad value
>
> WARNING: g++.dg/abi/mangle-regparm.C  -std=c++98 compilation failed to
> produce executable
> g++.dg/abi/mangle-regparm.C  -std=c++98 : output file does not exist
> UNRESOLVED: g++.dg/abi/mangle-regparm.C  -std=c++98  scan-assembler
> _Z18IndirectExternCallIPU7stdcallU7regparmILi3EEFviiEiEvT_T0_S3_

FYI, everything links and runs OK if .set is removed from the
following part of the asm:

.LFE4:
       .size   _Z18IndirectExternCallIPU7stdcallU7regparmILi3EEFviiEiEvT_T0_S3_,
.-_Z18IndirectExternCallIPU7stdcallU7regparmILi3EEFviiEiEvT_T0_S3_
       .weak   _Z18IndirectExternCallIPFviiEiEvT_T0_S3_
       .set    _Z18IndirectExternCallIPFviiEiEvT_T0_S3_,_Z18IndirectExternCallIPU7stdcallU7regparmILi3EEFviiEiEvT_T0_S3_
       .section
.text._Z18IndirectExternCallIPFviiEiEvT_T0_S3_,"axG",@progbits,_Z18IndirectExternCallIPFviiEiEvT_T0_S3_,comdat
       .weak   _Z18IndirectExternCallIPFviiEiEvT_T0_S3_
       .type   _Z18IndirectExternCallIPFviiEiEvT_T0_S3_, @function
_Z18IndirectExternCallIPFviiEiEvT_T0_S3_:

Uros.
Jason Merrill June 2, 2015, 1:04 p.m. UTC | #3
On 06/02/2015 07:34 AM, Uros Bizjak wrote:
>> Unfortunately, something is wrong with the testcase itself:
>>
>> FAIL: g++.dg/abi/mangle-regparm.C  -std=c++98 (test for excess errors)
>> WARNING: g++.dg/abi/mangle-regparm.C  -std=c++98 compilation failed to
>> produce executable
>> FAIL: g++.dg/abi/mangle-regparm.C  -std=c++11 (test for excess errors)
>> WARNING: g++.dg/abi/mangle-regparm.C  -std=c++11 compilation failed to
>> produce executable
>> FAIL: g++.dg/abi/mangle-regparm.C  -std=c++14 (test for excess errors)
>> WARNING: g++.dg/abi/mangle-regparm.C  -std=c++14 compilation failed to
>> produce executable
>>
>> with the following error:
>>
>> FAIL: g++.dg/abi/mangle-regparm.C  -std=c++98 (test for excess errors)
>> Excess errors:
>> /usr/bin/ld: /tmp/ccU8LttY.o: bad reloc symbol index (0x5b550 >= 0x12)
>> for offset 0x6c in section `.text'
>> /tmp/ccU8LttY.o: could not read symbols: Bad value
>>
>> WARNING: g++.dg/abi/mangle-regparm.C  -std=c++98 compilation failed to
>> produce executable
>> g++.dg/abi/mangle-regparm.C  -std=c++98 : output file does not exist
>> UNRESOLVED: g++.dg/abi/mangle-regparm.C  -std=c++98  scan-assembler
>> _Z18IndirectExternCallIPU7stdcallU7regparmILi3EEFviiEiEvT_T0_S3_
>
> FYI, everything links and runs OK if .set is removed from the
> following part of the asm:
>
> .LFE4:
>         .size   _Z18IndirectExternCallIPU7stdcallU7regparmILi3EEFviiEiEvT_T0_S3_,
> .-_Z18IndirectExternCallIPU7stdcallU7regparmILi3EEFviiEiEvT_T0_S3_
>         .weak   _Z18IndirectExternCallIPFviiEiEvT_T0_S3_
>         .set    _Z18IndirectExternCallIPFviiEiEvT_T0_S3_,_Z18IndirectExternCallIPU7stdcallU7regparmILi3EEFviiEiEvT_T0_S3_
>         .section
> .text._Z18IndirectExternCallIPFviiEiEvT_T0_S3_,"axG",@progbits,_Z18IndirectExternCallIPFviiEiEvT_T0_S3_,comdat
>         .weak   _Z18IndirectExternCallIPFviiEiEvT_T0_S3_
>         .type   _Z18IndirectExternCallIPFviiEiEvT_T0_S3_, @function
> _Z18IndirectExternCallIPFviiEiEvT_T0_S3_:

Ugh, I thought I had dealt with that issue.  Looking...

Jason
diff mbox

Patch

Index: mangle-regparm.C
===================================================================
--- mangle-regparm.C    (revision 224011)
+++ mangle-regparm.C    (working copy)
@@ -1,4 +1,4 @@ 
-// { dg-do run { target i?86-*-* } }
+// { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } }
// { dg-final { scan-assembler
"_Z18IndirectExternCallIPU7stdcallU7regparmILi3EEFviiEiEvT_T0_S3_" } }