This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ill effect of <register>+<constant>
- From: "Jan Beulich" <jbeulich at novell dot com>
- To: <binutils at sourceware dot org>
- Date: Fri, 21 Sep 2007 14:08:22 +0100
- Subject: ill effect of <register>+<constant>
Isn't it a bug that, for i386,
.text
.intel_syntax noprefix
_start:
.equ base, edx+4
.equ idx, edi-1
mov eax, [base+idx*4]
results in
mov eax, [esi+esi*4]
? Consequently, shouldn't expr() refrain from doing *any* optimization when
either side of O_add or the left side of O_subtract is a register? There are two
intentions I have with using expr() rather than doing parsing by hand (one is
the parsing of register names in the .cfi_* directive handling, the other is the
handling of x86 Intel mode (instruction operand) expressions, but both would
depend on register symbols to be retained unchanged throughout the
expression parsing/evaluation.
Thanks, Jan