2012/3/26 Georg-Johann Lay <a...@gjlay.de>: > This implements TARGET_BUILTIN_DECL which is needed to make > LTO work with target-specific built-ins. > > struct avr_builtin_description gets a new field .fndecl which is > initialized during avr_init_builtins and looked up in new hook > avr_builtin_decl. > > The built-ins are initialized in such a way that there is always > avr_bdesc[x].id == x > i.e. .id is superfluous and avr_expand_builtin can use id to access > the array and need no search loop to find built-in id. > > Johann > > Ok? > > gcc/ > PR target/52692 > * config/avr/avr.c (TARGET_BUILTIN_DECL): New define. > (avr_builtin_decl): New static function. > (struct avr_builtin_description, avr_bdesc): Move up. > Add GTY marker. Add field fndecl. Remove redundant field id. > (avr_init_builtins): Initialize avr_bdesc[ID].fndecl. > (avr_expand_builtin): Code cleanup because .id is removed. > > testsuite/ > * gcc.target/avr/torture/builtins-2.c: New test.
Please, apply. Denis.