Код: Выделить всё
struct Cell
{
Cell* U;
Cell* D;
void Detach();
};
void Cell::Detach()
{
U->D = D;
D->U = U;
}
< /code>
clang -14 -o3 производит: < /p>
mov rax, qword ptr [rdi]
Подробнее здесь: [url]https://stackoverflow.com/questions/71343461/how-does-gcc-not-clang-make-this-optimization-deciding-that-a-store-to-one-str[/url]
Мобильная версия