This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix problem causing g77 regressions


I believe this patch fill fix the bug, which is basically that TREE_READONLY
of an INDIRECT_REF is not to be copied from that of its first arg.

However:

(1) g77 should probably set the HONOR_READONLY hook to "true".
(2) It's not clear is the behavior of save_expr to look at TREE_READONLY
    should also do it if its an INDIRECT_REF and HONOR_READONLY is false.
    It used to do this for naked expressions but now does so also when
    surrounded by some arithmetic.  I think one could argue it should check
    for this case, but it didn't used to, so I'm inclined to leave it the way
    it is.

*** com.c	2001/11/18 11:04:48	1.141
--- com.c	2001/12/01 22:13:25
*************** ffecom_1 (enum tree_code code, tree type
*** 9557,9562 ****
    if (TREE_SIDE_EFFECTS (node))
      TREE_SIDE_EFFECTS (item) = 1;
!   if ((code == ADDR_EXPR) && staticp (node))
      TREE_CONSTANT (item) = 1;
    return fold (item);
  }
--- 9557,9564 ----
    if (TREE_SIDE_EFFECTS (node))
      TREE_SIDE_EFFECTS (item) = 1;
!   if (code == ADDR_EXPR && staticp (node))
      TREE_CONSTANT (item) = 1;
+   else if (code == INDIRECT_REF)
+     TREE_READONLY (item) = TYPE_READONLY (type);
    return fold (item);
  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]