From patchwork Tue Nov 1 01:23:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1697601 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=dxS7/yT9; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N1XP91kHRz23lC for ; Tue, 1 Nov 2022 12:24:29 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B9B5F3857687 for ; Tue, 1 Nov 2022 01:24:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9B5F3857687 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667265866; bh=QxnbToUTwpcnPgXWi3DBvWHxQbYyfRqKWbhIpd69vqs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=dxS7/yT9IAdijw7Fs40/83CKfGELApl9/YvVrsvGbADfdfDzbjxltsUzg1RfLuJpJ 2xkT9gVKNCMc3ZEly4sYhkSN7COPxHsJXJvDyqppfotZiiI7b/zvwoIhVp7G6g6UBr LSEyp7qrRHj+PGg1kHGWTTIsdNA49ltdBGYfHEks= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 6E2723857680 for ; Tue, 1 Nov 2022 01:23:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6E2723857680 Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-593-iBn5rKIbPhGAOfmx10FzoQ-1; Mon, 31 Oct 2022 21:23:49 -0400 X-MC-Unique: iBn5rKIbPhGAOfmx10FzoQ-1 Received: by mail-qv1-f71.google.com with SMTP id g12-20020a0cfdcc000000b004ad431ceee0so6786703qvs.7 for ; Mon, 31 Oct 2022 18:23:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QxnbToUTwpcnPgXWi3DBvWHxQbYyfRqKWbhIpd69vqs=; b=cYaJInV0nA/gDGunbXm/Z1pP1oqm9Dgy89CFwQY36T30dexmCVfk3m6AgzALem8KHB hjhJuQOCebnheXg+ISDNF2QVPgMFLUm1d+iPdILAw/9kHHJZvgIAyLYFegFCi+ZcEkzg zAY9ZnBCpI8EnZOSVp+H1QxE2vxl6MUEYMA+ggzSDS5u1pzmsdmgZCHQ0juelSeR3Vb5 Lxjb/iwHLUIILaNcnWP7VaMeoPViIcfyzsdnXVvYwEBJ3IYZDThkt1qMPlz81bpYLVqw DVj6Ku8ZnYHlDu2veXPerskSct4F/Zxh5Jm4MJX3/Wcdkx1LNHsf1vqLTvsy7JHfUfRB B11w== X-Gm-Message-State: ACrzQf1QE/2jbRrfoXmZz+5cuAAnu3mS2tGKuKpbX8nzHrmDr0V347tO X5Us5S3/UtvpHuOVVr18HRVVgmqU5nkF0w/g0imB6FSg47Kcr0F/b9ZwKjZLUiUuH3F7O+wY/7f 7q4rTjpB6Yiu/MudD6GTb7TvA7toUqhe1QlOtzjxHP4eajRNLjA4joOxqg+JVqsspsw== X-Received: by 2002:ac8:7dcc:0:b0:3a5:247:e1bd with SMTP id c12-20020ac87dcc000000b003a50247e1bdmr13210895qte.107.1667265828655; Mon, 31 Oct 2022 18:23:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5yyHvq/RoP5s/ctwJCDnhT6rJmVyY/WBV/kOhNfuiH8A7HEhEKruwk2vFvtk89UmCHi2U1Uw== X-Received: by 2002:ac8:7dcc:0:b0:3a5:247:e1bd with SMTP id c12-20020ac87dcc000000b003a50247e1bdmr13210879qte.107.1667265828278; Mon, 31 Oct 2022 18:23:48 -0700 (PDT) Received: from barrymore.redhat.com (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id m8-20020a05620a290800b006ce40fbb8f6sm5839632qkp.21.2022.10.31.18.23.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 18:23:47 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: set TREE_NOTHROW after genericize Date: Mon, 31 Oct 2022 21:23:44 -0400 Message-Id: <20221101012344.1456215-1-jason@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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 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-Patchwork-Original-From: Jason Merrill via Gcc-patches From: Jason Merrill Reply-To: Jason Merrill Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- genericize might introduce function calls (and does on the contracts branch), so it's safer to set this flag later. gcc/cp/ChangeLog: * decl.cc (finish_function): Set TREE_NOTHROW later in the function. --- gcc/cp/decl.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) base-commit: 6a1f27f45e44bcfbcc06a1aad74bb076e56eda36 diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 87cb7a6c3a4..6e98ea35a39 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -17867,14 +17867,6 @@ finish_function (bool inline_p) finish_fname_decls (); - /* If this function can't throw any exceptions, remember that. */ - if (!processing_template_decl - && !cp_function_chain->can_throw - && !flag_non_call_exceptions - && !decl_replaceable_p (fndecl, - opt_for_fn (fndecl, flag_semantic_interposition))) - TREE_NOTHROW (fndecl) = 1; - /* This must come after expand_function_end because cleanups might have declarations (from inline functions) that need to go into this function's blocks. */ @@ -18099,6 +18091,14 @@ finish_function (bool inline_p) && !DECL_OMP_DECLARE_REDUCTION_P (fndecl)) cp_genericize (fndecl); + /* If this function can't throw any exceptions, remember that. */ + if (!processing_template_decl + && !cp_function_chain->can_throw + && !flag_non_call_exceptions + && !decl_replaceable_p (fndecl, + opt_for_fn (fndecl, flag_semantic_interposition))) + TREE_NOTHROW (fndecl) = 1; + /* Emit the resumer and destroyer functions now, providing that we have not encountered some fatal error. */ if (coro_emit_helpers)