Commit 66bb4f32 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/28046 (libgomp test pr27337.C fails intermittently)

	PR middle-end/28046
	* c-omp.c (c_finish_omp_atomic): If ADDR is not simple enough,
	wrap it into TARGET_EXPR.

	* gcc.dg/gomp/atomic-10.c: New test.
	* g++.dg/gomp/atomic-10.C: New test.

From-SVN: r117077
parent 1e993cb8
2006-09-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/28046
* c-omp.c (c_finish_omp_atomic): If ADDR is not simple enough,
wrap it into TARGET_EXPR.
2006-09-20 Eric Christopher <echristo@apple.com> 2006-09-20 Eric Christopher <echristo@apple.com>
* config/i386/i386.c (x86_fisttp): Remove. * config/i386/i386.c (x86_fisttp): Remove.
......
...@@ -116,6 +116,15 @@ c_finish_omp_atomic (enum tree_code code, tree lhs, tree rhs) ...@@ -116,6 +116,15 @@ c_finish_omp_atomic (enum tree_code code, tree lhs, tree rhs)
if (addr == error_mark_node) if (addr == error_mark_node)
return error_mark_node; return error_mark_node;
addr = save_expr (addr); addr = save_expr (addr);
if (TREE_CODE (addr) != SAVE_EXPR
&& (TREE_CODE (addr) != ADDR_EXPR
|| TREE_CODE (TREE_OPERAND (addr, 0)) != VAR_DECL))
{
/* Make sure LHS is simple enough so that goa_lhs_expr_p can recognize
it even after unsharing function body. */
tree var = create_tmp_var_raw (TREE_TYPE (addr), NULL);
addr = build4 (TARGET_EXPR, TREE_TYPE (addr), var, addr, NULL, NULL);
}
lhs = build_indirect_ref (addr, NULL); lhs = build_indirect_ref (addr, NULL);
/* There are lots of warnings, errors, and conversions that need to happen /* There are lots of warnings, errors, and conversions that need to happen
......
2006-09-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/28046
* gcc.dg/gomp/atomic-10.c: New test.
* g++.dg/gomp/atomic-10.C: New test.
2006-09-20 Eric Christopher <echristo@apple.com> 2006-09-20 Eric Christopher <echristo@apple.com>
* gcc.target/i386/sse3-not-fisttp.c: New. * gcc.target/i386/sse3-not-fisttp.c: New.
// PR middle-end/28046
// { dg-do compile }
// { dg-options "-fopenmp -fdump-tree-gimple" }
int a[3], b;
struct C { int x; int y; } c;
int bar (void), *baz (void);
void
foo (void)
{
#pragma omp atomic
a[2] += bar ();
#pragma omp atomic
b += bar ();
#pragma omp atomic
c.y += bar ();
#pragma omp atomic
*baz () += bar ();
}
// { dg-final { scan-tree-dump-times "__sync_fetch_and_add" 4 "gimple" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } }
// { dg-final { cleanup-tree-dump "gimple" } }
/* PR middle-end/28046 */
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-gimple" } */
int a[3], b;
struct C { int x; int y; } c;
int bar (void), *baz (void);
void
foo (void)
{
#pragma omp atomic
a[2] += bar ();
#pragma omp atomic
b += bar ();
#pragma omp atomic
c.y += bar ();
#pragma omp atomic
*baz () += bar ();
}
/* { dg-final { scan-tree-dump-times "__sync_fetch_and_add" 4 "gimple" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */
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