Elektrine lite

← Feed

@saagar@federated.saagarjha.com

Post #2598505

2023-03-19 09:39 UTC

@slomo@toot.cat I expect the reason compilers don’t optimize on this is that it’s not actually very easy to do and has surprising results. But, theoretically, the “a future compiler could be super smart and optimize it!!1” argument does apply.

Replies (1)

  • @slomo@toot.cat Consider, for example: int foo(int i) { if (!i) { exit(0); } else { return do_expensive_thing(i); } } void bar(int a, int b) { return a + b; } How you generate code for bar(foo(/* something */), foo(/* another thing */)) can change.

    Open ##2598506