https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88877
--- Comment #17 from Alan Modra <amodra at gmail dot com> --- > Is anything broken though? Yes, as demonstrated by the testcase. > If the libcall routines know they are called this way, all is fine. They don't. libgcc functions are mostly C code that can make use of the fact that on ppc64 an unsigned int arg will have the top 32 bits zeroed. We avoid some potential problems with things like popcount by not having a popcountsi. Instead we use popcountdi, and that results in gcc zero-extending a 32-bit value to 64 bits before we reach emit_library_call_value_1.