#797 - col - Fri Jan 10, 2003 6:36 pm
hello
I've recently been having problems with my gba register access code.
Symptoms are:
the game works perfect on emulators, but crashed intermittently on hardware.
This was tracked down (thanks to VBA) to illegal word READS from the bios area!
It turned out that these reads were being caused by some code that uses register defines to WRITE!? to gba registers.
the registers are all defined in the usual manner
#define REG_XXXX *(volatile u32*)0x04000nnn
After some fiddling i discovered that everything is Aok when only optimising -O2.
The thing is - I get a noticable performance boost using -O3, and want to keep this switched on, so does anyone know what the problem might be?
why does -O3 think that it can optimise a write to a volatile by including a read??
and how can i switch this behaviour off? any ideas?
I'm using the latest windoze devkitadv
thanks
col
I've recently been having problems with my gba register access code.
Symptoms are:
the game works perfect on emulators, but crashed intermittently on hardware.
This was tracked down (thanks to VBA) to illegal word READS from the bios area!
It turned out that these reads were being caused by some code that uses register defines to WRITE!? to gba registers.
the registers are all defined in the usual manner
#define REG_XXXX *(volatile u32*)0x04000nnn
After some fiddling i discovered that everything is Aok when only optimising -O2.
The thing is - I get a noticable performance boost using -O3, and want to keep this switched on, so does anyone know what the problem might be?
why does -O3 think that it can optimise a write to a volatile by including a read??
and how can i switch this behaviour off? any ideas?
I'm using the latest windoze devkitadv
thanks
col