https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96327
--- Comment #6 from Paul McKenney <paulmckrcu at gmail dot com> --- (In reply to Marc Glisse from comment #5) > I don't think bug 3506 has been fixed (its status seems wrong to me). But > don't worry, there are several other duplicates that still have status NEW > (bug 50677 for instance). > This is a sensible enhancement request, I think some gcc backends already do > a similar optimization, it simply isn't a priority, because volatile almost > means "don't optimize this". > At least the difference between the gcc and clang codes matches those other > PRs. Not sure why you are talking of address computations. Probably because I was confused by the addressing mode and by wishful thinking, and yes, you are quite correct. Anyway, if you look at https://godbolt.org/z/fGze8E, you can see that Clang/LLVM is using a to-memory addl rather than loading, adding, and storing.