From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75767 invoked by alias); 4 Aug 2018 16:06:32 -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 75758 invoked by uid 89); 4 Aug 2018 16:06:31 -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=forgot X-HELO: EUR02-HE1-obe.outbound.protection.outlook.com Received: from mail-oln040092068020.outbound.protection.outlook.com (HELO EUR02-HE1-obe.outbound.protection.outlook.com) (40.92.68.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 04 Aug 2018 16:06:30 +0000 Received: from AM5EUR02FT022.eop-EUR02.prod.protection.outlook.com (10.152.8.51) by AM5EUR02HT202.eop-EUR02.prod.protection.outlook.com (10.152.9.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1038.3; Sat, 4 Aug 2018 16:06:26 +0000 Received: from AM5PR0701MB2657.eurprd07.prod.outlook.com (10.152.8.60) by AM5EUR02FT022.mail.protection.outlook.com (10.152.8.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.1038.3 via Frontend Transport; Sat, 4 Aug 2018 16:06:26 +0000 Received: from AM5PR0701MB2657.eurprd07.prod.outlook.com ([fe80::b1fe:1b4f:88c3:5243]) by AM5PR0701MB2657.eurprd07.prod.outlook.com ([fe80::b1fe:1b4f:88c3:5243%9]) with mapi id 15.20.1017.010; Sat, 4 Aug 2018 16:06:26 +0000 From: Bernd Edlinger To: Olivier Hainque CC: "gcc-patches@gcc.gnu.org" , Richard Biener , Eric Botcazou , Arnaud Charlet , Jakub Jelinek Subject: Re: [PATCH] Handle not explicitly zero terminated strings in merge sections Date: Sat, 04 Aug 2018 16:06:00 -0000 Message-ID: References: <7D840828-B2C9-4C20-BFE9-57249E324ED3@adacore.com> In-Reply-To: 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-08/txt/msg00342.txt.bz2 Aehm, I forgot the Fortran FE patch which is also a pre-condition (at least for building with all languages): [PATCH] Create internally nul terminated string literals in fortan FE https://gcc.gnu.org/ml/fortran/2018-08/msg00000.html Thanks Bernd. On 08/04/18 17:44, Bernd Edlinger wrote: > Again, with patch.... >=20 > On 08/04/18 17:43, Bernd Edlinger wrote: >> Hi! >> >> >> This patch is inspired by Olivier's feedback to my previous patch on the >> zero-termination of Ada STRING_CST. >> >> The idea is that strings that do not have embedded nul characters _and_ >> do not happen to be zero-terminated in the DECL_UNIT_SIZE, are currently >> not in the merge string sections.=A0 To be in the merge string section >> they need a terminating nul character, that gets written directly >> in varasm while assembling the string constant.=A0 This patch uses >> the new string properties that my previous patch series implements, >> and is based on the other patches here: >> >> [PATCH] Check the STRING_CSTs in varasm.c >> https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00331.html >> >> [PATCH] Handle overlength strings in the C FE >> https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00142.html >> >> [PATCH] Handle overlength strings in C++ FE >> https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00045.html >> Approved: https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00105.html >> >> [PATCH] Make GO string literals properly NUL terminated >> https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01931.html >> >> [PATCH] [Ada] Make middle-end string literals NUL terminated >> https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01929.html >> >> >> The existing test case gcc.dg/merge-all-constants-1.c >> contains two overlength strings that get now stripped down >> by the C FE, and look in the middle end exactly like normal >> Ada, Fortran or Go strings.=A0 And get now allocated >> in the merge.str section, unless they have an embedded >> nul character, which I changed to make the test pass again. >> >> Olivier, could you add test cases from the Ada side to this? >> >> >> Bootstrapped and reg-tested on x86_64-pc-linux-gnu. >> Is it OK for trunk (after all pre-condition patches >> are approved/committed)? >> >> >> Thanks >> Bernd.