diff --git a/gas/ChangeLog b/gas/ChangeLog index 4931c1a811..700014d47f 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,17 @@ +2019-12-11 Wilco Dijkstra + + * config/tc-arm.c (warn_on_restrict_it): Add new variable. + (it_fsm_post_encode): Check warn_on_restrict_it. + (arm_option_table): Add -mwarn-restrict-it/-mno-warn-restrict-it. + * testsuite/gas/arm/armv8-2-fp16-scalar-bad.d: Add -mwarn-restrict-it. + * testsuite/gas/arm/armv8-2-fp16-scalar-bad-ext.d: Likewise. + * testsuite/gas/arm/armv8-a-bad.d: Likewise. + * testsuite/gas/arm/armv8-a-it-bad.d: Likewise. + * testsuite/gas/arm/armv8-r-bad.d: Likewise. + * testsuite/gas/arm/armv8-r-it-bad.d: Likewise. + * testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d: Likewise. + * testsuite/gas/arm/udf.d: Likewise. + 2018-12-11 Jan Beulich * config/tc-i386.c (md_assemble): Extend SSE check conditional. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index c4ffeeec3a..e680f93cff 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -154,6 +154,7 @@ static int pic_code = FALSE; static int fix_v4bx = FALSE; /* Warn on using deprecated features. */ static int warn_on_deprecated = TRUE; +static int warn_on_restrict_it = FALSE; /* Understand CodeComposer Studio assembly syntax. */ bfd_boolean codecomposer_syntax = FALSE; @@ -22788,6 +22789,7 @@ it_fsm_post_encode (void) handle_pred_state (); if (now_pred.insn_cond + && warn_on_restrict_it && !now_pred.warn_deprecated && warn_on_deprecated && ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v8) @@ -30529,6 +30531,11 @@ struct arm_option_table arm_opts[] = {"mwarn-deprecated", NULL, &warn_on_deprecated, 1, NULL}, {"mno-warn-deprecated", N_("do not warn on use of deprecated feature"), &warn_on_deprecated, 0, NULL}, + + {"mwarn-restrict-it", N_("warn about performance deprecated IT instructions" + " in ARMv8-A and ARMv8-R"), &warn_on_restrict_it, 1, NULL}, + {"mno-warn-restrict-it", NULL, &warn_on_restrict_it, 0, NULL}, + {"mwarn-syms", N_("warn about symbols that match instruction names [default]"), (int *) (& flag_warn_syms), TRUE, NULL}, {"mno-warn-syms", N_("disable warnings about symobls that match instructions"), (int *) (& flag_warn_syms), FALSE, NULL}, {NULL, NULL, NULL, 0, NULL} diff --git a/gas/testsuite/gas/arm/armv8-2-fp16-scalar-bad-ext.d b/gas/testsuite/gas/arm/armv8-2-fp16-scalar-bad-ext.d index b98e7cf7b2..d904944514 100644 --- a/gas/testsuite/gas/arm/armv8-2-fp16-scalar-bad-ext.d +++ b/gas/testsuite/gas/arm/armv8-2-fp16-scalar-bad-ext.d @@ -1,4 +1,4 @@ #name: Invalid armv8.2-a scalar fp16 #source: armv8-2-fp16-scalar-bad.s -#as: -march=armv8.2-a+fp16 +#as: -march=armv8.2-a+fp16 -mwarn-restrict-it #error_output: armv8-2-fp16-scalar-bad.l diff --git a/gas/testsuite/gas/arm/armv8-2-fp16-scalar-bad.d b/gas/testsuite/gas/arm/armv8-2-fp16-scalar-bad.d index 13eb7c759f..da625db4dd 100644 --- a/gas/testsuite/gas/arm/armv8-2-fp16-scalar-bad.d +++ b/gas/testsuite/gas/arm/armv8-2-fp16-scalar-bad.d @@ -1,4 +1,4 @@ #name: Invalid armv8.2-a scalar fp16 #source: armv8-2-fp16-scalar-bad.s -#as: -march=armv8.2-a+fp16 -mfpu=fp-armv8 +#as: -march=armv8.2-a+fp16 -mfpu=fp-armv8 -mwarn-restrict-it #error_output: armv8-2-fp16-scalar-bad.l diff --git a/gas/testsuite/gas/arm/armv8-a-bad.d b/gas/testsuite/gas/arm/armv8-a-bad.d index 302658d7a1..45109ceeb3 100644 --- a/gas/testsuite/gas/arm/armv8-a-bad.d +++ b/gas/testsuite/gas/arm/armv8-a-bad.d @@ -1,4 +1,4 @@ #name: Invalid v8-a #source: armv8-ar-bad.s -#as: -march=armv8-a +#as: -march=armv8-a -mwarn-restrict-it #error_output: armv8-ar-bad.l diff --git a/gas/testsuite/gas/arm/armv8-a-it-bad.d b/gas/testsuite/gas/arm/armv8-a-it-bad.d index 43fc9f1c5b..02788e0dcd 100644 --- a/gas/testsuite/gas/arm/armv8-a-it-bad.d +++ b/gas/testsuite/gas/arm/armv8-a-it-bad.d @@ -1,4 +1,4 @@ #name: Deprecated IT blocks (ARM v8) #source: armv8-ar-it-bad.s #error_output: armv8-ar-it-bad.l -#as: -march=armv8-a -mimplicit-it=always +#as: -march=armv8-a -mimplicit-it=always -mwarn-restrict-it diff --git a/gas/testsuite/gas/arm/armv8-r-bad.d b/gas/testsuite/gas/arm/armv8-r-bad.d index 150390b587..b643c81de5 100644 --- a/gas/testsuite/gas/arm/armv8-r-bad.d +++ b/gas/testsuite/gas/arm/armv8-r-bad.d @@ -1,4 +1,4 @@ #name: Invalid v8-r #source: armv8-ar-bad.s -#as: -march=armv8-r +#as: -march=armv8-r -mwarn-restrict-it #error_output: armv8-ar-bad.l diff --git a/gas/testsuite/gas/arm/armv8-r-it-bad.d b/gas/testsuite/gas/arm/armv8-r-it-bad.d index 5260ae004f..c6f0c5bcae 100644 --- a/gas/testsuite/gas/arm/armv8-r-it-bad.d +++ b/gas/testsuite/gas/arm/armv8-r-it-bad.d @@ -1,4 +1,4 @@ #name: Deprecated IT blocks (ARM v8) #source: armv8-ar-it-bad.s #error_output: armv8-ar-it-bad.l -#as: -march=armv8-r -mimplicit-it=always +#as: -march=armv8-r -mimplicit-it=always -mwarn-restrict-it diff --git a/gas/testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d b/gas/testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d index 8ca576b2b8..41a6cdced7 100644 --- a/gas/testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d +++ b/gas/testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d @@ -1,4 +1,4 @@ -# as: -march=armv8-a +# as: -march=armv8-a -mwarn-restrict-it # name: Invalid SP and PC operands test - THUMB (v8a) # source: sp-pc-validations-bad-t.s # error_output: sp-pc-validations-bad-t-v8a.l diff --git a/gas/testsuite/gas/arm/udf.d b/gas/testsuite/gas/arm/udf.d index f53a43757e..a6a021e4d0 100644 --- a/gas/testsuite/gas/arm/udf.d +++ b/gas/testsuite/gas/arm/udf.d @@ -1,6 +1,6 @@ #objdump: -dr --prefix-addresses --show-raw-insn #name: UDF -#as: -march=armv8-a +#as: -march=armv8-a -mwarn-restrict-it #warning_output: udf.l #skip: *-*-pe *-*-wince