Jan,
it looks like your recent changes to function_and_variable_visibility and friends causes regressions in targets that do not support aliases (PTX for example).

specifically, we get a segfault  in update_vtable_references (ipa-visibility.c) 
at
        *tp = symtab_node::get (*tp)->noninterposable_alias ()->decl;

because symtab_node::noninterposable_alias (symtab.c) returns NULL. It does this on targets that do not support aliases:

#ifndef ASM_OUTPUT_DEF
  /* If aliases aren't supported by the assembler, fail.  */
  return NULL;
#endif

and update_vtable_references doesn't anticipate that happening, blindly dereferencing the returned value. Is the fix:

a) add  a check in update_vtable_references on noninterposable_alias's return 
value?

b) augment can_replace_by_local_alias_in_vtable to check whether aliases can be created?

c) augment function_and_variable_visibility to not attempt such replacement:
      /* Update virtual tables to point to local aliases where possible.  */
      if (DECL_VIRTUAL_P (vnode->decl)
          && !DECL_EXTERNAL (vnode->decl))
        ...
d) something else?

nathan

Reply via email to