https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119070
--- Comment #4 from Taylor Hutt <taylor.hutt at broadcom dot com> --- (In reply to Andrew Pinski from comment #3) > I don't see anything wrong with the warning since it is undefined in C to > what this testcase is trying to do. > > Do you have a full source rather than a reduced one? Because the reduced one > is definitely undefined code. Can you point to the section in the language ref for this? Pointer arithmetic? Sorry, I cannot provide the whole file; it's part of a commercial virtualization product. It's interfacing with (possibly proprietary virtual) hardware via a specification (which I have never seen). The subtraction of 0x2000 from the pointer is, apparently, to access specific hardware. If the operations are undefined, how should one interface directly with hardware without having code broken by UB?