This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[CilkPlus] fix issues when cilk_spawn is used with nontrivial expressions


This patch fixes issues with cilk_spawn where bad diagnostics are
emitted for expressions invoking conversion operators or constructor
calls (PR69024, PR68997).

It also fixes an issue with a missing CLEANUP_POINT_EXPR that causes
an ICE when gimplifying code containing a temporary with a destructor
(PR69048)

Bootstrapped and regression tested on x86_64-linux

2015-12-25  Ryan Burn  <contact@rnburn.com>

       PR cilkplus/69024, PR cilkplus/68997, PR cilkplus/PR69048
       * cilk.c (cilk_detect_spawn_and_unwrap): Use recursive function
find_spawn to search for the CILK_SPAWN_STMT.
         (cilk_ignorable_spawn_rhs_op): Also ignore COMPOUND_EXPR.
         (find_spawn): New.
         (is_conversion_operator_function_decl_p): New.
         (is_conversion_operator_call_p): New.
         (is_unary_constructor_aggr_init_p): New.
         (is_conversion_operator_aggr_init_p): New.
         (extract_free_variables): Don't extract the slot variable of
an AGGR_INIT_EXPR.
         (create_cilk_wrapper_body): Add CLEANUP_POINT_EXPR to the
spawn expression.

       * gcc/testsuite/g++.dg/cilk-plus/CK/pr68997.cc : New test.

       * gcc/testsuite/g++.dg/cilk-plus/CK/pr69024.cc : New test.

       * gcc/testsuite/g++.dg/cilk-plus/CK/pr69048.cc : New test.

       * gcc/testsuite/g++.dg/cilk-plus/CK/pr68001.cc : Removed check
depending on bad diagnostics.

Attachment: cilk_spawn.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]