This is the mail archive of the 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]

Re: How to extract types of variables and its uid?

Even I am getting same uid's on small programs.
I tried declaring variables across files also.
But I am unable to replicate the problem on small programs.

I am testing on SPEC CPU2006 benchmark suite, program - 453.povray
Below is the information which is getting dumped using -fdump-tree-gimple-uid

IStream has different uid's -> 5363, 5364, 11467 and 11521. In a file the uid is same.
Can you suggest other experiments to identify the reason?

defaultplatformbase.cpp.004t.gimple:  struct IStreamD.5363 * D.6034;
express.cpp.004t.gimple:  struct IStreamD.5363 * fD.16342;
fileinputoutput.cpp.004t.gimple:  struct IStreamD.5364 * D.6193;
fileinputoutput.cpp.004t.gimple:  struct IStreamD.5364 * D.6197;
fileinputoutput.cpp.004t.gimple:  struct IStreamD.5364 * D.6199;
fileinputoutput.cpp.004t.gimple:  struct IStreamD.5364 * D.6215;
fileinputoutput.cpp.004t.gimple:  struct IStreamD.5364 * D.6217;
fileinputoutput.cpp.004t.gimple:  struct IStreamD.5364 * D.6219;
fileinputoutput.cpp.004t.gimple:  struct IStreamD.5364 * tD.6075;
fileinputoutput.cpp.004t.gimple:  struct IStreamD.5364 * D.6221;
fileinputoutput.cpp.004t.gimple:  struct IStreamD.5364 & D.6273;
fileinputoutput.cpp.004t.gimple:  struct IStreamD.5364 & D.6286;
iff.cpp.004t.gimple:  struct IStreamD.5363 * fD.7934;
octree.cpp.004t.gimple:  struct IStreamD.5364 & D.14872;
pattern.cpp.004t.gimple:  struct IStreamD.5363 * fileD.17068;
pgm.cpp.004t.gimple:  struct IStreamD.5363 * filepD.7964;
pov_util.cpp.004t.gimple:  struct IStreamD.5363 * D.8057;
pov_util.cpp.004t.gimple:  struct IStreamD.5363 * resultD.7911;
pov_util.cpp.004t.gimple:  struct IStreamD.5363 * D.8065;
ppm.cpp.004t.gimple:  struct IStreamD.5363 * filepD.8409;
ppm.cpp.004t.gimple:  struct IStreamD.5363 * D.8683;
ppm.cpp.004t.gimple:  struct IStreamD.5363 * D.8894;
ppm.cpp.004t.gimple:  struct IStreamD.5363 * D.8940;
ppm.cpp.004t.gimple:  struct IStreamD.5363 * D.8941;
radiosit.cpp.004t.gimple:  struct IStreamD.11467 * fdD.14868;
targa.cpp.004t.gimple:  struct IStreamD.5363 * filepD.8491;
targa.cpp.004t.gimple:  struct IStreamD.5363 * D.8856;
targa.cpp.004t.gimple:  struct IStreamD.5363 * D.9155;
targa.cpp.004t.gimple:  struct IStreamD.5363 * D.9196;
targa.cpp.004t.gimple:  struct IStreamD.5363 * D.9197;
textstream.cpp.004t.gimple:  struct IStreamD.11521 * D.12125;
textstream.cpp.004t.gimple:  struct IStreamD.11521 * D.12188;
textstream.cpp.004t.gimple:  struct IStreamD.11521 * D.12208;
textstream.cpp.004t.gimple:  struct IStreamD.11521 * D.12267;
textstream.cpp.004t.gimple:  struct IStreamD.11521 * D.12286;
textstream.cpp.004t.gimple:  struct IStreamD.11521 * D.12293;
textstream.cpp.004t.gimple:  struct IStreamD.11521 * D.12294;
tokenize.cpp.004t.gimple:  struct IStreamD.5363 * isD.10339;
tokenize.cpp.004t.gimple:  struct IStreamD.5363 * isD.10040;
tokenize.cpp.004t.gimple:  struct IStreamD.5363 * rfileD.10196;
tokenize.cpp.004t.gimple:      struct IStreamD.5363 * isD.10167;
tokenize.cpp.004t.gimple:  struct IStreamD.5363 * rfileD.9708;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.9604;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.9801;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.9820;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.9959;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.9962;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.9969;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.10101;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.10177;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.10182;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.10216;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.10221;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.10249;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.10343;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.10405;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.10421;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.10524;
truetype.cpp.004t.gimple:  struct IStreamD.5363 * D.10579;

On Thursday 09 April 2015 04:13 PM, Richard Biener wrote:
On Thu, Apr 9, 2015 at 12:41 PM, Swati Rathi <> wrote:
The variables are declared as you have mentioned.

IStream *var1;
IStream *var2;

Also, var1 and var2 are declared in different functions.
Works for me.

class IStream;
void foo (void) { IStream *var1; }
void bar (void) { IStream *var2; }

g++ -S t.C -fdump-tree-gimple-uid
cat t.C.004t.gimple
void foo() ()
   struct IStreamD.2324 * var1D.2327;


void bar() ()
   struct IStreamD.2324 * var2D.2330;


thus both TYPE_NAMEs have the same DECL_UID 2324.
Their type, even the pointer type have the same TYPE_UID as well
as seen in a debugging session looking at the functions BLOCK
tree before gimplification.

You must be doing sth wrong.


On Thursday 09 April 2015 03:30 PM, Richard Biener wrote:
On Thu, Apr 9, 2015 at 11:57 AM, Swati Rathi <>
We want to store all the types associated with the class objects or
to a class in a program.

Consider two variables var1 and var2 declared in different functions as
      class IStream *var1;
      class IStream *var2;

We are extracting its type as below :
      tree type1 = TREE_TYPE (TREE_TYPE (var1));
      tree type2 = TREE_TYPE (TREE_TYPE (var2));

TREE_CODE (type1) and TREE_CODE (type2) is RECORD_TYPE.
We wish to record the type struct IStream.

However, when we print TYPE_UID (type1) and TYPE_UID (type2), it is
      TYPE_UID = 4326, tree_type : struct IStream
      TYPE_UID = 7421, tree_type : struct IStream

(type2)) also gives the same result.

We wish to avoid duplicate entries of the same type.
How to extract types and uid?
Doesn't it work with

class IStream;

IStream *var1;
IStream *var2;



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