https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97950
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 49613
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49613&action=edit
gcc11-pr97950.patch
Untested fix for the short cases.
As for __int128, I think it would be better if you filed a separate issue,
because it has nothing to do with the short one, and mentioned which moves you
find redundant. Generally, some redundant moves will be there with double-word
arithmetics, it is a matter of when exactly it is the right time to lower
double-word operations (and which) into word ones, doing it too early prevents
e.g. STV from doing its job and e.g. doing for __int128 some operations in SSE
registers, while doing it too late may result in the already assigning pairs of
GP registers for the 128-bit pseudos and while some useless moves can be
recovered afterwards, certainly not all of them. x86 doesn't really have
instructions that would allow implementing the 128-bit multiplications with
overflow efficiently.