From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id ABCE73857804 for ; Sun, 20 Sep 2020 06:15:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ABCE73857804 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=hubicka@kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id D5C14282AC6; Sun, 20 Sep 2020 08:15:51 +0200 (CEST) Date: Sun, 20 Sep 2020 08:15:51 +0200 From: Jan Hubicka To: David =?iso-8859-2?Q?=C8epel=EDk?= Cc: gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Re: New modref/ipa_modref optimization passes Message-ID: <20200920061551.GA29500@kam.mff.cuni.cz> References: <157394261677.27454.2367573047582814412@a285.localdomain> <20200919223255.GA69342@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200919223255.GA69342@kam.mff.cuni.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-16.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2020 06:15:57 -0000 Hi, this is patch I am using to fix the assumed_alias_type.f90 failure by simply arranging alias set 0 for the problematic array descriptor. I am not sure this is the best option, but I suppose it is better than setting all array descritors to have same canonical type (as done by LTO)? Honza * trans-types.c (gfc_get_array_type_bounds): Set alias set to 0 for arrays of unknown element type. diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 26fdb2803a7..bef3d270c06 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -1903,6 +1903,12 @@ gfc_get_array_type_bounds (tree etype, int dimen, int codimen, tree * lbound, base_type = gfc_get_array_descriptor_base (dimen, codimen, false); TYPE_CANONICAL (fat_type) = base_type; TYPE_STUB_DECL (fat_type) = TYPE_STUB_DECL (base_type); + /* Arrays of unknown type must alias with all array descriptors. */ + if (etype == ptr_type_node) + { + TYPE_ALIAS_SET (base_type) = 0; + TYPE_ALIAS_SET (fat_type) = 0; + } tmp = TYPE_NAME (etype); if (tmp && TREE_CODE (tmp) == TYPE_DECL)