public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13245] New: SIGBUS (alignment) on ia-32 if alignment trapping is enabled
@ 2003-11-30 20:22 gcc-bug at vogtner dot de
  2003-11-30 20:23 ` [Bug c++/13245] " gcc-bug at vogtner dot de
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: gcc-bug at vogtner dot de @ 2003-11-30 20:22 UTC (permalink / raw)
  To: gcc-bugs

even if -malign-double/-mpreferred-stack-boundary is properly set
GCC 3.3.2 generates unaligned stores/loads of double data.
Cf. code/test script enclosed.

ebp is 0xbffff328

    0x08048243 <main_(int, char**)+63>:	call   0x80481f4 <prepare_fpu()>
    0x08048248 <main_(int, char**)+68>:	fldl   0x80ed420
    0x0804824e <main_(int, char**)+74>:	fstpl  0xfffffff0(%ebp)
    0x08048251 <main_(int, char**)+77>:	fldl   0xfffffff0(%ebp)
===>0x08048254 <main_(int, char**)+80>:	fstpl  0x4(%esp,1)       <=====
    0x08048258 <main_(int, char**)+84>:	lea    0xffffffff(%ebp),%eax
    0x0804825b <main_(int, char**)+87>:	mov    %eax,(%esp,1)
    0x0804825e <main_(int, char**)+90>:	call   0x80482fe <XM& operator<<

-- 
           Summary: SIGBUS (alignment) on ia-32 if alignment trapping is
                    enabled
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc-bug at vogtner dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13245


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/13245] SIGBUS (alignment) on ia-32 if alignment trapping is enabled
  2003-11-30 20:22 [Bug c++/13245] New: SIGBUS (alignment) on ia-32 if alignment trapping is enabled gcc-bug at vogtner dot de
@ 2003-11-30 20:23 ` gcc-bug at vogtner dot de
  2003-11-30 20:23 ` gcc-bug at vogtner dot de
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: gcc-bug at vogtner dot de @ 2003-11-30 20:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gcc-bug at vogtner dot de  2003-11-30 20:23 -------
Created an attachment (id=5243)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5243&action=view)
test code


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13245


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/13245] SIGBUS (alignment) on ia-32 if alignment trapping is enabled
  2003-11-30 20:22 [Bug c++/13245] New: SIGBUS (alignment) on ia-32 if alignment trapping is enabled gcc-bug at vogtner dot de
  2003-11-30 20:23 ` [Bug c++/13245] " gcc-bug at vogtner dot de
@ 2003-11-30 20:23 ` gcc-bug at vogtner dot de
  2003-11-30 20:29 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: gcc-bug at vogtner dot de @ 2003-11-30 20:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gcc-bug at vogtner dot de  2003-11-30 20:23 -------
Created an attachment (id=5244)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5244&action=view)
test script


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13245


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/13245] SIGBUS (alignment) on ia-32 if alignment trapping is enabled
  2003-11-30 20:22 [Bug c++/13245] New: SIGBUS (alignment) on ia-32 if alignment trapping is enabled gcc-bug at vogtner dot de
  2003-11-30 20:23 ` [Bug c++/13245] " gcc-bug at vogtner dot de
  2003-11-30 20:23 ` gcc-bug at vogtner dot de
@ 2003-11-30 20:29 ` pinskia at gcc dot gnu dot org
  2003-11-30 20:48 ` gcc-bug at vogtner dot de
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-30 20:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-30 20:29 -------
This is a dup of bug 10395, the problem is that main is not aligned correctly at all, other functions 
are.

*** This bug has been marked as a duplicate of 10395 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13245


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/13245] SIGBUS (alignment) on ia-32 if alignment trapping is enabled
  2003-11-30 20:22 [Bug c++/13245] New: SIGBUS (alignment) on ia-32 if alignment trapping is enabled gcc-bug at vogtner dot de
                   ` (2 preceding siblings ...)
  2003-11-30 20:29 ` pinskia at gcc dot gnu dot org
@ 2003-11-30 20:48 ` gcc-bug at vogtner dot de
  2004-01-30  4:26 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: gcc-bug at vogtner dot de @ 2003-11-30 20:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gcc-bug at vogtner dot de  2003-11-30 20:48 -------
Please take a look into the code and notice that the mis-alignment does
*not* take place in main!

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13245


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/13245] SIGBUS (alignment) on ia-32 if alignment trapping is enabled
  2003-11-30 20:22 [Bug c++/13245] New: SIGBUS (alignment) on ia-32 if alignment trapping is enabled gcc-bug at vogtner dot de
                   ` (3 preceding siblings ...)
  2003-11-30 20:48 ` gcc-bug at vogtner dot de
@ 2004-01-30  4:26 ` pinskia at gcc dot gnu dot org
  2004-01-30  4:29 ` [Bug c++/13245] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-30  4:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-30 04:26 -------
Confirmed on the mainline.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-01-30 04:26:36
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13245


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/13245] [3.3/3.4/3.5 Regression] SIGBUS (alignment) on ia-32 if alignment trapping is enabled
  2003-11-30 20:22 [Bug c++/13245] New: SIGBUS (alignment) on ia-32 if alignment trapping is enabled gcc-bug at vogtner dot de
                   ` (4 preceding siblings ...)
  2004-01-30  4:26 ` pinskia at gcc dot gnu dot org
@ 2004-01-30  4:29 ` pinskia at gcc dot gnu dot org
  2004-01-30  9:52 ` rth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-30  4:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-30 04:29 -------
This is a regression from 3.2.3 where there is no fstpl at all and 2.95.3 had the right 
alignment.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|SIGBUS (alignment) on ia-32 |[3.3/3.4/3.5 Regression]
                   |if alignment trapping is    |SIGBUS (alignment) on ia-32
                   |enabled                     |if alignment trapping is
                   |                            |enabled
   Target Milestone|---                         |3.3.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13245


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/13245] [3.3/3.4/3.5 Regression] SIGBUS (alignment) on ia-32 if alignment trapping is enabled
  2003-11-30 20:22 [Bug c++/13245] New: SIGBUS (alignment) on ia-32 if alignment trapping is enabled gcc-bug at vogtner dot de
                   ` (5 preceding siblings ...)
  2004-01-30  4:29 ` [Bug c++/13245] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-01-30  9:52 ` rth at gcc dot gnu dot org
  2004-01-30 16:24 ` gcc-bug at vogtner dot de
  2004-01-31  0:20 ` rth at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-01-30  9:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2004-01-30 09:52 -------
Not a regression, nor a bug.  -maligned-double does *not* affect
parameter lists.

The call to operator<< has two arguments, the first is a 4 byte pointer,
and the second is a double.  The double will *always* be at sp+4, which
will always be misaligned if we're trying to keep the regular stack frame
aligned.

If gcc 2.95 passed this test, it's only because it moved the 3.0 to the
stack with integer move instructions.  Change the test to use the result
of real floating-point arithmetic and it will fail too.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13245


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/13245] [3.3/3.4/3.5 Regression] SIGBUS (alignment) on ia-32 if alignment trapping is enabled
  2003-11-30 20:22 [Bug c++/13245] New: SIGBUS (alignment) on ia-32 if alignment trapping is enabled gcc-bug at vogtner dot de
                   ` (6 preceding siblings ...)
  2004-01-30  9:52 ` rth at gcc dot gnu dot org
@ 2004-01-30 16:24 ` gcc-bug at vogtner dot de
  2004-01-31  0:20 ` rth at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: gcc-bug at vogtner dot de @ 2004-01-30 16:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gcc-bug at vogtner dot de  2004-01-30 16:24 -------
Is this an ABI defect? Do I have to built a cross-compiler with a different
machine description to get every double properly aligned? Or what else
shall I do?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13245


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/13245] [3.3/3.4/3.5 Regression] SIGBUS (alignment) on ia-32 if alignment trapping is enabled
  2003-11-30 20:22 [Bug c++/13245] New: SIGBUS (alignment) on ia-32 if alignment trapping is enabled gcc-bug at vogtner dot de
                   ` (7 preceding siblings ...)
  2004-01-30 16:24 ` gcc-bug at vogtner dot de
@ 2004-01-31  0:20 ` rth at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-01-31  0:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2004-01-31 00:19 -------
If you want to look at it that way, I guess you can call it an ABI defect.
Certainly the ABI was not designed to keep doubles aligned.

It is also quite certain that we will not be changing the ABI.

Basically you're out of luck wrt getting all doubles aligned on ia32.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13245


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-01-31  0:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-30 20:22 [Bug c++/13245] New: SIGBUS (alignment) on ia-32 if alignment trapping is enabled gcc-bug at vogtner dot de
2003-11-30 20:23 ` [Bug c++/13245] " gcc-bug at vogtner dot de
2003-11-30 20:23 ` gcc-bug at vogtner dot de
2003-11-30 20:29 ` pinskia at gcc dot gnu dot org
2003-11-30 20:48 ` gcc-bug at vogtner dot de
2004-01-30  4:26 ` pinskia at gcc dot gnu dot org
2004-01-30  4:29 ` [Bug c++/13245] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-01-30  9:52 ` rth at gcc dot gnu dot org
2004-01-30 16:24 ` gcc-bug at vogtner dot de
2004-01-31  0:20 ` rth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).