From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53453 invoked by alias); 19 Apr 2017 05:58:28 -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 16851 invoked by uid 89); 19 Apr 2017 05:57:34 -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_HELO_PASS autolearn=ham version=3.3.2 spammy=surprise 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; Wed, 19 Apr 2017 05:56:36 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 44DF065CEF; Wed, 19 Apr 2017 05:56:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 44DF065CEF Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 44DF065CEF Received: from tucnak.zalov.cz (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB91419219; Wed, 19 Apr 2017 05:56:36 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v3J5uYxx029360; Wed, 19 Apr 2017 07:56:34 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v3J5uUJg029359; Wed, 19 Apr 2017 07:56:30 +0200 Date: Wed, 19 Apr 2017 06:20:00 -0000 From: Jakub Jelinek To: Richard Biener Cc: Jason Merrill , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix TYPE_TYPELESS_STORAGE handling (PR middle-end/80423) Message-ID: <20170419055630.GC1809@tucnak> Reply-To: Jakub Jelinek References: <20170418151430.GZ1809@tucnak> <23D6ECD4-AA6B-4139-8E16-C9142B90B66D@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23D6ECD4-AA6B-4139-8E16-C9142B90B66D@suse.de> User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00816.txt.bz2 On Wed, Apr 19, 2017 at 07:45:36AM +0200, Richard Biener wrote: > >As mentioned in the PR, we now use TYPE_TYPELESS_STORAGE flag on > >ARRAY_TYPEs to denote types that need the special C++ alias handling. > >The problem is how is that created, we just use build_array_type and > >set TYPE_TYPELESS_STORAGE on the result, but build_array_type uses type > >caching, so we might modify that way some other array type. > >If all the array type creation goes through build_cplus_array_type, > >that > >wouldn't be a problem, as that flag is dependent just on the element > >type, but that is not the case, c-family as well as the middle-end has > >lots of spots that also create array types. So in the end whether > >one gets TYPE_TYPELESS_STORAGE flag or not is quite random, depends on > >GC etc. > > > >The following patch attempts to resolve this, by making the type > >hashing > >take that flag into account. Bootstrapped/regtested on x86_64-linux > >and > >i686-linux, ok for trunk? > > When changing the C++ function I thought that calling build_array_type was > wrong and it should instead do the same it does in the other places, use > its raw creation routine and then the canonical type register stuff. But > I was hesitant to change this at this point. The problem is that as the patch shows, we don't need it in a single place (the C++ FE), but at least in two places (C++ FE and c-family), and it wouldn't surprise me if we don't need it later on in further places (e.g. in middle-end, if we have a TYPE_TYPELESS_STORAGE array and say DSE wants to create a smaller one with the same property). Using a default argument to build_array_type is likely cleaner indeed, I'd just then also swap the arguments to build_array_type_1 (the shared vs. typeless_storage). Jakub