Possible compiler bug (avr-gcc 7.3 (Arduino)) WRT switch/case jump tables

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So have any of you daring folk using avr-gcc past the Microchip released version seen problems?

The latest Arduino (1.8.10) is using their own build of avr-gcc 7.3.0, and while I hate to cry "compiler bug", they're seeing a problem where (maybe) the start address of a jump table for a dense switch/case statement is getting calculated wrong:

 

https://github.com/arduino/Ardui...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A few months back, I was unable to get a switch/case statement implementation working on version 5.4.0(+atmel 3.6.0). I recall looking at the listing and having a little panic. I stepped away and decided a new plan was needed. I fear the problem was triggered by who knows what else that I was doing; I ended up using a table of pointers to functions.

my projects: https://github.com/epccs

Debugging is harder than programming - don’t write code you can’t debug! https://www.avrfreaks.net/forum/help-it-doesnt-work