Bug 7926 - i486 instructions in header files make c++ programs crash on i386
Summary: i486 instructions in header files make c++ programs crash on i386
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: ---
Assignee: Benjamin Kosnik
Depends on:
Reported: 2002-09-16 00:26 UTC by mschill4
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description mschill4 2002-09-16 00:26:00 UTC
When configuring and building gcc 3.2 on a i386-linux machine
c++ programs fail because you use 486 code in inline assembler
statements in your atomicity headers (xadd, cmpxchg and others)
libjava has the same problems. It would be nice if you could
rework the header files to use non-atomic i386 instructions
if such behaviour is required. A special configure option
would do, too. If you need help how the appropriate headers
for i386 might look like, mail me, but I haven't got the
files around here at the university, so it might take some
time to send them in...


i388 running Linux 2.2.21 and glibc 2.2.5

You can't repeat it unless you still have an old i386 around...
Comment 1 mschill4 2002-09-16 00:26:00 UTC
rework i386 atomicity header files to make a distinction
between i386 and i486 and newer...
Comment 2 Phil Edwards 2002-09-16 09:53:09 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Thank you for your bug report.
    We already make a distinction between i386 and higher.
    If we compare those two files:
       % cd libstdc++-v3/config/cpu
       % diff i386/atomicity.h i486/atomicity.h
       < // Low-level functions for atomic operations: x86, x < 4 version  -*- C++ -*-
       > // Low-level functions for atomic operations: x86, x >= 4 version  -*- C++ -*-
    Well, crumbs.  That's embarassing.
    I have not done any CVS archaeology to find out when
    this happened, but I'm sure it was a long time ago.
    (Those files are rarely changed.)  And it's gone undetected
    this long because there are only five i386 machines still
    in use, and you have one of them.  :-)
    Somebody more familiar with i386 will have to rewrite
    those instructions.  And remove those two useless blank
    lines.  :-)
Comment 3 Benjamin Kosnik 2002-11-01 17:45:53 UTC
Responsible-Changed-From-To: unassigned->bkoz
Responsible-Changed-Why: Mine.
Comment 4 Benjamin Kosnik 2002-11-01 17:45:53 UTC
State-Changed-From-To: analyzed->feedback
State-Changed-Why: This target, i386, should have been using the generic configuration, not the i486 files. I switched it. 
Comment 5 Benjamin Kosnik 2002-11-02 01:42:23 UTC
From: bkoz@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Subject: libstdc++/7926
Date: 2 Nov 2002 01:42:23 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	bkoz@gcc.gnu.org	2002-11-01 17:42:22
 Modified files:
 	libstdc++-v3   : ChangeLog configure.target 
 Removed files:
 	libstdc++-v3/config/cpu/arm: atomicity.h 
 	libstdc++-v3/config/cpu/i386: atomicity.h 
 	libstdc++-v3/config/cpu/x86-64: atomicity.h 
 Log message:
 	2002-11-01  Benjamin Kosnik  <bkoz@redhat.com>
 	PR libstdc++/7926
 	* configure.target: Simplify.
 	* config/cpu/i386/atomicity.h: Remove.
 	* config/cpu/i386: Remove.
 	* config/cpu/arm/atomicity.h: Remove.
 	* config/cpu/arm: Remove.
 	* config/cpu/x86-64/atomicity.h: Remove.
 	* config/cpu/x86-64: Remove.
Comment 6 Benjamin Kosnik 2002-11-11 15:05:25 UTC
State-Changed-From-To: feedback->closed
State-Changed-Why: This is fixed on mainline.