Closed Quuxplusone closed 14 years ago
can you please attach a preprocessed file? A non-optimized .bc file is also enough.
Yes, this is a serious bug, please include information to reproduce.
Specifically, please include the .ll or .bc file generated with -O0 -emit-llvm on your testcase, thanks.
Attached cam_periph.bc
(280280 bytes, application/octet-stream): Output .bc for file crashing with -O2
Attached cam_xpt.bc
(529292 bytes, application/octet-stream): Output .bc for file crashing with -O2
Attached db_command.bc
(27332 bytes, application/octet-stream): Output .bc for file crashing with -O2
Attached scsi_all.bc
(223220 bytes, application/octet-stream): Output .bc for file crashing with -O2
Attached scsi_sa.bc
(481880 bytes, application/octet-stream): Output .bc for file crashing with -O2
I've just attached a few files, compiled as Chris suggested with -emit-llvm -
O0. Apart from the one I've reported, I've added 4 others, including one
relatively small (26 KB) as I thought it might ease the problem finding.
All cause exactly the same assertion to fail with -O2.
These don't crash for me:
$ opt -O2 scsi_sa.bc
$ opt -std-compile-opts scsi_sa.bc
Do these commands crash for you?
I have no way to debug what is going wrong here. Does this occur with a debug
build of clang?
Problems here trying to compile gcc-frontedn LLVM-2.5 for x86_64 Linux.
OS:
-bash-3.2$ uname -a
Linux 2.6.18-92.1.22.el5 #1 SMP Tue Dec 16 11:57:43 EST 2008 x86_64 x86_64
x86_64 GNU/Linux
x86_64-redhat (I known, the IT manager will switch to a uBuntu in the summer)
Please any insight let me know.
Problem:
/home/GTI420/AH72000/tools/tools/build-llvm/./gcc/xgcc -
B/home/GTI420/AH72000/tools/tools/build-llvm/./gcc/ -B/usr/local/llvm/x86_64-
unknown-linux-gnu/bin/ -B/usr/local/llvm/x86_64-unknown-linux-gnu/lib/ -isystem
/usr/local/llvm/x86_64-unknown-linux-gnu/include -isystem
/usr/local/llvm/x86_64-unknown-linux-gnu/sys-include -O2 -O2 -g -O2 -DIN_GCC
-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-
definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -
D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../llvm-gcc4.2-2.5.source/gcc -
I../../llvm-gcc4.2-2.5.source/gcc/. -I../../llvm-gcc4.2-
2.5.source/gcc/../include -I../../llvm-gcc4.2-2.5.source/gcc/../libcpp/include
-I../../llvm-gcc4.2-2.5.source/gcc/../libdecnumber -I../libdecnumber -
I/usr/local/llvm/include -I/home/GTI420/AH72000/tools/tools/llvm-2.5/include -
DL_gcov_execlp -c ../../llvm-gcc4.2-2.5.source/gcc/libgcov.c -o
libgcc/./_gcov_execlp.o
cc1: /home/GTI420/AH72000/tools/tools/llvm-
2.5/include/llvm/Transforms/Utils/InlineCost.h:44:
llvm::InlineCost::InlineCost(int, int): Assertion `Cost == C && "Cost exceeds
InlineCost precision"' failed.
../../llvm-gcc4.2-2.5.source/gcc/libgcov.c:644: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[4]: *** [libgcc/./_gcov.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/home/GTI420/AH72000/tools/tools/build-llvm/gcc'
make[3]: *** [stmp-multilib] Error 2
rm gcov.pod fsf-funding.pod gfdl.pod cpp.pod gcc.pod gpl.pod
make[3]: Leaving directory `/home/GTI420/AH72000/tools/tools/build-llvm/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/home/GTI420/AH72000/tools/tools/build-llvm'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/GTI420/AH72000/tools/tools/build-llvm'
make: *** [all] Error 2
-bash-3.2$ g
configuration command:
CC=gcc43 CPP=g++43 ../llvm-gcc4.2-2.5.source/configure --prefix=/usr/local/llvm
--enable-checking --disable-multilib --program-prefix=llvm- --enable-
llvm=/usr/local/llvm --enable-languages=c,c++ --enable-bootstrap
Compiling:
make LLVM_VERSION_INFO=2.5
Please try with LLVM SVN, not 2.5. Also, what version of G++ are you using? Please include the output of g++ -v
I'm using the following:
-bash-3.2$ gcc43 -v
Using built-in specs.
Target: x86_64-redhat-linux6E
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --
enable-bootstrap --enable-shared --enable-threads=posix --enable-
checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-
exceptions --enable-languages=c,c++,fortran --disable-libgcj --with-cpu=generic
--build=x86_64-redhat-linux6E
Thread model: posix
gcc version 4.3.2 20081007 (Red Hat 4.3.2-7) (GCC)
-bash-3.2$ g++43 -v
Using built-in specs.
Target: x86_64-redhat-linux6E
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --
enable-bootstrap --enable-shared --enable-threads=posix --enable-
checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-
exceptions --enable-languages=c,c++,fortran --disable-libgcj --with-cpu=generic
--build=x86_64-redhat-linux6E
Thread model: posix
gcc version 4.3.2 20081007 (Red Hat 4.3.2-7) (GCC)
-bash-3.2$
The IT manager installed today for my usage, trying svn now.
Problems with the SVN version:
gcc43 -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -
Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
overlength-strings -Wold-style-definition -Wmissing-format-attribute -fno-
common -DHAVE_CONFIG_H -I. -I. -I../../llvm-gcc-4.2/gcc -I../../llvm-gcc-
4.2/gcc/. -I../../llvm-gcc-4.2/gcc/../include -I../../llvm-gcc-
4.2/gcc/../libcpp/include -I../../llvm-gcc-4.2/gcc/../libdecnumber -
I../libdecnumber -I/usr/local/llvm/include -
I/home/GTI420/AH72000/tools/tools/llvm-2.5/include -DENABLE_LLVM -
I/usr/local/llvm/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -
D__STDC_CONSTANT_MACROS -DLLVM_VERSION_INFO='"2.5"' \
../../llvm-gcc-4.2/gcc/config/i386/i386.c -o i386.o
../../llvm-gcc-4.2/gcc/llvm-backend.cpp: In function ‘void
emit_alias_to_llvm(tree_node*, tree_node*, tree_node*)’:
../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1041: error: ‘WeakAnyLinkage’ is not a
member of ‘llvm::GlobalValue’
../../llvm-gcc-4.2/gcc/llvm-backend.cpp: In function ‘void
emit_global_to_llvm(tree_node*)’:
../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1292: error: ‘WeakAnyLinkage’ is not a
member of ‘llvm::GlobalValue’
../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1294: error: ‘getWeakLinkage’ is not a
member of ‘llvm::GlobalValue’
../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1300: error: ‘getLinkOnceLinkage’ is
not a member of ‘llvm::GlobalValue’
../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1309: error: ‘WeakAnyLinkage’ is not a
member of ‘llvm::GlobalValue’
../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1310: error: ‘WeakODRLinkage’ is not a
member of ‘llvm::GlobalValue’
../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1311: error: ‘LinkOnceAnyLinkage’ is
not a member of ‘llvm::GlobalValue’
../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1312: error: ‘LinkOnceODRLinkage’ is
not a member of ‘llvm::GlobalValue’
../../llvm-gcc-4.2/gcc/llvm-backend.cpp: In function ‘void
llvm_mark_decl_weak(tree_node*)’:
../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1662: error: ‘WeakAnyLinkage’ is not a
member of ‘llvm::GlobalValue’
../../llvm-gcc-4.2/gcc/llvm-backend.cpp:1670: error: ‘WeakODRLinkage’ is not a
member of ‘llvm::GlobalValue’
../../llvm-gcc-4.2/gcc/config/i386/i386.c: In function ‘ix86_expand_move’:
../../llvm-gcc-4.2/gcc/config/i386/i386.c:9687: warning: unused variable ‘insn’
gcc43 -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -
Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
overlength-strings -Wold-style-definition -Wmissing-format-attribute -fno-
common -DHAVE_CONFIG_H -I. -I. -I../../llvm-gcc-4.2/gcc -I../../llvm-gcc-
4.2/gcc/. -I../../llvm-gcc-4.2/gcc/../include -I../../llvm-gcc-
4.2/gcc/../libcpp/include -I../../llvm-gcc-4.2/gcc/../libdecnumber -
I../libdecnumber -I/usr/local/llvm/include -
I/home/GTI420/AH72000/tools/tools/llvm-2.5/include -DENABLE_LLVM -
I/usr/local/llvm/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -
D__STDC_CONSTANT_MACROS -DLLVM_VERSION_INFO='"2.5"' ../../llvm-gcc-
4.2/gcc/tree-inline.c -o tree-inline.o
../../llvm-gcc-4.2/gcc/llvm-convert.cpp: In member function ‘void
TreeToLLVM::StartFunctionBody()’:
../../llvm-gcc-4.2/gcc/llvm-convert.cpp:473: error: ‘getLinkOnceLinkage’ is not
a member of ‘llvm::Function’
../../llvm-gcc-4.2/gcc/llvm-convert.cpp:476: error: ‘WeakAnyLinkage’ is not a
member of ‘llvm::Function’
../../llvm-gcc-4.2/gcc/llvm-convert.cpp:478: error: ‘getWeakLinkage’ is not a
member of ‘llvm::Function’
../../llvm-gcc-4.2/gcc/llvm-debug.cpp: In member function ‘llvm::DIType
llvm::DebugInfo::createStructType(tree_node*)’:
../../llvm-gcc-4.2/gcc/llvm-debug.cpp:580: error: no matching function for call
to ‘llvm::DIFactory::CreateCompositeType(unsigned int&, llvm::DIDescriptor,
const char*, llvm::DICompileUnit, int&, int, int, int, llvm::DIType::<anonymous
enum>, llvm::DIType, llvm::DIArray, unsigned int&)’
/usr/local/llvm/include/llvm/Analysis/DebugInfo.h:412: note: candidates are:
llvm::DICompositeType llvm::DIFactory::CreateCompositeType(unsigned int,
llvm::DIDescriptor, const std::string&, llvm::DICompileUnit, unsigned int,
uint64_t, uint64_t, uint64_t, unsigned int, llvm::DIType, llvm::DIArray)
../../llvm-gcc-4.2/gcc/llvm-debug.cpp:687: error: no matching function for call
to ‘llvm::DIFactory::CreateCompositeType(unsigned int&, llvm::DIDescriptor,
const char*, llvm::DICompileUnit, int&, uint64_t, uint64_t, int, int,
llvm::DIType, llvm::DIArray&, unsigned int&)’
/usr/local/llvm/include/llvm/Analysis/DebugInfo.h:412: note: candidates are:
llvm::DICompositeType llvm::DIFactory::CreateCompositeType(unsigned int,
llvm::DIDescriptor, const std::string&, llvm::DICompileUnit, unsigned int,
uint64_t, uint64_t, uint64_t, unsigned int, llvm::DIType, llvm::DIArray)
../../llvm-gcc-4.2/gcc/llvm-debug.cpp: In member function ‘llvm::DICompileUnit
llvm::DebugInfo::getOrCreateCompileUnit(const char*, bool)’:
../../llvm-gcc-4.2/gcc/llvm-debug.cpp:902: error: no matching function for call
to ‘llvm::DIFactory::CreateCompileUnit(unsigned int&, std::string&,
std::string&, const char [], bool&, int&, const char*&, unsigned int&)’
/usr/local/llvm/include/llvm/Analysis/DebugInfo.h:381: note: candidates are:
llvm::DICompileUnit llvm::DIFactory::CreateCompileUnit(unsigned int, const
std::string&, const std::string&, const std::string&, bool, bool, const char*)
make[2]: *** [llvm-debug.o] Error 1
make[2]: *** Waiting for unfinished jobs....
../../llvm-gcc-4.2/gcc/llvm-convert.cpp: In member function ‘bool
TreeToLLVM::EmitBuiltinCall(tree_node*, tree_node*, const MemRef*,
llvm::Value*&)’:
../../llvm-gcc-4.2/gcc/llvm-convert.cpp:4391: error:
‘getIntrinsicForGCCBuiltin’ is not a member of ‘llvm::Intrinsic’
make[2]: *** [llvm-backend.o] Error 1
make[2]: *** [llvm-convert.o] Error 1
../../llvm-gcc-4.2/gcc/config/i386/i386.c: In function ‘ix86_expand_prologue’:
../../llvm-gcc-4.2/gcc/config/i386/i386.c:5565: warning: array subscript is
above array bounds
rm gcov.pod gpl.pod fsf-funding.pod gfdl.pod cpp.pod gcc.pod
make[2]: Leaving directory `/home/GTI420/AH72000/tools/tools/build-llvm/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/GTI420/AH72000/tools/tools/build-llvm'
make: *** [all] Error 2
-bash-3.2$
You must build llvm-gcc SVN against llvm SVN.
(In reply to comment #14)
> You must build llvm-gcc SVN against llvm SVN.
>
same problem as before now:
/home/GTI420/AH72000/tools/tools/build-llvm/./gcc/xgcc -
B/home/GTI420/AH72000/tools/tools/build-llvm/./gcc/ -B/usr/local/llvm/x86_64-
unknown-linux-gnu/bin/ -B/usr/local/llvm/x86_64-unknown-linux-gnu/lib/ -isystem
/usr/local/llvm/x86_64-unknown-linux-gnu/include -isystem
/usr/local/llvm/x86_64-unknown-linux-gnu/sys-include -O2 -O2 -g -O2 -DIN_GCC
-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-
definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -
D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../llvm-gcc-4.2/gcc -I../../llvm-gcc-
4.2/gcc/. -I../../llvm-gcc-4.2/gcc/../include -I../../llvm-gcc-
4.2/gcc/../libcpp/include -I../../llvm-gcc-4.2/gcc/../libdecnumber -
I../libdecnumber -I/usr/local/llvm/include -
I/home/GTI420/AH72000/tools/tools/llvm.svn/include -DL_gcov_merge_add -c
../../llvm-gcc-4.2/gcc/libgcov.c -o libgcc/./_gcov_merge_add.o
cc1:
/home/GTI420/AH72000/tools/tools/llvm.svn/include/llvm/Transforms/Utils/InlineCost.h:44:
llvm::InlineCost::InlineCost(int, int): Assertion `Cost == C && "Cost exceeds
InlineCost precision"' failed.
../../llvm-gcc-4.2/gcc/libgcov.c:646: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://llvm.org/bugs/> for instructions.
make[3]: *** [libgcc/./_gcov.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/home/GTI420/AH72000/tools/tools/build-llvm/gcc'
make[2]: *** [stmp-multilib] Error 2
make[2]: Leaving directory `/home/GTI420/AH72000/tools/tools/build-llvm/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/GTI420/AH72000/tools/tools/build-llvm'
make: *** [all] Error 2
Sorry for not coming back at this sooner; had little time for this. For me
those commands indeed crash (tried with cam_xpt.bc). I did not have the
opportunity so far to update my llvm, so it'll be still at some mid-march
revision. I don't know if this should make a huge difference, so I'll just
start updating and hopefully come back with some further results in a while.
bash-3.2# opt -O2 cam_xpt.bc
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.
assertion "Cost == C && "Cost exceeds InlineCost precision"" failed: file
"/opt/include/llvm/Transforms/Utils/InlineCost.h", line 44
Stack dump:
0. Running pass 'CallGraph Pass Manager' on module 'cam_xpt.bc'.
Abort trap (core dumped)
bash-3.2# opt -std-compile-opts cam_xpt.bc
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.
assertion "Cost == C && "Cost exceeds InlineCost precision"" failed: file
"/opt/include/llvm/Transforms/Utils/InlineCost.h", line 44
Stack dump:
0. Running pass 'CallGraph Pass Manager' on module 'cam_xpt.bc'.
Abort trap (core dumped)
Ok, it seems that with debug builds it works fine but not with release build.
I've just compiled both the newest llvm/clang from svn both debug and release;
and the debug build gives no problems, but the release build still gives the
same assertion:
bash-3.2# opt -O2 cam_xpt.bc
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.
assertion "Cost == C && "Cost exceeds InlineCost precision"" failed: file
"/opt/include/llvm/Transforms/Utils/InlineCost.h", line 44
Stack dump:
0. Running pass 'CallGraph Pass Manager' on module 'cam_xpt.bc'.
Abort trap (core dumped)
Put your parameters that you used to construct the LLVM-gcc-frontend, because
is where I having this problem.
(In reply to comment #17)
> Ok, it seems that with debug builds it works fine but not with release build.
> I've just compiled both the newest llvm/clang from svn both debug and release;
> and the debug build gives no problems, but the release build still gives the
> same assertion:
>
> bash-3.2# opt -O2 cam_xpt.bc
> WARNING: You're attempting to print out a bitcode file.
> This is inadvisable as it may cause display problems. If
> you REALLY want to taste LLVM bitcode first-hand, you
> can force output with the `-f' option.
>
> assertion "Cost == C && "Cost exceeds InlineCost precision"" failed: file
> "/opt/include/llvm/Transforms/Utils/InlineCost.h", line 44
> Stack dump:
> 0. Running pass 'CallGraph Pass Manager' on module 'cam_xpt.bc'.
> Abort trap (core dumped)
>
I don't quite see the point, but here you go:
For optimized build:
bash-3.2# ./configure --enable-optimized --enable-targets=host-only; gmake
For debug build:
bash-3.2# ./configure --enable-targets=host-only; gmake
Attached ic.diff
(2438 bytes, text/plain): Possible fix
Fixed here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090420/076501.html
cam_periph.bc
(280280 bytes, application/octet-stream)cam_xpt.bc
(529292 bytes, application/octet-stream)db_command.bc
(27332 bytes, application/octet-stream)scsi_all.bc
(223220 bytes, application/octet-stream)scsi_sa.bc
(481880 bytes, application/octet-stream)ic.diff
(2438 bytes, text/plain)