https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107462
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|c++ |tree-optimization Keywords| |missed-optimization --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- There might be a dup of this bug already but gcc does not try to optimize fetch and add to just fetch if the operation was going to be a nop.