Executing on host: /home/dave/gnu/gcc-4.4/objdir/gcc/xgcc -B/home/dave/gnu/gcc-4.4/objdir/gcc/ /home/dave/gnu/gcc-4.4/gcc/libgomp/testsuite/libgomp.c/omp-nested-1.c -B/home/dave/gnu/gcc-4.4/objdir/hppa-linux/./libgomp/ -I/home/dave/gnu/gcc-4.4/objdir/hppa-linux/./libgomp -I/home/dave/gnu/gcc-4.4/gcc/libgomp/testsuite/.. -fmessage-length=0 -fopenmp -O2 -L/home/dave/gnu/gcc-4.4/objdir/hppa-linux/./libgomp/.libs -lgomp -lm -o ./omp-nested-1.exe (timeout = 300) PASS: libgomp.c/omp-nested-1.c (test for excess errors) Setting LD_LIBRARY_PATH to .:/home/dave/gnu/gcc-4.4/objdir/hppa-linux/./libgomp/.libs:/home/dave/gnu/gcc-4.4/objdir/gcc:.:/home/dave/gnu/gcc-4.4/objdir/hppa-linux/./libgomp/.libs:/home/dave/gnu/gcc-4.4/objdir/gcc:/home/dave/gnu/gcc-4.4/objdir/hppa-linux/libstdc++-v3/.libs:/home/dave/gnu/gcc-4.4/objdir/hppa-linux/libmudflap/.libs:/home/dave/gnu/gcc-4.4/objdir/hppa-linux/libssp/.libs:/home/dave/gnu/gcc-4.4/objdir/hppa-linux/libgomp/.libs:/home/dave/gnu/gcc-4.4/objdir/./gcc:/home/dave/gnu/gcc-4.4/objdir/./prev-gcc:/usr/lib/debug FAIL: libgomp.c/omp-nested-1.c execution test
The test didn't fail in revision 133125.
Same failure is also present on hppa2.0w-hp-hpux11.11 (4.3.1) and hppa64-hp-hpux11.11 (4.4.0). There are quite a few other libgomp fails that are probably the same bug.
Same on sh4-unknown-linux-gnu. It seems that they started to fail after r133162 | jakub | 2008-03-13 18:26:25 +0900 (Thu, 13 Mar 2008) | 7 lines PR middle-end/35185 * omp-low.c (lower_regimplify, init_tmp_var, save_tmp_var): Removed. (lower_omp_2): New function. (lower_omp_1, lower_omp): Rewritten. applied. There is a libgomp failure on x86-linux with -march=i386 FAIL: libgomp.c/pr26943-4.c execution test which doesn't fail on r133161, though I'm not sure it's related with this PR.
Seems OMP_ATOMIC_LOAD isn't properly regimplified and so &i in TREE_OPERAND (omp_atomic_load, 1) isn't replaced with .omp_data_i->i. For targets with sync builtins this doesn't matter, as expand_omp_atomic for them runs all addr references through force_gimple_operand_bsi and thus it is gimplified at expand_omp time. But the expand_omp_atomic_mutex fallback just assumes the address is gimple value. Here is a fix I'll be testing (though for hppa-linux I can only eyeball the assembly). 2008-03-18 Jakub Jelinek <jakub@redhat.com> PR middle-end/35611 * gimplify.c (gimplify_expr): Gimplify second operand of OMP_ATOMIC_LOAD. --- gcc/gimplify.c.jj 2008-03-06 18:45:59.000000000 +0100 +++ gcc/gimplify.c 2008-03-18 11:55:04.000000000 +0100 @@ -6022,12 +6022,18 @@ gimplify_expr (tree *expr_p, tree *pre_p case OMP_RETURN: case OMP_CONTINUE: - case OMP_ATOMIC_LOAD: - case OMP_ATOMIC_STORE: - + case OMP_ATOMIC_STORE: ret = GS_ALL_DONE; break; + case OMP_ATOMIC_LOAD: + if (gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, NULL, + is_gimple_val, fb_rvalue) != GS_ALL_DONE) + ret = GS_ERROR; + else + ret = GS_ALL_DONE; + break; + case POINTER_PLUS_EXPR: /* Convert ((type *)A)+offset into &A->field_of_type_and_offset. The second is gimple immediate saving a need for extra statement. libgomp.c/pr26943-4.c used to fail intermitently before http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132977 but I certainly can't reproduce it with current trunk or 4.3, and I don't see how this could be related to this - even -m32 -march=i386 has the needed sync builtins - both QImode and SImode lock; add{b,l}.
Subject: Bug 35611 Author: jakub Date: Tue Mar 18 12:21:02 2008 New Revision: 133309 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133309 Log: PR middle-end/35611 * gimplify.c (gimplify_expr): Gimplify second operand of OMP_ATOMIC_LOAD. * testsuite/libgomp.c/atomic-4.c: New test. Added: trunk/libgomp/testsuite/libgomp.c/atomic-4.c Modified: trunk/gcc/ChangeLog trunk/gcc/gimplify.c trunk/libgomp/ChangeLog
Subject: Bug 35611 Author: jakub Date: Tue Mar 18 12:31:28 2008 New Revision: 133310 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133310 Log: PR middle-end/35611 * gimplify.c (gimplify_expr): Gimplify second operand of OMP_ATOMIC_LOAD. * testsuite/libgomp.c/atomic-4.c: New test. Added: branches/gcc-4_3-branch/libgomp/testsuite/libgomp.c/atomic-4.c Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/gimplify.c branches/gcc-4_3-branch/libgomp/ChangeLog
Fixed.