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

            Bug ID: 69795
           Summary: g++ ICE on invalid code on x86_64-linux-gnu in
                    "reject_gcc_builtin"
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE when compiled with the current g++
trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes.

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160212 (experimental) [trunk revision 233377] (GCC) 



$ g++-trunk abc.cc
abc.cc:1:27: error: expected end of capture-list
 int freopen ( freopen += *[
                           ^
abc.cc: In lambda function:
abc.cc:1:27: error: expected ‘{’ at end of input
abc.cc: At global scope:
abc.cc:1:27: internal compiler error: tree check: expected function_decl, have
var_decl in reject_gcc_builtin, at c-family/c-common.c:12620
0xfb074c tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:9637
0x89cf16 tree_check(tree_node const*, char const*, int, char const*, tree_code)
        ../../gcc/gcc/tree.h:3262
0x89cf16 reject_gcc_builtin(tree_node const*, unsigned int)
        ../../gcc/gcc/c-family/c-common.c:12620
0x668f1c mark_rvalue_use(tree_node*, unsigned int, bool)
        ../../gcc/gcc/cp/expr.c:99
0x7eaa74 rvalue(tree_node*)
        ../../gcc/gcc/cp/tree.c:716
0x7eadad stabilize_expr(tree_node*, tree_node**)
        ../../gcc/gcc/cp/tree.c:4209
0x7805bf cp_build_modify_expr(tree_node*, tree_code, tree_node*, int)
        ../../gcc/gcc/cp/typeck.c:7704
0x62f275 build_new_op_1
        ../../gcc/gcc/cp/call.c:5740
0x62fa4e build_new_op(unsigned int, tree_code, int, tree_node*, tree_node*,
tree_node*, tree_node**, int)
        ../../gcc/gcc/cp/call.c:5824
0x781ceb build_x_modify_expr(unsigned int, tree_node*, tree_code, tree_node*,
int)
        ../../gcc/gcc/cp/typeck.c:7899
0x7416f6 cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:9095
0x741877 cp_parser_constant_expression
        ../../gcc/gcc/cp/parser.c:9324
0x742e2a cp_parser_parenthesized_expression_list
        ../../gcc/gcc/cp/parser.c:7454
0x7438d6 cp_parser_initializer
        ../../gcc/gcc/cp/parser.c:20730
0x7552dd cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:18594
0x755beb cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:12359
0x755f7a cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:12235
0x75ecde cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:12132
0x75d646 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:12011
0x75d958 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4321
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.




$ cat abc.cc
int freopen ( freopen += *[

Reply via email to