[LLVMbugs] [Bug 3436] New: clang: cannot codegen address of global variable

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Jan 29 05:59:18 PST 2009


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

           Summary: clang: cannot codegen address of global variable
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu, rdivacky at freebsd.org


Created an attachment (id=2469)
 --> (http://llvm.org/bugs/attachment.cgi?id=2469)
fixed preprocessed file

Using SVN r63306 on x86-64:

/usr/local/bin/ccc -c -O2 -pipe -fno-strict-aliasing -march=native -std=c99 -g
-Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef
-Wno-pointer-sign -fformat-extensions -nostdinc  -I. -I../../..
-I../../../contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include
opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100
--param large-func

./../../dev/aac/aac.c:2831:17: warning: incompatible pointer types assigning
'int8_t [18]', expected 'char *'
                         adapter_type = ((struct aac_supplement_adapter_info *)
                                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: cannot codegen this constant expression yet
error: cannot codegen this constant expression yet
error: cannot codegen this constant expression yet
ERROR: Error opening output file 'aac.o.bc'
*** Error code 1


$ clang -emit-llvm testcase-min.i
...
error: cannot codegen this constant expression yet

Reduced testcase from the aac.i file rdivacky sent me:

typedef unsigned int u_int;
    typedef unsigned long u_long;
    typedef char *caddr_t;
    typedef int d_open_t (struct cdev *dev, int oflags, int devtype,           
      struct thread *td);
    typedef int d_fdopen_t (struct cdev *dev, int oflags, struct thread *td,   
                struct file *fp);
    typedef int d_close_t (struct cdev *dev, int fflag, int devtype,           
       struct thread *td);
    typedef int d_ioctl_t (struct cdev *dev, u_long cmd, caddr_t data, int
fflag,                      struct thread *td);
    typedef int d_poll_t (struct cdev *dev, int events, struct thread *td);
    struct cdevsw {
    int d_version;
    u_int d_flags;
    const char *d_name;
    d_open_t *d_open;
    d_fdopen_t *d_fdopen;
    d_close_t *d_close;
    d_ioctl_t *d_ioctl;
    d_poll_t *d_poll;
  }
    __attribute__ ((__packed__));
    static d_open_t aac_open;
    static d_close_t aac_close;
    static d_ioctl_t aac_ioctl;
    static d_poll_t aac_poll;
    static struct cdevsw aac_cdevsw = {
    .d_version = 0x17032005,.d_flags = 0x00400000,.d_open = aac_open,.d_close =
    aac_close,.d_ioctl = aac_ioctl,.d_poll = aac_poll,.d_name = "aac", };
    int aac_attach (struct aac_softc *sc) {
    &aac_cdevsw;
  }


-- 
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