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.
*powerpc - its 32bit version is eager to allocate globals in .sdata
sections.
Normally, one can expect for the variable to be allocated in .srodata,
however, in case of powerpc-*-* or powerpc64-*-* (with -m32)
'targetm.have_srodata_section == false' and the code in
categorize_decl_for_section(varasm.cc), forces it to allocate in .sdata.
/* If the target uses small data sections, select it. */
else if (targetm.in_small_data_p (decl))
{
if (ret == SECCAT_BSS)
ret = SECCAT_SBSS;
else if targetm.have_srodata_section && ret == SECCAT_RODATA)
ret = SECCAT_SRODATA;
else
ret = SECCAT_SDATA;
}
I'd just skip the test for 32bit ppc. There should be suitable
effective-target tests you can use.
jeff