https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108740
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Piotr from comment #3) > (In reply to Richard Biener from comment #2) > > Hmm, ICF + re-inlining makes it ignore some of the pointless volatile dance? > > why the code is different abstracting form the sense of the assignment? It is the volatileness of the argument. which by the way for C++20 is deprecated ...