https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100253
Bug ID: 100253 Summary: [10/11/12 Regression] wrong code with -O2 -fno-tree-bit-ccp -ftree-slp-vectorize (unaligned movdqa) Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Created attachment 50672 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50672&action=edit testcase Output: $ x86_64-pc-linux-gnu-g++ testcase.C -O2 -fno-tree-bit-ccp -ftree-slp-vectorize $ ./a.out Segmentation fault Program received signal SIGSEGV, Segmentation fault. 0x00000000004011aa in S::operator= (this=0x404120 <s>) at testcase.C:7 7 struct S (gdb) disas Dump of assembler code for function main(): 0x0000000000401180 <+0>: push %rbp 0x0000000000401181 <+1>: mov $0x404120,%edi 0x0000000000401186 <+6>: push %rbx 0x0000000000401187 <+7>: sub $0x8,%rsp 0x000000000040118b <+11>: movsbq 0x2f2d(%rip),%rbp # 0x4040c0 <c> 0x0000000000401193 <+19>: shl $0x6,%rbp 0x0000000000401197 <+23>: lea 0x4040e0(%rbp),%rsi 0x000000000040119e <+30>: call 0x4014e0 <_ZNSt6vectorIS_I1TSaIS0_EESaIS2_EEaSERKS4_> 0x00000000004011a3 <+35>: movzbl 0x4040f8(%rbp),%eax => 0x00000000004011aa <+42>: movdqa 0x404109(%rbp),%xmm0 0x00000000004011b2 <+50>: movdqa 0x4040f9(%rbp),%xmm1 0x00000000004011ba <+58>: mov %al,0x2f78(%rip) # 0x404138 <s+24> 0x00000000004011c0 <+64>: xor %eax,%eax 0x00000000004011c2 <+66>: movups %xmm1,0x2f70(%rip) # 0x404139 <s+25> 0x00000000004011c9 <+73>: movups %xmm0,0x2f79(%rip) # 0x404149 <s+41> 0x00000000004011d0 <+80>: add $0x8,%rsp 0x00000000004011d4 <+84>: pop %rbx 0x00000000004011d5 <+85>: pop %rbp 0x00000000004011d6 <+86>: ret