[Bug ada/35493] Assert_Failure uintp.adb:1593

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Mar 7 12:06:00 GMT 2008



------- Comment #3 from pinskia at gcc dot gnu dot org  2008-03-07 12:05 -------
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 as
     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;



READ_ONLY means it is only read and not written to at all and the initializer
is valid.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35493



More information about the Gcc-bugs mailing list