dip1000 and preview in combine to cause extra safety errors

Paulo Pinto pjmlp at progtools.org
Tue Jun 14 07:34:29 UTC 2022


On Tuesday, 14 June 2022 at 07:17:39 UTC, forkit wrote:
> On Tuesday, 14 June 2022 at 04:40:44 UTC, rikki cattermole 
> wrote:
>> [...]
>
> how do I can explain this result in godbolt(using the -O 
> paramater to ldc2):
>
> https://d.godbolt.org/z/hhT8MPesv
>
> if I understand the output correctly (and it's possible I 
> don't), then it's telling me that there is no difference, in 
> terms of the number of intructions needed, to allocate an int 
> on the stack vs allocating it on the heap - no difference 
> whatsoever. I don't get it.
>
> Is the outcome perculiar to just this simple example?

The compiler removed it, as you aren't using it,  naturally it 
looks the same.

Now tell the compiler not to be smart helping you,

https://d.godbolt.org/z/fY14oz86E



More information about the Digitalmars-d mailing list