From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by sourceware.org (Postfix) with ESMTPS id 1C3733858C35 for ; Tue, 14 May 2024 17:08:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1C3733858C35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1C3733858C35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::133 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715706532; cv=none; b=cgH2/yhrzSi11ixE/ClZ9mY/mwmWNrm9enA5/16EfA7weCtNEyFxZUYqej8Y6tzI9VBLr0nTWzNa2iCLp9YjA2YgOYrhIW/5mQxsl8HBthgsl7UxWO3+/Xq+qbDBJX084iM30Zs8dSZBswhBb+RThEasYjosusD9oEGpmWoeurk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715706532; c=relaxed/simple; bh=sqPjOoMzh9Gv3L44YE9ehkxkSA++ZlwMrQMdZ3z36GM=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=BRLYUGPK4INGUTacnUX2WngTfNfJEd4VsSTR3BzfPRjW39MqwmLFLt1thL/LqUwd83BAvGv23HMrQ8HNSut+7pLf/Fr06//4GYCRFMF6h7Mhaxa0TE11lGEqFp0f5lmBPFoVcdMHc3HXRCkF4hxWEDSYQ9VzFfMb0ddXVMPh6xA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-520f9d559f6so6887906e87.3 for ; Tue, 14 May 2024 10:08:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715706529; x=1716311329; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=WJxTmz5ozRQg2Z7vfifuseobFGEwWxAQ/eW9zxt1ROY=; b=EaxH0xYswfHCsNQYQocwhZwadrhWYGoSTMY2s7ayADvhjN9A1v13qHTNJaOHTyqrvm zu8uJ6IDDmK7tww5R0lFwry/mUzcraMOBVvsjtZq0BZ4GSyg4q/nCXfu9yTyfYZPv8kT EocYVT8NwRiSAfTPKaRIXO3uBjnYKmTG78b/E9V0bJkAwHNuvKKSUn55Hc7+MZ0gRwfH VcYa58TPJnrEJMM2CSumfxSIbdgnUGOyOpee7I4xaL58FcKI1D2vj7H2ZT8QjbS6TBP5 212Q2JSAy+ZK0rik7WDdizDyXBqrPoqMsmOvo6+4k/+6yCwCAknqLMifmZE0z5lz9N13 h1Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715706529; x=1716311329; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WJxTmz5ozRQg2Z7vfifuseobFGEwWxAQ/eW9zxt1ROY=; b=InP+wovvISmDkCUMu1043NU2wX5AtY76Jjgg/HkbYjyQSP/gJ5XyDVrceJ5rsVUH4y ePcKNPJL04ThcZH/gBsVr/HSbtXhxVaXIqNsWCmDV5JkwPTwHMaGLCg9jyG/RxJZFC/g KcuzEOABr0BUMVxh/YTIUXsxpE4LUYMpAUTB8rOhP+AlocggFbP8GrH38WuVkZTgtmKY jgs1lVpMOL+xrCkmMcfQgQvTsxzzUHrAV2VPVlcp4GmfQPUfRB8ZYixppDVnEhgrZmwB lnNIK8aGsi+7wxwZUR+I7BAlSkgthELKjam0cjRv84cXtoX5ANeOpL8uZpurPoi6N9bp iC1A== X-Gm-Message-State: AOJu0Yxki/65EiCp2erQ2CAxWfJNquYb5Gxf6GQuuONFbWHJnh1iX/6p /Mdn13p5eKb/qg1nlEUcBKLkHLEJlwVfEyr/8I7w/yE1fWNi01reUIefe0BTeZegKLZyW1xPGG0 mEtQ0zsRUeM9il7Wt2uT4Pm8ZebY= X-Google-Smtp-Source: AGHT+IFOBhoSLBH2yh97hgEVYPoFtCzKp0uev3CdWS+8w2n8gI9eFZVrS52DFytR7E0C1StdQ98Fc+JLW8JHPsF2URQ= X-Received: by 2002:ac2:4e11:0:b0:518:b4a3:dee1 with SMTP id 2adb3069b0e04-5221006cd87mr10050344e87.66.1715706529027; Tue, 14 May 2024 10:08:49 -0700 (PDT) MIME-Version: 1.0 References: <20240505181458.2903045-1-ak@linux.intel.com> <20240505181458.2903045-5-ak@linux.intel.com> In-Reply-To: From: Richard Biener Date: Tue, 14 May 2024 19:08:38 +0200 Message-ID: Subject: Re: [PATCH v5 5/5] Add documentation for musttail attribute To: Andi Kleen Cc: gcc-patches@gcc.gnu.org, nathan@acm.org, josmyers@redhat.com, richard.sandiford@arm.com, jason@redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: On Tue, May 14, 2024 at 6:30=E2=80=AFPM Andi Kleen wro= te: > > > Looks generally OK though does this mean people can debug > > programs using [[gnu::musttail]] only with optimized builds? It > > seems to me we should try harder to make [[gnu::musttail]] work > > at -O0 and generally behave the same at all optimization levels? > > Yes that's a fair point. The problem is tree-tailcall failing, > not the RTL backend. Have to see what it would take to fix. I would > prefer to do this as a followon patch though. Btw, -Og also doesn't run the tail-calls pass. I think we should at least try to run the pass at -Og and -O0 somewhere before pass_expand and in find_tail_calls simply only consider the musttail annotated calls in this case? It should be reasonably cheap to walk the return stmts of each function. I'm not sure why we run pass_tail_calls so "early" and within the regular post-IPA optimization pipeline rather than in the pre-expand set of passes common to all optimization levels. Possibly simply moving the pass works out already. Richard. > > -Andi