On Sat, Jan 13, 2018 at 9:30 AM, Jan Hubicka <hubi...@ucw.cz> wrote: >> On Sat, Jan 13, 2018 at 7:56 AM, Jan Hubicka <hubi...@ucw.cz> wrote: >> >> >> +/* Output a funtion with a call and return thunk for indirect branch. >> >> >> + If BND_P is true, the BND prefix is needed. If REGNO != -1, the >> >> >> + function address is in REGNO. Otherwise, the function address is >> >> >> + on the top of stack. */ >> >> >> + >> >> >> +static void >> >> >> +output_indirect_thunk_function (bool need_bnd_p, int regno) >> >> >> +{ >> >> >> + char name[32]; >> >> >> + tree decl; >> >> >> + >> >> >> + /* Create __x86_indirect_thunk/__x86_indirect_thunk_bnd. */ >> >> >> + indirect_thunk_name (name, regno, need_bnd_p); >> >> >> + decl = build_decl (BUILTINS_LOCATION, FUNCTION_DECL, >> >> >> + get_identifier (name), >> >> >> + build_function_type_list (void_type_node, >> >> >> NULL_TREE)); >> >> >> + DECL_RESULT (decl) = build_decl (BUILTINS_LOCATION, RESULT_DECL, >> >> >> + NULL_TREE, void_type_node); >> >> >> + TREE_PUBLIC (decl) = 1; >> >> >> + TREE_STATIC (decl) = 1; >> >> >> + DECL_IGNORED_P (decl) = 1; >> >> > >> >> > DECL_ARTIFICIAL as well? >> >> >> >> This is done exactly the same way as PIC thunk. I don't think we >> >> should change it here. >> >> > >> >> > Why do you need to output asm visibility directives by hand when you >> >> > create >> >> > symbol for the function anyway? >> >> >> >> This is done exactly the same way as PIC thunk. I don't think we >> >> should change it here. >> > >> > I see, it is pretty ancient code. Perhaps you can at least commonize >> > the uglness so we don't duplicate the ifdefs for MACHO? >> >> I don't think we should such surgery at such late stage. I prefer to >> keep it for later cleanup. > > OK, lets keep it as it is and clean up next stage1. > >
The new set of patches are at https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01200.html https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01197.html https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01198.html https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01201.html https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01199.html -- H.J.