[Bug middle-end/108448] GCC Elides Assignment to Pointer and memcpy

2025-02-24 Thread gavin at yzena dot com via Gcc-bugs
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

[Bug middle-end/108448] GCC Elides Assignment to Pointer and memcpy

2025-02-24 Thread gavin at yzena dot com via Gcc-bugs
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

[Bug middle-end/108448] GCC Elides Assignment to Pointer and memcpy

2023-01-23 Thread gavin at yzena dot com via Gcc-bugs
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.

[Bug middle-end/108448] GCC Elides Assignment to Pointer and memcpy

2023-01-19 Thread gavin at yzena dot com via Gcc-bugs
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.

[Bug middle-end/108448] GCC Elides Assignment to Pointer and memcpy

2023-01-19 Thread gavin at yzena dot com via Gcc-bugs
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

[Bug middle-end/108448] GCC Elides Assignment to Pointer and memcpy

2023-01-18 Thread gavin at yzena dot com via Gcc-bugs
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

[Bug middle-end/108448] GCC Elides Assignment to Pointer and memcpy

2023-01-18 Thread gavin at yzena dot com via Gcc-bugs
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

[Bug middle-end/108448] GCC Elides Assignment to Pointer and memcpy

2023-01-18 Thread gavin at yzena dot com via Gcc-bugs
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

[Bug c/108448] New: GCC Elides Assignment to Pointer and memcpy

2023-01-18 Thread gavin at yzena dot com via Gcc-bugs
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