I'am using a 2313 and AVR-GCC version 2.95.2 with the -O3 option.
The 2313 has 128Byte SRAM and of course, 32 registers.
I'am using global variables only, to better keep track of my SRAM usage.
There are two 42 byte arrays, and seven single byte variables.
The code consists of main and two interrupt routines (timer overflow and UART_rx). No other function calls.
The problem is, I'am running out of SRAM!
If I'am counting correctly, there should be more than 30 byte SRAM left for the stack if every variable is placed in SRAM, and the only stuff that gets pushed onto the stack is the pc, sr, etc. from the two interrupt calls,
Besides, the compiler should be able to place some variables in registers in order to save even more SRAM, right?
How can I find out exactly how each byte SRAM/register is allocated?