On 11/14/22 08:38, Christoph Müllner wrote:

Ok, I will add the check.

Still, I don't think that the optimization changes the behavior in the
case of different ABIs
(i.e. the situation is problematic regardless if there is an indirect call
or a guarded direct call).
What could be done additionally to dropping the candidate is to emit a
warning (similar like ipa-devirt does for ODR violations).

The one target I'm aware of where this is most likely to cause problems would be the older 32bit PA SOM ABI.  It has the property that the ABI uses different registers for parameter passing for direct vs indirect calls.  But with all this happening before RTL generation we should be fine, even for that ABI (and its generally safe in that ABI to change an indirect to a direct call, but not vice-versa).


Jeff

Reply via email to