public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/47842] New: gcc forces 16-byte stack alignment on Solaris i386, when SYSV requires word alignment
@ 2011-02-22  0:54 yuri at tsoft dot com
  2011-02-22 11:18 ` [Bug target/47842] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: yuri at tsoft dot com @ 2011-02-22  0:54 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: gcc forces 16-byte stack alignment on Solaris i386,
                    when SYSV requires word alignment
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: yuri@tsoft.com


Linux made a decision to switch to 16-byte alignment, but not others.

I know for a fact that Solaris is affected, I am not sure, but FreeBSD i386
might also be affected.

Please turn this behavior back to the one prescribed by specification for
Solaris (and FreeBSD if affected):
http://www.sco.com/developers/devspecs/abi386-4.pdf
section 3-10: "The stack is word aligned. Although the architecture does not
require any alignment of the stack, software convention and the operating
system requires that the stack be aligned on a word boundary."

Or please refer to the Sun/Oracle decision to change this behavior.


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

* [Bug target/47842] gcc forces 16-byte stack alignment on Solaris i386, when SYSV requires word alignment
  2011-02-22  0:54 [Bug c/47842] New: gcc forces 16-byte stack alignment on Solaris i386, when SYSV requires word alignment yuri at tsoft dot com
@ 2011-02-22 11:18 ` rguenth at gcc dot gnu.org
  2011-02-22 11:46 ` schwab@linux-m68k.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-02-22 11:18 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2011.02.22 10:58:29
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-02-22 10:58:29 UTC ---
"forces"?  GCC re-aligns the stack if it thinks it is a good idea for
performance.  Or do you mean something else?  Please be more specific.


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

* [Bug target/47842] gcc forces 16-byte stack alignment on Solaris i386, when SYSV requires word alignment
  2011-02-22  0:54 [Bug c/47842] New: gcc forces 16-byte stack alignment on Solaris i386, when SYSV requires word alignment yuri at tsoft dot com
  2011-02-22 11:18 ` [Bug target/47842] " rguenth at gcc dot gnu.org
@ 2011-02-22 11:46 ` schwab@linux-m68k.org
  2011-02-22 19:43 ` yuri at tsoft dot com
  2013-11-10  5:10 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: schwab@linux-m68k.org @ 2011-02-22 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andreas Schwab <schwab@linux-m68k.org> 2011-02-22 11:06:41 UTC ---
A 16-byte aligned stack is still word aligned.


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

* [Bug target/47842] gcc forces 16-byte stack alignment on Solaris i386, when SYSV requires word alignment
  2011-02-22  0:54 [Bug c/47842] New: gcc forces 16-byte stack alignment on Solaris i386, when SYSV requires word alignment yuri at tsoft dot com
  2011-02-22 11:18 ` [Bug target/47842] " rguenth at gcc dot gnu.org
  2011-02-22 11:46 ` schwab@linux-m68k.org
@ 2011-02-22 19:43 ` yuri at tsoft dot com
  2013-11-10  5:10 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: yuri at tsoft dot com @ 2011-02-22 19:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Yuri <yuri at tsoft dot com> 2011-02-22 19:23:45 UTC ---
If gcc would only set 16 byte alignment this wouldn't be that bad since, as you
mentioned, it is still word aligned.

The problem is that gcc assumes that stack is 16 aligned and creates code based
on this. For example it places instruction like this 'movdqa %xmm0, 0x10(%esp)'
which assumes 16 byte alignment. As a result, gcc compiled procedure crashes
when called by ABI compliant code.

gcc can't assume 16 byte alignment.


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

* [Bug target/47842] gcc forces 16-byte stack alignment on Solaris i386, when SYSV requires word alignment
  2011-02-22  0:54 [Bug c/47842] New: gcc forces 16-byte stack alignment on Solaris i386, when SYSV requires word alignment yuri at tsoft dot com
                   ` (2 preceding siblings ...)
  2011-02-22 19:43 ` yuri at tsoft dot com
@ 2013-11-10  5:10 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-11-10  5:10 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Yuri from comment #3)
> The problem is that gcc assumes that stack is 16 aligned and creates code
> based on this. For example it places instruction like this 'movdqa %xmm0,
> 0x10(%esp)' which assumes 16 byte alignment. As a result, gcc compiled
> procedure crashes when called by ABI compliant code.

We need a testcase and one has not been forth coming in the last 2 years so
closing as invalid.


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

end of thread, other threads:[~2013-11-10  5:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-22  0:54 [Bug c/47842] New: gcc forces 16-byte stack alignment on Solaris i386, when SYSV requires word alignment yuri at tsoft dot com
2011-02-22 11:18 ` [Bug target/47842] " rguenth at gcc dot gnu.org
2011-02-22 11:46 ` schwab@linux-m68k.org
2011-02-22 19:43 ` yuri at tsoft dot com
2013-11-10  5:10 ` pinskia at gcc dot gnu.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).