------- Comment #18 from rguenther at suse dot de 2010-05-20 15:17 -------
Subject: Re: Revisit std::function for aliasing issues
and efficiency
On Thu, 20 May 2010, jason at gcc dot gnu dot org wrote:
> ------- Comment #17 from jason at gcc dot gnu dot org 2010-05-20 15:13
> -------
> Hmm...I tried reverting the change to functional::swap, but all the libstdc++
> tests still pass on x86_64-linux, and I haven't been able to write a failing
> testcase either. Anyone else have a testcase that still fails with 4.5.1pre
> or
> trunk? For instance, this doesn't break when compiled either as C or C++:
>
> union __attribute ((aligned (__alignof (float)))) U { char c[32]; };
That's because the union now effectively uses alias-set zero after
2010-04-15 Richard Guenther <[email protected]>
* alias.c (alias_set_subset_of): Handle alias-set zero
child properly.
which is also a pessimization (because we use alias-set zero for
structs with chars, not only char lvalues).
A testcase that breaks would use a union without a character member
(where you'd still need to copy the object representation).
So like
union { int i; } u,v;
float *f = new (&u) float(0.0;
v = u;
return (float *)&v;
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42832