https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93021
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- >When a bootloader transfers control to an application, there is no context to >be saved Yes that is correct but the way it is currently implemented in Adafruit Metro M4 Express is incorrect. It changes the SP behind GCC's back. therefore, GCC could be using the sp before the asm and after and expecting the same value. It is not about the context to be saved but rather: var saved to the sp ... inline-asm that changes sp; ... read the var from the sp Previously gcc just ignored the clobber of the sp on the inline-asm (well it acted as a barrier in other ways but I am not going to go into the full details of what the old behavior was). So GCC could have emitted the above code and you would get weird behavior. This is why GCC now rejects the clobber of the sp. >https://github.com/micropython/micropython/pull/4791 That is the way correct way to fix it. You CANNOT change the SP behind GCC's back inside the inline-asm without expecting bad behavor.