On 03/16/2011 02:46 PM, Georg-Johann Lay wrote: > 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.
It doesn't, quite. But value_regno_p isn't used for much anymore. Probably the most important thing remaining is in keep_with_call_p, where we attempt to prevent the lifetime of a return value from being extended too much. Otherwise it's only used in __builtin_apply, which I continue to hope we can eliminate. Anyway, for the benefit of keep_with_call_p, you're best off matching all register numbers between 18 and 25. That allows the Right Thing to happen even if the DImode value is completely decomposed into its QImode subregs. Anatoly, I'll go ahead and approve the patch as-is, given that it is an exact translation of the current state of the backend. Any logic fixes to the backend can be done with separate patches. r~