https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109821
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The second issue an buffer overflow: -O0 -fsanitize=undefined -fsanitize=address, we get: /app/example.cpp:19:9: runtime error: store to misaligned address 0x7f4fad20002c for type 'uint64_t', which requires 8 byte alignment 0x7f4fad20002c: note: pointer points here 39 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 00 00 00 00 00 00 00 00 00 00 ^ ================================================================= ==1==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7f4fad20003c at pc 0x0000004013c2 bp 0x7fff80744570 sp 0x7fff80744568 WRITE of size 8 at 0x7f4fad20003c thread T0 #0 0x4013c1 in IncrementalCopyFastPath /app/example.cpp:19 #1 0x4015c1 in main /app/example.cpp:32 #2 0x7f4faf58f082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee) #3 0x40114d in _start (/app/output.s+0x40114d) (BuildId: 634f65b0ae11c54185ffa1239c341eaa4dd87ee3) Address 0x7f4fad20003c is located in stack of thread T0 at offset 60 in frame #0 0x401456 in main /app/example.cpp:27 This frame has 1 object(s): [32, 63) 'src' (line 29) <== Memory access at offset 60 partially overflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow /app/example.cpp:20 in IncrementalCopyFastPath Shadow bytes around the buggy address: 0x7f4fad1ffd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x7f4fad1ffe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x7f4fad1ffe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x7f4fad1fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x7f4fad1fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x7f4fad200000: f1 f1 f1 f1 00 00 00[07]f3 f3 f3 f3 00 00 00 00 0x7f4fad200080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x7f4fad200100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x7f4fad200180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x7f4fad200200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x7f4fad200280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==1==ABORTING