https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109557
--- Comment #1 from Siddhesh Poyarekar <siddhesh at gcc dot gnu.org> --- The __bdos call itself cannot succeed in main() because it cannot see the allocation in store(). One way it could succeed is if store() was inlined, but for some reason it doesn't, even if you make the function static inline. If I decorate store() with __attribute__((inline)) I get the warning: foo.c:10:1: warning: ‘always_inline’ function might not be inlinable [-Wattributes] but it seems to proceed to inline the call because the assert in main() is no longer hit. So from the __bdos context I'm inclined to say NOTABUG.