From 6b34f5c5ec75823d656b6882f12d46248402a2aa Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 19 Oct 2021 11:11:16 +0200 Subject: [PATCH] target: Support whitespaces in target attr/pragma. PR target/102375 gcc/ChangeLog: * config/aarch64/aarch64.c (aarch64_process_one_target_attr): Strip whitespaces. gcc/testsuite/ChangeLog: * gcc.target/aarch64/pr102375.c: New test. --- gcc/config/aarch64/aarch64.c | 1 + gcc/testsuite/gcc.target/aarch64/pr102375.c | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/pr102375.c diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 76d99d247ae..fdf341812f4 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -17633,6 +17633,7 @@ aarch64_process_one_target_attr (char *arg_str) char *str_to_check = (char *) alloca (len + 1); strcpy (str_to_check, arg_str); + str_to_check = strip_whitespaces (str_to_check, &len); /* We have something like __attribute__ ((target ("+fp+nosimd"))). It is easier to detect and handle it explicitly here rather than going diff --git a/gcc/testsuite/gcc.target/aarch64/pr102375.c b/gcc/testsuite/gcc.target/aarch64/pr102375.c new file mode 100644 index 00000000000..fa75d319b2d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr102375.c @@ -0,0 +1,4 @@ +/* PR target/102375 */ +/* { dg-do compile } */ + +void calculate(void) __attribute__ ((target ("+sve, +sve2")));