Once compiling a file comes from Amaya, using -O2 fail but without it succeed.
| Bugzilla Link | 4969 |
| Resolution | FIXED |
| Resolved on | Nov 18, 2019 10:06 |
| Version | 2.6 |
| OS | Linux |
| Attachments | generated ll file and source code(C++ file) |
| Reporter | LLVM Bugzilla Contributor |
| CC | @lattner,@ekatz |
Extended Description
dreamkxd@dreamkxd-desktop:~/src/Amaya/Amaya/objs/thotlib$ /usr/lib/llvm2.6/gcc-4.2/bin/llvm-g++ -emit-llvm -S -v -O2 -Wall -x c++ -D__cplusplus -D_UNIX -D_GL -D_WX -DHAVE_CONFIG_H -I.. -I../../amaya/xpm -I../../thotlib/include -I../../thotlib/internals/var -I../../thotlib/internals/h -I../../thotlib/internals/f -I/home/dreamkxd/src/Amaya/wxWidgets/src/png -I/home/dreamkxd/src/Amaya/wxWidgets/src/jpeg -I/home/dreamkxd/src/Amaya/wxWidgets/src/tiff -I/home/dreamkxd/src/Amaya/Amaya/objs/wxWidgets_RELEASE/lib/wx/include/gtk2-unicode-release-static-2.8 -I/home/dreamkxd/src/Amaya/wxWidgets/include -I/home/dreamkxd/src/Amaya/wxWidgets/contrib/include -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I/home/dreamkxd/src/Amaya/Amaya/objs/Mesa/include -I/usr/include/freetype2 -c ../../thotlib/presentation/presrules.c -o presentation/presrules.o Using built-in specs. Target: i686-linux-gnu Configured with: /mnt/src/llvm-gcc/configure --host=i686-linux-gnu --build=i686-linux-gnu --prefix=/usr/lib/llvm2.6/gcc-4.2 --enable-languages=c,c++ --program-prefix=llvm- --enable-llvm=/usr/lib/llvm2.6 --enable-threads --disable-nls --disable-shared --disable-multilib --disable-bootstrap Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5649) (LLVM build) /usr/lib/llvm2.6/gcc-4.2/libexec/gcc/i686-linux-gnu/4.2.1/cc1plus -quiet -v -I.. -I../../amaya/xpm -I../../thotlib/include -I../../thotlib/internals/var -I../../thotlib/internals/h -I../../thotlib/internals/f -I/home/dreamkxd/src/Amaya/wxWidgets/src/png -I/home/dreamkxd/src/Amaya/wxWidgets/src/jpeg -I/home/dreamkxd/src/Amaya/wxWidgets/src/tiff -I/home/dreamkxd/src/Amaya/Amaya/objs/wxWidgets_RELEASE/lib/wx/include/gtk2-unicode-release-static-2.8 -I/home/dreamkxd/src/Amaya/wxWidgets/include -I/home/dreamkxd/src/Amaya/wxWidgets/contrib/include -I/home/dreamkxd/src/Amaya/Amaya/objs/Mesa/include -I/usr/include/freetype2 -D_GNU_SOURCE -D_REENTRANT -D__cplusplus -D_UNIX -D_GL -D_WX -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ ../../thotlib/presentation/presrules.c -emit-llvm -quiet -dumpbase presrules.c -mtune=generic -auxbase-strip presentation/presrules.o -O2 -Wall -version -o presentation/presrules.o ignoring nonexistent directory "/usr/lib/llvm2.6/gcc-4.2/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/include" ignoring nonexistent directory "/home/dreamkxd/src/Amaya/wxWidgets/contrib/include" #include "..." search starts here: #include <...> search starts here: .. ../../amaya/xpm ../../thotlib/include ../../thotlib/internals/var ../../thotlib/internals/h ../../thotlib/internals/f /home/dreamkxd/src/Amaya/wxWidgets/src/png /home/dreamkxd/src/Amaya/wxWidgets/src/jpeg /home/dreamkxd/src/Amaya/wxWidgets/src/tiff /home/dreamkxd/src/Amaya/Amaya/objs/wxWidgets_RELEASE/lib/wx/include/gtk2-unicode-release-static-2.8 /home/dreamkxd/src/Amaya/wxWidgets/include /home/dreamkxd/src/Amaya/Amaya/objs/Mesa/include /usr/include/freetype2 /usr/lib/llvm2.6/gcc-4.2/lib/gcc/i686-linux-gnu/4.2.1/../../../../include/c++/4.2.1 /usr/lib/llvm2.6/gcc-4.2/lib/gcc/i686-linux-gnu/4.2.1/../../../../include/c++/4.2.1/i686-linux-gnu /usr/lib/llvm2.6/gcc-4.2/lib/gcc/i686-linux-gnu/4.2.1/../../../../include/c++/4.2.1/backward /usr/local/include /usr/lib/llvm2.6/gcc-4.2/include /usr/lib/llvm2.6/gcc-4.2/lib/gcc/i686-linux-gnu/4.2.1/include /usr/include End of search list. GNU C++ version 4.2.1 (Based on Apple Inc. build 5649) (LLVM build) (i686-linux-gnu) compiled by GNU C version 4.2.1 (Based on Apple Inc. build 5636) (LLVM build). GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=63683 Compiler executable checksum: a994527e259f35a25d2a7ed449fb1e8b ../../thotlib/presentation/presrules.c:5016: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See URL:http://llvm.org/bugs/ for instructions.
Because of dependence is too much, so I didn't attach other files.
dreamkxd@dreamkxd-desktop:~/src/Amaya/Amaya/objs/thotlib$ /usr/lib/llvm2.6/gcc-4.2/bin/llvm-g++ -emit-llvm -S -v -Wall -x c++ -D__cplusplus -D_UNIX -D_GL -D_WX -DHAVE_CONFIG_H -I.. -I../../amaya/xpm -I../../thotlib/include -I../../thotlib/internals/var -I../../thotlib/internals/h -I../../thotlib/internals/f -I/home/dreamkxd/src/Amaya/wxWidgets/src/png -I/home/dreamkxd/src/Amaya/wxWidgets/src/jpeg -I/home/dreamkxd/src/Amaya/wxWidgets/src/tiff -I/home/dreamkxd/src/Amaya/Amaya/objs/wxWidgets_RELEASE/lib/wx/include/gtk2-unicode-release-static-2.8 -I/home/dreamkxd/src/Amaya/wxWidgets/include -I/home/dreamkxd/src/Amaya/wxWidgets/contrib/include -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I/home/dreamkxd/src/Amaya/Amaya/objs/Mesa/include -I/usr/include/freetype2 -c ../../thotlib/presentation/presrules.c -o presentation/presrules.o Using built-in specs. Target: i686-linux-gnu Configured with: /mnt/src/llvm-gcc/configure --host=i686-linux-gnu --build=i686-linux-gnu --prefix=/usr/lib/llvm2.6/gcc-4.2 --enable-languages=c,c++ --program-prefix=llvm- --enable-llvm=/usr/lib/llvm2.6 --enable-threads --disable-nls --disable-shared --disable-multilib --disable-bootstrap Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5649) (LLVM build) /usr/lib/llvm2.6/gcc-4.2/libexec/gcc/i686-linux-gnu/4.2.1/cc1plus -quiet -v -I.. -I../../amaya/xpm -I../../thotlib/include -I../../thotlib/internals/var -I../../thotlib/internals/h -I../../thotlib/internals/f -I/home/dreamkxd/src/Amaya/wxWidgets/src/png -I/home/dreamkxd/src/Amaya/wxWidgets/src/jpeg -I/home/dreamkxd/src/Amaya/wxWidgets/src/tiff -I/home/dreamkxd/src/Amaya/Amaya/objs/wxWidgets_RELEASE/lib/wx/include/gtk2-unicode-release-static-2.8 -I/home/dreamkxd/src/Amaya/wxWidgets/include -I/home/dreamkxd/src/Amaya/wxWidgets/contrib/include -I/home/dreamkxd/src/Amaya/Amaya/objs/Mesa/include -I/usr/include/freetype2 -D_GNU_SOURCE -D_REENTRANT -D__cplusplus -D_UNIX -D_GL -D_WX -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ ../../thotlib/presentation/presrules.c -emit-llvm -quiet -dumpbase presrules.c -mtune=generic -auxbase-strip presentation/presrules.o -Wall -version -o presentation/presrules.o ignoring nonexistent directory "/usr/lib/llvm2.6/gcc-4.2/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/include" ignoring nonexistent directory "/home/dreamkxd/src/Amaya/wxWidgets/contrib/include" #include "..." search starts here: #include <...> search starts here: .. ../../amaya/xpm ../../thotlib/include ../../thotlib/internals/var ../../thotlib/internals/h ../../thotlib/internals/f /home/dreamkxd/src/Amaya/wxWidgets/src/png /home/dreamkxd/src/Amaya/wxWidgets/src/jpeg /home/dreamkxd/src/Amaya/wxWidgets/src/tiff /home/dreamkxd/src/Amaya/Amaya/objs/wxWidgets_RELEASE/lib/wx/include/gtk2-unicode-release-static-2.8 /home/dreamkxd/src/Amaya/wxWidgets/include /home/dreamkxd/src/Amaya/Amaya/objs/Mesa/include /usr/include/freetype2 /usr/lib/llvm2.6/gcc-4.2/lib/gcc/i686-linux-gnu/4.2.1/../../../../include/c++/4.2.1 /usr/lib/llvm2.6/gcc-4.2/lib/gcc/i686-linux-gnu/4.2.1/../../../../include/c++/4.2.1/i686-linux-gnu /usr/lib/llvm2.6/gcc-4.2/lib/gcc/i686-linux-gnu/4.2.1/../../../../include/c++/4.2.1/backward /usr/local/include /usr/lib/llvm2.6/gcc-4.2/include /usr/lib/llvm2.6/gcc-4.2/lib/gcc/i686-linux-gnu/4.2.1/include /usr/include End of search list. GNU C++ version 4.2.1 (Based on Apple Inc. build 5649) (LLVM build) (i686-linux-gnu) compiled by GNU C version 4.2.1 (Based on Apple Inc. build 5636) (LLVM build). GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=127366 Compiler executable checksum: a994527e259f35a25d2a7ed449fb1e8b
As you can see, once I cancel the -O2 option, it's can be compiled correctly:) So it's must be the opt problem... I generate the ll file.
By the way, the source code of presrules.c can be download from http://www.w3.org/Amaya/User/SourceDist.html The exact source code I downloaded is http://wam.inrialpes.fr/software/amaya/amaya-fullsrc-11.3-pre.tgz
I can confirm that running opt v2.6 on the attached .ll file crashes (by the assert in PHINode::addIncoming: "All operands to PHI node must be the same type as the PHI node!"), while on the v9.0 (and even on v3.3) it does not crash. It must have been fixed since v2.6.
Unfortunately, I can't reproduce the problem with this. Running opt on the .ll file works ok on mainline, and llc produces valid code coming out. Please include the .ii file (run llvm-gcc with -E), thanks!
Also, can you try mainline? It is possible it has already been fixed since 2.6.