On 10/19/21 12:52, Richard Sandiford wrote:
It looks like this ought to happen after the alloca and copy, since it
modifies the string.
Oh yeah, good point.
Ready to be installed with the change?
Thanks,
Martin
From 68df4cba3bccb714a14e3c795e6d9e4a44c54318 Mon Sep 17 00:00:00 2001
From: Martin Liska <mli...@suse.cz>
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")));
--
2.33.1