https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108448
--- Comment #17 from Gavin Howard ---
> These links are dead. That's why we want references to a standalone testcase
> given (lines in it or functions and so on)...
Fair enough, but in my defense, it's been two years. I was pretty sure this had
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108448
--- Comment #19 from Gavin Howard ---
Understood.
If I had to guess, and this is a *wild* guess, it's because I'm putting a
pointer to a function in the allocation.
As far as I can tell, this is still allowed, per the docs:
> Attribute `mallo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108448
--- Comment #10 from Gavin Howard ---
I have confirmed that the GCC bug (if it is a bug) also exists in 12.2.1, at
least using the amal.c I have attached.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108448
--- Comment #9 from Gavin Howard ---
> I suspect cmake didn't add -fno-strict-aliasing really.
It did. I ran the build under `intercept-build` and looked at the
`compile_commands.json` output. It had the `-fno-strict-aliasing` for every
file.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108448
--- Comment #8 from Gavin Howard ---
Created attachment 54310
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54310&action=edit
Amalgamation with License Header
Not important for the bug, but I reuploaded the amalgamation with its proper
l
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108448
--- Comment #6 from Gavin Howard ---
Created attachment 54302
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54302&action=edit
An Amalgamation to Reproduce
I have managed to make an amalgamation that reproduces the bug. When you unzip
the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108448
--- Comment #5 from Gavin Howard ---
As mentioned, it works at -O0, and UBSan reports nothing until the segfault.
ASan also reports nothing. Valgrind also reports nothing. They all report
nothing at -O0 and -O2.
I keep my code clean of such thi
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108448
--- Comment #3 from Gavin Howard ---
> Have you tried -fno-strict-aliasing ? I have a feeling like you have some
> aliasing issues in this code ...
Just tried it, same thing happens.
I'll try to make a better test case, but in this case, the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108448
Bug ID: 108448
Summary: GCC Elides Assignment to Pointer and memcpy
Product: gcc
Version: 11.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c