[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 pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585 --- Comment #10 from Andrew Pinski --- If I change zix_btree_iter_is_end to: ZIX_API bool zix_btree_iter_is_end(const struct ZixBTreeIterImpl* const i) { if (!i) return 1; if (i->stack[0].node == NULL) return 1; return 0; } Then

[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 middle-end/109585] Carla/sord miscompiled with -O2 on ARM64 (inlining issue)

2023-04-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585 --- Comment #8 from Andrew Pinski --- Interesting compiling with the C++ front-end (with one minor change of adding a cast to the malloc) does not seg fault at -O2.