```d
import std.stdio;

__gshared int literal;

void main() {
    int[0] callstack;
    (&callstack+literal).writeln;
}
```

```asm
_Dmain:
.Lfunc_begin0:
        .file   1 "/" "app/example.d"
        .loc    1 5 0
        .cfi_startproc
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset %rbp, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register %rbp
        subq    $16, %rsp
        movq    _D7example7literali@GOTPCREL(%rip), %rax
        movslq  (%rax), %rax
        leaq    -4(%rbp), %rdi
        imulq   $0, %rax, %rax
        addq    %rax, %rdi
.Ltmp0:
        .loc    1 7 5 prologue_end
        callq   _D3std5stdio__T7writelnTPG0iZQoFNfQkZv@PLT
        .loc    1 8 1
        xorl    %eax, %eax
        .loc    1 8 1 epilogue_begin is_stmt 0
        addq    $16, %rsp
        popq    %rbp
        .cfi_def_cfa %rsp, 8
        retq
```

Its the famed equation ``ax+b``.

But with ``a * x`` becoming ``0`` by the frontend.
  • why is the behav... monkyyy via Digitalmars-d-learn
    • Re: why is ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn

Reply via email to