From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 5A70D3852A68 for ; Thu, 8 Dec 2022 11:33:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5A70D3852A68 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-x436.google.com with SMTP id u12so1249167wrr.11 for ; Thu, 08 Dec 2022 03:33:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h/lbhGOeqpCaudQ934gEKilm+MLGZ6T27z1YzEdpwPA=; b=QZR6G4WHg3q8YArJWwFxaS58lu2Xmg/CZRs5mIfLr4r50vffaJXA/HS3AEpxD8ipTY kv5w/MT2oESt6U0gqpZEuQS72An9aowYgUbFABHYjlpLIDL1V9np39q6f11Kx5zhqfxT iAo50VVrDMISoUswcKoSd7rCOPnzEAHC7jcVAqhAiC41mldAwMy36wgQefMMannGNKXB kpnvXkGD8TKA4nkNbUq2wxH6kaRNSH0LEvEE4KYmrpigaAUIQEaRRxfHoqt6XHHmRhzd pqbWrEz/Frp5Y7EDQX9cB15cChLy5ilb81VaQDPJD7xtXgtjE3jpe9huIqnrqnf+dmK4 bzuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h/lbhGOeqpCaudQ934gEKilm+MLGZ6T27z1YzEdpwPA=; b=I/FbnGgHrDuKwFSc6N+jefsPWe6jaarXSU8ti35Xs+jpJmLp1v1W0glWvJ2V3ECRCX 6fVDy2PqnvYFtp0l24FeTgrCqBCFqHXUzqA0auiF+5A71aWi9xVIDFNUqEoHAqd9wv78 F/c2JTMt0MwBYrheJDTcZy6kyEvejJwJriaW3MEtDJIoBKDx0L76uB0xNfgpOlTJWI3o ObsyX6gnReEILeUv5xM3T1L4L3QFk/nR2+aoQA5sx3wzz4d02GUIBMn24CsWc2gsNriG 9jn19Dqxd2eF5vvuMXUE8VJVTLXCguYP9TChA/g7aBGxLh136TRSdsGFqyWXEvKZsRWO Xwxg== X-Gm-Message-State: ANoB5pkMd7AdrFFUCdHFFPhid6RVchavJt4WPvEaK0EDDXPchkCioFAy a+ut6Zx9y43rzteEiDgOi95laA== X-Google-Smtp-Source: AA0mqf58zbC7uLBU8GOmq4KsyKO8qAlGLLxkBWbqwUgy4POllB+uCyus4Z75UV8xkWcNCWSqJODdaw== X-Received: by 2002:a5d:498b:0:b0:242:3ec:4ac2 with SMTP id r11-20020a5d498b000000b0024203ec4ac2mr1050958wrq.9.1670499193590; Thu, 08 Dec 2022 03:33:13 -0800 (PST) Received: from fomalhaut.localnet ([2a01:e0a:8d5:d990:e654:e8ff:fe8f:2ce6]) by smtp.gmail.com with ESMTPSA id y2-20020adfdf02000000b0023657e1b980sm21427595wrl.53.2022.12.08.03.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Dec 2022 03:33:13 -0800 (PST) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: Claudiu Zissulescu Ianculescu Cc: gcc@gcc.gnu.org Subject: Re: Possible regression in DF analysis Date: Thu, 08 Dec 2022 12:33:12 +0100 Message-ID: <2858689.e9J7NaK4W3@fomalhaut> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: > However, after this optimization I get the CC reg being dead after > JUMP_INSN 15, which may lead to wrong code gen. Here it is the dump > from fwprop1: > > (insn 14 11 15 3 (set (reg:CC 66 cc) > (compare:CC (reg/v:SI 98 [ bytes ]) > (const_int 8 [0x8]))) "bad_cc.c":11:8 406 {cmpsi} > (nil)) > (jump_insn 15 14 16 3 (set (pc) > (if_then_else (gtu (reg:CC 66 cc) > (const_int 0 [0])) > (label_ref 27) > (pc))) "bad_cc.c":11:8 15 {condjump} > (expr_list:REG_DEAD (reg:CC 66 cc) > (int_list:REG_BR_PROB 955630228 (nil))) > -> 27) > (note 16 15 18 4 [bb 4] NOTE_INSN_BASIC_BLOCK) > (jump_insn 18 16 19 4 (set (pc) > (if_then_else (eq (reg:CC 66 cc) > (const_int 0 [0])) > (label_ref:DI 34) > (pc))) "bad_cc.c":12:10 15 {condjump} > (expr_list:REG_DEAD (reg:CC 66 cc) > (int_list:REG_BR_PROB 365072228 (nil))) > -> 34) > > Please observe the REG_DEAD note on the both jump instructions. Passes that consume REG_DEAD/REG_UNUSED notes need to recompute them explicitly, they are not updated on the fly. -- Eric Botcazou