https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78636
Bug ID: 78636 Summary: PPC Optimization Bug in Libelemental unit test Product: gcc Version: 6.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: me at ryanlewis dot net Target Milestone: --- Created attachment 40218 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40218&action=edit example of failing code (which isn't failing) I am working on packaging libelemental for Fedora. I have found that a few of our unit tests fail on PPC with in Release mode and pass in Debug mode, only on this architecture. I suspect this to be a compiler bug, as the code is quite vanilla. Here is the associated build log demonstrating how the software located here: https://github.com/elemental/Elemental.git was compiled and ran: https://copr-be.cloud.fedoraproject.org/results/rhl/elemental/fedora-24-ppc64le/00482253-elemental/build.log.gz here are other examples of it failing (it looks like a timeout issue here): https://kojipkgs.fedoraproject.org//work/tasks/5356/16555356/build.log Here is an example of a failure in the debugger: Program received signal SIGSEGV, Segmentation fault. __memcpy_power7 () at ../sysdeps/powerpc/powerpc64/power7/memcpy.S:387 387 stvx 6,0,dst Missing separate debuginfos, use: dnf debuginfo-install mpich-3.2-5.fc24.ppc64le (gdb) bt #0 __memcpy_power7 () at ../sysdeps/powerpc/powerpc64/power7/memcpy.S:387 #1 0x00003fffb59da5f4 in std::char_traits<char>::copy (__n=13839561654909534208, __s2=<optimized out>, __s1=<optimized out>) at /usr/src/debug/gcc-6.2.1-20160916/obj-ppc64le-redhat-linux/ppc64le-redhat-linux/libstdc++-v3/include/bits/char_traits.h:290 #2 std::basic_streambuf<char, std::char_traits<char> >::xsputn (this=0x3fffffffe568, __s=<optimized out>, __n=11) at /usr/src/debug/gcc-6.2.1-20160916/obj-ppc64le-redhat-linux/ppc64le-redhat-linux/libstdc++-v3/include/bits/streambuf.tcc:90 #3 0x00003fffb59c5cd4 in std::basic_streambuf<char, std::char_traits<char> >::sputn (__n=11, __s=0x2000e0a8 " runtime: ", this=<optimized out>) at /usr/src/debug/gcc-6.2.1-20160916/obj-ppc64le-redhat-linux/ppc64le-redhat-linux/libstdc++-v3/include/streambuf:451 #4 std::__ostream_write<char, std::char_traits<char> > (__n=11, __s=0x2000e0a8 " runtime: ", __out=...) at /usr/src/debug/gcc-6.2.1-20160916/obj-ppc64le-redhat-linux/ppc64le-redhat-linux/libstdc++-v3/include/bits/ostream_insert.h:50 #5 std::__ostream_insert<char, std::char_traits<char> > (__out=..., __s=0x2000e0a8 " runtime: ", __n=11) at /usr/src/debug/gcc-6.2.1-20160916/obj-ppc64le-redhat-linux/ppc64le-redhat-linux/libstdc++-v3/include/bits/ostream_insert.h:101 #6 0x000000002000402c in std::operator<< <std::char_traits<char> > (__s=0x2000e0a8 " runtime: ", __out=...) at /usr/include/c++/6.2.1/ostream:561 #7 El::BuildStream<char [12], double, char [9]> (item=..., os=...) at /home/fedora/rpmbuild/BUILD/Elemental-master/include/El/core/environment/impl.hpp:167 #8 El::Output<char [12], double, char [9]> () at /home/fedora/rpmbuild/BUILD/Elemental-master/include/El/core/environment/impl.hpp:227 #9 main (argc=<optimized out>, argv=<optimized out>) at /home/fedora/rpmbuild/BUILD/Elemental-master/examples/number_theory/ZDependenceSearch.cpp:86 I isolated this bit of code to produce an elemental free minimal test case, but, it appears that it does not fail when freed from this example. I ran the code through valgrind I have attached the output, and I also removed the function El::Output() (in favor of std::cout) and the failure disappears. I then reran valgrind again. I will attach the valgrind output for both runs.