trans.c (add_decl_expr): Clear TREE_READONLY if clear DECL_INITIAL.
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Thu, 15 Jul 2004 03:17:42 +0000 (03:17 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 15 Jul 2004 03:17:42 +0000 (23:17 -0400)
* trans.c (add_decl_expr): Clear TREE_READONLY if clear DECL_INITIAL.
* utils.c (unchecked_convert): Don't do two VIEW_CONVERT_EXPRs.

From-SVN: r84742

gcc/ada/ChangeLog
gcc/ada/trans.c
gcc/ada/utils.c

index 82315c981e3e37e7326944b0e0400337ebd11201..5ad44ea54c066abc531e2aee33f957f8e02a9ad5 100644 (file)
@@ -1,3 +1,8 @@
+Wed Jul 14 23:16:59 2004  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * trans.c (add_decl_expr): Clear TREE_READONLY if clear DECL_INITIAL.
+       * utils.c (unchecked_convert): Don't do two VIEW_CONVERT_EXPRs.
+
 2004-07-14  Andreas Schwab  <schwab@suse.de>
 
        * trans.c (gnat_init_stmt_group): Remove duplicate definition.
index 0cc6f953fe666ab9ab582ed63515d75298575f8f..903b314477a2a7d8fa564da1c5381ad56dd45625 100644 (file)
@@ -4164,6 +4164,7 @@ add_decl_expr (tree gnu_decl, Entity_Id gnat_entity)
                               gnu_lhs, DECL_INITIAL (gnu_decl));
 
          DECL_INITIAL (gnu_decl) = 0;
+         TREE_READONLY (gnu_decl) = 0;
          annotate_with_locus (gnu_assign_stmt,
                               DECL_SOURCE_LOCATION (gnu_decl));
          add_stmt (gnu_assign_stmt);
index dc8a5b129f8f8120ec9e3cbf9ef6684fb2953bee..3d525a07b7c2adb14edd69998e947df9e4bfc83a 100644 (file)
@@ -3224,6 +3224,11 @@ unchecked_convert (tree type, tree expr, int notrunc_p)
   else
     {
       expr = maybe_unconstrained_array (expr);
+
+      /* There's no point in doing two unchecked conversions in a row.  */
+      if (TREE_CODE (expr) == VIEW_CONVERT_EXPR)
+       expr = TREE_OPERAND (expr, 0);
+
       etype = TREE_TYPE (expr);
       expr = build1 (VIEW_CONVERT_EXPR, type, expr);
     }