This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-fprofile-generate and -pthread possible race condition with indirect calls


When compiling my multi-threaded (pthreads) application with
-fprofile-generate and then -fprofile-use I consistently get errors
like these:

error: corrupted value profile: ic profile counter (305466 out of
303958) inconsistent with basic-block count (303958)
  (*t)();
        ^

(t here is a pointer to a base virtual class with the () operator.)
Similar errors occur with the modulo operator.

Lowering the number of concurrent threads down to 1 gets me no errors.

Unfortunately legal constraints don't allow me to disclosure the
source code and I was unable to reproduce it with other simpler code.


I was hopping that profile generation worked out the box with threaded
applications but it seems that it might not be the case. (Or am i
missing something?)

João Rafael


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]