Set RTX_UNCHANGING is readonly_field_p when clearing

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Mon Apr 21 21:18:00 GMT 2003


    Can you document what the compiler currently does?  I'm not asking for
    a redesign, I just want the docs to match the code.  If that means
    that instead of one paragraph we need 10 then that's OK.

The position I take is that the flag, as documented, is the correct
specification.  Any deviation from that specification is a bug.  It's
just that we don't know how to find and fix those bugs.

    If you really can't work out what the compiler currently does, we can
    remove this paragraph and write something like "Used in a `reg',
    `mem', or `concat'; no-one really understands what this flag does.",
    but that's a last resort.

No, that isn't the issue: we all understand what the flag is *supposed*
to mean, and the documentation accurately capture thats.

    > As has been said before, we really should eliminate all the mem flags and
    > replace them with alias information.  However, I'm not at all certain
    > that this would do more than just *moving* the above question to
    > another place.

    In this matter, at least, the alias information is well-defined; the
    alias set for the structure is a superset of the alias sets of its
    individual members.

Yes, but the proposal is to extend the alias set information to encode
whether something is "readonly" or not.  And the key is to be precise
as to what "readonly" means.  But that's the exact same problem we
have now!  What does it mean to be "set once"?  If we have

	const int foo[10] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 0};

and we implement that by clearing FOO and then storing the 1, is that
to be viewed as "set once"?  If so, then we have some problems with the
lower-level RTL semantics.  If not, then "const" is nearly useless.
I think it's going to be hard to pick a semantics of extending the alias
set information to encode this without being in exactly the same boat.



More information about the Gcc-patches mailing list