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: GCC Status Report (2004-03-09)


> I don't follow.  The idea is to do the *entire* store_constructor
> (clearing and initializing) into the temporary (which is not /u).

Yes.

> Then the temporary is copied to the /u target, each word of which is
> copied *once*.  Can you try again to explain your concern?

I agree that the *internal* problem is store_constructor is solved with your 
scheme.  But what about subsequent writes/reads to/from the aggregate?

Currently, the following code is miscompiled on UltraSPARC at -O2:

struct S {
  const int i1;
  const long l1;
  const int i2;
  const long l2;
  int i3;
  int i4;
};

extern void abort(void);

void bar (struct S *s)
{
  if (s->i3 != 2)
    abort();
}

int main(void)
{
  struct S s = { 0, 0, 0, 0 };

  s.i3 = 2;

  bar(&s);

  return 0;
}

because the write 's.i3 = 2;' is hoisted before the clearing by the pretty 
aggressive scheduler.

I think the same problem could occur with your scheme.

-- 
Eric Botcazou


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