From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41930 invoked by alias); 5 Apr 2017 15:20:31 -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 41893 invoked by uid 89); 5 Apr 2017 15:20:31 -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=(unknown) 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; Wed, 05 Apr 2017 15:20:29 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F3CE6ABAF; Wed, 5 Apr 2017 15:20:28 +0000 (UTC) Date: Wed, 05 Apr 2017 15:20:00 -0000 User-Agent: K-9 Mail for Android In-Reply-To: <20170405132832.GS17461@tucnak> References: <20170405132832.GS17461@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] Add a new type attribute always_alias (PR79671) To: Jakub Jelinek ,Bernd Edlinger CC: GCC Patches ,Jason Merrill ,"Marc Glisse ; Jakub Jelinek ; Jonathan Wakely" ,Jeff Law From: Richard Biener Message-ID: X-SW-Source: 2017-04/txt/msg00225.txt.bz2 On April 5, 2017 3:28:32 PM GMT+02:00, Jakub Jelinek wro= te: >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=3D79671 >>=20 >> Therefore I would like to add this now although >> the trunk is already at in stage 4. >>=20 >> 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. Agreed. >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. Yes, I expected it to work like this (didn't look at the patch yet). Richard. > Jakub