Skip to contentSkip to conversation

FYI ARM GCC 4.6.x miscompiles the kernel

DISCUSSION Krzysztof Halasa 2 participants 3 messages Aug 13, 2011 – Aug 14, 2011

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw
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: e12fff1e bx lr

#2 lore raw

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: e12fff1e bx lr

On x86-64:
0000000000000000 <test>:
0: f3 c3 repz retq

Signature · 1 line
Krzysztof Halasa