Bug 34519 - pr26943-2.c is regressed on mainline
Summary: pr26943-2.c is regressed on mainline
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: libgomp (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-18 10:17 UTC by İsmail Dönmez
Modified: 2007-12-18 23:11 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description İsmail Dönmez 2007-12-18 10:17:09 UTC
This test was fine with revision 130991 but broken with mainline now. This is what I get now :

[~]> gcc pr26943-2.c -lgomp

[~]> ./a.out
zsh: abort      ./a.out

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc/4.3.0 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include --datadir=/usr/share/gcc/i686-pc-linux-gnu/4.3.0 --mandir=/usr/share/gcc/i686-pc-linux-gnu/4.3.0/man --infodir=/usr/share/gcc/i686-pc-linux-gnu/4.3.0/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.0/include/g++-v3 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-libgcj --disable-libssp --disable-multilib --disable-nls --disable-werror --disable-mudflap --disable-libmudflap --enable-checking=release --enable-clocale=gnu --enable-__cxa_atexit --enable-languages=c,c++,fortran,objc --enable-libstdcxx-allocator=new --enable-shared --enable-ssp --enable-threads=posix --enable-version-specific-runtime-libs --without-included-gettext --without-system-libunwind --with-system-zlib --with-cpu=generic --with-pkgversion='Pardus Linux' --with-bugurl=http://bugs.pardus.org.tr
Thread model: posix
gcc version 4.3.0 20071217 [trunk revision 131010] (Pardus Linux)
Comment 1 Jakub Jelinek 2007-12-18 10:52:20 UTC
This test relies on being compiled wit -fopenmp (as a bunch of other tests do).
Why are you compiling it without it?
Comment 2 İsmail Dönmez 2007-12-18 14:17:51 UTC
I was testing outside of the testsuite to see why it failed. I see this in log :

PASS: libgomp.c/pr26943-2.c (test for excess errors)
Setting LD_LIBRARY_PATH to .:/var/pisi/gcc-4.3_pre20071218-31/work/gcc-4.3-20071218/build-default-i686-pc-linux-gnu/i686-pc-linux-gnu/./libgomp/.libs:/var/pisi/gcc-4.3_pre20071218-31/work/gcc-4.3-20071218/build-default-i686-pc-linux-gnu/gcc:.:/var/pisi/gcc-4.3_pre20071218-31/work/gcc-4.3-20071218/build-default-i686-pc-linux-gnu/i686-pc-linux-gnu/./libgomp/.libs:/var/pisi/gcc-4.3_pre20071218-31/work/gcc-4.3-20071218/build-default-i686-pc-linux-gnu/gcc:/var/pisi/gcc-4.3_pre20071218-31/work/gcc-4.3-20071218/build-default-i686-pc-linux-gnu/i686-pc-linux-gnu/libstdc++-v3/.libs:/var/pisi/gcc-4.3_pre20071218-31/work/gcc-4.3-20071218/build-default-i686-pc-linux-gnu/i686-pc-linux-gnu/libgomp/.libs:/var/pisi/gcc-4.3_pre20071218-31/work/gcc-4.3-20071218/build-default-i686-pc-linux-gnu/./gcc:/var/pisi/gcc-4.3_pre20071218-31/work/gcc-4.3-20071218/build-default-i686-pc-linux-gnu/./prev-gcc
FAIL: libgomp.c/pr26943-2.c execution test

I can't seem to compile the testcase by hand with -fopenmp :

[~]> gcc -fopenmp pr26943-2.c -lgomp
/tmp/ccaOHasa.o: In function `main.omp_fn.0':
pr26943-2.c:(.text+0x179): undefined reference to `__sync_fetch_and_add_4'
pr26943-2.c:(.text+0x2c7): undefined reference to `__sync_fetch_and_add_4'
collect2: ld returned 1 exit status
Comment 3 Jakub Jelinek 2007-12-18 14:30:52 UTC
On i386 you need also -march=i486 or higher, i386 doesn't have instructions
for atomic stuff.
Comment 4 İsmail Dönmez 2007-12-18 14:39:21 UTC
[~]> gcc -fopenmp -march=i486 pr26943-2.c -lgomp

[~]> ./a.out
[~]>

works fine like this, I don't know why it fails in the tests. Hmm wonder if --with-cpu=generic  could affect this? This is a 4 CPU Xeon machine btw.
Comment 5 İsmail Dönmez 2007-12-18 23:11:06 UTC
Re-tested with no problems now, but machine was under %300 load when this test failed. Interestingly rest of the regtests passed fine. Anyway this is invalid. Thanks for the attention.