http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48763
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-26 13:05:32 UTC --- (In reply to comment #4) > I would say that PR48761 testcase is not 100% dup of this one. One tests that > cgraph merging check type compatibility of direct call edges, the second tests > that ipa-prop does type compatibility check when turing indirect edge to > direct. The issue is the same, it will manifest in all IPA passes, with and without LTO now that we happily create direct calls from originally mismatching indirect calls. > I guess only way to go is to stomp call expression types to the callgraph > edges. Doable, but ugly since it will add need to store types into callgraph > sections that are currently simple blocks. Or to make inliner and ipa-prop to > handle all cases, even those not type compatible, right? > > This is not really my area, so I would hope someone to beat me on this problem > :)) We should defer detection of incompatibilities to when we see the call stmt, thus expand_call_inline. We shouldn't worry about this disturbing inliner heuristics too much. IPA optimizations should do propagation as-if things match, deal with missing arguments (or missing arg slots) properly by giving up and do the same checking when applying a transform. I don't think trying to move more information to WPA stages on the edges is the way to go.