AnsweredAssumed Answered

Interprocedural Analysis with libraries - inconsistent behavior

Question asked by kenfred on Aug 6, 2010
Latest reply on Dec 2, 2010 by kenfred

I am experiencing an interesting phenomenon while compiling an application and linking against a pre-compiled library.  Both projects (the lib and app) are compiled using the -ipa switch.  When compiling the application, I should expect that the IPA tool can recompile the application source based on the resource usage of both the lib and the app, but the library cannot be recompiled.  This seems to be obvious since library source is often not available at the time the app is being compiled.

 

In my situation, I have both projects open in a project group and the application project properties and dependencies set to link against the lib.  Most of the time the compiler behaves as I expect.  The lib is compiled first (generating ipa stats) because it is marked as a dependency and its build finishes.  Then the app is compiled (also generating ipa stats), the initial link happens, the app is recompiled based on ipa stats, and the build is completed.

 

Oddly enough, perhaps 10% of the time, the IPA tool decides to recompile the lib as well (as if the lib source is available during the app compilation).  Compiler annotations, viewing disassembly, and profiling have verified that the library has indeed been reoptimized.  (I have not verified if the program works as designed when this anomaly happens).

 

I have to assume this is a fluke due to the fact that my lib and app are in the same project group.  Is my understanding of the IPA procedure correct?  Has anyone else experienced this issue?

 

Thanks.

Outcomes