Attention is currently required from: Paul Menzel. Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/62828 )
Change subject: x86: mmio: Qualify variables as volatile ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
There is no garantee in the C standard that '(type *)CONSTANT' will actually point to the hardware address 'CONSTANT'. It's just how gcc happens to do it in most cases. [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c29]
That's it, folks, the GCC developers have now completely lost their minds as well. There's officially no sane compiler left.
Declaring these pointer arguments as volatile has no real meaning in C and is really "wrong" from a theoretical standpoint. Personally, I think I'd prefer if we could wait with uprevving to GCC 11+ until they hopefully have found their senses again and implemented a flag to disable this crap, if we should be so lucky. Or is maybe setting -Wno-array-bounds for a while an option? How useful is that warning?
However, if we want to stick to this then please at least clarify in the commit message that this is a workaround for a GCC bug, not a real fix. And add a comment to mmio.h to point to the bug so we might maybe one day have a chance to revert this back out.