https://gcc.gnu.org/g:f9a60d575f02822852aa22513c636be38f9c63ea
commit r15-2240-gf9a60d575f02822852aa22513c636be38f9c63ea Author: Jeff Law <j...@ventanamicro.com> Date: Tue Jul 23 19:11:04 2024 -0600 [PR rtl-optimization/115877][6/n] Add testcase from pr115877 This just adds the testcase from pr115877. It's working now on the trunk. I'm not done with cleanups/bugfixing, but there's no reason to not have the testcase installed at this point. PR rtl-optimization/115877 gcc/testsuite * gcc.dg/torture/pr115877.c: New test. Diff: --- gcc/testsuite/gcc.dg/torture/pr115877.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gcc/testsuite/gcc.dg/torture/pr115877.c b/gcc/testsuite/gcc.dg/torture/pr115877.c new file mode 100644 index 000000000000..432b1280b177 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr115877.c @@ -0,0 +1,20 @@ +/* { dg-do run { target int128 } } */ + +char a[16]; +unsigned short u; + +__int128 +foo (int i) +{ + i -= (unsigned short) ~u; + a[(unsigned short) i] = 1; + return i; +} + +int +main () +{ + __int128 x = foo (0); + if (x != -0xffff) + __builtin_abort(); +}