From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102164 invoked by alias); 11 Apr 2017 07:37:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 102142 invoked by uid 89); 11 Apr 2017 07:37:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Apr 2017 07:37:23 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A41FBAC19; Tue, 11 Apr 2017 07:37:22 +0000 (UTC) Date: Tue, 11 Apr 2017 07:37:00 -0000 From: Richard Biener To: Pedro Alves cc: Jason Merrill , Bernd Edlinger , Jakub Jelinek , Jonathan Wakely , Florian Weimer , GCC Patches , Jeff Law Subject: Re: [PATCH] Add a new type attribute always_alias (PR79671) In-Reply-To: Message-ID: References: <20170405160333.GR4425@redhat.com> <20170405160849.GV17461@tucnak> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2017-04/txt/msg00505.txt.bz2 On Mon, 10 Apr 2017, Pedro Alves wrote: > On 04/10/2017 01:50 PM, Richard Biener wrote: > > > +void *operator new(__SIZE_TYPE__, void *p2) { return p2; } > > +struct B { B(int i_) : i(i_) {} int i; }; > > +struct X > > +{ > > + unsigned char buf[sizeof (B)]; > > +}; > > Pedantically, shouldn't there be something here to enforce > X's alignment to be at least the same as B's ? > > > + > > +int __attribute__((noinline)) foo() > > +{ > > + X x, y; > > + new (&x) B (0); Right. I'll do X x alignas(B), y alignas(B); Meanwhile need to debug a LTO bootstrap failure caused by the patch. Richard.