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



             Bug #: 56147

           Summary: [4.8 Regression] ICE on invalid code in

                    lto_symtab_merge_decls_1

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: minor

          Priority: P3

         Component: lto

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: d.g.gorbac...@gmail.com





$ cat > foo.c

extern void baz(void);



void foo(void)

{

  baz();

}

^D

$ cat > bar.c

extern int baz;



void bar(void)

{

  ++baz;

}

^D

$ gcc -flto foo.c bar.c

lto1: internal compiler error: tree check: expected function_decl, have

var_decl in lto_symtab_merge_decls_1, at lto-symtab.c:446

0x872a772 tree_check_failed(tree_node const*, char const*, int, char const*,

...)

        ../../gcc-4.8/gcc/tree.c:8946

0x83ec6f2 tree_check

        ../../gcc-4.8/gcc/tree.h:3669

0x83ec6f2 lto_symtab_merge_decls_1

        ../../gcc-4.8/gcc/lto-symtab.c:446

0x83ec947 lto_symtab_merge_decls()

        ../../gcc-4.8/gcc/lto-symtab.c:522

0x811af10 read_cgraph_and_symbols

        ../../gcc-4.8/gcc/lto/lto.c:3037

0x811b228 lto_main()

        ../../gcc-4.8/gcc/lto/lto.c:3370

[...]



    GCC 4.7 gives:

In file included from :0:0:

foo.c:1:13: error: variable 'baz' redeclared as function

In file included from foo.c:1:0,

                 from :0:

bar.c:1:12: note: previously declared here

lto1: fatal error: errors during merging of translation units

compilation terminated.

[...]



    GCC 4.6 is even more concise:

foo.c:1:13: error: variable 'baz' redeclared as function

bar.c:1:12: note: previously declared here

lto1: fatal error: errors during merging of translation units

compilation terminated.

[...]

Reply via email to