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.
This commit is contained in:
Martin Liska 2021-10-19 11:11:16 +02:00
parent 5f5baf7992
commit 6b34f5c5ec
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,4 @@
/* PR target/102375 */
/* { dg-do compile } */
void calculate(void) __attribute__ ((target ("+sve, +sve2")));