Bug#472867: more simplier loop (asm x86 corrected)

2008-05-04 Thread Florian Weimer
* Cyprien LAPLACE: >> This is still undefined. If you need machine address arithmetic, you >> should use uintptr_t and hope for the best. > Does it mean that the loop indexed on an integer should become an > infinite loop ? Not necessarily. However, the compiler may assume that foo() performs

Bug#472867: more simplier loop (asm x86 corrected)

2008-05-04 Thread Cyprien LAPLACE
Florian Weimer a écrit : * Cyprien LAPLACE: 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++); } } This is stil

Bug#472867: more simplier loop (asm x86 corrected)

2008-05-03 Thread Florian Weimer
* Cyprien LAPLACE: > 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++); > } > } This is still undefined.

Bug#472867: more simplier loop (asm x86 corrected)

2008-03-27 Thread Cyprien LAPLACE
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: f

Bug#472867: more simplier loop (asm x86 corrected)

2008-03-27 Thread Bastian Blank
On Thu, Mar 27, 2008 at 12:33:58AM +0100, Cyprien LAPLACE wrote: > /* b.c */ > > int main() > { > register long foo = 0; "signed long". Signed integer values have no overflow behaviour in C. Use "unsigned long" if you want that. > do { >asm volatile("nop"::"r"(foo)); > } while(++foo); Ca

Bug#472867: more simplier loop (asm x86 corrected)

2008-03-26 Thread Cyprien LAPLACE
/* b.c */ int main() { register long foo = 0; do { asm volatile("nop"::"r"(foo)); } while(++foo); return 0; } which gives with gcc-4.3 -O2 -c b.c: b.o: file format elf64-x86-64 Disassembly of section .text: : 0: 31 c0 xor%eax,%eax 2

Bug#472867: more simplier loop

2008-03-26 Thread Cyprien Laplace
/* b.c */ int main() { register long foo = 0; do { asm volatile("nop"::"r"(foo)); } while(++foo); return 0; } which gives with gcc-4.3 -O2 -c b.c: b.o: file format elf64-x86-64 Disassembly of section .text: : 0: b8 00 00 00 00 mov$0x0,%eax 5: