Re: Do not spill variables/registers on the stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mi, 2011-02-02 at 17:34 +0000, Philip Herron wrote:
> I am not quite sure what you are asking/trying to do

What I'm trying to achieve is to compile some piece of code without
"any" optimization but keep the variables in registers, i.e. do not
spill them on the stack. Optimization level 1 does that, i.e. it keeps
variables in registers and only spills them if there are to many, but it
also enables a lot of other optimization techniques which I do not want.

I don't want to run the application in the end. The binary file will be
analyzed afterwards by other applications and the CFG will be
reconstructed. Therefore, the binary is not used in real world
scenarios, it is more of a "scientific interest".

[...]
> But have you tried comparing the outputs of what -O0 outputs to say -O2 ?

The problem with using anything else then -O0 is that it enables other
optimization techniques, e.g. constant propagation (the example of the
first mail would be scaled down to a simple "return 0;") which I do not
want. Therefore, I would like to compile my code without any
optimizations except register allocation.

I hope it got more clear. Otherwise just let me know.

Any other ideas?

Kind regards,
Stefan



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux