On Fri, Apr 12, 2019 at 05:10:48PM +0100, Ramana Radhakrishnan wrote:
> No, that's not right. we should get rid of this.

Here is a patch for that.

Bootstrapped/regtested on armv7hl-linux-gnueabi, ok for trunk?

2019-04-16  Jakub Jelinek  <ja...@redhat.com>

        PR target/89093
        * config/arm/arm.c (arm_valid_target_attribute_rec): Don't skip
        whitespace at the start of target attribute string.

        * gcc.target/arm/pr89093-2.c: New test.

--- gcc/config/arm/arm.c.jj     2019-04-13 17:20:07.353977370 +0200
+++ gcc/config/arm/arm.c        2019-04-15 19:50:31.386414421 +0200
@@ -30871,8 +30871,6 @@ arm_valid_target_attribute_rec (tree arg
 
   while ((q = strtok (argstr, ",")) != NULL)
     {
-      while (ISSPACE (*q)) ++q;
-
       argstr = NULL;
       if (!strcmp (q, "thumb"))
        opts->x_target_flags |= MASK_THUMB;
--- gcc/testsuite/gcc.target/arm/pr89093-2.c.jj 2019-04-15 19:53:23.740608673 
+0200
+++ gcc/testsuite/gcc.target/arm/pr89093-2.c    2019-04-15 19:52:29.841486100 
+0200
@@ -0,0 +1,9 @@
+/* PR target/89093 */
+/* { dg-do compile } */
+
+__attribute__((target (" arm"))) void f1 (void) {} /* { dg-error "unknown 
target attribute or pragma ' arm'" } */
+__attribute__((target ("   thumb"))) void f2 (void) {} /* { dg-error "unknown 
target attribute or pragma '   thumb'" } */
+__attribute__((target ("arm,  thumb"))) void f3 (void) {} /* { dg-error 
"unknown target attribute or pragma '  thumb'" } */
+__attribute__((target ("thumb,  arm"))) void f4 (void) {} /* { dg-error 
"unknown target attribute or pragma '  arm'" } */
+#pragma GCC target ("    arm") /* { dg-error "unknown target attribute or 
pragma '    arm'" } */
+void f5 (void) {}


        Jakub

Reply via email to