[Bug c++/58550] New: [4.9 Regression] ][c++0x] ICE with auto in function return type and lto

reichelt at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Sep 27 06:39:00 GMT 2013


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

            Bug ID: 58550
           Summary: [4.9 Regression] ][c++0x] ICE with auto in function
                    return type and lto
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following (probably invalid) code snippet triggers an ICE on trunk (4.9.0
20130926) when compiled with "std=c++0x -flto":

====================
auto foo();

auto fp = foo;
====================

bug.cc:1:10: warning: 'foo' function uses 'auto' type specifier without
trailing return type [enabled by default]
 auto foo();
          ^
bug.cc:3:14: internal compiler error: tree code 'template_type_parm' is not
supported in LTO streams
 auto fp = foo;
              ^
0xa17696 DFS_write_tree
        ../../gcc/gcc/lto-streamer-out.c:1244
0xa165c9 DFS_write_tree_body
        ../../gcc/gcc/lto-streamer-out.c:461
0xa165c9 DFS_write_tree
        ../../gcc/gcc/lto-streamer-out.c:1152
0xa165c9 DFS_write_tree_body
        ../../gcc/gcc/lto-streamer-out.c:461
0xa165c9 DFS_write_tree
        ../../gcc/gcc/lto-streamer-out.c:1152
0xa18907 lto_output_tree(output_block*, tree_node*, bool, bool)
        ../../gcc/gcc/lto-streamer-out.c:1334
0xa12cfc write_global_stream
        ../../gcc/gcc/lto-streamer-out.c:2084
0xa1a990 lto_output_decl_state_streams
        ../../gcc/gcc/lto-streamer-out.c:2128
0xa1a990 produce_asm_for_decls
        ../../gcc/gcc/lto-streamer-out.c:2413
0xa4e720 ipa_write_summaries_2
        ../../gcc/gcc/passes.c:2283
0xa4f799 ipa_write_summaries_1
        ../../gcc/gcc/passes.c:2314
0xa4f799 ipa_write_summaries()
        ../../gcc/gcc/passes.c:2371
0x807c5b ipa_passes
        ../../gcc/gcc/cgraphunit.c:2019
0x807c5b compile()
        ../../gcc/gcc/cgraphunit.c:2115
0x807ee9 finalize_compilation_unit()
        ../../gcc/gcc/cgraphunit.c:2269
0x61b2b0 cp_write_global_declarations()
        ../../gcc/gcc/cp/decl2.c:4360
Please submit a full bug report, [etc.]


In GCC 4.8.1 the code was rejected:
bug.cc:1:10: warning: 'foo' function uses 'auto' type specifier without
trailing return type [enabled by default]
 auto foo();
          ^
bug.cc:3:11: error: use of 'auto foo()' before deduction of 'auto'
 auto fp = foo;



More information about the Gcc-bugs mailing list