This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bad generation of jmp r/m32 with offset
- To: Joseph Kain <joseph at 3dfx dot com>
- Subject: Re: Bad generation of jmp r/m32 with offset
- From: Alan Modra <alan at SPRI dot Levels dot UniSA dot Edu dot Au>
- Date: Tue, 18 Jan 2000 09:30:07 +1030 (CST)
- cc: gcc-bugs at gcc dot gnu dot org
>[snip]
> GNU as version 2.9.5 (BFD 2.9.5.0.22) issues no warning but instead
> assembles the jump incorectly as:
> FF6804 (JMP FAR mem)
>
> Although it is the behavior of the assembler that has changed I
> believe this is a bug in gcc as it is emiting the wrong assembly. If
> the jump instruction is changed from
> jmp 4(%eax)
> to
> jmp *4(%eax)
>
> Then no warning is issued from as 2.9.1 and both assemblers generate
> the correct binary code.
This isn't a gcc bug, as I believe gcc has no way of knowing that a "*" is
needed for correct asm syntax. You should provide the "*" in your asm
statement.
However, it *is* a bug in the 2.9.5.0.22 assembler, introduced when
.intel_mode syntax support was added. It was fixed 1999-12-27,
and I see H.J. Lu has made a 2.9.5.0.24 release of the linux binutils at
ftp.varesearch.com/pub/support/hjl/binutils/
The new assembler will accept "jmp 4(%eax)" with a warning, and generate
the correct code. Please test it out, and send assembler bug reports to
binutils@sourceware.cygnus.com