Take the following two files:
typedef struct _xmlDict xmlDict;
struct _xmlDict {
int ref_counter;
};
void xmlDictCreate(void) {
xmlDict * dict;
}
--- CUT ---
typedef struct _xmlDict xmlDict;
struct _xmlDoc {
struct _xmlDict *dict;
};
void xmlAddEntity(struct _xmlDoc *a) {
xmlDict * dict = a->dict;
xmlHashCreateDict(0, dict);
}
--- CUT ---
Currently if the first file is included first it ICEs but if the second files
is done first on the command line, it works.
The ICE is:
lto1: error: non-trivial conversion at assignment
struct _xmlDict *
struct _xmlDict *
# VUSE <.MEM_3(D)>
dict_2 = a_1(D)->dict;
--
Summary: ICE with lto and incomplete types
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: lto
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41839