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

Joao Rafael jprafael@student.dei.uc.pt
Wed Dec 5 20:58:00 GMT 2012


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



More information about the Gcc-help mailing list