From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by sourceware.org (Postfix) with ESMTPS id B8CF23857835 for ; Fri, 17 Feb 2023 15:05:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B8CF23857835 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-xb29.google.com with SMTP id 63so965394ybq.6 for ; Fri, 17 Feb 2023 07:05:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=P+etdz8nE7pIrDfaeSJxcshoGCX4LUORbqbcamCpYG8=; b=gL3lUJNjgE2uIqY/d26BYyhAWym+noQsiXTAdEgIxhc3yIJdQTc0E0fdN/MwG93Ref VI3rEGIuwQmwzh4p10teswSdenO6r68mnT+mhA+9ovADb/Oe3rMmmmTTQTaJd/Ly1FWv I0pUozJwRvqfp7yHrBjcJ8fEnTFzAQvIZy+6PjY5EHTelntNfxx+9RVQ0BDb0ctLHwop V9O9r2gUbhWD8+N2LjJHNjBe28eZeX7Y1JL3y1BIbaRRF+PVtkYaAQqgSWYZgzg9s9Jm /5GAlsNPxKwgeyhby4yhIXVK7C84FeQP1vgA8hfkFEXfhBCZbodGb06siplV0uAswiIi JrpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=P+etdz8nE7pIrDfaeSJxcshoGCX4LUORbqbcamCpYG8=; b=fDFkLkof0xmD1ltalBGJb99+2WpM9OZcwD+xcsbEdTFNeB+mpwB+vcvBkTRufW0CZ/ p1bzZCuEP5el/DwISNolj+BFjo6/nxxSVorwPYO6RVUVIobS9jaHSOakkPU6d0dpTEMd /WumWPD5NMTDA3o299/7XqhAzWSDZGhxV7UHrEW/OBobk3OPPqx8UcCT6UqAGYQwIXN9 ip+7Sf8GfZpPmD9r3uJChWP3BpE7DVFKRuV2tO6dzTWW/GURgkuGiyDHW+EOgcjksNui 6++W8roik2Fl07HfMh/SsYCZpqJ4BZVmbBDyzjpnce5IdDzC6JuGozBcpwEpfCEVQXFp wFCg== X-Gm-Message-State: AO0yUKW5nRfaKJazmvfWppHjxgssvBhIgyTdzgGkx33CuPN8XkG2zoAA Zak/ZrHnxfHvVjWKhAoYzew/GiV7QL3TKNL98ts= X-Google-Smtp-Source: AK7set/1ROdtIh2ltm4IEoukU4+Azo16nw7k1h62ftCOUFaTtZP6CJZMmJKWnJtx+yvmUE4boK/ccSZXiWHDg4ubqkY= X-Received: by 2002:a5b:749:0:b0:8a9:b677:52a7 with SMTP id s9-20020a5b0749000000b008a9b67752a7mr146657ybq.30.1676646338019; Fri, 17 Feb 2023 07:05:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Uros Bizjak Date: Fri, 17 Feb 2023 16:05:25 +0100 Message-ID: Subject: Re: [PATCH] simplify-rtx: Fix VOIDmode operand handling in simplify_subreg [PR108805] To: Richard Biener Cc: "gcc-patches@gcc.gnu.org" , Richard Sandiford Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.6 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 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 Fri, Feb 17, 2023 at 12:31 PM Richard Biener wrote: > > On Fri, 17 Feb 2023, Uros Bizjak wrote: > > > On Fri, Feb 17, 2023 at 8:38 AM Richard Biener wrot= e: > > > > > > On Thu, 16 Feb 2023, Uros Bizjak wrote: > > > > > > > simplify_subreg can return VOIDmode const_int operand and will > > > > cause ICE in simplify_gen_subreg when this operand is passed to it. > > > > > > > > The patch prevents VOIDmode temporary from entering simplify_gen_su= breg. > > > > We can't process const_int operand any further, since outermode > > > > is not an integer mode here. > > > > > > But if it's a CONST_INT then we know it's of int_outermode, no? That = is, > > > doesn't simplify_subreg (mode, ...) always return something in 'mode' > > > and thus we can always pass just 'mode' as third argument to the > > > following simplify_gen_subreg call? > > > > You are right. I am testing the attached patch that works too. > > OK if that works. Thanks, pushed with the following ChangeLog: simplify-rtx: Fix VOIDmode operand handling in simplify_subreg [PR108805] simplify_subreg can return VOIDmode const_int operand and will cause ICE in simplify_gen_subreg when this operand is passed to it. The patch uses int_outermode instead of GET_MODE of temporary as the innermode argument of simplify_gen_subreg. 2023-02-17 Uro=C5=A1 Bizjak gcc/ChangeLog: PR target/108805 * simplify_rtx.cc (simplify_context::simplify_subreg): Use int_outermode instead of GET_MODE (tem) to prevent VOIDmode from entering simplify_gen_subreg. Uros. gcc/testsuite/ChangeLog: PR target/108805 * gcc.dg/pr108805.c: New test. Uros.