This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: GCC Status Report (2004-03-09)
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 1 Apr 2004 15:56:23 +0200
- Subject: Re: GCC Status Report (2004-03-09)
- References: <10404011238.AA23793@vlsi1.ultra.nyu.edu>
> 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