This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
gcc version 2.95.2 19991024 (release)
RedHat 6.1 Linux 2.2.12 Pentium III
Built like this
gcc -v --save-temps -o jump jump.c proc.S 2> output
The output from the above is included in plain text below. Attached
are jump.c and proc.S, and jump.i. This a small sample program that
causes the bug.
Here is a description of the bug. gcc 2.95.2 produces the wrong asm for
the dispatch function. The dispatch function looks like this:
void
dispatch (int *i)
{
/* Pop frame pointer */
asm ( "pop %ebp");
asm ( "jmp %0"
: /* no outputs */
: "m" (info.context->procs.test)
);
}
The generated asm looks like this:
.globl dispatch
.type dispatch,@function
dispatch:
pushl %ebp
movl %esp,%ebp
#APP
pop %ebp
#NO_APP
movl info+4,%eax
#APP
jmp 4(%eax)
#NO_APP
.L2:
leave
ret
.Lfe1:
With GNU as version 2.9.1 (BFD 2.9.1.0.24) the following warning is issued for
the jump instruction.
Warning: warning: missing prefix `*' in absolute indirect address,
maybe misassembled!
However it correctly assembles the jump as
FF6004 (JMP r/m32)
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.
Joseph Kain
gcc version/invocation information follows:
cat output
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/cpp -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ jump.c jump.i
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/../../../../include/g++-3
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/../../../../i386-redhat-linux/includeEnd of omitted list.
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/cc1 jump.i -quiet -dumpbase jump.c -version -o jump.s
GNU C version 2.95.2 19991024 (release) (i386-redhat-linux) compiled by GNU C version 2.95.2 19991024 (release).
as -V -Qy -o jump.o jump.s
GNU assembler version 2.9.5 (i386-redhat-linux) using BFD version 2.9.5.0.22
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/cpp -lang-asm -v -$ -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__ASSEMBLER__ -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ proc.S proc.s
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/../../../../include/g++-3
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/../../../../i386-redhat-linux/includeEnd of omitted list.
as -V -Qy -o proc.o proc.s
GNU assembler version 2.9.5 (i386-redhat-linux) using BFD version 2.9.5.0.22
/usr/lib/gcc-lib/i386-redhat-linux/2.95.2/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o jump /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i386-redhat-linux/2.95.2/crtbegin.o -L/usr/lib/gcc-lib/i386-redhat-linux/2.95.2 jump.o proc.o -lgcc -lc -lgcc /usr/lib/gcc-lib/i386-redhat-linux/2.95.2/crtend.o /usr/lib/crtn.o
<<bugreport.tar.bz2>>
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |