public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/39283]  New: volatile data types ignore __attribute__ ((__aligned ...))
@ 2009-02-23 22:40 hp at gcc dot gnu dot org
  2009-02-23 22:44 ` [Bug c/39283] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: hp at gcc dot gnu dot org @ 2009-02-23 22:40 UTC (permalink / raw)
  To: gcc-bugs

Maybe there are two bugs here.

#include <stdio.h>

typedef int ix __attribute__ ((__aligned__ (16)));
typedef volatile int vx __attribute__ ((__aligned__ (16)));

ix ix1 = __alignof__ (ix);
ix ix2 = __alignof__ (ix1);
vx vx1 = __alignof__ (vx);
vx vx2 = __alignof__ (vx1);

int main(void)
{
  printf ("ix1: %d, ix2: %d, vx1: %d, vx2: %d\n",
          ix1, ix2, vx1, vx2);
  return ix1 == ix2 && ix1 == vx1 && ix1 == vx2 ? 0 : 1;
}

For i686-pc-linux-gnu, observe 16, 16, 4, 4 for the above program.  That's by
itself surprising: the "volatile" specifier seems to nullify the attribute
specifier.

For crisv32-axis-linux-gnu it's even worse: it's 16, 16, 1, 4 at -O0, but 16,
16, 4, 4 at -O2.  Bother.


-- 
           Summary: volatile data types ignore __attribute__ ((__aligned
                    ...))
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hp at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: crisv32-axis-linux-gnu, i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <bug-39283-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2012-05-25  6:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-23 22:40 [Bug target/39283] New: volatile data types ignore __attribute__ ((__aligned ...)) hp at gcc dot gnu dot org
2009-02-23 22:44 ` [Bug c/39283] " pinskia at gcc dot gnu dot org
2009-02-23 22:45 ` pinskia at gcc dot gnu dot org
2009-02-23 22:48 ` hp at gcc dot gnu dot org
2009-02-23 22:57 ` hp at gcc dot gnu dot org
     [not found] <bug-39283-4@http.gcc.gnu.org/bugzilla/>
2012-05-25  6:40 ` hp 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).