From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 9F1833856DC2 for ; Thu, 6 Oct 2022 17:26:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9F1833856DC2 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-x42c.google.com with SMTP id u10so3757715wrq.2 for ; Thu, 06 Oct 2022 10:26:23 -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=UeChQin9uCPochsyic8JOVFANh+OrkvKuiCaYgJM8O8=; b=WXqdXWiB9J3jBkokcX0dFTJI9KcarHQvqBwFBBO57NV2TxDqqf7+fv0TKkP5hprF7E tG4tOGkBZYlj1chUeC1H6mBNEcicpK8h+ekPXhohpi5fEUUw6YDlEl9vqCOCJe6ic0D9 lWDibBH8Ln6pj9URKwvg+I10O+Iz0bV2YuOFk3sy2ffh/SydyQ+XNVFrFF3u8ZZeApwb xGdv+Gwtzc3oO29UASHeg3y8YvVpfIJ3U+ABsIrBde5WYKu3tFnbQQBBPMeo4D0A5/2e t6NwTIfk7PdeYak5Pfp7NLBZ7l+OkxdimI/CVf3nVeK6Ky45TrqqBWdc6otnuEZAbhfK eF4g== 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=UeChQin9uCPochsyic8JOVFANh+OrkvKuiCaYgJM8O8=; b=4lE3wV2bcXR1jMqVtuaFEFl4UO54HT+a/s4fwwT339LEizz3Ssb6ESVSHbsmzdq2B3 uhjW4nDqxznek47yHesuauBWWlwAiMDcjUN3jNDEXM3nd5+Lqq8N00rSPeMV37Z0gh/S xXA5grBn16beXuQf9Ldc3rwiAn5KPeZtFbcsnf+bv4yTriQ0CXBAJb6seMXXK1xltqi5 c1d9SY+3CBKVIu5E4jArt8CwLWrSMdbKDotoRZYBezFhDxm/7QmXggbzFcIAQUb5FY01 bgODiRz57bdsawHWFplrypyPAH/tYlxf7TO37y6m01HUdyvjapGZz8K1qw5Tt6W5c1jR QzrA== X-Gm-Message-State: ACrzQf3dnYl+AO/o92HV4qoROviFOvM4gmSbxdsHjm+12SHE0psHy3nC fy08oRSyW+cZhRxY/GEHHKGG85V5EPsOuQ== X-Google-Smtp-Source: AMsMyM7RfMrClgVJElt8npgCkXmzbadWWvuCOpbpyUGFR+UHf4PEfTKqLJdf00RbwzyYjZayC/wUFw== X-Received: by 2002:adf:d1c2:0:b0:22e:6499:3137 with SMTP id b2-20020adfd1c2000000b0022e64993137mr731810wrd.658.1665077182320; Thu, 06 Oct 2022 10:26:22 -0700 (PDT) Received: from fomalhaut.localnet ([2a01:e0a:8d5:d990:e654:e8ff:fe8f:2ce6]) by smtp.gmail.com with ESMTPSA id g6-20020a5d4886000000b0022cc6b8df5esm5298wrq.7.2022.10.06.10.26.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 10:26:21 -0700 (PDT) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [PATCH] Reduce DF computation at -O0 Date: Thu, 06 Oct 2022 19:25:53 +0200 Message-ID: <2601473.BddDVKsqQX@fomalhaut> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart1758408.TLkxdtWsSY" Content-Transfer-Encoding: 7Bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,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. --nextPart1758408.TLkxdtWsSY Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi, even at -O0 there may be a fair amount of DF computation performed when compiling large units and part of it appears to be useless. Bootstrapped/regtested on x86-64/Linux, OK for the mainline? 2022-10-06 Eric Botcazou * function.cc (thread_prologue_and_epilogue_insns): Update only entry and exit blocks when not optimizing. Remove dead statement. -- Eric Botcazou --nextPart1758408.TLkxdtWsSY 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/function.cc b/gcc/function.cc index 5498a712c4a..6474a663b30 100644 --- a/gcc/function.cc +++ b/gcc/function.cc @@ -6249,10 +6249,15 @@ thread_prologue_and_epilogue_insns (void) } } - /* Threading the prologue and epilogue changes the artificial refs - in the entry and exit blocks. */ - epilogue_completed = 1; - df_update_entry_exit_and_calls (); + /* Threading the prologue and epilogue changes the artificial refs in the + entry and exit blocks, and may invalidate DF info for tail calls. */ + if (optimize) + df_update_entry_exit_and_calls (); + else + { + df_update_entry_block_defs (); + df_update_exit_block_uses (); + } } /* Reposition the prologue-end and epilogue-begin notes after --nextPart1758408.TLkxdtWsSY--