From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by sourceware.org (Postfix) with ESMTPS id D7D573858D38 for ; Tue, 21 May 2024 13:35:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D7D573858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=linux.intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D7D573858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716298559; cv=none; b=jKB6PBVK/t2paXPb5s9whCj5Uo0s0QFmfrnVEw/0CBixvz0O3bu9plFEI4mtd1CTHL1cEkcrp46b5EyAL8sx+O+ogTq+fMgzojGYr/gkB34TFgRNaAlWqBHbYqO3UhHi4Q064KkmQzDtNJPm4ss75X+x0yyKqiTxtjznUA4m16s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716298559; c=relaxed/simple; bh=6Ekz4LrjklFpTkNeVQ1W1tshdQwd4pW0TRvjpHE9SsM=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=QnpQPvMkVQ8b4HhYd/62SrX2jjiK+iz/9mHpcZXezz4gv+ofIBQv61hR0QSkQof+D8dteJRLfSN37SY3lPHeTHidCmwhjXbEB9SUWgGQDMoWfU/Af9yzJx7ZYTiLrGSkwkJtSR9ivWhsJspcnnsFh2rKOxkkqElCEgHTwFmACFA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716298557; x=1747834557; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=6Ekz4LrjklFpTkNeVQ1W1tshdQwd4pW0TRvjpHE9SsM=; b=Pv8eg2sN12kWaElSUjqaHlxKRsPCOB9rZynRilcJZwB3I0AzQIF4dRoE gZDyESVRjC8/wgYrtsvqb029HW5LGr5lxmrPTQY7k6mhPmjIZM9oFLOaP Q4/6FHfZ8iSaG/KcpCxlZwG66IEiFH7YZBrVtkxBnI9DTqwg1A/6Hdxwq A0hsnSy1fk0eTRL1vWvnwoiOG9yKyAzY/48wlLIQ1p4agQOmWcG5aVTc8 8aU2sKQ3+yeH5Crxoi4oEzOj5pHDjx51qqjAF6xcYVZ7KePH91KUHt42u k3oxMctKtbGsiJfliwW7scAGJsq2kt4yZQ4QkUyfsbZmm9iau0x7RKZU0 A==; X-CSE-ConnectionGUID: XMNiTOpwQE6c3B9hYuujcg== X-CSE-MsgGUID: R6c+ZZ7LTYmvQMRKkxrGkg== X-IronPort-AV: E=McAfee;i="6600,9927,11078"; a="12716984" X-IronPort-AV: E=Sophos;i="6.08,177,1712646000"; d="scan'208";a="12716984" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2024 06:35:40 -0700 X-CSE-ConnectionGUID: BTp1huvIQLe5Wbdl0dNs3w== X-CSE-MsgGUID: xB3MmLoTSiu5E7+/b4SoSg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,177,1712646000"; d="scan'208";a="37436543" Received: from tassilo.jf.intel.com (HELO tassilo) ([10.54.38.190]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2024 06:35:40 -0700 Date: Tue, 21 May 2024 06:35:37 -0700 From: Andi Kleen To: Richard Biener Cc: gcc-patches@gcc.gnu.org, nathan@acm.org, josmyers@redhat.com, richard.sandiford@arm.com, jason@redhat.com Subject: Re: [PATCH v5 1/5] Improve must tail in RTL backend Message-ID: References: <20240505181458.2903045-1-ak@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > I can't see how this triggers on the IL above, the loop should have > ignored both the return and the clobber and when recursing to > the predecessor stop before the above check when runnig into the > call? Yes, I tracked that down later. The problem was that there were multiple successors to the BB due to exception handling, which makes the find_tail_calls walker give up. Putting the new pass after ehcleanup fixed that, but there are still cases when ehcleanup cannot get rid of them and then it gives up. musttail checking at expand time still works, but can only give a vague error message. > > > In a optimized build this passes, but with -O0 it always fails > > when the pass is placed before pass_optimizations_g. I assume > > it's some problem with mem ssa form. > > > > Any ideas how to fix that? Otherwise I can restrict musttail to non > > structs. > > I wonder how this works when optimizing? It just doesn't. You need optimization to do tail calls with structs. The only alternative would be to detect the situation and pull in some extra passes. Also even with optimization it only works for structs that fit into registers. This could be maybe fixed, but is out of scope for this patch kit. -Andi