https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122497
--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to David Binderman from comment #13) > (In reply to Andrew Pinski from comment #11) > > Fixed. > > Good. > > However, I find it somewhat concerning that six lines of C code > at a very mild optimisation level crashed the compiler. > > Clearly, the 62,000 C test cases in the gcc test suite aren't enough. In this case (and maybe only this case). There is an interaction between 3 things which was not thought of when the code was written. 1) First is the enabling of the ranger. 2) the second is the replacing g_4.3_21 with 0 in `g_2[_1][g_4.3_21];` and then trying to fold that. 3) With the ranger on, looking into the range of _1 and going back to `g_4.3_21 + 2;` and getting a crash due to not having `g_4.3_21` defined in the IR. The other thing is SCCP change r14-6010-g2dde9f326ded84 which didn't happen before GCC 14 and didn't the (2) and before r16-4739-g0919526efcb156 didn't do (1). (3 was due to a different change but I don't know when though and I am not going to look into it). Each on its own would be fine; it is just all 3 together introduced the issue. Interactions like this is not always thought of. Even with a good eye on things like this. (there were like 2 commits [in GCC 14] after r14-6010-g2dde9f326ded84 which fixed the unexpected interactions there too).
