[Bug lto/50747] [4.7 Regression] ICE in produce_symtab, at lto-streamer-out.c:1435

2011-12-08 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50747

--- Comment #6 from Richard Guenther rguenth at gcc dot gnu.org 2011-12-08 
12:32:24 UTC ---
Author: rguenth
Date: Thu Dec  8 12:32:19 2011
New Revision: 182108

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=182108
Log:
2011-12-08  Richard Guenther  rguent...@suse.de

PR lto/50747
* lto-streamer-out.c (produce_symtab): Remove asserts.

* g++.dg/opt/pr50747-1_0.C: New testcase.
* g++.dg/opt/pr50747-2_0.C: Likewise.

Added:
trunk/gcc/testsuite/g++.dg/opt/pr50747-1_0.C
trunk/gcc/testsuite/g++.dg/opt/pr50747-2_0.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/lto-streamer-out.c
trunk/gcc/testsuite/ChangeLog


[Bug lto/50747] [4.7 Regression] ICE in produce_symtab, at lto-streamer-out.c:1435

2011-12-08 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50747

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #7 from Richard Guenther rguenth at gcc dot gnu.org 2011-12-08 
12:32:37 UTC ---
Fixed.


[Bug lto/50747] [4.7 Regression] ICE in produce_symtab, at lto-streamer-out.c:1435

2011-12-07 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50747

--- Comment #5 from Richard Guenther rguenth at gcc dot gnu.org 2011-12-07 
16:13:14 UTC ---
The function in question is DECL_ABSTRACT (it's one of the B::B constructors).
Not sure why we have a cgraph node for it at all:

#0  cgraph_create_node (decl=0x75b92500)
at /space/rguenther/src/svn/trunk/gcc/cgraph.c:495
#1  0x009b6878 in cgraph_get_create_node (decl=0x75b92500)
at /space/rguenther/src/svn/trunk/gcc/cgraph.c:543
#2  0x008c3303 in c_genericize (fndecl=0x75b92500)
at /space/rguenther/src/svn/trunk/gcc/c-family/c-gimplify.c:101
#3  0x00858e0a in cp_genericize (fndecl=0x75b92500)
at /space/rguenther/src/svn/trunk/gcc/cp/cp-gimplify.c:1172
#4  0x00547836 in finish_function (flags=0)
at /space/rguenther/src/svn/trunk/gcc/cp/decl.c:13478
#5  0x00769a05 in synthesize_method (fndecl=0x75b92500)
at /space/rguenther/src/svn/trunk/gcc/cp/method.c:774
#6  0x0068fd62 in mark_used (decl=0x75b92600)
at /space/rguenther/src/svn/trunk/gcc/cp/decl2.c:4372
#7  0x004d0a88 in build_over_call (cand=0x1f33fd0, flags=3, complain=3)
at /space/rguenther/src/svn/trunk/gcc/cp/call.c:6727
#8  0x004d590c in build_new_method_call_1 (instance=0x75a2c1e0, 
fns=0x75b79a80, args=0x7fffcc50, conversion_path=0x75b8c340, 
flags=3, fn_p=0x0, complain=3)
at /space/rguenther/src/svn/trunk/gcc/cp/call.c:7337

The following fixes the ICE for Volkers testcase, but not the original
from Markus:

@@ -1431,8 +1444,9 @@ produce_symtab (struct output_block *ob,
 table: they end up being undefined and just consume space.  */
   if (!node-address_taken  !node-callers)
{
- gcc_assert (node-analyzed);
- gcc_assert (DECL_DECLARED_INLINE_P (node-decl));
+ gcc_assert ((node-analyzed
+   DECL_DECLARED_INLINE_P (node-decl))
+ || DECL_ABSTRACT (node-decl));
  continue;
}
   if (DECL_COMDAT (node-decl)

why assert anything at all here?  That is, that's the fix I'd do:

@@ -1430,11 +1443,7 @@ produce_symtab (struct output_block *ob,
 them indirectly or via vtables.  Do not output them to symbol
 table: they end up being undefined and just consume space.  */
   if (!node-address_taken  !node-callers)
-   {
- gcc_assert (node-analyzed);
- gcc_assert (DECL_DECLARED_INLINE_P (node-decl));
- continue;
-   }
+   continue;
   if (DECL_COMDAT (node-decl)
   cgraph_comdat_can_be_unshared_p (node))
continue;


[Bug lto/50747] [4.7 Regression] ICE in produce_symtab, at lto-streamer-out.c:1435

2011-11-19 Thread reichelt at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50747

Volker Reichelt reichelt at gcc dot gnu.org changed:

   What|Removed |Added

 CC||reichelt at gcc dot gnu.org

--- Comment #4 from Volker Reichelt reichelt at gcc dot gnu.org 2011-11-19 
22:58:50 UTC ---
Here's a different testcase that triggers the assertion one line before when
compiled with -flto. So the proposed fix might not be sufficient.

=
void foo();

static void bar() __attribute__((weakref(foo)));

struct A
{
  A();
};

int i;

template typename T, int struct B : T {};

BA, i b;
=

bug.cc:14:10: internal compiler error: in produce_symtab, at
lto-streamer-out.c:1434
Please submit a full bug report, [etc.]


[Bug lto/50747] [4.7 Regression] ICE in produce_symtab, at lto-streamer-out.c:1435

2011-10-27 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50747

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011-10-27
  Known to work||4.6.2
 Ever Confirmed|0   |1

--- Comment #2 from Richard Guenther rguenth at gcc dot gnu.org 2011-10-27 
11:05:41 UTC ---
Confirmed.

1432  if (!node-address_taken  !node-callers)
1433{
1434  gcc_assert (node-analyzed);
1435  gcc_assert (DECL_DECLARED_INLINE_P (node-decl));

hits.


[Bug lto/50747] [4.7 Regression] ICE in produce_symtab, at lto-streamer-out.c:1435

2011-10-27 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50747

--- Comment #3 from Markus Trippelsdorf markus at trippelsdorf dot de 
2011-10-27 11:39:23 UTC ---
I've been running gcc with this patch since the last week without ill
effects thus far:

@@ -1429,14 +1429,14 @@ produce_symtab (struct output_block *ob,
   /* We keep around unused extern inlines in order to be able to inline
  them indirectly or via vtables.  Do not output them to symbol
  table: they end up being undefined and just consume space.  */
-  if (!node-address_taken  !node-callers)
+  if (!node-address_taken  !node-callers  DECL_DECLARED_INLINE_P
(node-decl))
 {
   gcc_assert (node-analyzed);
-  gcc_assert (DECL_DECLARED_INLINE_P (node-decl));


[Bug lto/50747] [4.7 Regression] ICE in produce_symtab, at lto-streamer-out.c:1435

2011-10-17 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50747

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||lto
   Target Milestone|--- |4.7.0


[Bug lto/50747] [4.7 Regression] ICE in produce_symtab, at lto-streamer-out.c:1435

2011-10-16 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50747

--- Comment #1 from Markus Trippelsdorf markus at trippelsdorf dot de 
2011-10-16 17:45:35 UTC ---
Created attachment 25517
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=25517
delta reduced testcase