register variable is clobbered by passing parameter to a function

Ian Lance Taylor ian@wasabisystems.com
Tue Mar 16 13:00:00 GMT 2004


"Dave Korn" <dk@artimi.com> writes:

>   Wolfgang, your best bet is probably to just add -fixed-r16 to your
> compile-time flags.  And don't call any library functions that were compiled
> without it.

This is AVR, and he is trying to use r16.  According to
function_arg_regno_p() in avr.c, that register can be used to pass
parameters to functions.  gcc can't handle declaring a register used
for parameter passing as fixed.

Trying to do that is an implicit ABI change anyhow.  Maybe gcc should
warn about this, but it doesn't.

Ian



More information about the Gcc mailing list