This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]