Compiling the following testcase with "g++ -fmudflap" yields an ICE since GCC 4.0.0 (i.e. this is not a regression):
================= struct A; A foo() { A a; return a; } ================= bug.cc: In function 'A foo()': bug.cc:3: error: return type 'struct A' is incomplete bug.cc:5: error: aggregate 'A a' has incomplete type and cannot be defined bug.cc:3: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in mf_xform_derefs_1, at tree-mudflap.c:731 Please submit a full bug report, [etc.] Testing a patch. -- Summary: ICE with -fmudflap returning an incomplete struct Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: ice-on-invalid-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=26790