This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Declare a variable which can be incremented by all of the functions
- From: "Dave Korn" <dk at artimi dot com>
- To: "'Qiong Cai'" <qiong dot cai at gmail dot com>,<gcc at gcc dot gnu dot org>
- Date: Sun, 18 Jul 2004 14:03:45 +0100
- Subject: RE: Declare a variable which can be incremented by all of the functions
> -----Original Message-----
> From: gcc-owner On Behalf Of Qiong Cai
> Sent: 17 July 2004 14:19
> I'd like to declare a variable which can be incremented by all of the
> functions in a program.
>
> The variable is declared in "basic-block.h", initialized in
> "toplev.c", and incremented in several RTL passes. However, this only
> works for the functions in one .c file.
> The variable is always intitailzied to zero when a new .c
> file is compiled.
>
> Is there any solution for this problem?
Wouldn't it work to just declare it statically initialised to zero and
then don't reset it in toplev.c?
cheers,
DaveK
--
Can't think of a witty .sigline today....