From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72447 invoked by alias); 6 Apr 2017 18:49:57 -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 71472 invoked by uid 89); 6 Apr 2017 18:49:56 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=understands, confess X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Received: from mail-oln040092065085.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (40.92.65.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Apr 2017 18:49:54 +0000 Received: from DB5EUR01FT058.eop-EUR01.prod.protection.outlook.com (10.152.4.60) by DB5EUR01HT229.eop-EUR01.prod.protection.outlook.com (10.152.5.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1005.5; Thu, 6 Apr 2017 18:49:52 +0000 Received: from AM4PR0701MB2162.eurprd07.prod.outlook.com (10.152.4.51) by DB5EUR01FT058.mail.protection.outlook.com (10.152.5.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.5 via Frontend Transport; Thu, 6 Apr 2017 18:49:52 +0000 Received: from AM4PR0701MB2162.eurprd07.prod.outlook.com ([fe80::a806:64f0:6377:f3ea]) by AM4PR0701MB2162.eurprd07.prod.outlook.com ([fe80::a806:64f0:6377:f3ea%19]) with mapi id 15.01.1019.015; Thu, 6 Apr 2017 18:49:52 +0000 From: Bernd Edlinger To: Florian Weimer , Richard Biener , Jakub Jelinek CC: Jonathan Wakely , GCC Patches , Jason Merrill , Jeff Law Subject: Re: [PATCH] Add a new type attribute always_alias (PR79671) Date: Thu, 06 Apr 2017 18:49:00 -0000 Message-ID: References: <20170405160333.GR4425@redhat.com> <20170405160849.GV17461@tucnak> <20170406075104.GA17461@tucnak> <7d17b3b7-2d38-6184-8bd6-eb9f96f87912@redhat.com> <50936a77-870a-5156-1f5e-b1e0327498b6@redhat.com> <1a0cdc64-3c65-4f2b-427d-8dcb90095cab@redhat.com> In-Reply-To: <1a0cdc64-3c65-4f2b-427d-8dcb90095cab@redhat.com> authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=hotmail.de; x-incomingtopheadermarker: OriginalChecksum:0170407A8B1ADC57B0EC3C9DAC191106FC2B1FBACDB82E46119BABC0FD710AD4;UpperCasedChecksum:BC96C69241515D12C2832D06DB648B7302C641114E548CF756F698CEAD3E7BF8;SizeAsReceived:9170;Count:40 x-ms-exchange-messagesentrepresentingtype: 1 x-microsoft-exchange-diagnostics: 1;DB5EUR01HT229;5:+PvgDztZ60kS5tWtXQELQflelY6DsTkEedqOx/GRh+Q1F8bnBr397PoPhj5FnDJLvjM8oL/0QPBounBMn9UR/M10r95tFw1CnkxOi4beetf387ylEmiPxz/LoR4y8ZDHxATWebY758anHh32+E9c3Q==;24:7cOEmgptBauo411yPHEop90+z3Kmn3Sg/cs3NrRzn2Qc95z5jPm3Z/3a+f/VjqlGTkyyz3v5oPr/ca9b4K9Twwys08i5MzMh79+w8QabNOk=;7:MUmXvWxcCvL52xuuv72qmuHPAsnxHrEmRI4fLGdi/bXSYs2ozaP5ov2o8beWm1DhUQ5K7Ch/sKsvxIl+u1Gv1jcQYj1Ag3+sPSS+ycatqD2tn0bEdG/dCGm3IR4owlIGpEyYV3NU1h8eFT6amJr3Trjl95NCLuKWIoZ/wLnRow7IQ4P2R0vGkZxdDHMLTStJqMy0RdzfVKpg8CGNJZtrfikGlv072MdP8j67WHFfhIaiZICjEnum0hYFzLiG1dqkofVAWINwVqjKDTiBiVg6TwO/g096jgcBpqNyEV2bMTSZmdt+3nYeJ7rsQSG+9DBs x-incomingheadercount: 40 x-eopattributedmessage: 0 x-forefront-antispam-report: EFV:NLI;SFV:NSPM;SFS:(7070007)(98901004);DIR:OUT;SFP:1901;SCL:1;SRVR:DB5EUR01HT229;H:AM4PR0701MB2162.eurprd07.prod.outlook.com;FPR:;SPF:None;LANG:en; x-ms-office365-filtering-correlation-id: 5b3ad918-4a1a-4621-d975-08d47d1db53c x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322274)(1603101448)(1601125374)(1701031045);SRVR:DB5EUR01HT229; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(444000031);SRVR:DB5EUR01HT229;BCL:0;PCL:0;RULEID:;SRVR:DB5EUR01HT229; x-forefront-prvs: 02698DF457 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Apr 2017 18:49:52.3768 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR01HT229 X-SW-Source: 2017-04/txt/msg00323.txt.bz2 On 04/06/17 20:19, Florian Weimer wrote: > > I don't know what your patch does, but your proposed documentation does > not make this valid because =93declared as char=94 is still not =93having= no > declared type=94. Or put differently, =93behaves like a character type= =94 is > not what we actually want here. > What the patch does is just so simple but it is hard for me to find the right words so that really everybody understands: Technically, we already have the may_alias attribute, that forces all access through pointers to have "alias set 0" that in turn makes all other objects volatile, unless the compiler can prove that the address is in fact different. But it has no impact on DECLs, so if you use may_alias on a type, and you declare an object with that type, then directly accessing that object by name does NOT have "alias set 0". When I noticed that in the context of PR79671 I initially thought that was by accident, but Richi pointed out that this is a useful feature for vector types, that are always declared as may_alias, and moreover the may_alias is / has been always documented to have only meaning on pointers, all that changed is that the TBAA aliasing oracle has improved recently to follow the specified behavior more closely. My patch simply duplicates the semantic of may_alias and adds "alias set 0" for accesses through DECLs of that type. However, I must confess I find it difficult to understand the language in which the ISO standard is written. For instance how do you "declare an object without a declared type"? > Let me repeat that I don't know if this is merely a documentation issue. > > Thanks, > Florian