Another thing that can happen with GCC is if some of your code is static-linked and some is dynamic-linked. Or if the same class is defined in two different dynamic libraries.
For example, a type SomeClass in the static linked code will produce a SomeClass typeinfo. And the SomeClass in the dynamic linked code will also produce a SomeClass typeinfo.
What I have seen is that most of the code will point to the dynamic SomeClass typeinfo while all of the code in the static-linked block will point to its internal copy of SomeClass typeinfo.
Since GCC determines types for RTTI and exception handling via typeinfo pointers, this means that as far as it is concerned SomeClass and SomeClass are not the same type.
Now, Microsoft with Windows, probably because they deal with a lot more static linked code and old binary libraries that can't be recompiled, decided to do strcmp name comparisons of types which means that their RTTI and exception handling is a lot slower but works in almost all cases.