FYI ARM GCC 4.6.x miscompiles the kernel
Current gcc-4.6.x SVN, ARMEB EABI.
unsigned var[2];
void test(int arg)
{
unsigned v = *(volatile unsigned *)(&var[arg]);
*(volatile unsigned *)(&var[arg]) = v;
}Disassembly of section .text:
00000000 <test>:
0: e12fff1e bx lr
Signature · 1 line
Krzysztof Halasa
Quoted 1 line · Krzysztof Halasa
Current gcc-4.6.x SVN, ARMEB EABI.
Shouldn't this go to GCC ML too ?
Cheers
Quoted 13 lines
unsigned var[2];
void test(int arg)
{ unsigned v = *(volatile unsigned *)(&var[arg]); *(volatile unsigned *)(&var[arg]) = v; }Disassembly of section .text:
00000000 <test>:
0:e12fff1ebx lr
Re: FYI GCC 4.6.x miscompiles the kernel
Correction: this bug isn't ARM-specific.
Quoted 3 lines · Marek Vasut
Quoted 1 line
Current gcc-4.6.x SVN, ARMEB EABI.
Shouldn't this go to GCC ML too ?
Nope, I put it in bugzilla.
Quoted 8 lines
Quoted 8 lines
unsigned var[2];
void test(int arg)
{ unsigned v = *(volatile unsigned *)(&var[arg]); *(volatile unsigned *)(&var[arg]) = v; }
Quoted 4 lines
Quoted 4 lines
Disassembly of section .text:
00000000 <test>:
0:e12fff1ebx lr
On x86-64:
0000000000000000 <test>:
0: f3 c3 repz retq
Signature · 1 line
Krzysztof Halasa