This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/6144: segment-faults when using sse extensions and ia32 g++


The following reply was made to PR c++/6144; it has been noted by GNATS.

From: Tim Prince <tprince@computer.org>
To: "Dylan Cuthbert" <dylan@q-games.com>
Cc: <gcc-gnats@gcc.gnu.org>
Subject: Re: c++/6144: segment-faults when using sse extensions and ia32 g++
Date: Wed, 3 Apr 2002 10:01:45 -0800

 On Tuesday 02 April 2002 23:32, Dylan Cuthbert wrote:
 > Hi there,
 >
 > Sorry, the code attachment was lost when I hit "back" on my browser after a
 > botched post attempt and I didn't notice.it had disappeared.  I have
 > attached it to this mail, could you please attach it to the appropriate bug
 > report.
 >
 > I know cygwin doesn't support gcc 3.1 (yet), gcc 3.1 doesn't support cygwin
 > (yet), but its pretty important to the windows programming environment that
 > they do soon.  We don't want yet another generation weaned on Visual Studio
 > do we?  And unfortunately using gcc 2.95.3 is like working in the dark ages
 > with regards to functionality, performance and general C++ iso-standard
 > conformity.
 >
 > I don't mind frontiering the use of gcc 3.1 in cygwin but I would like a
 > little help in the way of directions to go next so here are some questions:
 >
 > 1. How easy is it to configure binutils to support an aligned stack?
 > 2. Does the problem with cygwin actually cause me any problems - I presume
 > it would only cause a serious problem if I have callbacks being called from
 > within the cygwin dll.  However I am not using the cygwin API at all, and
 > the only reason I am compiling with it at the moment is because MINGW
 > doesn't support gcc 3.1 as of yet.
 >
 > Regards
 >
 > ---------------------------------
 > Q-Games, Dylan Cuthbert.
 > http://www.q-games.com
 >
 > ----- Original Message -----
 > From: "Tim Prince" <tprince@computer.org>
 > To: <dylan@q-games.com>; <gcc-gnats@gcc.gnu.org>
 > Cc: <aj@suse.de>; <rth@redhat.com>
 > Sent: Wednesday, April 03, 2002 1:34 PM
 > Subject: Re: c++/6144: segment-faults when using sse extensions and ia32
 > g++
 >
 > > On Tuesday 02 April 2002 17:43, dylan@q-games.com wrote:
 > > > >Number:         6144
 > > > >Category:       c++
 > > > >Synopsis:       segment-faults when using sse extensions and ia32 g++
 > > > >Confidential:   no
 > > > >Severity:       serious
 > > > >Priority:       medium
 > > > >Responsible:    unassigned
 > > > >State:          open
 > > > >Class:          sw-bug
 > > > >Submitter-Id:   net
 > > > >Arrival-Date:   Tue Apr 02 17:46:21 PST 2002
 > > > >Closed-Date:
 > > > >Last-Modified:
 > > > >Originator:     Dylan Cuthbert (dylan@q-games.com)
 > > > >Release:        3.1 (25th March 2002 snapshot)
 > > > >Organization:
 > > > >Environment:
 > > >
 > > > cygwin 1.3.9, windows 2000, Athlon MP (2 processor) 1.2Ghz (problem
 >
 > occurs
 >
 > > > also on Pentium IV machines)
 > > >
 > > > >Description:
 > > >
 > > > A simplified piece of code to demonstrate SSE 16 byte values not being
 > > > stack-aligned correctly in certain cases.  The main problem appears to
 >
 > be
 >
 > > > when they are encapsulated in another class (like a matrix) and then
 > > > referenced individually in an expression.  This makes use of the SSE
 > > > extensions unreliable and, in effect, unusable so I think the priority
 > > > should be high.
 > > >
 > > > >How-To-Repeat:
 > > >
 > > > compile and run the attached code on Pentium IV or Athlon 4. MP or XP
 > > > chipset.
 > > >
 > > > >Fix:
 > > >
 > > > Unknown
 > > >
 > > > >Release-Note:
 > > > >Audit-Trail:
 > > > >Unformatted:
 > >
 > > I don't see any "attached code."  Did you build a copy of binutils which
 > > enables stack alignment, and configure gcc-3.1 to use that binutils?
 >
 > AFAIK,
 >
 > > there is no chance of SSE being reliable without the 16-byte alignments
 >
 > being
 >
 > > enabled in binutils bfd/coff-i386.c, as well as observing the requirement
 >
 > to
 >
 > > build the caller function with -mpreferred-stack-boundary=4.  Cygwin
 >
 > policy
 >
 > > is to set only 4-byte alignment, regardless of the options chosen in
 >
 > gcc/g++.
 >
 > > There is no way that gcc can compensate for failure at least to attempt
 > > to over-ride that policy, and it appears that cygwin cannot change the
 > > policy while continuing to use g++-2.95.  If I understand correctly that
 > > the
 >
 > default
 >
 > > 4-byte stack alignment, which gcc chooses with -Os, is incompatible with
 >
 > SSE,
 >
 > > I would like to see that documented better.  Cygwin is not a supported
 > > platform for gcc-3.1, nor does cygwin support gcc-3.1, so I suppose there
 >
 > is
 >
 > > no chance of the associated issues being documented.
 > >
 > > --
 > > Tim Prince
 
 I find that I must use -mpreferred-stack-boundary=4 along with 
 -march=pentium3 -mfpmath=sse in order to avoid the alignment fault when 
 running on linux.  I expect this when using my preferred option -Os, but the 
 same occurs with other options.  I am having some difficulty on cygwin with 
 failure to link the namespace std methods.  I am not so proficient in c++, so 
 please excuse my blunders.
 -- 
 Tim Prince


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