public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/44149]  New: lto1: internal compiler error: in lto_symtab_merge_decls_1, at lto-symtab.c:610
@ 2010-05-15  9:30 toon at moene dot org
  2010-05-15  9:33 ` [Bug lto/44149] " toon at moene dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: toon at moene dot org @ 2010-05-15  9:30 UTC (permalink / raw)
  To: gcc-bugs

The attached subroutine is compiled as follows:

gfortran -c -flto -O2 -fwhole-program bkfconv.F90

and then the object file is placed in a library of its own:

ar rv x.a bkfconv.o

Subsequently, a main program, b.f:

      call deep_convection
      end

is linked with this library, as follows:

gfortran -fuse-linker-plugin -flto -O2 -fwhole-program b.f x.a

This results in the ICE in the subject.

gfortran -v
Using built-in specs.
COLLECT_GCC=/usr/snp/bin/gfortran
COLLECT_LTO_WRAPPER=/usr/snp/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --enable-checking=release --prefix=/usr/snp
--enable-gold --enable-plugins --disable-multilib --disable-nls
--with-arch-64=native --with-tune-64=native --enable-languages=fortran,c++
--enable-stage1-languages=c++ --disable-werror
Thread model: posix
gcc version 4.6.0 20100514 (experimental) (GCC) 

ld -v
GNU gold (GNU Binutils 2.20.51.20100506) 1.9


-- 
           Summary: lto1: internal compiler error: in
                    lto_symtab_merge_decls_1, at lto-symtab.c:610
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: toon at moene dot org
  GCC host triplet: x64_86-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44149


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

* [Bug lto/44149] lto1: internal compiler error: in lto_symtab_merge_decls_1, at lto-symtab.c:610
  2010-05-15  9:30 [Bug lto/44149] New: lto1: internal compiler error: in lto_symtab_merge_decls_1, at lto-symtab.c:610 toon at moene dot org
@ 2010-05-15  9:33 ` toon at moene dot org
  2010-05-16 18:36 ` toon at moene dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: toon at moene dot org @ 2010-05-15  9:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from toon at moene dot org  2010-05-15 09:32 -------
Created an attachment (id=20664)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20664&action=view)
source code that shows the bug


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44149


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

* [Bug lto/44149] lto1: internal compiler error: in lto_symtab_merge_decls_1, at lto-symtab.c:610
  2010-05-15  9:30 [Bug lto/44149] New: lto1: internal compiler error: in lto_symtab_merge_decls_1, at lto-symtab.c:610 toon at moene dot org
  2010-05-15  9:33 ` [Bug lto/44149] " toon at moene dot org
@ 2010-05-16 18:36 ` toon at moene dot org
  2010-05-16 18:51 ` toon at moene dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: toon at moene dot org @ 2010-05-16 18:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from toon at moene dot org  2010-05-16 18:35 -------
Created an attachment (id=20675)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20675&action=view)
reduced test case

A reduced test case that failes in the same way.


-- 

toon at moene dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #20664|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44149


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

* [Bug lto/44149] lto1: internal compiler error: in lto_symtab_merge_decls_1, at lto-symtab.c:610
  2010-05-15  9:30 [Bug lto/44149] New: lto1: internal compiler error: in lto_symtab_merge_decls_1, at lto-symtab.c:610 toon at moene dot org
  2010-05-15  9:33 ` [Bug lto/44149] " toon at moene dot org
  2010-05-16 18:36 ` toon at moene dot org
@ 2010-05-16 18:51 ` toon at moene dot org
  2010-05-17  9:10 ` [Bug lto/44149] -fuse-linker-plugin " rguenth at gcc dot gnu dot org
  2010-05-18 18:15 ` ccoutant at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: toon at moene dot org @ 2010-05-16 18:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from toon at moene dot org  2010-05-16 18:51 -------
It might be useful to compare the two decls that invoke the mismatch that
triggers the gcc_assert:

prevailing->decl is:

 <function_decl 0x7fb0f574f900 convect_satmixratio
    type <function_type 0x7fb0f5786b28
        type <void_type 0x7fb0f584cd20 VOID
            align 8 symtab 0 alias set -1 canonical type 0x7fb0f584cd20
            pointer_to_this <pointer_type 0x7fb0f584cdc8>>
        QI
        size <integer_cst 0x7fb0f583d758 constant 8>
        unit size <integer_cst 0x7fb0f583d780 constant 1>
        align 8 symtab 0 alias set -1 canonical type 0x7fb0f5786b28>
    public external QI file bkfconv.f90 line 517 col 0 align 8>

whereas e->decl is:

 <function_decl 0x7fb0f574f600 convect_satmixratio
    type <function_type 0x7fb0f5763b28
        type <void_type 0x7fb0f584cd20 VOID
            align 8 symtab 0 alias set -1 canonical type 0x7fb0f584cd20
            pointer_to_this <pointer_type 0x7fb0f584cdc8>>
        QI
        size <integer_cst 0x7fb0f583d758 constant 8>
        unit size <integer_cst 0x7fb0f583d780 constant 1>
        align 8 symtab 0 alias set -1 canonical type 0x7fb0f5763b28
        arg-types <tree_list 0x7fb0f5754bb8 value <reference_type
0x7fb0f5750738>
            chain <tree_list 0x7fb0f5754be0 value <pointer_type 0x7fb0f5763bd0>
                chain <tree_list 0x7fb0f5754c08 value <pointer_type
0x7fb0f5764000>
                    chain <tree_list 0x7fb0f5754c30 value <pointer_type
0x7fb0f57643f0>
                        chain <tree_list 0x7fb0f5754c58 value <pointer_type
0x7fb0f57647e0> chain <tree_list 0x7fb0f5754c80>>>>>>>
    nothrow public static QI file bkfconv.f90 line 400 col 0 align 8
    arguments <parm_decl 0x7fb0f5760660 klon
        type <reference_type 0x7fb0f5750738 type <integer_type 0x7fb0f584c498>
            unsigned restrict DI
            size <integer_cst 0x7fb0f583da50 constant 64>
            unit size <integer_cst 0x7fb0f583da78 constant 8>
            align 64 symtab 0 alias set -1 canonical type 0x7fb0f5750738>
        readonly used unsigned DI passed-by-reference file bkfconv.f90 line 400
col 0 size <integer_cst 0x7fb0f583da50 64> unit size <integer_cst
0x7fb0f583da78 8>
        align 64 context <function_decl 0x7fb0f574f600 convect_satmixratio>
arg-type <reference_type 0x7fb0f5750738>
        chain <parm_decl 0x7fb0f57606e8 ppres type <pointer_type
0x7fb0f57653f0>
            readonly used unsigned DI passed-by-reference file bkfconv.f90 line
400 col 0 size <integer_cst 0x7fb0f583da50 64> unit size <integer_cst
0x7fb0f583da78 8>
            align 64 context <function_decl 0x7fb0f574f600 convect_satmixratio>
arg-type <pointer_type 0x7fb0f5763bd0> chain <parm_decl 0x7fb0f5760770 pt>>>
    result <result_decl 0x7fb0f5752180 D.2157 type <void_type 0x7fb0f584cd20>
        ignored VOID file bkfconv.f90 line 400 col 0
        align 8 context <function_decl 0x7fb0f574f600 convect_satmixratio>>>

This is found by adding the following to lto-symtab.c:

$ svn diff
Index: lto-symtab.c
===================================================================
--- lto-symtab.c        (revision 159454)
+++ lto-symtab.c        (working copy)
@@ -603,8 +603,15 @@
   /* Assert it's the only one.  */
   if (prevailing)
     for (e = prevailing->next; e; e = e->next)
-      gcc_assert (e->resolution != LDPR_PREVAILING_DEF_IRONLY
-                 && e->resolution != LDPR_PREVAILING_DEF);
+      {
+      if (!(e->resolution != LDPR_PREVAILING_DEF_IRONLY
+                 && e->resolution != LDPR_PREVAILING_DEF))
+        {
+         debug_tree(prevailing->decl);
+         debug_tree(e->decl);
+         gcc_assert(0);
+        }
+      }

   /* If there's not a prevailing symbol yet it's an external reference.
      Happens a lot during ltrans.  Choose the first symbol with a


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44149


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

* [Bug lto/44149] -fuse-linker-plugin lto1: internal compiler error: in lto_symtab_merge_decls_1, at lto-symtab.c:610
  2010-05-15  9:30 [Bug lto/44149] New: lto1: internal compiler error: in lto_symtab_merge_decls_1, at lto-symtab.c:610 toon at moene dot org
                   ` (2 preceding siblings ...)
  2010-05-16 18:51 ` toon at moene dot org
@ 2010-05-17  9:10 ` rguenth at gcc dot gnu dot org
  2010-05-18 18:15 ` ccoutant at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-17  9:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2010-05-17 09:10 -------
(In reply to comment #3)
> It might be useful to compare the two decls that invoke the mismatch that
> triggers the gcc_assert:
> 
> prevailing->decl is:
> 
>  <function_decl 0x7fb0f574f900 convect_satmixratio
>     type <function_type 0x7fb0f5786b28
>         type <void_type 0x7fb0f584cd20 VOID
>             align 8 symtab 0 alias set -1 canonical type 0x7fb0f584cd20
>             pointer_to_this <pointer_type 0x7fb0f584cdc8>>
>         QI
>         size <integer_cst 0x7fb0f583d758 constant 8>
>         unit size <integer_cst 0x7fb0f583d780 constant 1>
>         align 8 symtab 0 alias set -1 canonical type 0x7fb0f5786b28>
>     public external QI file bkfconv.f90 line 517 col 0 align 8>
> 
> whereas e->decl is:
> 
>  <function_decl 0x7fb0f574f600 convect_satmixratio
>     type <function_type 0x7fb0f5763b28
>         type <void_type 0x7fb0f584cd20 VOID
>             align 8 symtab 0 alias set -1 canonical type 0x7fb0f584cd20
>             pointer_to_this <pointer_type 0x7fb0f584cdc8>>
>         QI
>         size <integer_cst 0x7fb0f583d758 constant 8>
>         unit size <integer_cst 0x7fb0f583d780 constant 1>
>         align 8 symtab 0 alias set -1 canonical type 0x7fb0f5763b28
>         arg-types <tree_list 0x7fb0f5754bb8 value <reference_type
> 0x7fb0f5750738>
>             chain <tree_list 0x7fb0f5754be0 value <pointer_type 0x7fb0f5763bd0>
>                 chain <tree_list 0x7fb0f5754c08 value <pointer_type
> 0x7fb0f5764000>
>                     chain <tree_list 0x7fb0f5754c30 value <pointer_type
> 0x7fb0f57643f0>
>                         chain <tree_list 0x7fb0f5754c58 value <pointer_type
> 0x7fb0f57647e0> chain <tree_list 0x7fb0f5754c80>>>>>>>
>     nothrow public static QI file bkfconv.f90 line 400 col 0 align 8
>     arguments <parm_decl 0x7fb0f5760660 klon
>         type <reference_type 0x7fb0f5750738 type <integer_type 0x7fb0f584c498>
>             unsigned restrict DI
>             size <integer_cst 0x7fb0f583da50 constant 64>
>             unit size <integer_cst 0x7fb0f583da78 constant 8>
>             align 64 symtab 0 alias set -1 canonical type 0x7fb0f5750738>
>         readonly used unsigned DI passed-by-reference file bkfconv.f90 line 400
> col 0 size <integer_cst 0x7fb0f583da50 64> unit size <integer_cst
> 0x7fb0f583da78 8>
>         align 64 context <function_decl 0x7fb0f574f600 convect_satmixratio>
> arg-type <reference_type 0x7fb0f5750738>
>         chain <parm_decl 0x7fb0f57606e8 ppres type <pointer_type
> 0x7fb0f57653f0>
>             readonly used unsigned DI passed-by-reference file bkfconv.f90 line
> 400 col 0 size <integer_cst 0x7fb0f583da50 64> unit size <integer_cst
> 0x7fb0f583da78 8>
>             align 64 context <function_decl 0x7fb0f574f600 convect_satmixratio>
> arg-type <pointer_type 0x7fb0f5763bd0> chain <parm_decl 0x7fb0f5760770 pt>>>
>     result <result_decl 0x7fb0f5752180 D.2157 type <void_type 0x7fb0f584cd20>
>         ignored VOID file bkfconv.f90 line 400 col 0
>         align 8 context <function_decl 0x7fb0f574f600 convect_satmixratio>>>
> 
> This is found by adding the following to lto-symtab.c:

It's obvious that somehow the prevailing one is the wrong one.

 <function_decl 0x7fb0f574f900 convect_satmixratio
    type <function_type 0x7fb0f5786b28
        type <void_type 0x7fb0f584cd20 VOID
            align 8 symtab 0 alias set -1 canonical type 0x7fb0f584cd20
            pointer_to_this <pointer_type 0x7fb0f584cdc8>>
        QI
        size <integer_cst 0x7fb0f583d758 constant 8>
        unit size <integer_cst 0x7fb0f583d780 constant 1>
        align 8 symtab 0 alias set -1 canonical type 0x7fb0f5786b28>
    public external QI file bkfconv.f90 line 517 col 0 align 8>

isn't prevailing at all.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-05-17 09:10:19
               date|                            |
            Summary|lto1: internal compiler     |-fuse-linker-plugin lto1:
                   |error: in                   |internal compiler error: in
                   |lto_symtab_merge_decls_1, at|lto_symtab_merge_decls_1, at
                   |lto-symtab.c:610            |lto-symtab.c:610


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44149


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

* [Bug lto/44149] -fuse-linker-plugin lto1: internal compiler error: in lto_symtab_merge_decls_1, at lto-symtab.c:610
  2010-05-15  9:30 [Bug lto/44149] New: lto1: internal compiler error: in lto_symtab_merge_decls_1, at lto-symtab.c:610 toon at moene dot org
                   ` (3 preceding siblings ...)
  2010-05-17  9:10 ` [Bug lto/44149] -fuse-linker-plugin " rguenth at gcc dot gnu dot org
@ 2010-05-18 18:15 ` ccoutant at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: ccoutant at gcc dot gnu dot org @ 2010-05-18 18:15 UTC (permalink / raw)
  To: gcc-bugs



-- 

ccoutant at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |ccoutant at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-05-17 09:10:19         |2010-05-18 18:15:27
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44149


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

end of thread, other threads:[~2010-05-18 18:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-15  9:30 [Bug lto/44149] New: lto1: internal compiler error: in lto_symtab_merge_decls_1, at lto-symtab.c:610 toon at moene dot org
2010-05-15  9:33 ` [Bug lto/44149] " toon at moene dot org
2010-05-16 18:36 ` toon at moene dot org
2010-05-16 18:51 ` toon at moene dot org
2010-05-17  9:10 ` [Bug lto/44149] -fuse-linker-plugin " rguenth at gcc dot gnu dot org
2010-05-18 18:15 ` ccoutant at gcc dot gnu dot org

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).