From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 495C3385842C for ; Tue, 5 Sep 2023 05:05:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 495C3385842C 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-pl1-x62a.google.com with SMTP id d9443c01a7336-1bc83a96067so10209065ad.0 for ; Mon, 04 Sep 2023 22:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693890303; x=1694495103; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=S9YAshAFlGCLZDxxYwjP7Ou+ZUB+F+JNGixQ3NKh2qk=; b=c7+UlMIuB5jh3VTvccK0tR09dG1875/cAEGYgqw5WOy9jUfPAGqFvHUHJNn9m9zuRg 1gq0i7FQS34+iNXA3fhsDz36saIY59WydIiVSSrlaobDbax/ChMDFr62jK8+72rc271Z dJzDdFflqG8HoGyqQaT7kwXWOSkF+OQO3ofSQRx+TzW3P55OgLNCwzmKwopf+R6xAJxT 8IW9CzLQMRBeVZXYut59tVHs5YWiPIxooD4BgvN8aCbaHC5hFVMV0SmktHqH/DNYvmqw wtxhGLaXtXT9ELG1oIQNCFWl1VM3JcWeT9M8MO5nouwyu9fpJpwHm205ZTj/NUXkjUa6 F1/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693890303; x=1694495103; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S9YAshAFlGCLZDxxYwjP7Ou+ZUB+F+JNGixQ3NKh2qk=; b=Y4zva+ZeA9vqaIpKenh9HWPVU13k87PWkhY5dtRCj6YE9YeRek702j6jnWc+XfGJlX Vlk58ywo0Nkg5/4dZDX6J7E8Mft+xbosp3KI9j2QYBoT082zVrD7DLGBK8ez34cKElkA Q+B0CoF2LMZeHlm/V63W8RMkoEpTrCRh8o3b/dZ2vAbzjjgQCvAFeN/86+yJvB7gZi4Q pSUFosIvD80cY31Jui/KVxfpB80BwxB99oEozO/oEQXfkR6vJKLUQx5L+7Q683wpIZAQ 8mA3FEm/gjizcug2aA/V+EVa5o/ZCFt+48oKpb9Qz5GwsF8lh2NLxYY+BZhJf/Mkq7xN gHeQ== X-Gm-Message-State: AOJu0YyLm9slX3AHMkHA1A65cQ9Y1mpv7BeW/wH1EYOTbC1wwDWADrnK Zp0ravFFZRn3nfRYFyapz8hATuX/4RYDgA== X-Google-Smtp-Source: AGHT+IGmbONiF2b8hp0W+lHf95lxNHC1UtyNx39Dt/XaiYEwijIAT5Ir04DhixOs85ByM2Vz1GvimA== X-Received: by 2002:a17:902:dad2:b0:1be:f2a1:22d8 with SMTP id q18-20020a170902dad200b001bef2a122d8mr12273894plx.14.1693890302690; Mon, 04 Sep 2023 22:05:02 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id b14-20020a170903228e00b001bdb8f757besm8381935plh.23.2023.09.04.22.05.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Sep 2023 22:05:02 -0700 (PDT) Message-ID: <06503c0a-48a8-4a86-882d-60263254fc98@gmail.com> Date: Mon, 4 Sep 2023 23:05:00 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] lra: Avoid unfolded plus-0 Content-Language: en-US To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com References: From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 8/31/23 09:24, Richard Sandiford via Gcc-patches wrote: > While backporting another patch to an earlier release, I hit a > situation in which lra_eliminate_regs_1 would eliminate an address to: > > (plus (reg:P R) (const_int 0)) > > This address compared not-equal to plain: > > (reg:P R) > > which caused an ICE in a later peephole2. (The ICE showed up in > gfortran.fortran-torture/compile/pr80464.f90 on the branch but seems > to be latent on trunk.) > > These unfolded PLUSes shouldn't occur in the insn stream, and later code > in the same function tried to avoid them. > > Tested on aarch64-linux-gnu so far, but I'll test on x86_64-linux-gnu too. > Does this look OK? > > There are probably other instances of the same thing elsewhere, > but it seemed safer to stick to the one that caused the issue. > > Thanks, > Richard > > > gcc/ > * lra-eliminations.cc (lra_eliminate_regs_1): Use simplify_gen_binary > rather than gen_rtx_PLUS. OK jeff