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: RFC: [PATCH]: PR31806 - Fix MEM_READONLY_P aliasing disambiguation


On 5/30/07, Richard Guenther <richard.guenther@gmail.com> wrote:
>
> Any comments?

I think those mems should not be MEM_READONLY_P if they are written to
(if not the program is invalid).  Of course the patch is a reasonable
workaround for
the branches if the "real" fix is too invasive.  I suppose the
frontend(s) set this
bit?

I mentioned the same thing in the bug report and pointed to another bug report where the front-end messes up TREE_READONLY (PR 31809). MEM_READONLY_P is set from TREE_READONLY: if (base && DECL_P (base) && TREE_READONLY (base) && (TREE_STATIC (base) || DECL_EXTERNAL (base))) { tree base_type = TREE_TYPE (base); gcc_assert (!(base_type && TYPE_NEEDS_CONSTRUCTING (base_type)) || DECL_ARTIFICIAL (base)); MEM_READONLY_P (ref) = 1; }


So the real issue is the C++ front-end is setting TREE_READONLY to true when it should not (exactly the same as PR 31809).

Thanks,
Andrew Pinski


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