DSPRelated.com
Forums

optimization problem (file level o3)

Started by ahma...@yahoo.com December 18, 2008
Dear all, Please help me
my code works without optimization. but when I set it to file level (o3) optimization it doesn't work and it remains for allways in the following while loop. when I investigated the code in mixed mode I saw that the spitobyte() function is deleted in readreg() function. Even when I substituted spitobyte() with its source code compiler deleted some parts of it and it didn't work. Do you know why? and how can I use the code in file level optimization without this problem?( I work with CCS3.1 and c5510 DSP)

int readreg(int i)
{
bytetospi(i);
return spitobyte();
}

...
regval=readreg(31);
while(regval)
regval=readreg(31);
...
How about you define the parameter 'volatile'? But it can also because of other problems.

Wei

--- In c..., ahmadagha23@... wrote:
>
> Dear all, Please help me
> my code works without optimization. but when I set it to file level
(o3) optimization it doesn't work and it remains for allways in the
following while loop. when I investigated the code in mixed mode I saw
that the spitobyte() function is deleted in readreg() function. Even
when I substituted spitobyte() with its source code compiler deleted
some parts of it and it didn't work. Do you know why? and how can I
use the code in file level optimization without this problem?( I work
with CCS3.1 and c5510 DSP)
>
> int readreg(int i)
> {
> bytetospi(i);
> return spitobyte();
> }
>
> ...
> regval=readreg(31);
> while(regval)
> regval=readreg(31);
> ...
>