This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[zahn@berlin.snafu.de] libc/1149: #ifdef __i686__ problematic to generate 686-dependent code



What shall we do with the appended bug report?  Is this a problem with 
the compiler and will somebody try to fix egcs - or should we change
glibc?

Andreas



Topics:
   libc/1149: #ifdef __i686__ problematic to generate 686-dependent code


----------------------------------------------------------------------

Date: Sun, 6 Jun 1999 09:25:33 +0200
From: zahn@berlin.snafu.de
To: bugs@gnu.org
Subject: libc/1149: #ifdef __i686__ problematic to generate 686-dependent code
Message-Id: <199906060725.JAA03249@n245-167.berlin.snafu.de>


>Number:         1149
>Category:       libc
>Synopsis:       incorrect usage of __i686__ symbol
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    libc-gnats
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Sun Jun 06 03:50:01 EDT 1999
>Last-Modified:
>Originator:     Steffen Zahn
>Organization:
>Release:        libc-2.1.1
>Environment:
        Linux 2.2.7, AMD K6 processor, i586-pc-linux-gnu
Host type: i586-pc-linux-gnu
System: Linux taliesin 2.2.7 #4 Mon May 3 18:52:14 MEST 1999 i586 unknown
Architecture: i586

Addons: crypt linuxthreads
Build CFLAGS: -g -O2
Build CC: gcc
Compiler version: egcs-2.91.66 19990314 (egcs-1.1.2 release)
Kernel headers: 2.2.7
Symbol versioning: yes
Build static: yes
Build shared: yes
Build pic-default: no
Build profile: yes
Build omitfp: no
Build bounded: no
Build static-nss: no
Stdio: libio

>Description:
	I find the use of constructs of the form
        #ifdef __i686__
        to generate 686-dependent code problematic. This is done in
        glibc-2.1.1/sysdeps/i386/i486/bits/string.h:1261
        and also in /usr/include/bits/string.h.
        If in the above places the symbol __i686__ is defined then
        the generated code will only run on processors with
        cmove instruction, i.e. i686.
        Now the __i686__ symbol cannot distinguish between
        -mpentiumpro and -march=pentiumpro. I had the case that
        -mpentiumpro was the default configuration of egcs on a machine
        without cmove instruction. Normally this was no problem, since
        -mpentiumpro will only use instructions of the i386 but generate
        code that runs fast on a i686. Not so with glibc-2.1.1.
        
>How-To-Repeat:

>Fix:
        For glibc internal use it would be possible to use the
        information derived by the configure script (i586-pc-linux-gnu),
        which has the correct processor class identifier.
	For the use in /usr/include/bits/string.h there should be a way
        to distinguish between -mpentiumpro and -march=pentiumpro using
        preprocessor symbols. I don't know if this is currently possible
        with egcs.


>Audit-Trail:
>Unformatted:


------------------------------

End of forwardr9B7ug Digest
***************************



-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]