Dmitry Mikushin
2013-Feb-06 22:47 UTC
[LLVMdev] [llvm-tblgen] Two issues: crash case and mysterious double-inclusion case
Dear all, I need your help to understand weird llvm-tblgen behavior. Please take your favourite version of llvm-tblgen and use it in the root directory of the archive attached in both bug reports: http://llvm.org/bugs/show_bug.cgi?id=15188 http://llvm.org/bugs/show_bug.cgi?id=15189 ===1) First test case: crashing === $ ./llvm-tblgen -gen-tgt-intrinsic NVPTX1.td assert(iid <= Intrinsic::0 llvm-tblgen 0x00000000005c56b6 1 llvm-tblgen 0x00000000005c54b2 2 libpthread.so.0 0x00007fc734644a10 3 libstdc++.so.6 0x00007fc7345bba5e std::string::_M_data() const + 12 4 libstdc++.so.6 0x00007fc7345bba9c std::string::_M_rep() const + 24 5 libstdc++.so.6 0x00007fc7345bba4c std::string::length() const + 24 6 llvm-tblgen 0x000000000042507f 7 llvm-tblgen 0x000000000051efd9 8 llvm-tblgen 0x000000000051be22 9 llvm-tblgen 0x000000000054f4f9 10 llvm-tblgen 0x000000000055ce65 11 llvm-tblgen 0x000000000054fb50 12 libc.so.6 0x00007fc73426ca76 __libc_start_main + 370 13 llvm-tblgen 0x00000000004071f9 Stack dump: 0. Program arguments: ./llvm-tblgen -gen-tgt-intrinsic NVPTX1.td Segmentation fault (core dumped) ===2) Second test case: double inclusion of file, that is definitely included once: === $ ./llvm-tblgen -gen-tgt-intrinsic NVPTX2.td Included from NVPTX2.td:20: NVPTXIntrinsics.td:10:1: error: def 'immFloat0' already defined def immFloat0 : PatLeaf<(fpimm), [{ ^ NVPTX1.td differs from NVPTX2.td just in one line: include "NVPTXIntrinsics.td" ===Expected behavior === 1) In first case, where .td file has empty list of intrinsics, the tool should not crash 2) In second case there should not me an error message about already defined symbol, because the definition comes from the file, which is included only once. Could you please confirm these issues or help catching my mistake? Thanks, - Dima. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130206/1a57ed42/attachment.html>
陳韋任 (Wei-Ren Chen)
2013-Feb-07 03:44 UTC
[LLVMdev] [llvm-tblgen] Two issues: crash case and mysterious double-inclusion case
On Wed, Feb 06, 2013 at 11:47:31PM +0100, Dmitry Mikushin wrote:> Dear all, > > I need your help to understand weird llvm-tblgen behavior. Please take your > favourite version of llvm-tblgen and use it in the root directory of the > archive attached in both bug reports: > > http://llvm.org/bugs/show_bug.cgi?id=15188 > http://llvm.org/bugs/show_bug.cgi?id=15189$ llvm-tblgen --version LLVM (http://llvm.org/): LLVM version 3.1 Optimized build. Built Oct 17 2012 (19:26:30). Default target: amd64-portbld-freebsd8.3 Host CPU: core2> ===> 1) First test case: crashing > ===> > $ ./llvm-tblgen -gen-tgt-intrinsic NVPTX1.td > > assert(iid <= Intrinsic::0 llvm-tblgen 0x00000000005c56b6 > 1 llvm-tblgen 0x00000000005c54b2 > 2 libpthread.so.0 0x00007fc734644a10 > 3 libstdc++.so.6 0x00007fc7345bba5e std::string::_M_data() const + 12 > 4 libstdc++.so.6 0x00007fc7345bba9c std::string::_M_rep() const + 24 > 5 libstdc++.so.6 0x00007fc7345bba4c std::string::length() const + 24 > 6 llvm-tblgen 0x000000000042507f > 7 llvm-tblgen 0x000000000051efd9 > 8 llvm-tblgen 0x000000000051be22 > 9 llvm-tblgen 0x000000000054f4f9 > 10 llvm-tblgen 0x000000000055ce65 > 11 llvm-tblgen 0x000000000054fb50 > 12 libc.so.6 0x00007fc73426ca76 __libc_start_main + 370 > 13 llvm-tblgen 0x00000000004071f9 > Stack dump: > 0. Program arguments: ./llvm-tblgen -gen-tgt-intrinsic NVPTX1.td > Segmentation fault (core dumped)$ llvm-tblgen -gen-tgt-intrinsic NVPTX1.td Included from NVPTX1.td:18: NVPTXRegisterInfo.td:32:14: error: Value list is not of list type foreach i = 0-395 in { ^ Included from NVPTX1.td:18: NVPTXRegisterInfo.td:32:14: error: expected declaration in for foreach i = 0-395 in { ^> ===> 2) Second test case: double inclusion of file, that is definitely included > once: > ===> > $ ./llvm-tblgen -gen-tgt-intrinsic NVPTX2.td > Included from NVPTX2.td:20: > NVPTXIntrinsics.td:10:1: error: def 'immFloat0' already defined > def immFloat0 : PatLeaf<(fpimm), [{ > ^$ llvm-tblgen -gen-tgt-intrinsic NVPTX2.td Included from NVPTX2.td:18: NVPTXRegisterInfo.td:32:14: error: Value list is not of list type foreach i = 0-395 in { ^ Included from NVPTX2.td:18: NVPTXRegisterInfo.td:32:14: error: expected declaration in for foreach i = 0-395 in { ^> NVPTX1.td differs from NVPTX2.td just in one line: > > include "NVPTXIntrinsics.td"Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj
Dmitry Mikushin
2013-Feb-07 04:07 UTC
[LLVMdev] [llvm-tblgen] Two issues: crash case and mysterious double-inclusion case
Hi Chen, Thanks for trying! Your favorite llvm-tblgen 3.1 is too old. Here we need 3.2svn, should be also reproducible with TOT. - D. 2013/2/7 陳韋任 (Wei-Ren Chen) <chenwj at iis.sinica.edu.tw>> On Wed, Feb 06, 2013 at 11:47:31PM +0100, Dmitry Mikushin wrote: > > Dear all, > > > > I need your help to understand weird llvm-tblgen behavior. Please take > your > > favourite version of llvm-tblgen and use it in the root directory of the > > archive attached in both bug reports: > > > > http://llvm.org/bugs/show_bug.cgi?id=15188 > > http://llvm.org/bugs/show_bug.cgi?id=15189 > > $ llvm-tblgen --version > LLVM (http://llvm.org/): > LLVM version 3.1 > Optimized build. > Built Oct 17 2012 (19:26:30). > Default target: amd64-portbld-freebsd8.3 > Host CPU: core2 > > > ===> > 1) First test case: crashing > > ===> > > > $ ./llvm-tblgen -gen-tgt-intrinsic NVPTX1.td > > > > assert(iid <= Intrinsic::0 llvm-tblgen 0x00000000005c56b6 > > 1 llvm-tblgen 0x00000000005c54b2 > > 2 libpthread.so.0 0x00007fc734644a10 > > 3 libstdc++.so.6 0x00007fc7345bba5e std::string::_M_data() const + 12 > > 4 libstdc++.so.6 0x00007fc7345bba9c std::string::_M_rep() const + 24 > > 5 libstdc++.so.6 0x00007fc7345bba4c std::string::length() const + 24 > > 6 llvm-tblgen 0x000000000042507f > > 7 llvm-tblgen 0x000000000051efd9 > > 8 llvm-tblgen 0x000000000051be22 > > 9 llvm-tblgen 0x000000000054f4f9 > > 10 llvm-tblgen 0x000000000055ce65 > > 11 llvm-tblgen 0x000000000054fb50 > > 12 libc.so.6 0x00007fc73426ca76 __libc_start_main + 370 > > 13 llvm-tblgen 0x00000000004071f9 > > Stack dump: > > 0. Program arguments: ./llvm-tblgen -gen-tgt-intrinsic NVPTX1.td > > Segmentation fault (core dumped) > > $ llvm-tblgen -gen-tgt-intrinsic NVPTX1.td > Included from NVPTX1.td:18: > NVPTXRegisterInfo.td:32:14: error: Value list is not of list type > foreach i = 0-395 in { > ^ > Included from NVPTX1.td:18: > NVPTXRegisterInfo.td:32:14: error: expected declaration in for > foreach i = 0-395 in { > ^ > > > ===> > 2) Second test case: double inclusion of file, that is definitely > included > > once: > > ===> > > > $ ./llvm-tblgen -gen-tgt-intrinsic NVPTX2.td > > Included from NVPTX2.td:20: > > NVPTXIntrinsics.td:10:1: error: def 'immFloat0' already defined > > def immFloat0 : PatLeaf<(fpimm), [{ > > ^ > > $ llvm-tblgen -gen-tgt-intrinsic NVPTX2.td > Included from NVPTX2.td:18: > NVPTXRegisterInfo.td:32:14: error: Value list is not of list type > foreach i = 0-395 in { > ^ > Included from NVPTX2.td:18: > NVPTXRegisterInfo.td:32:14: error: expected declaration in for > foreach i = 0-395 in { > ^ > > > NVPTX1.td differs from NVPTX2.td just in one line: > > > > include "NVPTXIntrinsics.td" > > Regards, > chenwj > > -- > Wei-Ren Chen (陳韋任) > Computer Systems Lab, Institute of Information Science, > Academia Sinica, Taiwan (R.O.C.) > Tel:886-2-2788-3799 #1667 > Homepage: http://people.cs.nctu.edu.tw/~chenwj >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130207/12d3d53e/attachment.html>
Sean Silva
2013-Feb-07 04:36 UTC
[LLVMdev] [llvm-tblgen] Two issues: crash case and mysterious double-inclusion case
On Wed, Feb 6, 2013 at 5:47 PM, Dmitry Mikushin <dmitry at kernelgen.org>wrote:> > ===> 2) Second test case: double inclusion of file, that is definitely included > once: >Includes are transitive, so it was being included more than once. With r174582 we now diagnose double inclusions and point you at the previous include location. -- Sean Silva -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130206/2ebfc917/attachment.html>
Dmitry Mikushin
2013-Feb-07 13:33 UTC
[LLVMdev] [llvm-tblgen] Two issues: crash case and mysterious double-inclusion case
Hi Sean, Thank you, great catch! Strange, how I missed it with grep... However, this means question 1) becomes more interesting, because it is now clear intrinsics table is included in there, but somehow llvm-lblgen crashes. Best, - D. 2013/2/7 Sean Silva <silvas at purdue.edu>> > On Wed, Feb 6, 2013 at 5:47 PM, Dmitry Mikushin <dmitry at kernelgen.org>wrote: >> >> ===>> 2) Second test case: double inclusion of file, that is definitely >> included once: >> > > Includes are transitive, so it was being included more than once. With r174582 > we now diagnose double inclusions and point you at the previous include > location. > > -- Sean Silva >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130207/e3971448/attachment.html>
Seemingly Similar Threads
- [LLVMdev] [llvm-tblgen] Two issues: crash case and mysterious double-inclusion case
- [LLVMdev] [llvm-commits] RFC: Merge branches/R600 into TOT for 3.2 release
- [LLVMdev] [llvm-commits] RFC: Merge branches/R600 into TOT for 3.2 release
- [LLVMdev] Can I add GlobalVariable in MachineFunctionPass ?
- [LLVMdev] [llvm-commits] RFC: Merge branches/R600 into TOT for 3.2 release