public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* update_vtable_references segfault
@ 2015-12-11 18:04 Nathan Sidwell
  2015-12-11 18:15 ` Jan Hubicka
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Sidwell @ 2015-12-11 18:04 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: GCC Patches

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-16 20:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-11 18:04 update_vtable_references segfault Nathan Sidwell
2015-12-11 18:15 ` Jan Hubicka
2015-12-12 14:44   ` Nathan Sidwell
2015-12-16 20:16     ` Nathan Sidwell
2015-12-16 20:54       ` Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).