This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Identifying global state within GCC
- From: David Malcolm <dmalcolm at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Cc: "gcc-python-plugin at lists dot fedorahosted dot org" <gcc-python-plugin at lists dot fedorahosted dot org>
- Date: Wed, 01 May 2013 16:32:12 -0400
- Subject: Identifying global state within GCC
I had a go at writing a custom pass to try to locate places where GCC
makes use of global state.
You can see the pass here (which I implemented using gcc-python-plugin):
https://gcc-python-plugin.readthedocs.org/en/latest/working-with-c.html#finding-global-variables
A build log from recompiling gcc using this pass can be seen at:
http://fedorapeople.org/~dmalcolm/gcc/2013-05-01/make.log
(about 12MB in size; I killed it when I saw that stage 1 was done).
I'm sure there are quite a few false positives in there.
Hope this is helpful. FWIW I had an earlier version of the pass which
merely gave *declaration* sites for global variables, rather than all
*uses* of such variables.
Dave