[Bug rtl-optimization/109585] Carla/sord miscompiled with -O2 on ARM64 with flexible array member

2023-04-23 Thread hector at marcansoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585 --- Comment #15 from Hector Martin --- The prior repro was too complex and depended on other environmental stuff (some other people couldn't repro it on arm64 either), so please ignore it. If the reduced repro triggers the issue, it's the same

[Bug middle-end/109585] Carla/sord miscompiled with -O2 on ARM64 (inlining issue)

2023-04-21 Thread hector at marcansoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585 --- Comment #11 from Hector Martin --- Giving a nonzero size to the `ZixBTreeIterFrame stack[]` member also avoids the segfault, so this might be a flexible array member thing.

[Bug middle-end/109585] Carla/sord miscompiled with -O2 on ARM64 (inlining issue)

2023-04-21 Thread hector at marcansoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585 --- Comment #9 from Hector Martin --- Yes, a strict aliasing violation could explain the behavior of the optimizer here... but given all the types are identical and there is no casting going on, clearly there is no strict aliasing violation.

[Bug target/109585] Carla/sord miscompiled with -O2 on ARM64 (inlining issue)

2023-04-21 Thread hector at marcansoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585 --- Comment #6 from Hector Martin --- Cleaned it up into a self-contained repro. Simply compiling with `gcc -O2 -o test test.c && test` gives a segfault. -O1 or -fno-schedule-insns -fno-schedule-insns2 avoids the issue. Looking at assembly

[Bug target/109585] Carla/sord miscompiled with -O2 on ARM64 (inlining issue)

2023-04-21 Thread hector at marcansoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585 --- Comment #5 from Hector Martin --- Created attachment 54904 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54904=edit self-contained reproducer

[Bug target/109585] Carla/sord miscompiled with -O2 on ARM64 (inlining issue)

2023-04-21 Thread hector at marcansoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585 --- Comment #4 from Hector Martin --- This whole codebase is complex, and the problem is in btree code which is hard to simplify down. Best I can do right now is this. First grab the lv2.tar.gz attachment and extract it into /tmp. Then: $ git

[Bug target/109585] Carla/sord miscompiled with -O2 on ARM64 (inlining issue)

2023-04-21 Thread hector at marcansoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585 --- Comment #3 from Hector Martin --- Created attachment 54903 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54903=edit lv2 plugin bundle for testing

[Bug c/109585] Carla/sord miscompiled with -O2 on ARM64 (inlining issue)

2023-04-21 Thread hector at marcansoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585 --- Comment #1 from Hector Martin --- Created attachment 54901 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54901=edit Preprocessed input

[Bug c/109585] New: Carla/sord miscompiled with -O2 on ARM64 (inlining issue)

2023-04-21 Thread hector at marcansoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585 Bug ID: 109585 Summary: Carla/sord miscompiled with -O2 on ARM64 (inlining issue) Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal