▲ | josephg 9 hours ago | |
I just tried it, and the problem is even worse in gcc. Given this C code:
Clang generates clean code for the eq_copy variant, but complex code for the eq_ref variant. Gcc emits pretty complex code in both variants.For example, here's eq_ref from gcc -O2:
Have a play around: https://c.godbolt.org/z/79Eaa3jYf |