Understanding integer_cst

Primrose.Mbanefo@Infineon.com Primrose.Mbanefo@Infineon.com
Wed Dec 7 15:34:00 GMT 2005


Hello,

A limitiation by some other software means that I am working with gcc .3
.4 1
And I am therefore using the accompanying manuals.

I do not understand the gcc internal documentation on the integer_cst
expression trees.
An expression is given to calculate the value of the constant:

( (TREE_INT_CST_HIGH(e) << HOST_BITS_PER_WIDE_INT)
+ TREE_INT_CST_LOW(e))

Using the expression, what is wrong in the following example:

Example
-----------
Given integer = 5
HOST_BITS_PER_WIDE_INT = 4 //just an example
HOST_WIDE_INT is a type for which the integers are
HOST_BITS_PER_WIDE_INT bits long.

Binary representation of given integer is 0|1|0|1
TREE_INT_CST_HIGH = 0|0|0|1
TREE_INT_CST_LOW = 0|0|0|1
-----------

This definitely does not yield 5 if I apply that expression, so, I
imagine there is something wrong somewhere.
If it does, then maybe I did not understand the expression?

Could anybody please tell me where my thinking went wrong?

Thanks a lot,
Primrose Mbanefo



More information about the Gcc-help mailing list