Commit 14e5b285 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/39331 (OpenMP and return-slot-optimization generate invalid gimple)

2009-03-01  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/39331
	* omp-low.c (lower_send_shared_vars): Do not receive new
	values for the reference of DECL_BY_REFERENCE parms or results.

From-SVN: r144531
parent f4ea99bd
2009-03-01 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39331
* omp-low.c (lower_send_shared_vars): Do not receive new
values for the reference of DECL_BY_REFERENCE parms or results.
2009-03-01 Jan Hubicka <jh@suse.cz>
PR debug/39267
......
......@@ -2821,7 +2821,14 @@ lower_send_shared_vars (gimple_seq *ilist, gimple_seq *olist, omp_context *ctx)
x = build_sender_ref (ovar, ctx);
gimplify_assign (x, var, ilist);
if (!TREE_READONLY (var))
if (!TREE_READONLY (var)
/* We don't need to receive a new reference to a result
or parm decl. In fact we may not store to it as we will
invalidate any pending RSO and generate wrong gimple
during inlining. */
&& !((TREE_CODE (var) == RESULT_DECL
|| TREE_CODE (var) == PARM_DECL)
&& DECL_BY_REFERENCE (var)))
{
x = build_sender_ref (ovar, ctx);
gimplify_assign (var, x, olist);
......
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