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]

Re: Change to readonly conflict handling


    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.)

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