On September 14, 2015 4:30:23 PM GMT+02:00, Christian Bruel 
<christian.br...@st.com> wrote:
>Finally, the final part of the patch set does the attribute target 
>parsing and checking, redefines the preprocessor macros and implements 
>the inlining rules.
>
>testcases and documentation included.

@@ -29501,6 +29532,8 @@
 static bool
 arm_valid_target_attribute_rec (tree args, struct gcc_options *opts)
 {
+  int ret=true;
+
   if (TREE_CODE (args) == TREE_LIST)
     {
       bool ret = true;


Doesn't the hunk above trigger a shadow warning? Furthermore there are missing 
spaces before and after the '='. And finally (no diff -p so I can only guess) 
why the int if the function returns a bool?

Thanks,

@@ -29518,30 +29551,35 @@
     }
 
   char *argstr = ASTRDUP (TREE_STRING_POINTER (args));
-  while (argstr && *argstr != '\0')
+  char *q;
+
+  while ((q = strtok (argstr, ",")) != NULL)
     {
-      while (ISSPACE (*argstr))
-       argstr++;
+      while (ISSPACE (*q)) ++q;
 
-      if (!strcmp (argstr, "thumb"))
-       {
+      argstr = NULL;
+      if (!strncmp (q, "thumb", 5))
          opts->x_target_flags |= MASK_THUMB;
-         arm_option_check_internal (opts);
-         return true;
-       }
 
-      if (!strcmp (argstr, "arm"))
-       {
+      else if (!strncmp (q, "arm", 3))
          opts->x_target_flags &= ~MASK_THUMB;
-         arm_option_check_internal (opts);
-         return true;
+
+      else if (!strncmp (q, "fpu=", 4))
+       {
+         if (! opt_enum_arg_to_value (OPT_mfpu_, q+4,
+                                      &opts->x_arm_fpu_index, CL_TARGET))
+           {
+             error ("invalid fpu for attribute(target(\"%s\"))", q);
+             return false;
+           }
        }
+      else
+       warning (0, "attribute(target(\"%s\")) is unknown", argstr);
 
-      warning (0, "attribute(target(\"%s\")) is unknown", argstr);
-      return false;
+      arm_option_check_internal (opts);
     }
 
-  return false;
+  return ret;
 }


>
>thanks
>
>Christian


Reply via email to