[Bug rtl-optimization/97961] unnecessary moves with __builtin_{add,sub}_overflow_p and __int128

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jan 19 23:23:44 GMT 2023


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 94804. The problem is arguments.
If we do:
```
bool f1(unsigned __int128 *a,unsigned __int128 *b) {
    return __builtin_add_overflow_p(*a, *b, (unsigned __int128)0);
}

bool f2(__int128 *a,__int128 *b) {
    return __builtin_add_overflow_p(*a, *b, (__int128)0);
}


bool f3(unsigned __int128 *a,unsigned __int128 *b) {
    return __builtin_sub_overflow_p(*a, *b, (unsigned __int128)0);
}

bool f4(__int128 *a,__int128 *b) {
    return __builtin_sub_overflow_p(*a, *b, (__int128)0);
}
```
We don't get extra mov's.

*** This bug has been marked as a duplicate of bug 94804 ***


More information about the Gcc-bugs mailing list