diff options
author | Jan Beulich <jbeulich@suse.com> | 2021-06-07 12:04:24 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2021-06-07 12:04:24 +0200 |
commit | 014fbcda4c662c275532eb0e0e7ef57f46bd7321 (patch) | |
tree | 6731012674c8d09b313da22e71e5bee039c5d0fc /gas/config/tc-i386.c | |
parent | 9d299bea8cca3bfd91a3c7a47510c52a9e829858 (diff) | |
download | gdb-014fbcda4c662c275532eb0e0e7ef57f46bd7321.zip gdb-014fbcda4c662c275532eb0e0e7ef57f46bd7321.tar.gz gdb-014fbcda4c662c275532eb0e0e7ef57f46bd7321.tar.bz2 |
x86: allow unary operators to start a memory operand
So far only - was permitted, but +, !, and ~ ought to be treated the
same.
Rather than adding them to digit_chars[], which was at least odd to have
held - so far, drop this array and its wrapper macro for being used just
once.
While adjusting this logic, also include [ in the characters which may
start a displacement expression - gas generally treats [] as equivalent
to ().
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r-- | gas/config/tc-i386.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 063383c..bbdb5bd4 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -518,7 +518,6 @@ static char mnemonic_chars[256]; static char register_chars[256]; static char operand_chars[256]; static char identifier_chars[256]; -static char digit_chars[256]; /* Lexical macros. */ #define is_mnemonic_char(x) (mnemonic_chars[(unsigned char) x]) @@ -526,7 +525,6 @@ static char digit_chars[256]; #define is_register_char(x) (register_chars[(unsigned char) x]) #define is_space_char(x) ((x) == ' ') #define is_identifier_char(x) (identifier_chars[(unsigned char) x]) -#define is_digit_char(x) (digit_chars[(unsigned char) x]) /* All non-digit non-letter characters that may occur in an operand. */ static char operand_special_chars[] = "%$-+(,)*._~/<>|&^!:[@]"; @@ -3140,14 +3138,7 @@ md_begin (void) for (c = 0; c < 256; c++) { - if (ISDIGIT (c)) - { - digit_chars[c] = c; - mnemonic_chars[c] = c; - register_chars[c] = c; - operand_chars[c] = c; - } - else if (ISLOWER (c)) + if (ISDIGIT (c) || ISLOWER (c)) { mnemonic_chars[c] = c; register_chars[c] = c; @@ -3185,7 +3176,6 @@ md_begin (void) identifier_chars['?'] = '?'; operand_chars['?'] = '?'; #endif - digit_chars['-'] = '-'; mnemonic_chars['_'] = '_'; mnemonic_chars['-'] = '-'; mnemonic_chars['.'] = '.'; @@ -11370,10 +11360,9 @@ maybe_adjust_templates (void) static INLINE bool starts_memory_operand (char c) { - return is_digit_char (c) + return ISDIGIT (c) || is_identifier_char (c) - || c == '"' - || c == '('; + || strchr ("([\"+-!~", c); } /* Parse OPERAND_STRING into the i386_insn structure I. Returns zero |