[PATCH 2/2] Corrected pr25521.c target matching.

Cupertino Miranda cupertino.miranda@oracle.com
Tue Jan 24 12:24:58 GMT 2023


Thank you for the comments and suggestions.
I have changed the patch.

Unfortunately in case of rx target I could not make
scan-assembler-symbol-section to match. I believe it is because the
.section and .global entries order is reversed in this target.

Patch in inlined below. looking forward to your comments.

Cupertino

-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.patch
Type: text/x-diff
Size: 1240 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20230124/08a839d9/attachment.bin>
-------------- next part --------------


Jeff Law writes:

> On 12/7/22 08:45, Cupertino Miranda wrote:
>>
>>> On 12/2/22 10:52, Cupertino Miranda via Gcc-patches wrote:
>>>> This commit is a follow up of bugzilla #107181.
>>>> The commit /a0aafbc/ changed the default implementation of the
>>>> SELECT_SECTION hook in order to match clang/llvm behaviour w.r.t the
>>>> placement of `const volatile' objects.
>>>> However, the following targets use target-specific selection functions
>>>> and they choke on the testcase pr25521.c:
>>>>    *rx - target sets its const variables as '.section C,"a",@progbits'.
>>> That's presumably a constant section.  We should instead twiddle the test to
>>> recognize that section.
>> Although @progbits is indeed a constant section, I believe it is
>> more interesting to detect if the `rx' starts selecting more
>> standard sections instead of the current @progbits.
>> That was the reason why I opted to XFAIL instead of PASSing it.
>> Can I keep it as such ?
> I'm not aware of any ongoing development for that port, so I would not let
> concerns about the rx port changing behavior dominate how we approach this
> problem.
>
> The rx port is using a different name for the section.  That's  valid thing to
> do and to the extent we can, we should support that in the test rather than
> (incorrectly IMHO) xfailing the test just becuase the name isn't what we
> expected.
>
> To avoid over-eagerly matching, I would probably search for "C,"  I wouldn't do
> that for the const or rodata sections as they often have a suffix like 1, 2, 4,
> 8 for different sized rodata sections.
>
> PPC32 is explicitly doing something different and placing those objects into an
> RW section.  So for PPC32 it makes more sense to skip the test rather than xfail
> it.
>
> Jeff


More information about the Gcc-patches mailing list