public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/20763] New: [4.0 regression] Incompatible struct alignment change
@ 2005-04-05 8:52 aph at gcc dot gnu dot org
2005-04-05 8:55 ` [Bug c++/20763] " aph at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: aph at gcc dot gnu dot org @ 2005-04-05 8:52 UTC (permalink / raw)
To: gcc-bugs
C++ structure layout has changed and is now incompatible between C++ and Java,
and between older releases of C++.
Structure layout is also incompatible with C.
This is an ABI breaking bug.
See the discussion beginning at
http://gcc.gnu.org/ml/gcc/2005-04/msg00139.html
and the testcase at http://gcc.gnu.org/ml/gcc/2005-04/msg00152.html
--
Summary: [4.0 regression] Incompatible struct alignment change
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: aph at gcc dot gnu dot org
CC: aph at gcc dot gnu dot org,gcc-bugs at gcc dot gnu dot
org,pinskia at physics dot uc dot edu
GCC build triplet: powerpc-unknown-linux-gnu
GCC host triplet: powerpc-unknown-linux-gnu
GCC target triplet: powerpc-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/20763] [4.0 regression] Incompatible struct alignment change
2005-04-05 8:52 [Bug c++/20763] New: [4.0 regression] Incompatible struct alignment change aph at gcc dot gnu dot org
@ 2005-04-05 8:55 ` aph at gcc dot gnu dot org
2005-04-05 12:59 ` jakub at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: aph at gcc dot gnu dot org @ 2005-04-05 8:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From aph at gcc dot gnu dot org 2005-04-05 08:54 -------
Created an attachment (id=8535)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8535&action=view)
A test case
If you run the appended code with g++ version 3.4.1, you get
$ g++ -m32 thing.cc -save-temps && ./a.out
56
With 4.0, you get
$ PATH=/local/aph/install/bin/:$PATH g++ -m32 thing.cc -save-temps
-fabi-version=0 && ./a.out
52
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/20763] [4.0 regression] Incompatible struct alignment change
2005-04-05 8:52 [Bug c++/20763] New: [4.0 regression] Incompatible struct alignment change aph at gcc dot gnu dot org
2005-04-05 8:55 ` [Bug c++/20763] " aph at gcc dot gnu dot org
@ 2005-04-05 12:59 ` jakub at gcc dot gnu dot org
2005-04-05 13:07 ` [Bug c++/20763] [4.0/4.1 " pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-04-05 12:59 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From jakub at gcc dot gnu dot org 2005-04-05 12:59 -------
typedef void *voidp;
struct S
{
char a;
voidp __attribute__ ((aligned (16))) b;
};
struct T
{
char a;
void *__attribute__ ((aligned (16))) b;
};
int f[sizeof (struct S) != sizeof (struct T) ? -1 : 1];
also fails, on all arches I tried (16 byte alignment so that it fails also
on 64-bit arches).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/20763] [4.0/4.1 regression] Incompatible struct alignment change
2005-04-05 8:52 [Bug c++/20763] New: [4.0 regression] Incompatible struct alignment change aph at gcc dot gnu dot org
2005-04-05 8:55 ` [Bug c++/20763] " aph at gcc dot gnu dot org
2005-04-05 12:59 ` jakub at gcc dot gnu dot org
@ 2005-04-05 13:07 ` pinskia at gcc dot gnu dot org
2005-04-05 13:14 ` jakub at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-05 13:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-05 13:07 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
GCC build triplet|powerpc-unknown-linux-gnu |
GCC host triplet|powerpc-unknown-linux-gnu |
GCC target triplet|powerpc-unknown-linux-gnu |
Keywords| |ABI, wrong-code
Last reconfirmed|0000-00-00 00:00:00 |2005-04-05 13:07:32
date| |
Summary|[4.0 regression] |[4.0/4.1 regression]
|Incompatible struct |Incompatible struct
|alignment change |alignment change
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/20763] [4.0/4.1 regression] Incompatible struct alignment change
2005-04-05 8:52 [Bug c++/20763] New: [4.0 regression] Incompatible struct alignment change aph at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-04-05 13:07 ` [Bug c++/20763] [4.0/4.1 " pinskia at gcc dot gnu dot org
@ 2005-04-05 13:14 ` jakub at gcc dot gnu dot org
2005-04-05 14:04 ` jakub at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-04-05 13:14 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2005-04-05 13:07:32 |2005-04-05 13:14:01
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/20763] [4.0/4.1 regression] Incompatible struct alignment change
2005-04-05 8:52 [Bug c++/20763] New: [4.0 regression] Incompatible struct alignment change aph at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-04-05 13:14 ` jakub at gcc dot gnu dot org
@ 2005-04-05 14:04 ` jakub at gcc dot gnu dot org
2005-04-05 16:02 ` mmitchel at gcc dot gnu dot org
2005-04-05 17:38 ` mmitchel at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-04-05 14:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From jakub at gcc dot gnu dot org 2005-04-05 14:04 -------
Mark, this seems to be caused by
http://gcc.gnu.org/ml/gcc-patches/2004-06/msg01720.html
The attributes are attached to the cdk_id declarator which is stored inside
of a cdk_pointer declarator, but grokdeclarator only looks at
declarator->attributes of the non-cdk_id declarators and so the attributes
get lost.
I'm not sure where is the best place to handle these, so will work on
g++.dg-struct-layout-1 testsuite which ought to catch such ABI changes instead.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu dot org
AssignedTo|jakub at gcc dot gnu dot org|unassigned at gcc dot gnu
| |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/20763] [4.0/4.1 regression] Incompatible struct alignment change
2005-04-05 8:52 [Bug c++/20763] New: [4.0 regression] Incompatible struct alignment change aph at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-04-05 14:04 ` jakub at gcc dot gnu dot org
@ 2005-04-05 16:02 ` mmitchel at gcc dot gnu dot org
2005-04-05 17:38 ` mmitchel at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-04-05 16:02 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |mark at codesourcery dot com
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20763
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/20763] [4.0/4.1 regression] Incompatible struct alignment change
2005-04-05 8:52 [Bug c++/20763] New: [4.0 regression] Incompatible struct alignment change aph at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-04-05 16:02 ` mmitchel at gcc dot gnu dot org
@ 2005-04-05 17:38 ` mmitchel at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-04-05 17:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-04-05 17:38 -------
Fixed in 4.0.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20763
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-04-05 17:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-05 8:52 [Bug c++/20763] New: [4.0 regression] Incompatible struct alignment change aph at gcc dot gnu dot org
2005-04-05 8:55 ` [Bug c++/20763] " aph at gcc dot gnu dot org
2005-04-05 12:59 ` jakub at gcc dot gnu dot org
2005-04-05 13:07 ` [Bug c++/20763] [4.0/4.1 " pinskia at gcc dot gnu dot org
2005-04-05 13:14 ` jakub at gcc dot gnu dot org
2005-04-05 14:04 ` jakub at gcc dot gnu dot org
2005-04-05 16:02 ` mmitchel at gcc dot gnu dot org
2005-04-05 17:38 ` mmitchel 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).