[LLVMdev] [llvm-tblgen] Two issues: crash case and mysterious double-inclusion case

陳韋任 (Wei-Ren Chen) chenwj at iis.sinica.edu.tw
Wed Feb 6 19:44:39 PST 2013


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




More information about the llvm-dev mailing list