The following valid code snippet triggers an ICE since GCC 4.2.0: ====================================== struct A { const char* p; };
void foo() { __builtin_offsetof(struct A, p[0]); } ====================================== bug.cc: In function 'void foo()': bug.cc:8: internal compiler error: in fold_offsetof_1, at c-common.c:7647 Please submit a full bug report, [etc.] The code is accepted by the C frontend. -- Summary: [4.2/4.3/4.4 regression] ICE using offsetof with array Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: ice-on-valid-code, monitored Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reichelt at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38699