seen with a profiled build (make profile-opt PROFILE_TASK='$(srcdir)/Lib/test/regrtest.py') building python-3.0rc3 on i486-linux-gnu. Using pybench as the PROFILE_TASK doesn't show this bug). Seen PR22471, but this one was reported long ago. What other information should be provided for this kind of report? gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-prototypes -fprofile-use -I. -IInclude -I../Include -DPy_BUILD_CORE -o Modules/config.o Modules/config.c ../Python/thread.c: In function 'PyThread_acquire_lock': ../Python/thread.c:419: error: corrupted profile info: number of executions for edge 16-3 thought to be -1 ../Python/thread.c:419: error: corrupted profile info: number of executions for edge 16-17 thought to be 5657524 make[3]: *** [Python/thread.o] Error 1
Subject: Bug 38292 Author: jakub Date: Wed Feb 4 19:50:58 2009 New Revision: 143937 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143937 Log: PR tree-optimization/38977 PR gcov-profile/38292 * calls.c (special_function_p): Disregard __builtin_ prefix. Modified: trunk/gcc/ChangeLog trunk/gcc/calls.c
still seen with a backport of the patch to the 4.3 branch and with trunk 20090211 on amd64. works on i486. gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fprofile-use -I. -IInclude -I../Include -DPy_BUILD_CORE -o Modules/config.o Modules/config.c ../Python/thread.c: In function 'PyThread_acquire_lock': ../Python/thread.c:423: error: corrupted profile info: profile data is not flow-consistent ../Python/thread.c:423: error: corrupted profile info: number of executions for edge 16-3 thought to be -7 ../Python/thread.c:423: error: corrupted profile info: number of executions for edge 16-17 thought to be 4920917
Can you check if moving the PR38977 fix to special_function_p (handling plain fork there) fixes it? What is the contents of thread.c?
Created attachment 17286 [details] thread.c source file
Created attachment 17287 [details] thread_pthread.h header
a build with the suggested change doesn't show any change. --- gcc/calls.c~ 2009-02-05 09:30:24.000000000 +0100 +++ gcc/calls.c 2009-02-12 15:17:08.000000000 +0100 @@ -530,6 +530,8 @@ } else if ((tname[0] == 'q' && tname[1] == 's' && ! strcmp (tname, "qsetjmp")) + || (tname[0] == 'f' && tname[1] == 'o' + && ! strcmp (tname, "fork")) || (tname[0] == 'v' && tname[1] == 'f' && ! strcmp (tname, "vfork")) || (tname[0] == 'g' && tname[1] == 'e'
seen as well on sparc-linux, x86_64-linux and i486-linux (when built with -mcpu=i686 -mtune=i586), although triggered in different files.
same behaviour with the 4.4.1 release
GCC 4.3.4 is being released, adjusting target milestone.
GCC 4.3.5 is being released, adjusting target milestone.
Richard's reorg of profiling to SSA uncovered some of issues with pure&const functions that are fixed in the current mainline. Can you, please, check if that solves your problem?
I ran into bug #47248 trying to build a recent snapshot.
trying to build python 3.2~rc1, I run into: I get (with the just built python (built with -fprofile-generate): build-static$ ./python XXX lineno: 1101, opcode: 0 Fatal Python error: Py_Initialize: Unable to get the locale encoding Traceback (most recent call last): File "/home/packages/python/3.2/python3.2-3.2~rc1/build-static/../Lib/encodings/__init__.py", line 31, in <module> XXX lineno: 39, opcode: 0 Aborted The build is ok with the normal build.
no, normal python build fails too, this is reported as bug #47271.
hmm, can't set the status back to NEW, just to RESOLVED. ... a normal build of 3.2rc1 succeeds with trunk r169142 and the proposed fix for PR47271. the profiled build still fails with: gcc-4.6 -pthread -c -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fprofile-use -I. -IInclude -I../Include -DPy_BUILD_CORE -o Python/bltinmodule.o ../Python/bltinmodule.c ../Python/bltinmodule.c: In function 'builtin___build_class__': ../Python/bltinmodule.c:40:23: warning: variable 'nbases' set but not used [-Wunused-but-set-variable] ../Python/bltinmodule.c: In function 'builtin_exec': ../Python/bltinmodule.c:769:9: warning: variable 'plain' set but not used [-Wunused-but-set-variable] gcc-4.6 -pthread -c -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fprofile-use -I. -IInclude -I../Include -DPy_BUILD_CORE -o Python/ceval.o ../Python/ceval.c ../Python/ceval.c: In function 'PyEval_RestoreThread': ../Python/ceval.c:4472:1: error: corrupted profile info: profile data is not flow-consistent ../Python/ceval.c:4472:1: error: corrupted profile info: number of executions for edge 4-5 thought to be 2002859 ../Python/ceval.c:4472:1: error: corrupted profile info: number of executions for edge 4-1 thought to be -9 make[3]: *** [Python/ceval.o] Error 1
(In reply to comment #15) > hmm, can't set the status back to NEW, just to RESOLVED. ... > You have to use your gcc account (I think).
4.3 branch is being closed, moving to 4.4.7 target.
I don't think this is a regression now as we never had good thread support for gcov/profiling. That is we don't do atomic adds for the profiling.
We seem to miss a reproducer here.
4.4 branch is being closed, moving to 4.5.4 target.
the python builds works when built using -fprofile-correction