This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] gas/arm: Misses deprecated IT instruction warning for ARMv8


given code:

.thumb .syntax unified

it eq
addeq sp, sp, #12

assembled with -march=armv8-a -mthumb, gas fails to warn
that this is a deprecated form.

this patch add this into the deprecated pattern list for armv8.

OK for trunk?

thanks.

gas/
  * config/tc-arm.c (depr_it_insns): New check for inc/dec sp.

gas/testsuite/
  * gas/arm/armv8-a-it-bad.s: Likewise.
  * gas/arm/armv8-a-it-bad.l: Likewise.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 1471fce..2d00935 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -17326,6 +17326,7 @@ static const struct depr_insn_mask depr_it_insns[] = {
   { 0x4800, 0xf800, N_("Literal loads") },
   { 0x4478, 0xf478, N_("Hi-register ADD, MOV, CMP, BX, BLX using pc") },
   { 0x4487, 0xfc87, N_("Hi-register ADD, MOV, CMP using pc") },
+  { 0x00dd, 0x7fff, N_("ADD/SUB sp, sp #imm") },
   { 0, 0, NULL }
 };
 
diff --git a/gas/testsuite/gas/arm/armv8-a-it-bad.l b/gas/testsuite/gas/arm/armv8-a-it-bad.l
index e3a5971..282216e 100644
--- a/gas/testsuite/gas/arm/armv8-a-it-bad.l
+++ b/gas/testsuite/gas/arm/armv8-a-it-bad.l
@@ -12,3 +12,7 @@
 .*:55: Error: r15 not allowed here -- `addeq r0,pc,pc'
 .*:58: Warning: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM
 .*:58: Error: r15 not allowed here -- `addeq pc,r0,r0'
+.*:61: Warning: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: ADD/SUB sp, sp #imm
+.*:65: Warning: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: ADD/SUB sp, sp #imm
+.*:68: Warning: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: ADD/SUB sp, sp #imm
+.*:72: Warning: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: ADD/SUB sp, sp #imm
diff --git a/gas/testsuite/gas/arm/armv8-a-it-bad.s b/gas/testsuite/gas/arm/armv8-a-it-bad.s
index 42f2b86..d1bc07a 100644
--- a/gas/testsuite/gas/arm/armv8-a-it-bad.s
+++ b/gas/testsuite/gas/arm/armv8-a-it-bad.s
@@ -56,3 +56,17 @@ addeq r0, pc, pc
 
 it eq
 addeq pc, r0, r0
+
+it eq
+addeq sp, sp, #12
+
+@ Misaligned immediate.
+it eq
+addeq sp, sp, #3
+
+it eq
+subeq sp, sp, #12
+
+@ Misaligned immediate.
+it eq
+subeq sp, sp, #3

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]