From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81667 invoked by alias); 5 Apr 2017 13:28:48 -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 80747 invoked by uid 89); 5 Apr 2017 13:28:47 -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_HELO_PASS autolearn=ham version=3.3.2 spammy=H*i:sk:AM4PR07, HTo:D*hotmail.de X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Apr 2017 13:28:45 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9BCD8680E2; Wed, 5 Apr 2017 13:28:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9BCD8680E2 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9BCD8680E2 Received: from tucnak.zalov.cz (ovpn-116-72.ams2.redhat.com [10.36.116.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 285A67DE55; Wed, 5 Apr 2017 13:28:44 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v35DSeUA030838; Wed, 5 Apr 2017 15:28:40 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v35DSXY4030837; Wed, 5 Apr 2017 15:28:33 +0200 Date: Wed, 05 Apr 2017 13:28:00 -0000 From: Jakub Jelinek To: Bernd Edlinger Cc: GCC Patches , Jason Merrill , "Marc Glisse ; Jakub Jelinek ; Jonathan Wakely" , Richard Biener , Jeff Law Subject: Re: [PATCH] Add a new type attribute always_alias (PR79671) Message-ID: <20170405132832.GS17461@tucnak> Reply-To: Jakub Jelinek References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00218.txt.bz2 On Wed, Apr 05, 2017 at 09:46:09AM +0000, Bernd Edlinger wrote: > this is related to the P1 codegen bug PR79671: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79671 > > Therefore I would like to add this now although > the trunk is already at in stage 4. > > I propose to add a new type attribute always_alias that > works like may_alias but unlike may_alias it should > also make instances alias anything. It is also exposed > in C/C++ as __attribute__((always_alias)). I have just two small comments, for review IMHO want agreement between Jason and Richard on this. One thing is whether it is a good idea to keep this info in the IL as an attribute, especially when you add it automatically in the C++ FE. I see e.g. 25 spare bits in tree_type_common. Don't say we need to waste them, but I'd say in C++ unsigned char arrays are fairly common and thus not having to create the attribute for them each time and look it up might be beneficial. Also, wonder if you need to mark all types containing such arrays, if you couldn't just set that flag in C++ on unsigned char/std::byte arrays (and on anything with that attribute), have that imply alias set 0 on it and then let the rest of alias machinery handle aggregate types containing such fields. Jakub