From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2057 invoked by alias); 20 May 2010 15:18:50 -0000 Received: (qmail 1814 invoked by alias); 20 May 2010 15:17:48 -0000 Date: Thu, 20 May 2010 15:18:00 -0000 Message-ID: <20100520151747.1813.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/42832] Revisit std::function for aliasing issues and efficiency In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenther at suse dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-05/txt/msg02204.txt.bz2 ------- 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 * 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