Thanks VaneB. Point taken. We'll take a look at the release notes but I have no reason not to believe you.
For what it's worth we tracked this down. If a couple of specific optimization flags are removed (from the collection included when using -Os) then the variable below is not initialized by the C runtime initialization. It remains set to null by the time `main()` is reached (which is obviously a problem). Happens with GCC 10.2 and 11.4. If we halt the debugger and punch that address in then things are fine.
That assignment was happening before the definition of Clock_Ip_CodeInRamSetFlashWaitStates. If we move the assignment after all is well.
#ifdef CLOCK_IP_HAS_FLASH_WAIT_STATES
static SetFlashWaitStatesCallbackType Clock_Ip_SetFlashWaitStatesCallback = &Clock_Ip_CodeInRamSetFlashWaitStates; /* Set Flash Wait States callback */
#endif