NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/45673: gcc on i386 current generates bad code for assembler code in lock.h



>Number:         45673
>Category:       toolchain
>Synopsis:       gcc on i386 current generates bad code for assembler code in 
>lock.h
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 30 20:55:00 +0000 2011
>Originator:     Kai-Uwe Eckhardt
>Release:        5.99.57
>Organization:
>Environment:
GENERIC i386 from releng 20111127
gcc version 4.5.3 (NetBSD nb2 20110806)
>Description:
Building lang/gcc46 oder gcc44 fails with:

/usr/include/x86/lock.h:108: Error: bad register name '%sil'


>How-To-Repeat:
Build lang/gcc46 on i386 current.
>Fix:
The reason seems to be gcc bug 10153. The error with pkgsrc can be fixed
by changing r to q in line 108 of /usr/include/x86/lock.h:

_asm volatile ("xchgb %0,(%2)" : 
            "=r" (val)
            :"0" (val), "r" (lockp));
        
This restricts allowable registers to a,b,c or d. Of course it would be
much better to fix gcc somehow. 







Home | Main Index | Thread Index | Old Index