Anatoly Sokolov schrieb:

 /* Returns register number for function return value.*/
-int
+static inline int
 avr_ret_register (void)
 {
   return 24;
 }

I always wondered why that works.

SI is returned in r22..r25 (not in r24..27)
DI is returnet in r18..r25 (not in r24..31)

So according to docs, possible return regs are 18, 22, 24.

http://gcc.gnu.org/onlinedocs/gccint/Scalar-Return.html#index-TARGET_005fFUNCTION_005fVALUE_005fREGNO_005fP-4158

<>
TARGET_FUNCTION_VALUE_REGNO_P

A target hook that return true if regno is the number of a hard register in which the values of called function may come back.

A register whose use for returning values is limited to serving as the second of a pair (for a value of type double, say) need not be recognized by this target hook.
</>

Johann

Reply via email to