I checked http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16104 which is for
gcc.c-torture/execute/20050316-1.c and this is not related.
In this test optimization levels "-O0", "-O1" and "-O2" are broken, levels
"-O3" and "-Os" are OK. I am using rtl and rtlflag checking.
# gcc/xgcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /root/downloads/gcc-4_3-trunk/configure --verbose
--enable-languages=c,ada,c++,fortran,java,objc,obj-c++ --prefix=/usr
--enable-objc-gc --enable-concept-checks --disable-multilib
--with-gxx-include-dir=/usr/include/c++/4.3 --enable-libstdcxx-debug
--enable-static --enable-shared --enable-initfini-array --enable-__cxa_atexit
--enable-threads=posix --enable-version-specific-runtime-libs --enable-libssp
--enable-libmudflap --enable-libgomp --disable-werror --enable-nls
--with-included-gettext --enable-decimal-float --enable-debug
--enable-java-gc=boehm --with-x --x-includes=/usr/X11R6/include
--x-libraries=/usr/X11R6/lib --enable-java-awt=gtk,xlib --enable-gtk-cairo
--enable-qt-peer --enable-xmlj --enable-gconf-peer --enable-tool-wrappers
--enable-portable-native-sync --enable-examples --with-stabs
--enable-hash-synchronization --enable-gc-debug --enable-interpreter
--with-system-zlib --enable-libada --with-tls --with-tune=athlon-xp
--with-cpu=athlon-xp --with-arch=athlon-xp
--enable-stage1-checking=assert,fold,gc,misc,rtl,rtlflag,runtime,tree :
(reconfigured) /root/downloads/gcc-4_3-trunk/configure --verbose
--enable-languages=c,ada,c++,fortran,java,objc,obj-c++ --prefix=/usr
--enable-objc-gc --enable-concept-checks --disable-multilib
--with-gxx-include-dir=/usr/include/c++/4.3 --enable-libstdcxx-debug
--enable-static --enable-shared --enable-initfini-array --enable-__cxa_atexit
--enable-threads=posix --enable-version-specific-runtime-libs --enable-libssp
--enable-libmudflap --enable-libgomp --disable-werror --enable-nls
--with-included-gettext --enable-decimal-float --enable-debug
--enable-java-gc=boehm --with-x --x-includes=/usr/X11R6/include
--x-libraries=/usr/X11R6/lib --enable-java-awt=gtk,xlib --enable-gtk-cairo
--enable-qt-peer --enable-xmlj --enable-gconf-peer --enable-tool-wrappers
--enable-portable-native-sync --enable-examples --with-stabs
--enable-hash-synchronization --enable-gc-debug --enable-interpreter
--with-system-zlib --enable-libada --with-tls --with-tune=athlon-xp
--with-cpu=athlon-xp --with-arch=athlon-xp
--enable-stage1-checking=assert,gc,misc,rtl,rtlflag,runtime,tree
Thread model: posix
gcc version 4.3.0 20070607 (experimental)
Here is part of my log file:
Executing on host: /opt/gcc-4_3-build-2/gcc/xgcc -B/opt/gcc-4_3-build-2/gcc/
/root/downloads/gcc-4_3-trunk/gcc/testsuite/gcc.c-torture/execute/20050316-2.c
-w -O0 -fno-show-column -lm -o
/opt/gcc-4_3-build-2/gcc/testsuite/gcc/20050316-2.x0 (timeout = 300)
PASS: gcc.c-torture/execute/20050316-2.c compilation, -O0
Setting LD_LIBRARY_PATH to
:/opt/gcc-4_3-build-2/gcc::/opt/gcc-4_3-build-2/gcc:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libstdc++-v3/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libmudflap/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libssp/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libgomp/.libs:/opt/gcc-4_3-build-2/./gcc:/opt/gcc-4_3-build-2/./prev-gcc
FAIL: gcc.c-torture/execute/20050316-2.c execution, -O0
Executing on host: /opt/gcc-4_3-build-2/gcc/xgcc -B/opt/gcc-4_3-build-2/gcc/
/root/downloads/gcc-4_3-trunk/gcc/testsuite/gcc.c-torture/execute/20050316-2.c
-w -O1 -fno-show-column -lm -o
/opt/gcc-4_3-build-2/gcc/testsuite/gcc/20050316-2.x1 (timeout = 300)
PASS: gcc.c-torture/execute/20050316-2.c compilation, -O1
Setting LD_LIBRARY_PATH to
:/opt/gcc-4_3-build-2/gcc::/opt/gcc-4_3-build-2/gcc:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libstdc++-v3/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libmudflap/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libssp/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libgomp/.libs:/opt/gcc-4_3-build-2/./gcc:/opt/gcc-4_3-build-2/./prev-gcc
FAIL: gcc.c-torture/execute/20050316-2.c execution, -O1
Executing on host: /opt/gcc-4_3-build-2/gcc/xgcc -B/opt/gcc-4_3-build-2/gcc/
/root/downloads/gcc-4_3-trunk/gcc/testsuite/gcc.c-torture/execute/20050316-2.c
-w -O2 -fno-show-column -lm -o
/opt/gcc-4_3-build-2/gcc/testsuite/gcc/20050316-2.x2 (timeout = 300)
PASS: gcc.c-torture/execute/20050316-2.c compilation, -O2
Setting LD_LIBRARY_PATH to
:/opt/gcc-4_3-build-2/gcc::/opt/gcc-4_3-build-2/gcc:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libstdc++-v3/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libmudflap/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libssp/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libgomp/.libs:/opt/gcc-4_3-build-2/./gcc:/opt/gcc-4_3-build-2/./prev-gcc
FAIL: gcc.c-torture/execute/20050316-2.c execution, -O2
Executing on host: /opt/gcc-4_3-build-2/gcc/xgcc -B/opt/gcc-4_3-build-2/gcc/
/root/downloads/gcc-4_3-trunk/gcc/testsuite/gcc.c-torture/execute/20050316-2.c
-w -O3 -fomit-frame-pointer -fno-show-column -lm -o
/opt/gcc-4_3-build-2/gcc/testsuite/gcc/20050316-2.x3 (timeout = 300)
PASS: gcc.c-torture/execute/20050316-2.c compilation, -O3 -fomit-frame-pointer
Setting LD_LIBRARY_PATH to
:/opt/gcc-4_3-build-2/gcc::/opt/gcc-4_3-build-2/gcc:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libstdc++-v3/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libmudflap/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libssp/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libgomp/.libs:/opt/gcc-4_3-build-2/./gcc:/opt/gcc-4_3-build-2/./prev-gcc
PASS: gcc.c-torture/execute/20050316-2.c execution, -O3 -fomit-frame-pointer
Executing on host: /opt/gcc-4_3-build-2/gcc/xgcc -B/opt/gcc-4_3-build-2/gcc/
/root/downloads/gcc-4_3-trunk/gcc/testsuite/gcc.c-torture/execute/20050316-2.c
-w -O3 -g -fno-show-column -lm -o
/opt/gcc-4_3-build-2/gcc/testsuite/gcc/20050316-2.x4 (timeout = 300)
PASS: gcc.c-torture/execute/20050316-2.c compilation, -O3 -g
Setting LD_LIBRARY_PATH to
:/opt/gcc-4_3-build-2/gcc::/opt/gcc-4_3-build-2/gcc:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libstdc++-v3/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libmudflap/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libssp/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libgomp/.libs:/opt/gcc-4_3-build-2/./gcc:/opt/gcc-4_3-build-2/./prev-gcc
PASS: gcc.c-torture/execute/20050316-2.c execution, -O3 -g
Executing on host: /opt/gcc-4_3-build-2/gcc/xgcc -B/opt/gcc-4_3-build-2/gcc/
/root/downloads/gcc-4_3-trunk/gcc/testsuite/gcc.c-torture/execute/20050316-2.c
-w -Os -fno-show-column -lm -o
/opt/gcc-4_3-build-2/gcc/testsuite/gcc/20050316-2.x5 (timeout = 300)
PASS: gcc.c-torture/execute/20050316-2.c compilation, -Os
Setting LD_LIBRARY_PATH to
:/opt/gcc-4_3-build-2/gcc::/opt/gcc-4_3-build-2/gcc:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libstdc++-v3/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libmudflap/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libssp/.libs:/opt/gcc-4_3-build-2/i686-pc-linux-gnu/libgomp/.libs:/opt/gcc-4_3-build-2/./gcc:/opt/gcc-4_3-build-2/./prev-gcc
PASS: gcc.c-torture/execute/20050316-2.c execution, -Os
I altered the "main()" of 20050316-2.c to include some printf statements:
main (void)
{
if (sizeof (short) != 2 || sizeof (int) != 4 || sizeof (long long) != 8)
return 0;
V2SF x = { 2.0, 2.0 };
union { long long l; float f[2]; int i[2]; } u;
u.l = test1 (x);
printf("test1 - 2.0 - u.f[0] = %10.10f u.f[1] = %10.10f \n", u.f[0],
u.f[1]);
if (u.f[0] != 2.0 || u.f[1] != 2.0)
abort ();
V2SF y = { 6.0, 6.0 };
u.l = test2 (y);
printf("test2 - 6.0 - u.f[0] = %10.10f u.f[1] = %10.10f \n", u.f[0],
u.f[1]);
if (u.f[0] != 6.0 || u.f[1] != 6.0)
abort ();
V2SI z = { 4, 4 };
u.l = test3 (z);
printf("test3 - 4 - u.i[0] = %u u.i[1] = %u \n", u.i[0],
u.i[1]);
if (u.i[0] != 4 || u.i[1] != 4)
abort ();
return 0;
}
I compiled the tests with the same options as the testsuite used and ran them:
# ./20050316-2.x0
test1 - 2.0 - u.f[0] = nan u.f[1] = nan
test2 - 6.0 - u.f[0] = nan u.f[1] = nan
test3 - 4 - u.i[0] = 4 u.i[1] = 4
# ./20050316-2.x1
test1 - 2.0 - u.f[0] = 2.0000000000 u.f[1] = nan
Aborted
# ./20050316-2.x2
test1 - 2.0 - u.f[0] = 2.0000000000 u.f[1] = nan
Aborted
# ./20050316-2.x3
test1 - 2.0 - u.f[0] = 2.0000000000 u.f[1] = 2.0000000000
test2 - 6.0 - u.f[0] = 6.0000000000 u.f[1] = 6.0000000000
test3 - 4 - u.i[0] = 4 u.i[1] = 4
# ./20050316-2.x4
test1 - 2.0 - u.f[0] = 2.0000000000 u.f[1] = 2.0000000000
test2 - 6.0 - u.f[0] = 6.0000000000 u.f[1] = 6.0000000000
test3 - 4 - u.i[0] = 4 u.i[1] = 4
# ./20050316-2.x5
test1 - 2.0 - u.f[0] = 2.0000000000 u.f[1] = 2.0000000000
test2 - 6.0 - u.f[0] = 6.0000000000 u.f[1] = 6.0000000000
test3 - 4 - u.i[0] = 4 u.i[1] = 4
Here are just the PASS/FAIL lines (for execution only) from the log:
FAIL: gcc.c-torture/execute/20050316-2.c execution, -O0
FAIL: gcc.c-torture/execute/20050316-2.c execution, -O1
FAIL: gcc.c-torture/execute/20050316-2.c execution, -O2
PASS: gcc.c-torture/execute/20050316-2.c execution, -O3 -fomit-frame-pointer
PASS: gcc.c-torture/execute/20050316-2.c execution, -O3 -g
PASS: gcc.c-torture/execute/20050316-2.c execution, -Os
I noticed this:
0): Test ./20050316-2.x0 did not abort, though it did fail. "nan" not compared
properly?
1): Test ./20050316-2.x1 did abort and fail - which seems proper (considering
the result).
2): Test ./20050316-2.x2 did abort and fail - which seems proper - "nan"
compared properly.
3): Test ./20050316-2.x3 did not abort, and it passed - OK
4): Test ./20050316-2.x4 did not abort, and it passed - OK
5): Test ./20050316-2.x5 did not abort, and it passed - OK
The testsuite operated correctly in all the cases.
GCC did not compile correctly in cases "0", "1" and "2".
In case "0" the GCC program ought to have aborted since the statements:
"if (u.f[0] != 2.0 || u.f[1] != 2.0) abort ();" _and_
"if (u.f[0] != 6.0 || u.f[1] != 6.0) abort ();" _and_
"if (u.i[0] != 4 || u.i[1] != 4 ) abort ();"
work out as:
"if (nan != 2.0 || nan != 2.0) abort ();" _and_
"if (nan != 6.0 || nan != 6.0) abort ();" _and_
"if (4 != 4 || 4 != 4 ) abort ();"
In cases "1" and "2", "u.f[1]" was equal to "nan" instead of 2.0 .
--
Summary: GCC 4.3.0 20070607 - FAIL: gcc.c-
torture/execute/20050316-2.c execution
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rob1weld at aol dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32259