aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/dependency.cc
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2023-06-15 17:15:09 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2023-12-12 15:48:41 +0000
commit321477fc3a0f8de18c4452f431309f896ae3a854 (patch)
treed3ced6aa2df254b5512b63d8387b468f89ea23c6 /gcc/fortran/dependency.cc
parentd83acace704927ee351968258c8a8cd39e305d03 (diff)
downloadgcc-321477fc3a0f8de18c4452f431309f896ae3a854.zip
gcc-321477fc3a0f8de18c4452f431309f896ae3a854.tar.gz
gcc-321477fc3a0f8de18c4452f431309f896ae3a854.tar.bz2
aarch64,arm: Fix branch-protection= parsing
Refactor the parsing to have a single API and fix a few parsing issues: - Different handling of "bti+none" and "none+bti": these should be rejected because "none" can only appear alone. - Accepted empty strings such as "bti++pac-ret" or "bti+", this bug was caused by using strtok_r. - Memory got leaked (str_root was never freed). And two buffers got allocated when one is enough. The callbacks now have no failure mode, only parsing can fail and all failures are handled locally. The "-mbranch-protection=" vs "target("branch-protection=")" difference in the error message is handled by a separate argument to aarch_validate_mbranch_protection. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_override_options): Update. (aarch64_handle_attr_branch_protection): Update. * config/arm/aarch-common-protos.h (aarch_parse_branch_protection): Remove. (aarch_validate_mbranch_protection): Add new argument. * config/arm/aarch-common.cc (aarch_handle_no_branch_protection): Update. (aarch_handle_standard_branch_protection): Update. (aarch_handle_pac_ret_protection): Update. (aarch_handle_pac_ret_leaf): Update. (aarch_handle_pac_ret_b_key): Update. (aarch_handle_bti_protection): Update. (aarch_parse_branch_protection): Remove. (next_tok): New. (aarch_validate_mbranch_protection): Rewrite. * config/arm/aarch-common.h (struct aarch_branch_protect_type): Add field "alone". * config/arm/arm.cc (arm_configure_build_target): Update. gcc/testsuite/ChangeLog: * gcc.target/aarch64/branch-protection-attr.c: Update. * gcc.target/aarch64/branch-protection-option.c: Update.
Diffstat (limited to 'gcc/fortran/dependency.cc')
0 files changed, 0 insertions, 0 deletions