https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143
--- Comment #14 from Giulio Benetti <giulio.benetti at benettiengineering dot com> --- This bug still shows up in gcc version 9.x and 11.x. But not on version 10.x I've found the simple work-around to disable the optimization(override CFLAGS with -O0) and it works.