From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by sourceware.org (Postfix) with ESMTPS id 70A6E3858D1E for ; Wed, 25 Oct 2023 16:26:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 70A6E3858D1E 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 70A6E3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1034 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698251214; cv=none; b=EWUkKeRx1SDALBENr5xgWOEUaX0difr1cPcVlfU6Rmgz06OjWzz2DIu9tJbQpfRjQv4i/nC20bpf2oEm7TTxLiMSabR1UtD2lvgKIWRzpURJZ/KqxbY9oT/PqyLIkF2I/RgtT1Umf/a9BNPeAEeJzbTTs9IPmFHoEsvG9mXdLU4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698251214; c=relaxed/simple; bh=ORcQMpi322+PUZi8gY4JOUKYIsK8JSnOzdHDpP+LDRg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=GFJPCKhvVuDTb75ZSbppE3c2pHp6vi6G1MaY+FOijIulHDD7HlkzMPuKQ3wCx3TyCn9QSmyJ8yM2QHCUxdYl8xRFZsUcJ9AYjo9gDpzUeWUhuRMfwxPV1fZROdzimkZao7V9aolu4QCpgRSzQhCIWi+d1hB8cxWQCnfgCKQn+qM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-27d0e3d823fso4160381a91.1 for ; Wed, 25 Oct 2023 09:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698251212; x=1698856012; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PezHOkLg6lB1hmIn9KvXB3ISX6Y4NYG1doIPXA9Fo7o=; b=dVKhUdaPNe2eKoBJF06fYImcNFd8Eg56Tb9bKbhP8469mg6Y0806qSuBDMu8Xo2zA4 PTQ/MzDdqhEAbcFUGp/ljY0sVsiHdo4HO9YOQQdTXFSuUHzuZ4z6InW4wfe2D++D4Zfq CJSebXfG+FQH5Kz05WPqWLV6cgrLE4GGQPel6bwxwnH248Sv5i48TOZ60GXh/r5O0Znx qVR+0uJe+WhQb0n7B95UElIBRtaiZXyndpb2xS9puy+UxbKa3rYAxThNOAXoPHpTpXYx szFAlo/NBt7qwSC8NFRyE/VHxxubxiYrYBPgGeLQiI1KyhhACVnZpVNBAuYDDz4u4Tu0 VuCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698251212; x=1698856012; h=content-transfer-encoding:in-reply-to:from:references:cc: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=PezHOkLg6lB1hmIn9KvXB3ISX6Y4NYG1doIPXA9Fo7o=; b=SSBEvWg6PwYqfJ9xQJRN3RXsqyY0nqpw673abN59yJedUevxWf0CdYE+7ImEpu4+oK CGYDj+2JYU+IiX7XBGDA8s6hOGQPQLAAETaNeeNEva6lxyFBoey2209Jh2HeKRcaxsqD OK3rCstENcKNZVdyJ0vYJsgxbPmWknmUNGyb0E912r/nSncXIxXri4XQCRcYP4aSnBaY gEE5nqM9i5PbUvgCqD/J4VSIvvJ5snUJAF62KI6o31xdUFV0hgE1DRUgRfQGpn5vUXek P5wggheMjrVbbyZuRsDFc4GGIlVs7BmwTf9X+vIstZqwGyQkcfCXRNIfsD58iR9EGnHl eshQ== X-Gm-Message-State: AOJu0Yzw42mawHVUooEqkLxXCR1vjzsd/qWgjpOgsN/d4aXN5qI/Noux PeUL4JUkV418IwesgCsDqXXbdHOZUH0= X-Google-Smtp-Source: AGHT+IHd6Eh/LQW17XdvL7eBJ48bXkcVK1vm5Pe/KIZZC1xhNcxwWejuCmgy1DR8SkhhSRPqPNzOBw== X-Received: by 2002:a17:90b:48c4:b0:271:ae4f:dd12 with SMTP id li4-20020a17090b48c400b00271ae4fdd12mr12854676pjb.26.1698251212047; Wed, 25 Oct 2023 09:26:52 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id 30-20020a17090a01de00b002794fe14cabsm115220pjd.12.2023.10.25.09.26.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Oct 2023 09:26:51 -0700 (PDT) Message-ID: <317c2f6c-2d1a-45a3-9e45-287033fc0789@gmail.com> Date: Wed, 25 Oct 2023 10:26:46 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] PR 91865: Avoid ZERO_EXTEND of ZERO_EXTEND in make_compound_operation. Content-Language: en-US To: Roger Sayle Cc: gcc-patches@gcc.gnu.org, 'Richard Biener' References: <01f701d9feeb$ce8654e0$6b92fea0$@nextmovesoftware.com> <48dd875c-b65f-451c-b878-3b1c1215227d@gmail.com> <001501da0724$b12ffc20$138ff460$@nextmovesoftware.com> From: Jeff Law In-Reply-To: <001501da0724$b12ffc20$138ff460$@nextmovesoftware.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,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 10/25/23 03:21, Roger Sayle wrote: > > Hi Jeff, > Many thanks for the review/approval of my fix for PR rtl-optimization/91865. > Based on your and Richard Biener's feedback, I’d like to propose a revision > calling simplify_unary_operation instead of simplify_const_unary_operation > (i.e. Richi's recommendation). I was originally concerned that this might > potentially result in unbounded recursion, and testing for ZERO_EXTEND was > safer but "uglier", but testing hasn't shown any issues. If we do see issues > in the future, it's easy to fall back to the previous version of this patch. > > This patch has been tested on x86_64-pc-linux-gnu with make bootstrap > and make -k check, both with and without --target_board=unix{-m32} > with no new failures. Ok for mainline? > > > 2023-10-25 Roger Sayle > Richard Biener > > gcc/ChangeLog > PR rtl-optimization/91865 > * combine.cc (make_compound_operation): Avoid creating a > ZERO_EXTEND of a ZERO_EXTEND. > > gcc/testsuite/ChangeLog > PR rtl-optimization/91865 > * gcc.target/msp430/pr91865.c: New test case. I'm not terribly worried about recursion. For the case you want to handle, it's going to be picked up by the call to simplify_const_unary_operation at the start of simplify_unary_operation. It's only if that fails that we call into simplify_unary_operation_1. The only thing that even comes close to worrisome to me in this space is the asserts in do_SUBST. But I don't think your patch is likely to make the problems with those asserts any worse than they already are. OK for the trunk. Jeff