So far I've assumed this to be inevitable but after getting n-th INVALID duplicate bug report about this, I'm really getting tired. The problem roughly boils down to:
1. Install A without recording it in @world.
2. Install B that requires incompatible dependencies (i.e. rebuilds A's deps with other set of USE flags or unmerges them).
3. A will stay installed but its dependencies are no longer satisfied.
4. If you now install C that depends on A, Portage will assume that A is already installed correctly and ignore non-satisfied RDEPEND.
How to resolve this? I have no clue. Portage would either have to recursively verify whole dependency graph (doesn't -D do this?) while installing anything, or it would have to proactively unmerge packages once their dependencies are no longer satisfied.
Yes, the -D / --deep option is one way to prevent this sort of miscalculation. However, --deep also has the side-effect of triggering upgrades when combined with the --update option.
The --complete-graph option is like --deep but without the above (possibly unwanted) side-effect. We currently have options like --complete-graph-if-new-use and --complete-graph-if-new-ver enabled by default in order to automatically trigger --complete-graph behavior for common cases where it is needed, but obviously these to not cover all cases. The case described in comment #0 is perhaps the most notable case which is not covered.
*** Bug 625164 has been marked as a duplicate of this bug. ***
*** Bug 750368 has been marked as a duplicate of this bug. ***
*** Bug 750185 has been marked as a duplicate of this bug. ***