[Bug c/112442] Segfault from casting a ptr when using -O2

2023-11-08 Thread adam.andersson at elisapolystar dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112442 --- Comment #9 from Adam Andersson --- I was sure I had tried -fno-strict-aliasing without any difference, but I guessed I messed up somehow. Sorry about that. Still, is it not strange that -Wall doesn't generate a warning about this then?

[Bug c/112442] Segfault from casting a ptr when using -O2

2023-11-08 Thread adam.andersson at elisapolystar dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112442 --- Comment #4 from Adam Andersson --- (In reply to Andrew Pinski from comment #3) > I am not 100% sure but there seems like some kind of aliasing issue going on. > > Basically you have a pointer to an `unsigned char` but writing it via a > poi

[Bug c/112442] Segfault from casting a ptr when using -O2

2023-11-08 Thread adam.andersson at elisapolystar dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112442 --- Comment #1 from Adam Andersson --- Disregard my comment about it working GCC 12. In gcc version 12.3.0 (GCC) it does not work either.

[Bug c/112442] New: Segfault from casting a ptr when using -O2

2023-11-08 Thread adam.andersson at elisapolystar dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112442 Bug ID: 112442 Summary: Segfault from casting a ptr when using -O2 Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c