https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105198
--- Comment #11 from Tomas Kalibera <tomas.kalibera at gmail dot com> --- Thanks for the very quick fix! I confirm that when R is built with the fixed version of GCC 12, the R testcase for MASS is fixed, it works with -O2.