This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
gas generating bad code for i386
- To: binutils at sourceware dot cygnus dot com
- Subject: gas generating bad code for i386
- From: Tom Riddle <ftr at oracom dot com>
- Date: Tue, 07 Mar 2000 14:17:01 -0500
- Organization: Oracom Inc.
I think a bug was introduced somewhere between releases
2.9.1.0.23 and 2.9.5.0.22 that causes the following code:
__asm__ __volatile__ (...
"je 4\n\t"
...);
To produce:
0x80483b6 <main+22>: je 0x4
Whereas 2.9.1.0.23 (correctly) gives:
0x80483b6 <main+22>: je 0x80483bc <main+28>
Version:
GNU assembler version 2.9.5 (i386-redhat-linux) using BFD version
2.9.5.0.22
Reproduce the problem with the following code:
int main(int argc, char **argv)
{
int count;
void *p1;
void *p2;
int __res;
__asm__ __volatile__ ("cld\n\t"
"repe\n\t"
"cmpsl\n\t"
"je 4\n\t"
"sbbl %%eax,%%eax\n\t"
"orb $1,%%al\n"
:"=a" (__res):"0" (0),"S" (p1),"D" (p2),"c" (count)
:"si","di","cx");
return __res;
}
** I am not subscribed to this list, please reply directly to me
--
Tom Riddle
Oracom, Inc.
http://www.oracom.com
Tel. +1 978.557.5710x305
Fax +1 978.557.5716