Don’t blame this on gcc or the library/function author - it is 100% user (i.e. programmer) error. Uninitialised memory of any type is undefined behaviour in the C and C++ abstract machine. That means optimising compilers can assume it does not exist.
For example, the compiler could see that your ‘b’ is never initialised. Therefore, using it would be undefined behaviour. So, the optimiser can assume it is never used, and it is as if that code simply does not exist: the behaviour you saw.
I’m not saying that is what happened, nor that it will always happen, but it is a possibility.
Shade aside, I do think more developers should make their own engine. Yes it takes time and resources, but those are spent on exactly what you need instead of on getting what you want out of an engine that was made to do everything but focused on nothing.