Help in AST dump

2006-03-09 Thread Darthrader

Hi,

Can someone tell me what do unql,high,low refer to in the dump generated by
gcc using -fdump-tree-original-raw.

@10 integer_type name: @20  unql: @21  size: @22
 algn: 64   prec: 36   unsigned
 min : @23  max : @24

@27 integer_cst  type: @13  high: -1   low : -2147483648

Darth
--
View this message in context: 
http://www.nabble.com/Help-in-AST-dump-t1252187.html#a3318259
Sent from the gcc - Dev forum at Nabble.com.



AST dump

2006-03-09 Thread Darthrader

Hi,

Can someone tell me what do unql,high,low refer to in the dump generated by
gcc using -fdump-tree-original-raw.

@10 integer_type name: @20  unql: @21  size: @22
 algn: 64   prec: 36   unsigned
 min : @23  max : @24

@27 integer_cst  type: @13  high: -1   low : -2147483648

Darth
--
View this message in context: 
http://www.nabble.com/AST-dump-t1252187.html#a3318259
Sent from the gcc - Dev forum at Nabble.com.



What do these mean?

2006-02-02 Thread Darthrader (sent by Nabble.com)

Hi ,

Can someone please let me know what the extensions t02 & original mean in the 
filename test.c.t02.original after compiling test.c using the option 
fdump-tree-original-raw, generating an AST?

Darth
--
View this message in context: 
http://www.nabble.com/What-do-these-mean--t1046908.html#a2720645
Sent from the gcc - Dev forum at Nabble.com.



Re: What do these mean?

2006-02-02 Thread Darthrader (sent by Nabble.com)

Thanx for ur reply Diego.
Got a few more queries...

What does the number '02' signify?
Can I change that ? How?

Darthrader
--
View this message in context: 
http://www.nabble.com/What-do-these-mean--t1046908.html#a2720928
Sent from the gcc - Dev forum at Nabble.com.



Machine Dependance

2006-02-02 Thread Darthrader (sent by Nabble.com)

Is the AST[Abstract Syntax Tree] machine dependent?

I read some where that it should be machine independent but when i compiled a c 
program and generated its AST using -fdump-tree-original-raw on gcc-4.0.0 , 
there were certain node values ,which were diifferent on different machines 
like algn,why ?
Also what does algn :  mean?
 
Darthrader
--
View this message in context: 
http://www.nabble.com/Machine-Dependance-t1047440.html#a2722136
Sent from the gcc - Dev forum at Nabble.com.



AST

2006-02-02 Thread Darthrader (sent by Nabble.com)

Can someone give a good link to any information about the Abstract Syntax Tree.
Any help will be appreciated.

TIA,
Darthrader
--
View this message in context: http://www.nabble.com/AST-t1047504.html#a2722321
Sent from the gcc - Dev forum at Nabble.com.



Re: Machine Dependance

2006-02-02 Thread Darthrader (sent by Nabble.com)

Thanx for ur reply.I have a few more questions below:

Paolo Bonzini-2 wrote: 
> 
> Darthrader (sent by Nabble.com) wrote:
>> Is the AST[Abstract Syntax Tree] machine dependent?
> 
> The nodes that are generated for the program as it is parsed are machine 
> independent.  However:
> 
> 1) this can only be true if your source code is already preprocessed. 
> Otherwise, the source code that GCC really sees it is different.  If you 
> use the "--save-temps" option, you will find a .i file which is what GCC 
> has built the parse tree from.
> 
> I saw the .i file but i could not make any sense out of it.Its the program 
> code (mine was a very simple 4 line code) but in the part before main() it 
> contains :
> 
> # 1 "test.c"
> # 1 " "
> # 1 " "
> # 1 "test.c"
> 
> What do these represent?
> 
> 
> 2) Some tree nodes are implicit in the compiler, and are always created 
> even if the program does not mention them.  You can imagine that every 
> program had on top of it something like:
> 
> typedef void __attribute__ ((mode (QI))) char;
> typedef void __attribute__ ((mode (HI))) short;
> typedef void __attribute__ ((mode (SI))) int;
> typedef void __attribute__ ((mode (__word__))) long;
> typedef void __attribute__ ((mode (DI))) long long;
> 
> (which is not really valid C code, of course!) and so on.  GCC's
> syntax tree nodes are heavily annotated with information on the nodes, 
> and the information for these implicit nodes can be machine dependent: 
> for example, long may have 4 bytes on some machines and 8 bytes on 
> others.  In your case, "algn" was the alignment required by the type.
> 
> -
> Kindly elaborate on algn.The alignment required by the type relative to what 
> and why?
> -
> 
> 3) Some of the information percolates from the types to other tree 
> nodes, such as the variables.  So your "original" dump could contain 
> some differences in the tree nodes for variables: these come from the 
> machine dependent nodes I just described.
> 
> 4) Finally, some minor optimizations in fold-const.c that are performed 
> before the ".original" dump is emitted, so you could see differences 
> because of that.
> 
> You probably know that a compiler is roughly divided in front-ends 
> (reads source code), middle-end (works on an intermediate 
> representation), and back-end (uses the intermediate representation to 
> emit assembly).
> 
> Very roughly speaking, GCC's middle-end starts in fold-const.c.  GCC's 
> middle-end uses more or less four intermediate representation: GENERIC 
> (a standardized form of syntax trees), GIMPLE (an even more standardized 
> and simplified form of syntax trees), RTL, and "strict" RTL (where each 
> instruction and each operand has an almost 1-1 mapping with the assembly 
> language instructions and operands).  In practice it is a bit more 
> complicated because GENERIC is transformed to GIMPLE "slowly" and gradually.
> 
> GCC's syntax trees are pretty well machine independent, enough 
> independent that they work well as a machine independent intermediate 
> representation for many optimization passes at the beginning in the 
> compiler pipeline.  As GCC switches from tree nodes to RTL and to strict 
> RTL, more and more machine dependent pieces creep into its intermediate 
> representation.  In the end, things are so machine dependent that most 
> non-trivial changes to the RTL middle-end had better be tested on more 
> than one machine: they can work like a charm on i686 and break, say, 
> powerpc or arm or s390 or all of these.
> 
> Paolo
> 
> 
>
--
View this message in context: 
http://www.nabble.com/Machine-Dependance-t1047440.html#a2725013
Sent from the gcc - Dev forum at Nabble.com.



Re: Machine Dependance

2006-02-02 Thread Darthrader (sent by Nabble.com)

Hey Paolo thanx  a lot.I got the info I required.
Can u mention any links that i can use as a reference to understand the dump 
output of   -fdump-tree-original-raw as AST?
Thanx a lot.

Darthrader

--
View this message in context: 
http://www.nabble.com/Machine-Dependance-t1047440.html#a2725614
Sent from the gcc - Dev forum at Nabble.com.



Internpreter

2006-02-03 Thread Darthrader (sent by Nabble.com)

If I want to write an interpreter for AST, what are _some_ of  the things I 
would be required to do? Basically , how does an interpreter work?

--
View this message in context: 
http://www.nabble.com/Internpreter-t1052475.html#a2736701
Sent from the gcc - Dev forum at Nabble.com.



Interpreter

2006-02-03 Thread Darthrader (sent by Nabble.com)

If I want to write an interpreter for AST, what are _some_ of  the things I 
would be required to do? Basically , how does an interpreter work?

--
View this message in context: 
http://www.nabble.com/Interpreter-t1052476.html#a2736703
Sent from the gcc - Dev forum at Nabble.com.