https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88000
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Dominik Czarnota from comment #2) > Yes, I know it. > > Why do we let users to use local register variables for other purposes than > extended asm if it can't be expected to work properly (in this example, copy > the passing value from the declared register)? Because if the user wants to shoot them selves in the foot that is up to them. Read the documentation and you see that what you want to be use it for, is not supported: As with global register variables, it is recommended that you choose a register that is normally saved and restored by function calls on your machine, so that calls to library routines will not clobber it. In this case you the register is being clobbered.