Fix "psb CSYNC" and "bti C".

Message ID 1574372321-32472-1-git-send-email-apinski@marvell.com
State New
Headers show
Series
  • Fix "psb CSYNC" and "bti C".
Related show

Commit Message

Andrew Pinski Nov. 21, 2019, 9:38 p.m.
From: Andrew Pinski <apinski@marvell.com>


psb CYSNC was not finding that CSYNC was a correct spelling.
The problem was upper case version was being put in the
wrong hashtable.  This fixes the problem by using the
correct hashtable.
Also adds testcases for the upper case versions.

OK?  Tested for aarch64-linux-gnu with no test failures.

Thanks,
Andrew Pinski


        * config/tc-aarch64.c (md_begin): Use correct
        hash table for uppercase version of hint.
        * testsuite/gas/aarch64/system-2.s: Extend psb case to uppercase.
        * testsuite/gas/aarch64/system-2.d: Update.
---
 gas/ChangeLog                           | 7 +++++++
 gas/config/tc-aarch64.c                 | 9 ++++++---
 gas/testsuite/gas/aarch64/bti.d         | 3 +++
 gas/testsuite/gas/aarch64/bti.s         | 4 ++++
 gas/testsuite/gas/aarch64/illegal-bti.l | 3 +++
 gas/testsuite/gas/aarch64/system-2.d    | 1 +
 gas/testsuite/gas/aarch64/system-2.s    | 1 +
 7 files changed, 25 insertions(+), 3 deletions(-)

-- 
1.8.3.1

Comments

Nick Clifton Nov. 25, 2019, 10:44 a.m. | #1
Hi Andrew,

>         * config/tc-aarch64.c (md_begin): Use correct

>         hash table for uppercase version of hint.

>         * testsuite/gas/aarch64/system-2.s: Extend psb case to uppercase.

>         * testsuite/gas/aarch64/system-2.d: Update.

 
Approved - please apply.

Cheers
  Nick

Patch

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 9117918..bfab9c4 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@ 
+2019-11-20  Andrew Pinski  <apinski@marvell.com>
+
+	* config/tc-aarch64.c (md_begin): Use correct
+	hash table for uppercase version of hint.
+	* testsuite/gas/aarch64/system-2.s: Extend psb case to uppercase.
+	* testsuite/gas/aarch64/system-2.d: Update.
+
 2019-11-20  Alan Modra  <amodra@gmail.com>
 
 	PR 24944
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 77a9189..c2a6a1e 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -8782,12 +8782,15 @@  md_begin (void)
   for (i = 0; aarch64_hint_options[i].name != NULL; i++)
     {
       const char* name = aarch64_hint_options[i].name;
+      const char* upper_name = get_upper_str(name);
 
       checked_hash_insert (aarch64_hint_opt_hsh, name,
 			   (void *) (aarch64_hint_options + i));
-      /* Also hash the name in the upper case.  */
-      checked_hash_insert (aarch64_pldop_hsh, get_upper_str (name),
-			   (void *) (aarch64_hint_options + i));
+
+      /* Also hash the name in the upper case if not the same.  */
+      if (strcmp (name, upper_name) != 0)
+	checked_hash_insert (aarch64_hint_opt_hsh, upper_name,
+			     (void *) (aarch64_hint_options + i));
     }
 
   /* Set the cpu variant based on the command-line options.  */
diff --git a/gas/testsuite/gas/aarch64/bti.d b/gas/testsuite/gas/aarch64/bti.d
index 4f65ee5..e1ac700 100644
--- a/gas/testsuite/gas/aarch64/bti.d
+++ b/gas/testsuite/gas/aarch64/bti.d
@@ -10,3 +10,6 @@  Disassembly of section \.text:
 .*:	d503245f 	bti	c
 .*:	d503249f 	bti	j
 .*:	d50324df 	bti	jc
+.*:	d503245f 	bti	c
+.*:	d503249f 	bti	j
+.*:	d50324df 	bti	jc
diff --git a/gas/testsuite/gas/aarch64/bti.s b/gas/testsuite/gas/aarch64/bti.s
index 42f199d..528447b 100644
--- a/gas/testsuite/gas/aarch64/bti.s
+++ b/gas/testsuite/gas/aarch64/bti.s
@@ -6,3 +6,7 @@ 
 	bti c
 	bti j
 	bti jc
+
+	bti C
+	bti J
+	bti JC
diff --git a/gas/testsuite/gas/aarch64/illegal-bti.l b/gas/testsuite/gas/aarch64/illegal-bti.l
index 354c6f2..d18f8c5 100644
--- a/gas/testsuite/gas/aarch64/illegal-bti.l
+++ b/gas/testsuite/gas/aarch64/illegal-bti.l
@@ -3,3 +3,6 @@ 
 [^:]*:[0-9]+: Error: selected processor does not support `bti c'
 [^:]*:[0-9]+: Error: selected processor does not support `bti j'
 [^:]*:[0-9]+: Error: selected processor does not support `bti jc'
+[^:]*:[0-9]+: Error: selected processor does not support `bti C'
+[^:]*:[0-9]+: Error: selected processor does not support `bti J'
+[^:]*:[0-9]+: Error: selected processor does not support `bti JC'
diff --git a/gas/testsuite/gas/aarch64/system-2.d b/gas/testsuite/gas/aarch64/system-2.d
index bcf2b8e..7896dfb 100644
--- a/gas/testsuite/gas/aarch64/system-2.d
+++ b/gas/testsuite/gas/aarch64/system-2.d
@@ -10,3 +10,4 @@  Disassembly of section \.text:
    4:	d503221f 	esb
    8:	d503223f 	psb	csync
    c:	d503223f 	psb	csync
+  10:	d503223f 	psb	csync
diff --git a/gas/testsuite/gas/aarch64/system-2.s b/gas/testsuite/gas/aarch64/system-2.s
index 3402e76..d619449 100644
--- a/gas/testsuite/gas/aarch64/system-2.s
+++ b/gas/testsuite/gas/aarch64/system-2.s
@@ -7,4 +7,5 @@ 
 
 	/* Statistical profiling.  */
 	psb csync
+	psb CSYNC
 	hint #0x11