This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Change to readonly conflict handling
- To: geoffk at cygnus dot com
- Subject: Re: Change to readonly conflict handling
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Sun, 17 Sep 00 19:06:02 EDT
- Cc: gcc-patches at gcc dot gnu dot org
How is the Ada frontend creating a non-unchanging write to a readonly
field?
With a constructor, as an initializing expression.
Here's something similar in C, though it generates a warning:
struct foo {const int a; int b;};
void
sub1 (struct foo *p, struct foo *q)
{
*p = (struct foo) {1, 2};
*q = *p;
}
If you look at the RTL, you'll see that one word of *p is being stored with /u
and loaded without it. (They also have different alias sets, but that's
probably something I did in my last change and will fix momentarily.)