https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82394
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Component|c++ |middle-end --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- With GCC 7.1 on x86_64, they both produce: my_sorted_array: .LFB0: .cfi_startproc xorl %eax, %eax ret my_sorted_array1: .LFB1: .cfi_startproc xorl %eax, %eax ret I have not tried the trunk yet.