This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix problem causing g77 regressions
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: toon at moene dot indiv dot nluug dot nl
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 1 Dec 01 17:12:22 EST
- Subject: 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);
}