------- Comment #6 from ebotcazou at gcc dot gnu dot org 2008-03-07 18:28 ------- > I think the Ada front-end has TREE_CONSTANT and TREE_READONLY definition > swapped around: > > /* Whether we will make TREE_CONSTANT the DECL we produce here, in which > case the initializer may be used in-lieu of the DECL node (as done in > Identifier_to_gnu). This is useful to prevent the need of elaboration > code when an identifier for which such a decl is made is in turn used > an initializer. We used to rely on CONST vs VAR_DECL for this purpose, > but extra constraints apply to this choice (see below) and are not > relevant to the distinction we wish to make. */ > bool constant_p = const_flag && init_const; > > TREE_READONLY (var_decl) = const_flag; > DECL_EXTERNAL (var_decl) = extern_flag; > TREE_PUBLIC (var_decl) = public_flag || extern_flag; > TREE_CONSTANT (var_decl) = constant_p;
This doesn't seem to be the case according to http://gcc.gnu.org/ml/gcc/2005-08/msg00686.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35493