[Bug rtl-optimization/103550] 2 more instructions generated by gcc than clang

unlvsur at live dot com gcc-bugzilla@gcc.gnu.org
Sat Dec 4 13:56:45 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103550

--- Comment #10 from cqwrteur <unlvsur at live dot com> ---
(In reply to Roger Sayle from comment #9)
> Note adding -fno-tree-reassoc results in fewer instructions than clang.

maybe I am a little bit picky since I keep writing "portable assembly code"
with C++. I just frequently compare assembly generated by the compiler to
manually written assembly. However, I think that is how we got an improvement
on the GCC compiler since I do frequently find out suboptimal codegen with it.

The 21 instructions look really good. Do not know whether we can squeeze it
further.

Do not get me wrong. Actually, clang runs much slower for my sha512 in general
(since they generate much more instructions (around 10% more)). I just compare
GCC to openssl's manually written assembly (well it is actually generated by
perl script) and i feel it moves more registers.


More information about the Gcc-bugs mailing list