From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67688 invoked by alias); 13 Sep 2018 19:41:15 -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 67662 invoked by uid 89); 13 Sep 2018 19:41:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR02-HE1-obe.outbound.protection.outlook.com Received: from mail-oln040092068097.outbound.protection.outlook.com (HELO EUR02-HE1-obe.outbound.protection.outlook.com) (40.92.68.97) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Sep 2018 19:41:13 +0000 Received: from AM5EUR02FT062.eop-EUR02.prod.protection.outlook.com (10.152.8.51) by AM5EUR02HT184.eop-EUR02.prod.protection.outlook.com (10.152.9.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.1101.10; Thu, 13 Sep 2018 19:41:10 +0000 Received: from VI1PR0701MB2862.eurprd07.prod.outlook.com (10.152.8.52) by AM5EUR02FT062.mail.protection.outlook.com (10.152.9.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.14 via Frontend Transport; Thu, 13 Sep 2018 19:41:10 +0000 Received: from VI1PR0701MB2862.eurprd07.prod.outlook.com ([fe80::854a:328:c580:5fb9]) by VI1PR0701MB2862.eurprd07.prod.outlook.com ([fe80::854a:328:c580:5fb9%3]) with mapi id 15.20.1143.014; Thu, 13 Sep 2018 19:41:10 +0000 From: Bernd Edlinger To: Jeff Law , Martin Sebor , Richard Biener CC: "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH] Check the STRING_CSTs in varasm.c Date: Thu, 13 Sep 2018 19:51:00 -0000 Message-ID: References: <3c743954-cae6-a7b8-3c63-71d170d8e56c@gmail.com> <2f4995e8-b081-54be-54ba-34e6e15effeb@redhat.com> In-Reply-To: <2f4995e8-b081-54be-54ba-34e6e15effeb@redhat.com> received-spf: None (protection.outlook.com: hotmail.de does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=bernd.edlinger@hotmail.de; Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2018-09/txt/msg00723.txt.bz2 On 09/13/18 20:44, Jeff Law wrote: > On 8/24/18 2:18 PM, Bernd Edlinger wrote: >> Hi! >> >> >> This is an alternative approach in making STRING_CST semantics >> consistent. >> >> This means it makes STRING_CST used for literals and for initializers >> use exactly the same semantics. >> >> It makes sure that all STRING_CST have a TYPE_SIZE_UNIT, and that it is >> always larger than TREE_STRING_LENGTH, these and certain other properties >> are checked in varasm.c, so the currently observed consistency issues >> in the middle-end can be resolved. >> >> >> It depends on the following pre-condition patches: > [ ... ] >=20 >> >> [PATCHv2] Handle overlength strings in C++ FE >> https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01567.html > I've committed this patch to the trunk. >=20 Note, however this leaves pr87503.c semi-broken: gcc -fpermissive -x c++ -O2 pr87053.c pr87053.c:11:23: warning: initializer-string for array of chars is too long= [-fpermissive] 11 | } u =3D {{"1234", "567"}}; | ^ $ ./a.out Aborted (core dumped) This would be fixed by the patch I posted earlier today: https://gcc.gnu.org/ml/gcc-patches/2018-09/msg00690.html Thanks Bernd.