aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-07-07 21:41:17 +0930
committerAlan Modra <amodra@gmail.com>2022-07-09 21:00:09 +0930
commitd3be5dab558ab91789800a03fc2c1dc3c529eaf5 (patch)
treeedf29f13752e5285589f10ce89a26d6740c760ea /gas/config/tc-arm.c
parentRegenerate with automake-1.15.1 (diff)
downloadbinutils-gdb-d3be5dab558ab91789800a03fc2c1dc3c529eaf5.tar.gz
binutils-gdb-d3be5dab558ab91789800a03fc2c1dc3c529eaf5.tar.bz2
binutils-gdb-d3be5dab558ab91789800a03fc2c1dc3c529eaf5.zip
gas: arm -mwarn-syms duplicates
arm gas is only supposed to warn once per symbol for -mwarn-syms, but doesn't because the str_hash_find added with commit 629310abec88 always returns NULL. That's so because the str_hash_insert inserts a NULL value for the key,value pair. Let str_hash_insert do the job instead. * config/tc-arm.c (arm_tc_equal_in_insn): Correct already_warned logic. * testsuite/gas/arm/pr18347.s: Modify to generate duplicate warning without this patch.
Diffstat (limited to 'gas/config/tc-arm.c')
-rw-r--r--gas/config/tc-arm.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 2e6d175482e..68fd6896607 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -28120,11 +28120,8 @@ arm_tc_equal_in_insn (int c ATTRIBUTE_UNUSED, char * name)
already_warned = str_htab_create ();
/* Only warn about the symbol once. To keep the code
simple we let str_hash_insert do the lookup for us. */
- if (str_hash_find (already_warned, nbuf) == NULL)
- {
- as_warn (_("[-mwarn-syms]: Assignment makes a symbol match an ARM instruction: %s"), name);
- str_hash_insert (already_warned, nbuf, NULL, 0);
- }
+ if (str_hash_insert (already_warned, nbuf, NULL, 0) == NULL)
+ as_warn (_("[-mwarn-syms]: Assignment makes a symbol match an ARM instruction: %s"), name);
}
else
free (nbuf);