From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667265832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QxnbToUTwpcnPgXWi3DBvWHxQbYyfRqKWbhIpd69vqs=; b=O4aCWGMzj7SXwK39W0goPVVAwMUj3SgCRP/mAAyw/unlqFJtgtnjCEi2zCMcpF2RVJZnC9 XidsQ4LKL6RnvGXrvMLoSuC1Nqdj+eqgJIBQ0dEmp8X2EShA7AAtK4utOUwPYrb3KeM+mk kZcGYeRt7GgNtwmRDV+s24S03/Hv9eM= 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) From: Jason Merrill 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 List-Id: 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(-) 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) base-commit: 6a1f27f45e44bcfbcc06a1aad74bb076e56eda36 -- 2.31.1