4 ms·
FreePascal: procedure x; var a: integer; b: pinteger; begin b := @a; b^ := 1; b^ := 2; end; becomes project
by benibela 5y ago
FreePascal:
procedure x;
var a: integer;
b: pinteger;
begin
b := @a;
b^ := 1;
b^ := 2;
end;
becomes
project1.lpr:15 begin
0000000000401090 50 push %rax
project1.lpr:17 b^ := 1;
0000000000401091 c7042401000000 movl $0x1,(%rsp)
project1.lpr:18 b^ := 2;
0000000000401098 c7042402000000 movl $0x2,(%rsp)
project1.lpr:19 end;
000000000040109F 59 pop %rcx
00000000004010A0 c3 ret
Perhaps Delphi, too
Although I do not know how much is by design and how much comes from bugs in the optimizer. But they said that one reason why they maintain their own optimizer rather than switching to LLVM. LLVM would "break" this function