http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49832

--- Comment #1 from Uros Bizjak <ubizjak at gmail dot com> 2011-07-25 06:55:23 
UTC ---
Please mark x32 bugs with [x32].

(In reply to comment #0)

> [hjl@gnu-6 ilp32-8]$ make x.o
> /export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc
> -B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -S -o x.s -mx32 -O2 -fPIC
> -dp  x.i
> /export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc
> -B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -mx32 -O2 -fPIC -dp  -c -o
> x.o x.s
> x.s: Assembler messages:
> x.s:18: Error: too many memory references for `lea'
> x.s:20: Error: too many memory references for `lea'

Works for me with current mainline + patch [1].

~/gcc-build/gcc/cc1 -O2 -fPIC -mx32 pr49832.c

bar:
.LFB0:
    .cfi_startproc
    subq    $40, %rsp
    .cfi_def_cfa_offset 48
    movl    %edi, 16(%rsp)
    movq    %rsp, %rdi
    movl    $.LC0, (%rsp)
    movl    $8, 4(%rsp)
    movl    $.LC1, 8(%rsp)
    movl    $16, 12(%rsp)
    movl    %esi, 20(%rsp)
    call    foo@PLT
    addq    $40, %rsp
    .cfi_def_cfa_offset 8
    ret
    .cfi_endproc
.LFE0:

Please rewrite PIC handling on top of patch [1].

[1] http://gcc.gnu.org/ml/gcc-patches/2011-07/msg02089.html

Reply via email to