[coldfire-gnu-discuss] save value at 0x1000090C with board 5485
Carlos O'Donell
carlos at codesourcery.com
Thu Feb 1 17:43:27 UTC 2007
On Thu, Feb 01, 2007 at 04:37:42AM -0600, Ha Luong wrote:
> #define SLT_SSR0 (*(unsigned long *)(void*)(0x1000090C))
> int main (void)
> {
> int i=0;
> SLT_SSR0=i;
> i=1;
> SLT_SSR0=i;
> printf("%lu",SLT_SSR0);
> i=2;
> SLT_SSR0=i;
> printf("%lu",SLT_SSR0);
> i=3;
> SLT_SSR0=i;
> printf("%lu",SLT_SSR0);
> i=4;
> SLT_SSR0=i;
> printf("%lu",SLT_SSR0);
>
> return 0;
> }
>
> and receive 0034 . I don't know why 2 first values didn't receive 1,2 .
Thank you for using Sourcery G++!
At the highest optimization I get "1234" when I run this on real
hardware. The assembly output from the compiler looks correct.
As another poster has mentioned, if you expect SLT_SSR0 to change
unexpectedly then you should mark the data or accesses as "volatile."
In order to recreate the problem on our end we need you to provide us
with the following information:
1. The compiler command line that causes the failure.
e.g. g++ -O2 -g -o test.o test.cc
2. The output of running the compiler but with "-v" added.
e.g. g++ -v -O2 -g -o test.o test.cc > compiler.log
3. The pre-processed source output by the compiler. This is done by
adding '-save-temps' to the compiler command line. This produces a ".ii"
file that you can attach to an email.
e.g. g++ -save-temps -v -O2 -g -o test.o test.cc
Please attach the "compiler.log" and the "*.ii" file to an email.
Cheers,
Carlos.
--
Carlos O'Donell
CodeSourcery
carlos at codesourcery.com
(650) 331-3385 x716
More information about the coldfire-gnu-discuss
mailing list