https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122035
--- Comment #15 from Krzysztof Pecka <krzysiu858519851 at gmail dot com> ---
(In reply to Andrew Pinski from comment #14)
> (In reply to Krzysztof Pecka from comment #13)
> > Can you give me the command that prints you this? I am not getting anything,
> > after adding `-fsanitize=undefined -fsanitize=address`
>
>
> This was at runtime. rather than compile time. That is `-fsanitize=undefined
> -fsanitize=address` detects the issue at runtime.
Ok, I got error printed finally.
What is still weird, is that this error is printed with -O1, but now with -O2
and -O3
g++ -O3 -mavx2 -fsanitize=undefined -fsanitize=address -std=c++26 main.cpp -o
main_gcc
./main_gcc
{Warsaw;16.3=0.0/0.0/0.0, Warsaw;5.0=0.0/0.0/0.0, Warsaw;-11.0=0.0/0.0/0.0}
g++ -O2 -mavx2 -fsanitize=undefined -fsanitize=address -std=c++26 main.cpp -o
main_gcc
./main_gcc
{Warsaw;16.3=0.0/0.0/0.0, Warsaw;5.0=0.0/0.0/0.0, Warsaw;-11.0=0.0/0.0/0.0}
g++ -O1 -mavx2 -fsanitize=undefined -fsanitize=address -std=c++26 main.cpp -o
main_gcc
./main_gcc
=================================================================
==42429==ERROR: AddressSanitizer: stack-buffer-overflow on address
0x7b7b86d00021 at pc 0x7f7b89a7c597 bp 0x7fff796b4d50 sp 0x7fff796b4508
READ of size 2 at 0x7b7b86d00021 thread T0...