This is the mail archive of the
mailing list for the GCC project.
Compiler crash with block numbers
- From: Ian Lance Taylor <iant at google dot com>
- To: dehao at google dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 20 Sep 2012 11:25:42 -0700
- Subject: Compiler crash with block numbers
Hi Dehao, I suspect that your recent patch changing block handling has
broken bootstrap with --enable-languages=go. I reduced the test case
to this C++ code:
f(bool is_string, bool is_constant)
return left_string + right_string;
When I compile that with current mainline with -O -g I get a crash
(the backtrace is a local patch of mine):
foo.cc: In function ‘std::string f(bool, bool)’:
foo.cc:17:1: internal compiler error: tree check: expected block, have
function_decl in change_scope, at final.c:1544
0xe388bd tree_check_failed(tree_node const*, char const*, int, char const*, ...)
0x50c495 tree_check(tree_node*, char const*, int, char const*, tree_code)
0x937822 final_start_function(rtx_def*, _IO_FILE*, int)
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.
At first glance the bug is that the block obtained from insn_scope
(insn), called from reemit_insn_block_notes, has a block number of 0.
That leads to the crash in insn_scope.
It's interesting that it only occurs with -g. I'm not sure what that means.
Could you take a look at this and see if it is due to your patch?