This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320F2808: honoring the register keyword

Part Number: TMS320F2808

Tool/software: TI C/C++ Compiler

Hello.

I have picked up some old code that has the following

register volatile UINT16 A;
register volatile UINT16 B;
register volatile UINT16 *P;

Using an old compiler (version 3.09) and the command: cl2000 -g -ss -mf -ml -v28
all three variables are allocated to registers.

I'm trying to move to the latest compiler (version 18.1.4.LTS), but find that only P is allocated to a register.  Compiling with cl2000 -v28 -ml -mt -Ooff -g --gen_func_subsections=on

Is there any way to more aggressively force the use of registers for all three variables?

Regards, Giles

  • Giles Robnson said:
    Is there any way to more aggressively force the use of registers for all three variables?

    No.  You can increase the likelihood a register will be used by increasing the optimization level.  You currently use -Ooff.  The equivalent long form of this option is --opt_level=off.  Try --opt_level=2, or --opt_level=3,  or --opt_level=4.

    Thanks and regards,

    -George

  • OK. Thanks for the definitive response, even if it was not what I wanted.
    Other optimizations don't help alas.