http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51764
Bug #: 51764 Summary: mudflap does not work with LTO Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassig...@gcc.gnu.org ReportedBy: rgue...@gcc.gnu.org lto1 is not linked with tree-mudflap.o but with tree-nomudflap.o which causes us to ICE when you combine -flto and -fmudflap. Even if you fix that we ICE because the 2nd stage of mudflap depends on state set up by the 1st stage which runs in different contexts (link-time vs. compile-time). So to work with LTO this state would need to be streamed and combined. Instead of ICEing we should sorry () for the -flto -fmudflap combination already at compile-time and reject -fmudflap at link-time (why is that a common.opt flag anyway when it only applies to a subset of all languages?)