[LLVMbugs] [Bug 4138] New: GEP is not of right type for indices!

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun May 3 10:14:33 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=4138

           Summary: GEP is not of right type for indices!
           Product: tools
           Version: 2.5
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-ld
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: mattp223 at renzelmann.com
                CC: llvmbugs at cs.uiuc.edu


Hello,

As an experiment, I'm attempting to port user-mode Linux 2.6.29 to LLVM.  In my
day-old attempt at a port, LLVM gets relatively far before encountering a
problem.

Build environment/platform:  LLVM 2.5, using the LLVM-2.5 GCC front end for GCC
4.2.1.  Used GCC 4.2.4 for building LLVM.  Platform is RHEL 5, kernel
2.6.18-128.1.6.el5.

Here's the output of a slightly-reduced test case.  You can download the
object/bitcode files for this test from here:

http://pages.cs.wisc.edu/~mjr/files/test_case.tbz

I can provide the complete source code as well, if desired, since it's straight
from the Linux 2.6.29 kernel.

======================================
> llvm-ld -verify-each -disable-opt -disable-inlining -v   -r -o proc.o base.o proc_tty.o cmdline.o cpuinfo.o

  Linking bitcode file 'base.o'
  Linked in file 'base.o'
  Linking bitcode file 'proc_tty.o'
  Linked in file 'proc_tty.o'
  Linking bitcode file 'cmdline.o'
  Linked in file 'cmdline.o'
  Linking bitcode file 'cpuinfo.o'
  Linked in file 'cpuinfo.o'
GEP is not of right type for indices!
        %29 = getelementptr %struct.inode* %2, i32 0, i32 22            ;
<%struct.inode_operations**> [#uses=1]
 { i32 (%struct.inode*, %struct.dentry*, i32, %struct.nameidata*)*,
%struct.dentry* (%struct.inode*, %struct.dentry*, %struct.nameidata*)*, i32
(%struct.dentry*, %struct.inode*, %struct.dentry*)*, i32 (%struct.inode*,
%struct.dentry*)*, i32 (%struct.inode*, %struct.dentry*, i8*)*, i32
(%struct.inode*, %struct.dentry*, i32)*, i32 (%struct.inode*,
%struct.dentry*)*, i32 (%struct.inode*, %struct.dentry*, i32, i32)*, i32
(%struct.inode*, %struct.dentry*, %struct.inode*, %struct.dentry*)*, i32
(%struct.dentry*, i8*, i32)*, i8* (%struct.dentry*, %struct.nameidata*)*, void
(%struct.dentry*, %struct.nameidata*, i8*)*, void (%struct.inode*)*, i32
(%struct.inode*, i32)*, i32 (%struct.dentry*, %struct.iattr*)*, i32
(%struct.vfsmount*, %struct.dentry*, %struct.kstat*)*, i32 (%struct.dentry*,
i8*, i8*, i32, i32)*, i32 (%struct.dentry*, i8*, i8*, i32)*, i32
(%struct.dentry*, i8*, i32)*, i32 (%struct.dentry*, i8*)*, void
(%struct.inode*, i64, i64)*, i32 (%struct.inode*, i32, i64, i64)*, i32
(%struct.inode*, %struct.fiemap_extent_info*, i64, i64)* }*Instruction does not
dominate all uses!
        %29 = getelementptr %struct.inode* %2, i32 0, i32 22            ;
<%struct.inode_operations**> [#uses=1]
        store %struct.inode_operations* %27, %struct.inode_operations** %29,
align 4
Broken module found, compilation aborted!
0   llvm-ld   0x083571de
1   libc.so.6 0x002ccac1 abort + 257
2   llvm-ld   0x082fa195
./test.sh: line 5: 14575 Aborted                 llvm-ld -verify-each
-disable-opt -disable-inlining -v -r -o proc.o base.o proc_tty.o cmdline.o
cpuinfo.o
======================================

These objects were produced using commands like this:

======================================
llvm-gcc
    -Wp,-MD,fs/proc/.page.o.d 
    -nostdinc
    -isystem
/scratch/sym/llvm-gcc4.2-2.5-x86-linux-RHEL4/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/include
    -Iinclude 
    -I/scratch/sym/linux-2.6.29-llvm/arch/um/include
    -include include/linux/autoconf.h
    -D__KERNEL__
    -I/scratch/sym/linux-2.6.29-llvm/arch/um/sys-i386
    -I/scratch/sym/linux-2.6.29-llvm/arch/x86/include
    -Wall
    -Wundef
    -Wstrict-prototypes
    -Wno-trigraphs
    -fno-strict-aliasing
    -fno-common
    -Werror-implicit-function-declaration
    -Os
    -emit-llvm
    -D__arch_um__
    -DSUBARCH=\"i386\"
    -I/scratch/sym/linux-2.6.29-llvm/arch/um/include/shared
    -I/scratch/sym/linux-2.6.29-llvm/arch/um/sys-i386/shared
    -I/scratch/sym/linux-2.6.29-llvm/arch/um/include/shared/skas
    -Dvmap=kernel_vmap
    -Din6addr_loopback=kernel_in6addr_loopback
    -Din6addr_any=kernel_in6addr_any
    -funit-at-a-time
    -march=i686
    -Wa,-mtune=generic32
    -mpreferred-stack-boundary=2
    -ffreestanding
    -D_LARGEFILE64_SOURCE
    -Derrno=kernel_errno
    -Dsigprocmask=kernel_sigprocmask
    -Dmktime=kernel_mktime
    -fno-stack-protector
    -fno-omit-frame-pointer
    -fno-optimize-sibling-calls
    -g
    -Wdeclaration-after-statement
    -Wno-pointer-sign
    -fwrapv 
    -D"KBUILD_STR(s)=#s"
    -D"KBUILD_BASENAME=KBUILD_STR(page)" 
    -D"KBUILD_MODNAME=KBUILD_STR(proc)" 
    -c
    -o fs/proc/page.o fs/proc/page.c
======================================

I recognize this is a huge mess compared to some of the test cases you normally
deal with.  If you would like me to try anything else, aside from writing a
patch ;), or you need more information, please let me know.

Thanks and regards,
Matt


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list