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

            Bug ID: 59631
           Summary: ICE using _Cilk_spawn without -fcilkplus
           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 valid code snippet (compiled *without* "-fcilkplus")
triggers an ICE on trunk:

==============================================================
void foo()
{
  _Cilk_spawn foo();
}
==============================================================

bug.cc: In function 'void foo()':
bug.cc:3:20: internal compiler error: in cp_gimplify_expr, at
cp/cp-gimplify.c:714
   _Cilk_spawn foo();
                    ^
0x762dab cp_gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**)
        ../../gcc/gcc/cp/cp-gimplify.c:712
0x9c674b gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7350
0x9cb7b6 gimplify_stmt(tree_node**, gimple_statement_base**)
        ../../gcc/gcc/gimplify.c:5334
0x9c74ec gimplify_cleanup_point_expr
        ../../gcc/gcc/gimplify.c:5110
0x9c74ec gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7787
0x9cb7b6 gimplify_stmt(tree_node**, gimple_statement_base**)
        ../../gcc/gcc/gimplify.c:5334
0x9ccf7a gimplify_body(tree_node*, bool)
        ../../gcc/gcc/gimplify.c:8531
0x9cd579 gimplify_function_tree(tree_node*)
        ../../gcc/gcc/gimplify.c:8684
0x85b927 analyze_function
        ../../gcc/gcc/cgraphunit.c:649
0x85cbdb analyze_functions
        ../../gcc/gcc/cgraphunit.c:1017
0x85e305 finalize_compilation_unit()
        ../../gcc/gcc/cgraphunit.c:2310
0x655b0e cp_write_global_declarations()
        ../../gcc/gcc/cp/decl2.c:4431
Please submit a full bug report, [etc.]


Balaji, this appeared right after your patch 

2013-12-11  Balaji V. Iyer  <balaji.v.i...@intel.com>

    * cp-tree.h (cilk_valid_spawn): New prototype.
    (gimplify_cilk_spawn): Likewise.
    (create_try_catch_expr): Likewise.
    * decl.c (finish_function): Insert Cilk function-calls when a
    _Cilk_spawn is used in a function.
    * parser.c (cp_parser_postfix_expression): Added RID_CILK_SPAWN and
    RID_CILK_SYNC cases.
        [...]

Would you mind havin a look?

Reply via email to