Dead Code Elimination
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Wed Oct 21 07:27:54 UTC 2026
On 21/10/2026 8:24 PM, Adam Wilson wrote:
> On Monday, 19 October 2026 at 07:50:10 UTC, Walter Bright wrote:
>> On 10/19/2026 12:04 AM, Alexandru Ermicioi wrote:
>>> On Monday, 19 October 2026 at 06:46:13 UTC, Walter Bright wrote:
>>>> dmd -c -vasm -O -m32 dead.d:
>>>
>>> So is it just 32 bit only?
>>
>> See https://github.com/dlang/dmd/pull/24074
>>
>> The alwaysframe is specific to OSX64.
>>
>> But it does eliminate the dead code due to a DFA optimization called
>> "constant propagation". There's a persistent belief that DMD does not
>> do data flow analysis optimizations.
>
> Has something doesn't mean it works very well. See Rikki's example.
In this case I understand it to have been out of scope.
DCE'ing symbols has requirements that C doesn't provide.
In this case there is no harm in it being missing, but there is harm if
it wasn't designed correctly (see -allinst).
More information about the Digitalmars-d
mailing list