[Bug c++/99965] segfault only happening with -O3

2021-04-08 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99965 --- Comment #9 from Jakub Jelinek --- Note, even std::vector isn't guaranteed to align for the pointer types, but usually will, but even when you ensure the start is aligned, the pointer arithmetics you do afterwards needs to ensure that it is

[Bug c++/99965] segfault only happening with -O3

2021-04-07 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99965 --- Comment #8 from Andrew Pinski --- (In reply to Juan Lucas Rey from comment #7) > the thing is removing the vector m_vPointers makes it work. Just by accident. > also this code works fine on clang.. why would it be misaligned? Because pBuf

[Bug c++/99965] segfault only happening with -O3

2021-04-07 Thread juanlucasrey at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99965 --- Comment #7 from Juan Lucas Rey --- the thing is removing the vector m_vPointers makes it work. also this code works fine on clang.. why would it be misaligned?

[Bug c++/99965] segfault only happening with -O3

2021-04-07 Thread juanlucasrey at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99965 --- Comment #6 from Juan Lucas Rey --- I get the following with -fsanitize=alignment bug.cpp:29:21: runtime error: store to misaligned address 0x02249044 for type 'char *', which requires 8 byte alignment 0x02249044: note: pointer

[Bug c++/99965] segfault only happening with -O3

2021-04-07 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99965 Andrew Pinski changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|---

[Bug c++/99965] segfault only happening with -O3

2021-04-07 Thread juanlucasrey at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99965 --- Comment #4 from Juan Lucas Rey --- I get the error "cannot find -lubsan" with -fsanitize=alignment g++ bug.cpp -o bug -O2 -ftree-loop-vectorize -fvect-cost-model && ./bug this also reproduces the segfault

[Bug c++/99965] segfault only happening with -O3

2021-04-07 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99965 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #3

[Bug c++/99965] segfault only happening with -O3

2021-04-07 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99965 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |WAITING Ever confirmed|0

[Bug c++/99965] segfault only happening with -O3

2021-04-07 Thread juanlucasrey at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99965 --- Comment #1 from Juan Lucas Rey --- g++ --version g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)