https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96966
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|redundant memcpy not |[8/9/10/11 Regression] |eliminated after pointer |redundant memcpy not |subtraction |eliminated after pointer | |subtraction Known to work| |8.1.0, 8.2.0 Known to fail| |10.2.0, 11.0, 7.3.0, 8.3.0, | |9.2.0 Keywords| |missed-optimization --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- According to Godbolt, GCC 8.1 and 8.2 emit optimal code for both functions but GCC 8.3 emits the less optimal code for f and has g jump to it. Starting with 10.1, GCC emits the same suboptimal code for both functions.