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
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
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?
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99965
Andrew Pinski changed:
What|Removed |Added
Status|WAITING |RESOLVED
Resolution|---
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
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99965
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |WAITING
Ever confirmed|0
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)