public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* partial fix for PR lto/50430
@ 2011-09-16 15:48 Jan Hubicka
  0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2011-09-16 15:48 UTC (permalink / raw)
  To: gcc-patches

Hi,
this patch fixes ICE seen when compiling libreoffice. Sadly I didn't get any
testcase since libreoffice one desn't reproduce with -r.

The problem is external vtable whose constructor is not streamed, because we
stream only constructors needed and we do not take external vars into account.

This patch makes the ICE go away turning 50430 into an missed optimization.
We obvoiusly shoud do something for programs with error in them, so the patch
makes sense even after we fix the streaming issue.

Bootstrapped/regtested x86_64-linux, will commit it shortly.

Honza

	PR lto/50430
	* gimple-fold.c (gimple_get_virt_method_for_binfo): Do not ICE on
	error_mark_node in the DECL_INITIAL of vtable.

Index: gimple-fold.c
===================================================================
--- gimple-fold.c	(revision 178757)
+++ gimple-fold.c	(working copy)
@@ -3048,7 +3048,8 @@ gimple_get_virt_method_for_binfo (HOST_W
 
   if (TREE_CODE (v) != VAR_DECL
       || !DECL_VIRTUAL_P (v)
-      || !DECL_INITIAL (v))
+      || !DECL_INITIAL (v)
+      || DECL_INITIAL (v) == error_mark_node)
     return NULL_TREE;
   gcc_checking_assert (TREE_CODE (TREE_TYPE (v)) == ARRAY_TYPE);
   size = tree_low_cst (TYPE_SIZE (TREE_TYPE (TREE_TYPE (v))), 1);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-16 14:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-16 15:48 partial fix for PR lto/50430 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).