[Top][All Lists]

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

[avr-gcc-list] Interrupt prologues

From: Curtis Maloney
Subject: [avr-gcc-list] Interrupt prologues
Date: Tue, 01 Feb 2005 10:54:25 +1100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Ben Mann wrote:
While many of us are having to hand-assemble
interrupt handlers to get around AVR-GCC's occasionally long-winded and
inefficient prologue/epilogue,

I'd been meaning to ask others about this. One of our other developers complained of the absurdly long prologue on a simple interrupt function he'd written which needed to check a port pin ASAP. I checked the code, and noticed some odd things.

An example:

  58                    /* prologue: frame size=0 */
  59 0000 1F92                  push __zero_reg__
  60 0002 0F92                  push __tmp_reg__
  61 0004 0FB6                  in __tmp_reg__,__SREG__
  62 0006 0F92                  push __tmp_reg__
  63 0008 1124                  clr __zero_reg__
  64 000a 8F93                  push r24
  65 000c 9F93                  push r25
  66                    /* prologue end (size=7) */

All looks sane enough. Saving the zero, temp, and status regs, and the two regs the ISR uses.

However, why save the zero and tmp regs, when they are not used at all in the function? Is this because they're "hidden" from GCC, and saved as a precaution?

This is with gcc 3.4.1 (WinAVR), but also does it with gcc 4.0.0 (20050123)

Curtis Maloney

reply via email to

[Prev in Thread] Current Thread [Next in Thread]