[PATCH][AArch64][11/14] Re-layout SIMD builtin types on builtin expansion

Kyrill Tkachov kyrylo.tkachov@arm.com
Thu Jul 16 15:21:00 GMT 2015


Hi all,

This patch fixes an ICE that I encountered while testing the series.
The testcase in the patch ICEs during builtin expansion because the testcase
is compiled with +nofp which means the builtin SIMD types are laid out
according to the nofp rules, but later when a function tagged with +simd
tries to use them assuming they are laid out for SIMD, the ICE occurs.

I've struggled for some time to find a good fix for that.
This is the best I could come up with. During expansion time we take
the decl of the thing being passed to the builtin function and re-lay it.
The majority (all?) of uses of these builtins are only within the intrinsics in arm_neon.h anyway.
This fixes the ICE and doesn't have a negative impact on compile time (not that I could measure, anyway)

This patch also initializes the crc intrinsics unconditionally to handle the case where a user may compile
a file with +nocrc and then have a function with +crc using an intrinsic.

Bootstrapped and tested on aarch64.

Ok for trunk?

Thanks,
Kyrill

2015-07-16  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/aarch64/aarch64.c (aarch64_option_valid_attribute_p):
     Initialize simd builtins if TARGET_SIMD.
     * config/aarch64/aarch64-builtins.c (aarch64_init_simd_builtins):
     Make sure that the builtins are initialized only once no matter how
     many times the function is called.
     (aarch64_init_builtins): Unconditionally initialize crc builtins.
     (aarch64_relayout_simd_param): New function.
     (aarch64_simd_expand_args): Use above during argument expansion.
     * config/aarch64/aarch64-c.c (aarch64_pragma_target_parse): Initialize
     simd builtins if TARGET_SIMD.
     * config/aarch64/aarch64-protos.h (aarch64_init_simd_builtins): New
     prototype.
     (aarch64_relayout_simd_types): Likewise.

2015-07-16  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * gcc.target/aarch64/target-attr-crypto-ice-1.c: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aarch64-attrs-11.patch
Type: text/x-patch
Size: 6287 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150716/1423bafa/attachment.bin>


More information about the Gcc-patches mailing list