Commit a7ea9e29 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/36877 (-O0 -fopenmp -march=i386 atomics)

	PR middle-end/36877
	* omp-low.c (expand_omp_atomic_fetch_op): Make sure the
	return value of the builtin is ignored.

	* gcc.dg/gomp/atomic-11.c: New test.

From-SVN: r137989
parent 5e2be41f
2008-07-19 Jakub Jelinek <jakub@redhat.com>
PR middle-end/36877
* omp-low.c (expand_omp_atomic_fetch_op): Make sure the
return value of the builtin is ignored.
2008-07-19 Olivier Hainque <hainque@adacore.com> 2008-07-19 Olivier Hainque <hainque@adacore.com>
* doc/tm.texi (MALLOC_ABI_ALIGNMENT): New macro. Alignment, in * doc/tm.texi (MALLOC_ABI_ALIGNMENT): New macro. Alignment, in
......
...@@ -4742,6 +4742,7 @@ expand_omp_atomic_fetch_op (basic_block load_bb, ...@@ -4742,6 +4742,7 @@ expand_omp_atomic_fetch_op (basic_block load_bb,
bsi = bsi_last (load_bb); bsi = bsi_last (load_bb);
gcc_assert (TREE_CODE (bsi_stmt (bsi)) == OMP_ATOMIC_LOAD); gcc_assert (TREE_CODE (bsi_stmt (bsi)) == OMP_ATOMIC_LOAD);
call = build_call_expr (decl, 2, addr, fold_convert (itype, rhs)); call = build_call_expr (decl, 2, addr, fold_convert (itype, rhs));
call = fold_convert (void_type_node, call);
force_gimple_operand_bsi (&bsi, call, true, NULL_TREE, true, BSI_SAME_STMT); force_gimple_operand_bsi (&bsi, call, true, NULL_TREE, true, BSI_SAME_STMT);
bsi_remove (&bsi, true); bsi_remove (&bsi, true);
......
2008-07-19 Jakub Jelinek <jakub@redhat.com>
PR middle-end/36877
* gcc.dg/gomp/atomic-11.c: New test.
2008-07-19 Tobias Burnus <burnus@net-b.de> 2008-07-19 Tobias Burnus <burnus@net-b.de>
PR fortran/36795 PR fortran/36795
......
/* PR middle-end/36877 */
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
/* { dg-options "-fopenmp -march=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
int i;
float f;
void foo (void)
{
#pragma omp atomic
i++;
#pragma omp atomic
f += 1.0;
}
/* { dg-final { scan-assembler-not "__sync_(fetch|add|bool|val)" { target i?86-*-* x86_64-*-* powerpc*-*-* ia64-*-* s390*-*-* sparc*-*-* } } } */
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