From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id AD7D13858412 for ; Mon, 24 Oct 2022 08:25:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AD7D13858412 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x42d.google.com with SMTP id z14so1378454wrn.7 for ; Mon, 24 Oct 2022 01:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=yqw0Z3ADNpRe3TNDLN8Pn4sHUIcreaWh1PCuNxrw2qA=; b=eqMSGUaeiwTybELvmDtQrwkQnoMoZ5fl8SeMkOlI/J+AziTDIIcFUxVYEcLcBSkgM+ jlQLn4srvGsydhPl7PzoP3EhcTpC1jjAkxZKH+hxyY/nkaY5irLquAESM0RytPt9qQUH WBaVK9MKYy35WmHDBSYq4IUOhgBb+A1rmzNB13aKTWVbHz1f8eYLCKXZeLyghyvKXlH8 0AQvQelAMPs/hYNwLHuY5wnDJVuwzYwB/zs96VkIiRklpZBPAHZd75WYyFdFMMN1QIOE Xq8Da/A42F7ozULiMdrYBL+EzW4U36wlnXG2fii9kNP/ZljYLUAPISgURSLpuVLUweAh APEg== 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=yqw0Z3ADNpRe3TNDLN8Pn4sHUIcreaWh1PCuNxrw2qA=; b=TJw7YkGSJgOLSk9VdIXmb/M3y5HO6Fv7CKjC1yqCvKtXkSlNXlErCzuGeYM0bqETdG gp9quPVyLkKWBcCRB5YOyKzsDf18TWmGDvn+YYrFxcatqKZV9eZQ9qXM7VWFEvAn50AD wi76qkpHghRNw5P9OV5xpjTolxH/1mlY9LIpQwOC6uOMvbCpMDymlK7rkigLUVCNOuVm cdThK2++e4H2NrU3k3s+78Sxzk2zXrCKtyGmyzh5G7rE0+gx2xlddsqH5yYlg53LKu7U xrMQ/EIoou9PAyFcE7tZTVZqlsj4R3oTs3jqSsBEQYlWspSrZZhRd8LQMpxgJKv20aFK fvKQ== X-Gm-Message-State: ACrzQf0r3/jh+GEMauepA6pDupVJOF5KFY1E/YDpgmebLmljZzbxcgNS YHbr7XtOxxeaEW0HxV/HhLuojezE+7KODg== X-Google-Smtp-Source: AMsMyM4PkN6ao3zmj4q+BJ75i+VryJx56SbrvV6y5dxlpMwgAyoP09COqen4i9EpI1SGfQ+Q7266gw== X-Received: by 2002:a5d:668e:0:b0:22f:d914:80ed with SMTP id l14-20020a5d668e000000b0022fd91480edmr20593233wru.45.1666599912454; Mon, 24 Oct 2022 01:25:12 -0700 (PDT) Received: from fomalhaut.localnet ([2a01:e0a:8d5:d990:e654:e8ff:fe8f:2ce6]) by smtp.gmail.com with ESMTPSA id d4-20020a05600c3ac400b003c64c186206sm10206483wms.16.2022.10.24.01.25.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 01:25:11 -0700 (PDT) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [PATCH] Relax assertion in profile.cc Date: Mon, 24 Oct 2022 10:25:10 +0200 Message-ID: <1910003.PYKUYFuaPT@fomalhaut> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart21647293.EfDdHjke4D" Content-Transfer-Encoding: 7Bit X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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: This is a multi-part message in MIME format. --nextPart21647293.EfDdHjke4D Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi, this assertion in branch_prob: if (bb == ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb) { location_t loc = DECL_SOURCE_LOCATION (current_function_decl); gcc_checking_assert (!RESERVED_LOCATION_P (loc)); had been correct until: 2021-08-11 Bernd Edlinger PR debug/101598 * gcc-interface/trans.c (Subprogram_Body_to_gnu): Set the DECL_SOURCE_LOCATION of DECL_IGNORED_P gnu_subprog_decl to UNKNOWN_LOCATION. was installed. Tested on x86-64/Linux, OK for mainline and 12 branch? 2022-10-24 Eric Botcazou * profile.cc (branch_prob): Be prepared for ignored functions with DECL_SOURCE_LOCATION set to UNKNOWN_LOCATION. 2022-10-24 Eric Botcazou * gnat.dg/specs/coverage1.ads: New test. -- Eric Botcazou --nextPart21647293.EfDdHjke4D Content-Disposition: attachment; filename="p.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="utf-8"; name="p.diff" diff --git a/gcc/profile.cc b/gcc/profile.cc index 96121d60711..1527a04124f 100644 --- a/gcc/profile.cc +++ b/gcc/profile.cc @@ -1457,11 +1457,13 @@ branch_prob (bool thunk) if (bb == ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb) { location_t loc = DECL_SOURCE_LOCATION (current_function_decl); - gcc_checking_assert (!RESERVED_LOCATION_P (loc)); - seen_locations.add (loc); - expanded_location curr_location = expand_location (loc); - output_location (&streamed_locations, curr_location.file, - MAX (1, curr_location.line), &offset, bb); + if (!RESERVED_LOCATION_P (loc)) + { + seen_locations.add (loc); + expanded_location curr_location = expand_location (loc); + output_location (&streamed_locations, curr_location.file, + MAX (1, curr_location.line), &offset, bb); + } } for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) --nextPart21647293.EfDdHjke4D Content-Disposition: attachment; filename="coverage1.ads" Content-Transfer-Encoding: 7Bit Content-Type: text/x-adasrc; charset="utf-8"; name="coverage1.ads" -- { dg-do compile } -- { dg-options "-ftest-coverage" } package Coverage1 is type Rec is record I : Integer := 0; end record; end Coverage1; --nextPart21647293.EfDdHjke4D--