Earlier quoted context omitted.
> Like assigning an address to then use as pointer to physical memory... What do you mean by this? Like writing to a specific integer address? *((volatile unsigned *)(0x20001000)) = 0x12345678; That's not UB and is also the only way to write to memmapped registers.
It's not UB. It's also not covered by standard - it's implementation-specified. What will happen is dependant on decision of compiler writers. It is, however, not the only way to write to memmapped registers. The original C way of doing so was to use an assembly function wrapping the actual act of reading/writing (honestly, better than doing the above, as it helps making it very explicit how the write will happen as…
At least they don't without LTO.