Commit 018b899b by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/28713 (GNU OpenMP produces type mismatches)

	PR middle-end/28713
	* omp-low.c (lower_omp_parallel): Convert t to
	receiver_decl's type.
	(expand_omp_parallel): STRIP_NOPS from the MODIFY_EXPR
	source before comparison.

From-SVN: r116154
parent d0f53cbc
2006-08-15 Jakub Jelinek <jakub@redhat.com> 2006-08-15 Jakub Jelinek <jakub@redhat.com>
PR middle-end/28713
* omp-low.c (lower_omp_parallel): Convert t to
receiver_decl's type.
(expand_omp_parallel): STRIP_NOPS from the MODIFY_EXPR
source before comparison.
PR middle-end/28724 PR middle-end/28724
* gimplify.c (gimplify_omp_atomic_pipeline): Convert oldival * gimplify.c (gimplify_omp_atomic_pipeline): Convert oldival
to itype in assignment to oldival2. to itype in assignment to oldival2.
......
...@@ -2475,13 +2475,17 @@ expand_omp_parallel (struct omp_region *region) ...@@ -2475,13 +2475,17 @@ expand_omp_parallel (struct omp_region *region)
for (si = bsi_start (entry_succ_bb); ; bsi_next (&si)) for (si = bsi_start (entry_succ_bb); ; bsi_next (&si))
{ {
tree stmt; tree stmt, arg;
gcc_assert (!bsi_end_p (si)); gcc_assert (!bsi_end_p (si));
stmt = bsi_stmt (si); stmt = bsi_stmt (si);
if (TREE_CODE (stmt) == MODIFY_EXPR if (TREE_CODE (stmt) != MODIFY_EXPR)
&& TREE_CODE (TREE_OPERAND (stmt, 1)) == ADDR_EXPR continue;
&& TREE_OPERAND (TREE_OPERAND (stmt, 1), 0)
arg = TREE_OPERAND (stmt, 1);
STRIP_NOPS (arg);
if (TREE_CODE (arg) == ADDR_EXPR
&& TREE_OPERAND (arg, 0)
== OMP_PARALLEL_DATA_ARG (entry_stmt)) == OMP_PARALLEL_DATA_ARG (entry_stmt))
{ {
if (TREE_OPERAND (stmt, 0) == DECL_ARGUMENTS (child_fn)) if (TREE_OPERAND (stmt, 0) == DECL_ARGUMENTS (child_fn))
...@@ -4084,6 +4088,8 @@ lower_omp_parallel (tree *stmt_p, omp_context *ctx) ...@@ -4084,6 +4088,8 @@ lower_omp_parallel (tree *stmt_p, omp_context *ctx)
if (ctx->record_type) if (ctx->record_type)
{ {
t = build_fold_addr_expr (ctx->sender_decl); t = build_fold_addr_expr (ctx->sender_decl);
/* fixup_child_record_type might have changed receiver_decl's type. */
t = fold_convert (TREE_TYPE (ctx->receiver_decl), t);
t = build2 (MODIFY_EXPR, void_type_node, ctx->receiver_decl, t); t = build2 (MODIFY_EXPR, void_type_node, ctx->receiver_decl, t);
append_to_statement_list (t, &new_body); append_to_statement_list (t, &new_body);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment