On Tue, Nov 07, 2023 at 03:57:45AM -0600, Segher Boessenkool wrote:
On Mon, Nov 06, 2023 at 06:16:24PM -0800, Paul E. McKenney wrote:
I am very much against incurring real overhead to solve an issue that is
an issue only in theory and not in practice. I wish I could confidently
say that my view will prevail, but...
If what youBut in this case, it would be most excellent if compiler practice were
are writing has a constrained scope, or a limited impact, or both, you
can ignore this "we'll deal with it later if/when it shows up". But a
compiler does not have that luxury at all: it has to make correct
translations from source code to assembler code (or machine code
directly, for some compilers), or refuse to compile something. Making
an incorrect translation is not an option.
to follow theory. Because the theory of avoiding OOTA without emitting
extraneous instructions is quite simple:
Avoid breaking semanitic dependencies.
4. Semantics of volatile. Perhaps the current state is the best
that can be hoped for, but given that the current state is a
few vague words in the standard in combination with the fact
that C-language device drivers must be able to use volatile
to reliably and concurrently access memory shared with device
firmware, one would hope for better.
5. UB on signed integer overflow. Right now, the kernel just
forces wrapping, which works, so maybe we don't really care
all that much. But at this point, it seems to me that it was a
mistake for the language to have failed to provide a means of
specifying signed integers that wrap (int_wrap?). (Yes, yes,
you can get them by making an atomic signed int, but that is
not exactly an ergonomic workaround.)