https://bugs.llvm.org/show_bug.cgi?id=32906

            Bug ID: 32906
           Summary: fatal error with "-mcmodel=medium -fpic" for global
                    pointers
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: elad2.co...@intel.com
                CC: llvm-bugs@lists.llvm.org

Created attachment 18399
  --> https://bugs.llvm.org/attachment.cgi?id=18399&action=edit
Generated .ll file (clang tst.c -S -emit-llvm -mcmodel=medium -fpic

The following code crashes when compiling with top-of-trunc clang using
"-mcmodel=medium -fpic":

> cat tst.c
void foo(int *);
int *x;

int main() {
  foo(x);
  return 0;
}

> clang tst.c -c -mcmodel=medium -fpic
fatal error: error in backend: 32 bit reloc applied to a field with a different
size

With gcc this code compiles successfully.


The error is given during assembly:
> clang tst.c -S -mcmodel=medium -fpic
> clang tst.s
tst.s:19:2: error: 32 bit reloc applied to a field with a different size
        movabsq $x@GOTPCREL, %rax
        ^

Generated .ll and .s files are attached.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to