From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28306 invoked by alias); 13 Sep 2018 21:44:09 -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 28294 invoked by uid 89); 13 Sep 2018 21:44:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KAM_SHORT,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Thu, 13 Sep 2018 21:44:06 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A42D230024C4; Thu, 13 Sep 2018 21:44:05 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-75.rdu2.redhat.com [10.10.112.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34DCB5D9C8; Thu, 13 Sep 2018 21:44:03 +0000 (UTC) Subject: Re: [PATCH] Check the STRING_CSTs in varasm.c To: Bernd Edlinger , Martin Sebor , Richard Biener Cc: "gcc-patches@gcc.gnu.org" References: <3c743954-cae6-a7b8-3c63-71d170d8e56c@gmail.com> From: Jeff Law Openpgp: preference=signencrypt Message-ID: Date: Thu, 13 Sep 2018 22:02:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00728.txt.bz2 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: > > [PATCH] Use complete_array_type on flexible array member initializers > https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01538.html > > PATCHv2] Call braced_list_to_string after array size is fixed > https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01565.html > > [PATCHv2] Handle overlength strings in the C FE > https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01566.html > > [PATCHv2] Handle overlength strings in C++ FE > https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01567.html > > [PATCHv2] Handle overlength string literals in the fortan FE > https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01568.html > > The Ada and GO patches are no longer necessary. > > > Bootstrapped and reg-tested on x86_64-pc-linux-gnu. > Is it OK for trunk? > > > Thanks > Bernd. > > > patch-varasm-v2.diff > > 2018-08-24 Bernd Edlinger > > * varasm.c (compare_constant): Compare type size of STRING_CSTs. > (get_constant_size): Don't make STRING_CSTs larger than they are. > (check_string_literal): New check function for STRING_CSTs. > (output_constant): Use it. The prereqs above are all installed and I've installed this patch. We've still got the pr87053 regression, but I'll commit a fix for that momentarily. Jeff