+2019-04-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/89093
+ * config/arm/arm.c (arm_valid_target_attribute_rec): Use strcmp
+ instead of strncmp when checking for thumb and arm. Formatting fixes.
+
2019-04-12 Iain Buclaw <ibuclaw@gdcproject.org>
* doc/install.texi: Document --with-target-system-zlib.
while (ISSPACE (*q)) ++q;
argstr = NULL;
- if (!strncmp (q, "thumb", 5))
- opts->x_target_flags |= MASK_THUMB;
+ if (!strcmp (q, "thumb"))
+ opts->x_target_flags |= MASK_THUMB;
- else if (!strncmp (q, "arm", 3))
- opts->x_target_flags &= ~MASK_THUMB;
+ else if (!strcmp (q, "arm"))
+ opts->x_target_flags &= ~MASK_THUMB;
else if (!strncmp (q, "fpu=", 4))
{
int fpu_index;
- if (! opt_enum_arg_to_value (OPT_mfpu_, q+4,
+ if (! opt_enum_arg_to_value (OPT_mfpu_, q + 4,
&fpu_index, CL_TARGET))
{
error ("invalid fpu for target attribute or pragma %qs", q);
}
else if (!strncmp (q, "arch=", 5))
{
- char* arch = q+5;
+ char *arch = q + 5;
const arch_option *arm_selected_arch
= arm_parse_arch_option_name (all_architectures, "arch", arch);
--- /dev/null
+/* PR target/89093 */
+/* { dg-do compile } */
+
+__attribute__((target ("arm.foobar"))) void f1 (void) {} /* { dg-error "unknown target attribute or pragma 'arm.foobar'" } */
+__attribute__((target ("thumbozoo1"))) void f2 (void) {} /* { dg-error "unknown target attribute or pragma 'thumbozoo1'" } */
+__attribute__((target ("arm,thumbique"))) void f3 (void) {} /* { dg-error "unknown target attribute or pragma 'thumbique'" } */
+__attribute__((target ("thumb981,arm"))) void f4 (void) {} /* { dg-error "unknown target attribute or pragma 'thumb981'" } */