• AVR Freaks

Hot!XC8 v2.10 bug XC8-1775 static local in ISR

Author
dan1138
Super Member
  • Total Posts : 4316
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
2020/02/10 18:33:38 (permalink)
4.5 (4)

XC8 v2.10 bug XC8-1775 static local in ISR

Ok, Microchip is aware of issues related to static local variable in functions invoked through pointers.

See these threads:

https://www.microchip.com/forums/FindPost/1064058
https://www.microchip.com/forums/FindPost/1109955

There seems a related way to cause the same kind of havoc in a Interrupt-Service-Routine.

As bug XC8-1775 was not addressed in v2.10 and I have found that v2.05 behaves in the same way with my code. I recommend not using any local variables in an ISR. Further calling a function with local variables from an ISR may also have issues.

I am not going to report this as a support case to Microchip because I do not have the time to create a simple example application.

Also XC8 v1.45 does not have this bug.
#1

5 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 19185
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: XC8 v2.10 bug XC8-1775 static local in ISR 2020/02/10 18:52:14 (permalink)
    +2 (2)
    Both C90 and C99 mode?
    #2
    dan1138
    Super Member
    • Total Posts : 4316
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: XC8 v2.10 bug XC8-1775 static local in ISR 2020/02/10 23:15:19 (permalink)
    0
    I only tested C90, but I expect it to be bugged in both modes.
    #3
    mpgmike
    Super Member
    • Total Posts : 542
    • Reward points : 0
    • Joined: 2014/01/23 17:27:06
    • Location: NJ
    • Status: offline
    Re: XC8 v2.10 bug XC8-1775 static local in ISR 2020/02/11 08:23:09 (permalink)
    0
    I'm relatively new with programming in C (mostly used PBP and ASM), but I use global variables declared volatile for my ISRs.  Probably a bit bloated once compiled, but at least it works.

    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.
    #4
    Wieschebrock
    Super Member
    • Total Posts : 236
    • Reward points : 0
    • Joined: 2005/01/22 07:57:44
    • Location: Germany
    • Status: online
    Re: XC8 v2.10 bug XC8-1775 static local in ISR 2021/03/08 08:27:59 (permalink)
    +1 (1)
    XC8-1775 was reported 2.5 years ago. Does anyone expect a solution from MC after eons?
     
    #5
    Aussie Susan
    Super Member
    • Total Posts : 3857
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re: XC8 v2.10 bug XC8-1775 static local in ISR 2021/03/08 18:25:03 (permalink)
    0 (2)
    Please remember that this is a user forum - there are only a very few Microchip people that come here.
    If you want an official Microchip response then you will need to log a support ticket or contact your local Microchip representative.
    Susan
    #6
    Jump to:
    © 2021 APG vNext Commercial Version 4.5