------- Comment #8 from rguenth at gcc dot gnu dot org 2010-07-09 12:52 -------
The only difference I see for typedef struct { } T1; vs typedef struct X { }
T1;
when looking at its main variant (or recursively DECL_ORIGINAL_TYPE) is
<type_decl 0x7ffff5b2be60 X
type <record_type 0x7ffff5b31dc8 X type_5 QI
size <integer_cst 0x7ffff7ed24b0 constant 8>
unit size <integer_cst 0x7ffff7ed24d8 constant 1>
align 8 symtab 0 alias set -1 canonical type 0x7ffff5b31dc8
fields <type_decl 0x7ffff5b2bf18 X type <record_type 0x7ffff5b31e70 X>
nonlocal decl_4 VOID file t.i line 1 col 18
align 1 context <record_type 0x7ffff5b31dc8 X> result <record_type
0x7ffff5b31dc8 X>
>
full-name "struct X"
X() X(constX&) this=(X&) n_parents=0 use_template=0 interface-unknown
chain <type_decl 0x7ffff5b2be60 X>>
public decl_2 VOID file t.i line 1 col 16
align 8 chain <function_decl 0x7ffff5b23e00 __cxa_call_unexpected>>
<type_decl 0x7ffff5b43000 T1
type <record_type 0x7ffff5b31dc8 T1 type_5 QI
size <integer_cst 0x7ffff7ed24b0 constant 8>
unit size <integer_cst 0x7ffff7ed24d8 constant 1>
align 8 symtab 0 alias set -1 canonical type 0x7ffff5b31dc8
fields <type_decl 0x7ffff5b2bf18 ._0 type <record_type 0x7ffff5b31e70
T1>
nonlocal decl_4 VOID file t.i line 1 col 16
align 1 context <record_type 0x7ffff5b31dc8 T1> result <record_type
0x7ffff5b31dc8 T1>
>
full-name "struct T1"
X() X(constX&) this=(X&) n_parents=0 use_template=0 interface-unknown
chain <type_decl 0x7ffff5b2be60 ._0>>
VOID file t.i line 1 col 20
align 1 chain <type_decl 0x7ffff5b2be60 ._0>>
which is the difference in alignment, TREE_PUBLIC and decl_lang_flag_2 set
(DECL_IMPLICIT_TYPEDEF_P).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44871