[patch][pr22217] Use the most recent decl for mangling

Richard Smith richard at metafoo.co.uk
Thu Jan 22 16:38:40 PST 2015


On Thu, Jan 22, 2015 at 4:36 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> On Thu, Jan 22, 2015 at 12:49 PM, Rafael EspĂ­ndola
> <rafael.espindola at gmail.com> wrote:
>>> It is also a tentative definition in the corresponding case with
>>> __attribute__((section)). In that case, both GCC and Clang silently
>>> ignore the attribute.
>>
>> That is not what I am seeing with gcc. Given
>>
>> int pr22217_foo;
>> int *b = &pr22217_foo;
>> extern int pr22217_foo __attribute__((section("zed")));
>>
>> It produces
>>
>> .section zed,"aw", at progbits
>> .align 4
>> .type pr22217_foo, @object
>> .size pr22217_foo, 4
>> pr22217_foo:
>>
>> I am testing with gcc 4.9.2.
>
> gcc SVN from ~6 months ago ("GCC: (GNU) 4.10.0 20140708
> (experimental)") produces:
>
>         .comm   pr22217_foo,4,4
>
> in C, and
>
>         .globl  pr22217_foo
>         .bss
>         .align 4
>         .type   pr22217_foo, @object
>         .size   pr22217_foo, 4
> pr22217_foo:
>         .zero   4
>
> in C++.

Testing on gcc.godbolt.org shows that GCC 4.5-4.9 all do include the
section, so perhaps this is just a semi-recent regression?




More information about the cfe-commits mailing list