https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106022
Bug ID: 106022 Summary: [12/13 Regression] Enable vectorizer generates extra load Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com CC: crazylht at gmail dot com Target Milestone: --- [hjl@gnu-clx-1 gcc-bisect]$ cat x.c void foo(char * c) { c[0] = 0; c[1] = 1; c[2] = 2; c[3] = 3; } [hjl@gnu-clx-1 gcc-bisect]$ gcc -O3 x.c -S [hjl@gnu-clx-1 gcc-bisect]$ cat x.s .file "x.c" .text .p2align 4 .globl foo .type foo, @function foo: .LFB0: .cfi_startproc movl .LC0(%rip), %eax movl %eax, (%rdi) ret .cfi_endproc .LFE0: .size foo, .-foo .section .rodata.cst4,"aM",@progbits,4 .align 4 .LC0: .byte 0 .byte 1 .byte 2 .byte 3 .ident "GCC: (GNU) 12.1.1 20220507 (Red Hat 12.1.1-1)" .section .note.GNU-stack,"",@progbits [hjl@gnu-clx-1 gcc-bisect]$ gcc -O3 x.c -S -fno-tree-vectorize [hjl@gnu-clx-1 gcc-bisect]$ cat x.s .file "x.c" .text .p2align 4 .globl foo .type foo, @function foo: .LFB0: .cfi_startproc movl $50462976, (%rdi) ret .cfi_endproc .LFE0: .size foo, .-foo .ident "GCC: (GNU) 12.1.1 20220507 (Red Hat 12.1.1-1)" .section .note.GNU-stack,"",@progbits [hjl@gnu-clx-1 gcc-bisect]$ /usr/gcc-11.2.1-x32/bin/gcc -S -O3 x.c [hjl@gnu-clx-1 gcc-bisect]$ cat x.s .file "x.c" .text .p2align 4 .globl foo .type foo, @function foo: .LFB0: .cfi_startproc movl $50462976, (%rdi) ret .cfi_endproc .LFE0: .size foo, .-foo .ident "GCC: (GNU) 11.2.1 20220118" .section .note.GNU-stack,"",@progbits [hjl@gnu-clx-1 gcc-bisect]$