Hi! This testcase has been fixed by r11-5904-g4cf70c20cb10acd6fb1016611d05540728176b60 so I'm checking it in so that we can close the PR.
Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2021-02-02 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/97960 * g++.dg/torture/pr97960.C: New test. --- gcc/testsuite/g++.dg/torture/pr97960.C.jj 2021-02-01 19:00:07.912833437 +0100 +++ gcc/testsuite/g++.dg/torture/pr97960.C 2021-02-01 18:57:04.616927413 +0100 @@ -0,0 +1,30 @@ +// PR tree-optimization/97960 +// { dg-do run } + +#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 +const int & +foo (const int &d, const int &f) +{ + if (d < f) + return f; + return d; +} + +short a[575]; +unsigned b[25]; +unsigned char g; +#endif + +int +main () +{ +#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 + for (int e = 0; e < 23; ++e) + a[e * 23] = 16137; + for (signed char h = (unsigned char) (foo (g, 253) + 3); h < 24; h++) + b[h] = 1064739102; + for (int e = 0; e < 23; ++e) + if (a[e * 23] != 16137) + __builtin_abort (); +#endif +} Jakub