<div dir="ltr"><div dir="ltr">On Thu, 12 Sept 2024 at 04:26, Walter Bright via Digitalmars-d <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 9/11/2024 3:23 PM, Manu wrote:<br>
> Even if you can manage to convince a compiler to write the output you're <br>
> alleging,<br>
<br>
Alleging? I cut and pasted what dmd did and what gcc did. My gcc may behave <br>
differently than yours, as there are many versions of it.<br></blockquote><div><br></div><div>This is literally my point...</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> I would never imagine for a second that's a reliable strategy. The <br>
> optimiser could do all kinds of things... even though in all my experiments, it <br>
> does exactly what I predicted it would.<br>
<br>
Did you use -O?<br></blockquote><div><br></div><div>I used -O2... I don't imagine that would have made a difference though? I don't think I've ever seen anyone use -O before.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
dmd does what I predicted it would, as it is designed to operate that way. If <br>
gcc doesn't do what you want, there's nothing I can do about it.<br></blockquote><div><br></div><div>You're not meant to do anything about it; just accept that your suggestion to rely on contorting the code and a prayer that the compiler emits the code you'd like to see (it doesn't) is not a reasonable suggestion.</div><div>This needs a proper solution.<br></div></div></div>