public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/42098]  New: gcc does not honor alignment specification, gives different alignment than g++
@ 2009-11-18 20:23 jepler at unpythonic dot net
  2009-11-25 21:24 ` [Bug c/42098] gcc does not honor alignment specification for qualified typedefs pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: jepler at unpythonic dot net @ 2009-11-18 20:23 UTC (permalink / raw)
  To: gcc-bugs

Given the declaration: typedef volatile double D __attribute__((aligned(16)));
gcc and g++ give different alignments (and thus differing offsets and sizes)
for structures that contain D.  Removal of the volatile qualifier changes the
alignment behavior.

$ g++ -m32 vs.c && ./a.out
$ gcc -m32 -Dvolatile= vs.c && ./a.out
$ gcc -m32 vs.c && ./a.out
a.out: vs.c:8: main: Assertion `__alignof__(S) == 8' failed.
Aborted

$ gcc -v 2>&1 | tail -1
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)


-- 
           Summary: gcc does not honor alignment specification, gives
                    different alignment than g++
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jepler at unpythonic dot net
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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


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

end of thread, other threads:[~2011-03-28 12:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-42098-4@http.gcc.gnu.org/bugzilla/>
2011-03-28 12:20 ` [Bug c/42098] gcc does not honor alignment specification for qualified typedefs rguenth at gcc dot gnu.org
2009-11-18 20:23 [Bug c/42098] New: gcc does not honor alignment specification, gives different alignment than g++ jepler at unpythonic dot net
2009-11-25 21:24 ` [Bug c/42098] gcc does not honor alignment specification for qualified typedefs 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).