https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62129

            Bug ID: 62129
           Summary: internal compiler error: in output_constant, at
                    varasm.c:4755
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: brooks at gcc dot gnu.org

Created attachment 33316
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33316&action=edit
Small example program.

(Google ref: b/17007254)

The following program causes an ICE in output_constant, at varasm.c:4755 on the
4.9 branch at r213772, and a similar ICE on trunk:

$ cat b17007254.cc 
class Evaluator
{
    int MakeChangelist ();
    struct CreatorEntry
    {
        char *type;
        int (Evaluator::*factory) ();
    };
    static constexpr CreatorEntry kCreators[] = { "",
&Evaluator::MakeChangelist };
};

constexpr Evaluator::CreatorEntry Evaluator::kCreators[];

$ gcc-archive/4.9/213772/bin/g++ --std=c++11 -c b17007254.cc
b17007254.cc:9:82: warning: deprecated conversion from string constant to
‘char*’ [-Wwrite-strings]
     static constexpr CreatorEntry kCreators[] = { "",
&Evaluator::MakeChangelist };
                                                                               
  ^
b17007254.cc:12:57: internal compiler error: in output_constant, at
varasm.c:4755
 constexpr Evaluator::CreatorEntry Evaluator::kCreators[];
                                                         ^
0xb21e2a output_constant
        gcc/gcc-4_9-branch/gcc/varasm.c:4755
0xb26102 output_constant
        gcc/gcc-4_9-branch/gcc/varasm.c:4611
0xb26102 output_constructor_regular_field
        gcc/gcc-4_9-branch/gcc/varasm.c:4952
0xb26102 output_constructor
        gcc/gcc-4_9-branch/gcc/varasm.c:5231
0xb26102 output_constant
        gcc/gcc-4_9-branch/gcc/varasm.c:4611
0xb26102 output_constructor_regular_field
        gcc/gcc-4_9-branch/gcc/varasm.c:4952
0xb26102 output_constructor
        gcc/gcc-4_9-branch/gcc/varasm.c:5231
0xb2581e assemble_variable(tree_node*, int, int, int)
        gcc/gcc-4_9-branch/gcc/varasm.c:2139
0xb27455 varpool_assemble_decl(varpool_node*)
        gcc/gcc-4_9-branch/gcc/varpool.c:466
0x6df31d output_in_order
        gcc/gcc-4_9-branch/gcc/cgraphunit.c:2011
0x6df31d compile()
        gcc/gcc-4_9-branch/gcc/cgraphunit.c:2248
0x6df5e4 finalize_compilation_unit()
        gcc/gcc-4_9-branch/gcc/cgraphunit.c:2330
0x5946db cp_write_global_declarations()
        gcc/gcc-4_9-branch/gcc/cp/decl2.c:4611
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ gcc-archive/trunk/213772/bin/g++ --std=c++11 -c b17007254.cc
b17007254.cc:9:82: warning: deprecated conversion from string constant to
‘char*’ [-Wwrite-strings]
     static constexpr CreatorEntry kCreators[] = { "",
&Evaluator::MakeChangelist };
                                                                               
  ^
b17007254.cc:12:57: internal compiler error: in output_constant, at
varasm.c:4734
 constexpr Evaluator::CreatorEntry Evaluator::kCreators[];
                                                         ^
0xe19a5a output_constant
        gcc/gcc-trunk/gcc/varasm.c:4734
0xe206a3 output_constructor_regular_field
        gcc/gcc-trunk/gcc/varasm.c:4929
0xe206a3 output_constructor
        gcc/gcc-trunk/gcc/varasm.c:5195
0xe19a87 output_constant
        gcc/gcc-trunk/gcc/varasm.c:4735
0xe206a3 output_constructor_regular_field
        gcc/gcc-trunk/gcc/varasm.c:4929
0xe206a3 output_constructor
        gcc/gcc-trunk/gcc/varasm.c:5195
0xe19a87 output_constant
        gcc/gcc-trunk/gcc/varasm.c:4735
0xe22235 assemble_variable(tree_node*, int, int, int)
        gcc/gcc-trunk/gcc/varasm.c:2175
0xe23d03 varpool_node::assemble_decl()
        gcc/gcc-trunk/gcc/varpool.c:553
0x8475ae output_in_order
        gcc/gcc-trunk/gcc/cgraphunit.c:2012
0x8475ae compile()
        gcc/gcc-trunk/gcc/cgraphunit.c:2249
0x848bc4 finalize_compilation_unit()
        gcc/gcc-trunk/gcc/cgraphunit.c:2331
0x638155 cp_write_global_declarations()
        gcc/gcc-trunk/gcc/cp/decl2.c:4644
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Reply via email to