[Bug rtl-optimization/40987] ifcvt sometimes goes wrong for integer modes > 64bit
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jun 2 00:56:08 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40987
--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is a x86_64-linux-gnu testcase:
```
#include <stdio.h>
typedef __int128_t mytype;
#define value (((__int128_t)(((unsigned long long)__LONG_LONG_MAX__)+1)) |
(((__int128_t)0xffffffffffffffffull)<<64))
mytype func(long arg) __attribute__((noinline,noclone));
mytype func(long arg) {
mytype val = 0;
if (arg < 0) {
// __int128_t t = 0x8000000000000000ull |
(((__int128_t)0xffffffffffffffff)<<64);
val = value;
}
return val;
}
int main() {
mytype result = func(-1);
if (result != value) {
printf("failed.\n");
return 1;
}
printf("passed.\n");
return 0;
}
```
It failed until GCC 4.9.0
More information about the Gcc-bugs
mailing list