<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 12, 2023, 3:39 AM Anthony Martin <<a href="mailto:ality@pbrane.org">ality@pbrane.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dan Cross <<a href="mailto:crossd@gmail.com" target="_blank" rel="noreferrer">crossd@gmail.com</a>> once said:<br>
> I'm told that the plan9 C compilers were callee-save in part to keep<br>
> these state labels svelte.<br>
<br>
The Plan 9 compilers are caller-save. That means the labels only have<br>
to contain pc and sp.</blockquote></div></div><div dir="auto"><br></div><div dir="auto">Indeed. I typo-ed but meant caller-save; it wouldn't be very svelte if it were the other way around. ;-)</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Waserror works well except for one small issue<br>
involving whether or not the compiler decides to store a value to a<br>
non-volatile, non-pointer variable when the value would not be used<br>
after a function call. As in:<br>
<br>
        int a;<br>
        a = 1;<br>
        if(waserror()){ /* ... */ }<br>
        a = 2;<br>
        a = foo(a);<br>
<br>
The waserror branch may see a == 1 if foo errors.<br>
<br>
Ken's compilers are great, though. They don't engage in antisocial<br>
optimizations based on dubious notions of undefined behavior. I'd<br>
prefer my compiler to not elide explicit null checks or loads and<br>
stores from a pointer.</blockquote></div></div><div dir="auto"><br></div><div dir="auto">It is certainly a shame that modern compiler writers have become essentially hostile to programmers in their pursuit of ever more aggressive optimizations based on rigid readings of the standard, common sense be damned.</div><div dir="auto"><br></div><div dir="auto">As for the plan9 C _language_, in the late 80s, it was arguably an improvement over what ANSI put out. Nowadays, however, I think the inverse is true. *Shrug*</div><div dir="auto"><br></div><div dir="auto">        - Dan C.</div><div dir="auto"><br></div></div>