+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
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);