From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by sourceware.org (Postfix) with ESMTPS id 8DAB03858D35 for ; Thu, 7 Mar 2024 10:57:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8DAB03858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8DAB03858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::234 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709809074; cv=none; b=kiAQrC6hcpwkvhlDp5Oz4KARp7CRidVR1Bs1KlexzvKlooJ3hAcGMu9iqoRUG3IJ6BItsvBEqFp7Mi9mUgYl+LrolxzQWWvSH8x+a7gvYdwIWFC6vBW6N2fbrUKRPW4w52eHCW6qpOgepsg343PvMMa0I/DlVlpkxeAbmypvm3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709809074; c=relaxed/simple; bh=iggjt0INjBKB1m+wFPy/KySM1xGEaeB3224FWTjacJE=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=oFcptWMdhZPZDNciTpgUomm3ZzqNvF07HZ1lZSS5kw59GZ6PLWs+MngdzFY33TYINV9NfA9+eViELjJHICAlOktdJSorjl0WkQk7z0KKRu59CW0rckhhoiuBd+rzx0SU5ySrfrHK1c7x7EZU45h3hgk+lsNL4HaPTWX8I4P323o= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2d2fad80eacso7644271fa.2 for ; Thu, 07 Mar 2024 02:57:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709809070; x=1710413870; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TYfcs5dcBvzefJJigZA+N3r90zejckmMmXw1uJimFeo=; b=ldbAldp/a9G2oqf0MvKITBqS8A6S5/IwROlWkdriG3jb0w+uUL89liAYNdOCwCxNhl wd9iVLyF7u7Ig+i64zFQjGlEHYS4NCehST0Whs1Ptox+8CmRtFJmUSAKydwUkzlySVWp /RTRd3psi53ErIyv92W7wVhUIJRAFJjCUvDFreoeNjGktW1YqenCChvA9V3EsYW2EZzl P+VujhZP/A8L5tytRFoXe8X4ZoY648vmCSX5MFpH2A5jsveeQT8inwLc1i+YpMbeAwn+ GqS21WSWv4wjDNBLeCRu0iap5ex/gPnBrS6etx1Baveu1/RcrbAMJNvkFkCnV35hmF6X 5G3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709809070; x=1710413870; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TYfcs5dcBvzefJJigZA+N3r90zejckmMmXw1uJimFeo=; b=r7SvZFJT4ofbdku8083Z+UyTcXWberMD0vQpOLy1eFBi7usZ6BprFVs065YmyG0tP7 Qq1Ncd1ooBe/0rR8fiykWXb3KAZfa0WljyueUsqVWVqBmOpntgC7Af2ssht2IKLdI98u 22M5BupXTJ1qGWWHwrxHpl9xdjEEOF16oOCk352k2jgVg3fXwo9vTbefqhByhCWtBV31 HVzuUc6E9h0ClPDyLK9dBdhGbM8Qr0QSkIHdeh/ssqRNjROu63cZwQuU8Qo9mhDSW40R BpAwRHYd4pQO1QhwVyZyjQFO/QnpCffIrPGB6LzY99OCBIB5SLPh3YXl++/3zHCXfirK vThg== X-Forwarded-Encrypted: i=1; AJvYcCXJEo4MOZV6iLJA5dwGTCB61AwbPCOYJk5us/zN5dWCGMcKuLQMR4/6FGaQ4W3zQ0LdKcD0N5BDfiEotqm8u5qsJCGodw+gIg== X-Gm-Message-State: AOJu0Yy7Ad7Wi7me/dW1+SHVZaWyU5Qb1OjQYB61eDiHBcw3qgNoZPP+ rjSKsJjo7fMmWyQKdX7RZ+02RM9fN8us8XZajy/SyDJOXaRup0vlBGaltsg/DpybhvOyLTH3ynC cT/i1xEgdUExt74Ksfa/2Q+pZ72A= X-Google-Smtp-Source: AGHT+IEHGKv28tvOuvsiRK+43kNnWZtlEChdOdKszb6P+tvjd4ywRpzXPeipffm3ZsGVQ1TOL50PpIFBo0k4ZCRWErA= X-Received: by 2002:a2e:a607:0:b0:2d3:8c1f:c0ff with SMTP id v7-20020a2ea607000000b002d38c1fc0ffmr1061515ljp.16.1709809069724; Thu, 07 Mar 2024 02:57:49 -0800 (PST) MIME-Version: 1.0 References: <2737spr1-459p-3oon-n852-qn034s55p66r@fhfr.qr> In-Reply-To: From: Uros Bizjak Date: Thu, 7 Mar 2024 11:57:38 +0100 Message-ID: Subject: Re: [PATCH v2] combine: Fix ICE in try_combine on pr112494.c [PR112560] To: Jakub Jelinek Cc: Richard Biener , "gcc-patches@gcc.gnu.org" , Jeff Law , segher@kernel.crashing.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: On Thu, Mar 7, 2024 at 11:37=E2=80=AFAM Jakub Jelinek wr= ote: > > On Thu, Mar 07, 2024 at 11:11:35AM +0100, Uros Bizjak wrote: > > > Since you CCed me - looking at the code I wonder why we fatally fail. > > > The following might also fix the issue and preserve more of the > > > rest of the flow of the function. > > > > > > If that works I'd prefer it. But I'll defer approval to the combine > > > maintainer which is Segher. > > > > Your patch is basically what v1 did [1], but it was suggested (in a > > reply by you ;) ) that we should stop the attempt to combine if we > > can't handle the use. So, the v2 patch undoes the combine and records > > a nice message in this case. > > My understanding of Richi's patch is that it it treats the non-COMPARISON= _P > the same as if find_single_use fails, which is a common case that certain= ly > has to be handled right and it doesn't seem that we are giving up complet= ely > for that case. So, I think it is reasonable to treat the non-COMPARISON_= P > *cc_use_loc as NULL cc_use_loc. Please see the logic in my v1 patch. For COMPARISON_P (*cc_use_loc), we execute the same code in the first hunk of the patch, but for non-COMPARISON_P, my patch zeroes cc_use_loc. The cc_use_loc is used only in the "if (cc_use_loc)" protected part, so clearing cc_use_loc when !COMPARISON_P (*cc_use_loc) has exactly the same effect as adding COMPARISON_P check to existing "if (cc_use_loc) - we can execute the "if" part only when *cc_use_loc is a comparison. The functionality of Richi's patch is exactly the same as my v1 patch which was rejected for the reason mentioned in my previous post. Uros.