AVR C Runtime Library - Bugs: bug #26734, Unsafe SP register changes in...
You are not allowed to post comments on this tracker with your current authentication level.
bug #26734: Unsafe SP register changes in ISR_NOBLOCK interrupt handlers
Submitter: | Anatoly Sokolov <aesok> | ||
Submitted: | Wed 03 Jun 2009 02:10:16 AM UTC | ||
Category: | Library | Severity: | 5 - Blocker |
Priority: | 9 - Immediate | Item Group: | Header files |
Status: | None | Percent Complete: | 0% |
Assigned to: | None | Open/Closed: | Open |
Release: | 1.6.6 | Fixed Release: | None |
Fri 08 Jun 2012 10:45:18 PM UTC, comment #2: |
Georg-Johann Lay <gjlayde> |
Wed 03 Jun 2009 03:07:00 AM UTC, comment #1: The ISR(INT0_vect,ISR_NOBLOCK) macro expand in:
This code confused the GCC. The 'interrupt' attribute makes emit the 'sei' instruction but the 'signal' attribute makes don't disable interrupt when SP reg is changed.
This is bad use 'interrupt' and 'signal' attribute simultaneously.
1. I will add in the GCC code for checking incorrect attributes use. i.e use 'interrupt' and 'signal' attribute simultaneously for one function.
2. avr-libc should be modified and don't use 'interrupt' and 'signal' attribute simultaneously.
Anatoly. |
Anatoly Sokolov <aesok>![]() |
Wed 03 Jun 2009 02:10:16 AM UTC, original submission:
Test case:
ISR(INT0_vect,ISR_NOBLOCK)
foo = 1;
INTERRUPT(PCINT0_vect)
foo = 1;
int main(void)
For 'PCINT0_vect' interrupt handler correct code is generated:
INTERRUPT(PCINT0_vect)
For 'INT0_vect' interrupt handler wrong code is generated:
ISR(INT0_vect,ISR_NOBLOCK)
Anatoly. |
Anatoly Sokolov <aesok>![]() |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Follows 1 latest change.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2012-11-16 | arcanum | Priority | 5 - Normal | ![]() |
9 - Immediate |
With avr-gcc 4.7.1 and higher, attribute interrupt will override attribute signal, see
http://gcc.gnu.org/PR53256
and the GCC manual.