Is there a way to check if a tree_node is variable in GCC?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi community,

*I want to check if iteration count is a variable, instead of a constant.*

for example, for the source code below:

for(int j = 0; j < n; j++){
    dst[j] += src[j];
}

I want to check if `n` is a variable in GCC middle-end source code.
I print the tree code of `n` using:

TREE_CODE(LOOP_VINFO_NITERS(loop_vinfo)); //the output is POSTINCREMENT_EXPR

So I tried to find a tree code like VARIABLE but there is nothing like
that.
However, there are another 3 similar tree code:

PREDECREMENT_EXPR,
PREINCREMENT_EXPR,
POSTDECREMENT_EXPR.

I wonder if `n`'s tree code is either of 4, can we say it is a variable?
or is there any good way to check if `n` is a variable?



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux