aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve
diff options
context:
space:
mode:
authorVictor Do Nascimento <victor.donascimento@arm.com>2023-07-10 20:16:07 +0100
committerVictor Do Nascimento <victor.donascimento@arm.com>2023-12-06 10:39:14 +0000
commit5af697d72d79db7ad5713c18dea8f52cfc79612f (patch)
tree43682a7b91b33a4a6ff413813844ec07428d9593 /gcc/rust/resolve
parentfc42900d21abd5eacb7537c3c8ffc5278d510195 (diff)
downloadgcc-5af697d72d79db7ad5713c18dea8f52cfc79612f.zip
gcc-5af697d72d79db7ad5713c18dea8f52cfc79612f.tar.gz
gcc-5af697d72d79db7ad5713c18dea8f52cfc79612f.tar.bz2
aarch64: Add front-end argument type checking for target builtins
In implementing the ACLE read/write system register builtins it was observed that leaving argument type checking to be done at expand-time meant that poorly-formed function calls were being "fixed" by certain optimization passes, meaning bad code wasn't being properly picked up in checking. Example: const char *regname = "amcgcr_el0"; long long a = __builtin_aarch64_rsr64 (regname); is reduced by the ccp1 pass to long long a = __builtin_aarch64_rsr64 ("amcgcr_el0"); As these functions require an argument of STRING_CST type, there needs to be a check carried out by the front-end capable of picking this up. The introduced `check_general_builtin_call' function will be called by the TARGET_CHECK_BUILTIN_CALL hook whenever a call to a builtin belonging to the AARCH64_BUILTIN_GENERAL category is encountered, carrying out any appropriate checks associated with a particular builtin function code. gcc/ChangeLog: * config/aarch64/aarch64-builtins.cc (aarch64_general_check_builtin_call): New. * config/aarch64/aarch64-c.cc (aarch64_check_builtin_call): Add `aarch64_general_check_builtin_call' call. * config/aarch64/aarch64-protos.h (aarch64_general_check_builtin_call): New. gcc/testsuite/ChangeLog: * gcc.target/aarch64/acle/rwsr-3.c: New.
Diffstat (limited to 'gcc/rust/resolve')
0 files changed, 0 insertions, 0 deletions