https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118037
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Jeffrey A. Law from comment #1) > This was fixed in gcc-15. I didn't try to identify precisely what change > though. Most likely the changes that fixed PR 120003 since it is thread2 where the "unswitch" happens and it was fixed in GCC 15.2.0 but not working in GCC 15.1.0. Yes I agree it is fixed.