Hi devs,

(Sorry for reusing subject of a previous message, but I'm unable to
reply to that message directly)

as I did not find some solution yet, I've dropped a testcase on
gcc-help[1], here's the answer - what do you think ?

[1] http://gcc.gnu.org/ml/gcc-help/2007-04/msg00200.html

Thanks!

/haubi/

-------- Forwarded Message --------
> From: Ian Lance Taylor <[EMAIL PROTECTED]>
> To: Michael Haubenwallner <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: can't find a register in class 'GENERAL_REGS' while
> reloading 'asm'
> Date: 19 Apr 2007 22:43:23 -0700
> 
> Michael Haubenwallner <[EMAIL PROTECTED]> writes:
> 
> > in openssl-0.9.8e there is some inlined assembler code, which does not
> > compile with -fpic (or -fPIC) and -O0 on x86-linux-gnu.
> 
> > openssl-error.c:28: error: can't find a register in class 'GENERAL_REGS' 
> > while reloading 'asm'
> 
> >        asm volatile (
> >                "pushl       %%ebx\n"
> >                "    leal    16(%0),%%edx\n"
> >                "    leal    32(%0),%%ebx\n"
> >                ".byte 0xf3,0x0f,0xa7,0xc8" "\n"
> >                "    popl    %%ebx"
> >                : "=a"(iv), "=c"(cnt), "=D"(out), "=S"(inp)
> >                : "0"(cdata), "1"(cnt), "2"(out), "3"(inp), "m"(*cdata)
> >                : "edx", "cc", "memory"
> >        );
> 
> This puts iv in %eax, cnt in %ecx, out in %edi, inp in %esi, and it
> lists *cdata as an explicit input.  You are using -fpic so %ebx is
> used as a PIC register.  %ebp is the frame pointer.  %edx is in the
> list of clobbered registers.  You are left with no registers to hold
> *cdata.
> 
> I think I would write this more like
>     xchg  %ebx, %2
>     .byte 0xf3, 0x0f, 0xa7, 0xc8
>     xchg %ebx, %2
> : "+c" (cnt), "+d" (cdata->len), "+r" (cdata->addr), "+D" (out), "+S" (inp)
> : "cc", "memory"
> 
> Ian


-- 
Salomon Automation GmbH - Friesachstrasse 15 - A-8114 Friesach bei Graz
Sitz der Gesellschaft: Friesach bei Graz
UID-NR:ATU28654300 - Firmenbuchnummer: 49324 K
Firmenbuchgericht: Landesgericht für Zivilrechtssachen Graz

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to