[Oberon] Beware of "optimizing" compilers

Chris Burrows chris at cfbsoftware.com
Tue Jul 21 04:57:59 MEST 2009

>-----Original Message-----
>From: oberon-bounces at lists.inf.ethz.ch 
>[mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of Paul Reed
>Sent: Tuesday, 21 July 2009 4:08 AM
>To: oberon at lists.inf.ethz.ch
>Subject: [Oberon] Beware of "optimizing" compilers
>For those of us who believe in keeping things simple, a 
>certain amount of Schadenfreude can be had at the moment due 
>to a security flaw discovered in the latest Linux kernel, 
>caused by a compiler:

I had to look up 'Schadenfreude' - very appropriate! 

I had a similar feeling recently when reading of some poor soul's experience
with the ARM gcc compiler:

gcc optimizer bug

maybe I am totally wrong, but this code:

typedef volatile unsigned long __vu32;
void bs()
int i;
__vu32 *tbl = (__vu32 *)0xffffff00;
for(i = 0; i < 64; ++i){
*tbl++ = (__vu32)10;

compiles with -Os to an endless loop:
mvn r2, #255
mov r3,#10
str r3, [r2], #4
b .L2

It is really difficult for me to be sympathetic when I see code like that,

Chris Burrows
CFB Software

Armaide: ARM Oberon-07 Development System

More information about the Oberon mailing list