public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/16660] New: attribute((aligned)) doesn't work for variables on the stack
@ 2004-07-21 20:43 jens dot maurer at gmx dot net
  2004-07-21 21:14 ` [Bug target/16660] " pinskia at gcc dot gnu dot org
  2004-08-15  4:27 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: jens dot maurer at gmx dot net @ 2004-07-21 20:43 UTC (permalink / raw)
  To: gcc-bugs

Running the program below compiled with "-mpreferred-stack-boundary=2"
gets a "segmentation fault" because the variable "tmp"
is not properly aligned on a 16-byte boundary (required for
movaps), violating the aligned(16) request in the attribute.

void f()
{
  unsigned long tmp[4] __attribute__((aligned(16)));
  asm("movaps %%xmm0, (%0)" : : "r" (tmp) : "memory");
}

int main()
{
  f();
}

-- 
           Summary: attribute((aligned)) doesn't work for variables on the
                    stack
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jens dot maurer at gmx dot net
                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=16660


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

* [Bug target/16660] attribute((aligned)) doesn't work for variables on the stack
  2004-07-21 20:43 [Bug c/16660] New: attribute((aligned)) doesn't work for variables on the stack jens dot maurer at gmx dot net
@ 2004-07-21 21:14 ` pinskia at gcc dot gnu dot org
  2004-08-15  4:27 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-21 21:14 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target
           Keywords|                            |wrong-code


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


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

* [Bug target/16660] attribute((aligned)) doesn't work for variables on the stack
  2004-07-21 20:43 [Bug c/16660] New: attribute((aligned)) doesn't work for variables on the stack jens dot maurer at gmx dot net
  2004-07-21 21:14 ` [Bug target/16660] " pinskia at gcc dot gnu dot org
@ 2004-08-15  4:27 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-15  4:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-15 04:27 -------
Confirmed, note that the inline-asm can be improved:
  asm("movaps %%xmm0, %0" : : "m" (*tmp) );


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-15 04:27:30
               date|                            |


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


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

end of thread, other threads:[~2004-08-15  4:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-21 20:43 [Bug c/16660] New: attribute((aligned)) doesn't work for variables on the stack jens dot maurer at gmx dot net
2004-07-21 21:14 ` [Bug target/16660] " pinskia at gcc dot gnu dot org
2004-08-15  4:27 ` pinskia 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).