Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Clang 3.5 Regression: bit-field compare optimized out #22257

Open Quuxplusone opened 9 years ago

Quuxplusone commented 9 years ago
Bugzilla Link PR22258
Status NEW
Importance P normal
Reported by Luke (lukebenes@hotmail.com)
Reported on 2015-01-18 13:36:11 -0800
Last modified on 2015-11-05 14:45:55 -0800
Version 3.5
Hardware PC Linux
CC anton@korobeynikov.info, llvm-bugs@lists.llvm.org, mst.lo@arcor.de
Fixed by commit(s)
Attachments clang22258.cxx (535 bytes, text/x-c++src)
Blocks
Blocked by
See also
I am no longer able to build LibreOffice with newer versions of clang 3.5. When
I upgraded to 3.5.0 final and 3.5.1(rc2), libreoffice generates unit test
error. I tested both the Pre-built Binaries and the Ubuntu nightly packages on
a fresh install of Ubuntu 14.4. All recent builds of clang failed with the same
unit test errors. Reverting back to an earlier build, always resolves the issue.

Steps to reproduce:
1. $ git clone git://anongit.freedesktop.org/libreoffice/core
2. $ git checkout libreoffice-4-4-0 (optional, master fails with same errors)
3. $ apt-get build-dep libreoffice ( also lo_usefull Shell Script if missing
dep)
4. Remove ccache if it's installed ( ccache generates warning w/ clang)
5. create file autogen.input with CC=clang and CXX=clang++
6 ./autogen.sh && make

Results:
clang 3.5.0 svn201651 - SUCCESS
gcc 4.8.2 - SUCCESS
gcc 4.9.2 - SUCCESS
clang 3.5.0 RELEASE_350/final - FAIL
clang 3.5.1 RELEASE_351/rc2 - FAIL

Build log:

[build CUT] basic_nested_struct
[build CUT] basic_coverage
Segmentation fault (core dumped)

No core file identified in directory
/lo/core/workdir/CppunitTest/basic_nested_struct.test.core
To show backtraces for crashes during test execution,
enable core files with:

   ulimit -c unlimited

Segmentation fault (core dumped)

No core file identified in directory
/lo/core/workdir/CppunitTest/basic_enable.test.core
To show backtraces for crashes during test execution,
enable core files with:

   ulimit -c unlimited

Error: a unit test failed, please do one of:

export DEBUGCPPUNIT=TRUE            # for exception catching
export CPPUNITTRACE="gdb --args"    # for interactive debugging on Linux
export CPPUNITTRACE="\"[full path to devenv.exe]\" /debugexe" # for interactive
debugging in Visual Studio
export VALGRIND=memcheck            # for memory checking

and retry using: make CppunitTest_basic_enable

Error: a unit test failed, please do one of:

export DEBUGCPPUNIT=TRUE            # for exception catching
export CPPUNITTRACE="gdb --args"    # for interactive debugging on Linux
export CPPUNITTRACE="\"[full path to devenv.exe]\" /debugexe" # for interactive
debugging in Visual Studio
export VALGRIND=memcheck            # for memory checking

and retry using: make CppunitTest_basic_nested_struct

make[1]: *** [/lo/core/workdir/CppunitTest/basic_enable.test] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [/lo/core/workdir/CppunitTest/basic_nested_struct.test] Error 1
make: *** [build] Error 2
Quuxplusone commented 9 years ago

If ToT is fine, then everything should work in 3.6

Quuxplusone commented 9 years ago

Yes, clang 3.6.0-svn225356-1~exp1 can LibreOffice build successfully.

Quuxplusone commented 9 years ago

Attached clang22258.cxx (535 bytes, text/x-c++src): reproducer for bitfield mis-optimization

Quuxplusone commented 9 years ago

LibreOffice git master now contains a work-around for the bug:

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6f1c202547d087d1115ab023f9b6ee4c230c6602