https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80491
Paul Zimmermann <zimmerma+gcc at loria dot fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zimmerma+gcc at loria dot fr --- Comment #15 from Paul Zimmermann <zimmerma+gcc at loria dot fr> --- I just checked with gcc 9.2.1 20191109 (Debian 9.2.1-19) and it seems -O1 produces better code than -O3. Is there a non-regression test? $ gcc -S -O3 test.cc -o- .file "test.cc" .text .p2align 4 .globl _Z3addR4pairS0_ .type _Z3addR4pairS0_, @function _Z3addR4pairS0_: .LFB0: .cfi_startproc movq (%rsi), %rax xorl %ecx, %ecx addq (%rdi), %rax setc %cl movq 8(%rsi), %rdx addq 8(%rdi), %rdx addq %rcx, %rdx ret .cfi_endproc .LFE0: .size _Z3addR4pairS0_, .-_Z3addR4pairS0_ .ident "GCC: (Debian 9.2.1-19) 9.2.1 20191109" .section .note.GNU-stack,"",@progbits $ gcc -S -O1 test.cc -o- .file "test.cc" .text .globl _Z3addR4pairS0_ .type _Z3addR4pairS0_, @function _Z3addR4pairS0_: .LFB0: .cfi_startproc movq (%rdi), %rax movq 8(%rsi), %rdx addq (%rsi), %rax adcq 8(%rdi), %rdx ret .cfi_endproc .LFE0: .size _Z3addR4pairS0_, .-_Z3addR4pairS0_ .ident "GCC: (Debian 9.2.1-19) 9.2.1 20191109" .section .note.GNU-stack,"",@progbits