From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64226 invoked by alias); 10 Apr 2017 15:31:08 -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 58190 invoked by uid 89); 10 Apr 2017 15:30:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1557 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; Mon, 10 Apr 2017 15:30:55 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C1F2CABA2; Mon, 10 Apr 2017 15:30:52 +0000 (UTC) Date: Mon, 10 Apr 2017 15:31:00 -0000 From: Richard Biener To: Jason Merrill cc: 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/msg00456.txt.bz2 On Mon, 10 Apr 2017, Jason Merrill wrote: > On Mon, Apr 10, 2017 at 8:50 AM, Richard Biener wrote: > > So here's my variant of a fix. I constrained the new flag > > TYPE_TYPELESS_STORAGE to arrays and thus hope my localized fix in > > build_cplus_array_type will suffice (if I have time I'll play with > > template instantiation). > > Looks good. I would expect this to just work with templates, but it > should of course be tested. In particular, std::aligned_storage needs > to work. The libstdc++ testsuite passes... (of course it did before as well). I'll experiment with some trivial bits tomorrow. > > * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE > > for arrays of unsigned char or std::byte. > > I think it would be good to have a flag to select whether these > semantics apply to any char variant and std::byte, only unsigned char > and std::byte, or only std::byte. Any suggestion? Not sure we really need it (I'm hesitant to write all the testcases to verify it actually works). Meanwhile re-testing with the following hunk to fix some LTO fallout. Richard. Index: gcc/tree.h =================================================================== --- gcc/tree.h (revision 246808) +++ gcc/tree.h (working copy) @@ -4914,7 +4917,7 @@ inline bool canonical_type_used_p (const_tree t) { return !(POINTER_TYPE_P (t) - || TREE_CODE (t) == ARRAY_TYPE + || (TREE_CODE (t) == ARRAY_TYPE && ! TYPE_TYPELESS_STORAGE (t)) || TREE_CODE (t) == VECTOR_TYPE); }