[PATCH][AArch64] Increase static buffer size in aarch64_rewrite_selected_cpu

Kyrill Tkachov kyrylo.tkachov@arm.com
Mon Apr 20 16:24:00 GMT 2015


Hi all,

When trying to compile a testcase with -mcpu=cortex-a57+crypto+nocrc I got the weird assembler error:
Assembler messages:
Error: missing architectural extension
Error: unrecognized option -mcpu=cortex-a57+crypto+no

The problem is the aarch64_rewrite_selected_cpu that is used to rewrite -mcpu for big.LITTLE options
has a limit of 20 characters in what it handles, which we can exhaust quickly if we specify
architectural extensions in a fine-grained manner.

This patch increases that character limit to 128 and adds an assert to confirm that no bad things
happen.


It also fixes another problem: If we pass a big.LITTLE combination with feature modifiers like:
-mcpu=cortex-a57.cortex-a53+nosimd

the code will truncate everything after '.', thus destroying the extensions that we want to pass.
The patch adds code to stitch the extensions back on after the LITTLE cpu is removed.

Tested aarch64-none-elf and made sure the given mcpu option works fine with the assembler.

Ok for trunk?

Thanks,
Kyrill

2015-04-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * common/config/aarch64/aarch64-common.c (AARCH64_CPU_NAME_LENGTH):
     Increase to 128.
     (aarch64_rewrite_selected_cpu): Do not chop off extensions starting
     at '.'.  Assert that there's enough space for everything.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aarch64-cpu-name-length.patch
Type: text/x-patch
Size: 1922 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150420/c7735150/attachment.bin>


More information about the Gcc-patches mailing list