Bug#472867: more simplier loop (asm x86 corrected)
Hum, well .. another sample test:
/* c.c */
extern void func(void*);
void test()
{
register char (*foo)[32] = (typeof(foo))0-1024;
register int index;
for(index=0;index<1024;index++) {
func(foo++);
}
}
gives, in x86_32:
$ gcc-4.3 -c c.c -O3 && objdump -d c.o
c.o: file format elf32-i386
Disassembly of section .text:
00000000 <test>:
0: 55 push %ebp
1: b8 00 80 ff ff mov $0xffff8000,%eax
6: 89 e5 mov %esp,%ebp
8: 53 push %ebx
9: 83 ec 04 sub $0x4,%esp
c: 8d 74 26 00 lea 0x0(%esi),%esi
10: 8d 58 20 lea 0x20(%eax),%ebx
13: 89 04 24 mov %eax,(%esp)
16: e8 fc ff ff ff call 17 <test+0x17>
1b: 89 d8 mov %ebx,%eax
1d: eb f1 jmp 10 <test+0x10>
still an infinite loop...
Cyprien
Reply to: