This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
What exactly does is_variable_sized test for?
- From: Amittai Aviram <amittai dot Aviram at yale dot edu>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 21 Feb 2012 23:50:46 -0500
- Subject: What exactly does is_variable_sized test for?
I am trying to understand some code in gcc/omp-low.c that calls the predicate is_variable_sized:
omp-low.c:is_variable_sized (const_tree expr)
where const_tree is a pointer to a constant tree_node, which is a union of a bunch of structures, but, in this case, it must be (I think) a tree_var_decl structure. It is defined as follows:
static inline bool
is_variable_sized (const_tree expr)
{
return !TREE_CONSTANT (TYPE_SIZE_UNIT (TREE_TYPE (expr)));
}
Unpacking the macros, I get
return !expr->common.type->type.size_unit->base.constant_flag;
But what exactly does this mean? What kind of C variable counts as "variable sized"? Does that mean an array or struct type? Thanks!
Amittai Aviram
PhD Student in Computer Science
Yale University
646 483 2639
amittai.aviram@yale.edu
http://www.amittai.com