aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-i386-intel.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2009-09-14 22:02:26 +0000
committerH.J. Lu <hjl.tools@gmail.com>2009-09-14 22:02:26 +0000
commit6cee4cdae4e52a8fce7f3bba86cc6fa79720e977 (patch)
treea2c01d89f4a978d051f5521ae5da7c88aad5ca77 /gas/config/tc-i386-intel.c
parent41dcd03ff79cb197e121d17028baefbdf49e306f (diff)
downloadgdb-6cee4cdae4e52a8fce7f3bba86cc6fa79720e977.zip
gdb-6cee4cdae4e52a8fce7f3bba86cc6fa79720e977.tar.gz
gdb-6cee4cdae4e52a8fce7f3bba86cc6fa79720e977.tar.bz2
gas/
2009-09-14 H.J. Lu <hongjiu.lu@intel.com> PR gas/10637 * config/tc-i386-intel.c (intel_state): Add has_offset. (i386_intel_simplify): Set intel_state.has_offset to 1 for O_offset. (i386_intel_operand): Turn on intel_state.is_mem if intel_state.has_offset is 0 and the last char is ']'. gas/testsuite/ 2009-09-14 H.J. Lu <hongjiu.lu@intel.com> PR gas/10637 * gas/i386/disp.s: Add tests for Intel syntax. * gas/i386/x86-64-disp.s: Likewise. * gas/i386/disp.d: Updated. * gas/i386/intelok.d: Likewise. * gas/i386/x86-64-disp.d: Likewise. * gas/i386/disp-intel.d: New. * gas/i386/x86-64-disp-intel.d: Likewise. * gas/i386/i386.exp: Run disp-intel and x86-64-disp-intel.
Diffstat (limited to 'gas/config/tc-i386-intel.c')
-rw-r--r--gas/config/tc-i386-intel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c
index ff20874..0c37e45 100644
--- a/gas/config/tc-i386-intel.c
+++ b/gas/config/tc-i386-intel.c
@@ -23,6 +23,7 @@ static struct
{
operatorT op_modifier; /* Operand modifier. */
int is_mem; /* 1 if operand is memory reference. */
+ int has_offset; /* 1 if operand has offset. */
unsigned int in_offset; /* >=1 if processing operand of offset. */
unsigned int in_bracket; /* >=1 if processing operand in brackets. */
unsigned int in_scale; /* >=1 if processing multipication operand
@@ -279,6 +280,7 @@ static int i386_intel_simplify (expressionS *e)
break;
case O_offset:
+ intel_state.has_offset = 1;
++intel_state.in_offset;
ret = i386_intel_simplify_symbol (e->X_add_symbol);
--intel_state.in_offset;
@@ -497,6 +499,10 @@ i386_intel_operand (char *operand_string, int got_a_float)
as_bad (_("invalid expression"));
ret = 0;
}
+ else if (!intel_state.has_offset
+ && input_line_pointer > buf
+ && *(input_line_pointer - 1) == ']')
+ intel_state.is_mem |= 1;
input_line_pointer = saved_input_line_pointer;
free (buf);