From patchwork Fri Aug 11 21:55:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 1820437 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=bNXJ8osF; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMyKp02Gyz1yfN for ; Sat, 12 Aug 2023 07:56:13 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D01303858C00 for ; Fri, 11 Aug 2023 21:56:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D01303858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691790971; bh=1JQHHPD/MM5hIAHalbS3RuMd7TDuv8j1BjlS57c19Dw=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=bNXJ8osFK90pfdWyD0TVlQrogg9FW/oebZQCwOXXlz3XUrVmsgTfNHE3SIs7QO5j1 wL18FkUP34NMVH8xtzm6Ipbo6VKnJk/qRNE+o3tPfHKm9DBvij+wifNTEUhFjJsx22 KYJoydFvEd/yXo1MczyFtSCG2UHvJxMCQF4h+1zs= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 1AC2A3858D20 for ; Fri, 11 Aug 2023 21:55:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1AC2A3858D20 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-686efb9ee0cso2226774b3a.3 for ; Fri, 11 Aug 2023 14:55:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691790950; x=1692395750; h=to:subject:from:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1JQHHPD/MM5hIAHalbS3RuMd7TDuv8j1BjlS57c19Dw=; b=k1EOqBd6DZ4EsHVv65AI6teTKgKn55JsBH1ooIvi168EqaaXV4cJH7XxtU8LcCVXoI glNfN6wpfQww9ICGnK+JYkqZbF78YtlyXN1RcMJ9wIec4+qcuLQ7hRSnN4CZ3qBY6Ls5 Hjd2mvkbxWgw7uatbX9TBoPv9JaNOrvwOXYnWlSxup7xT12HRf14pNruvUBNv4pkLPN2 t6aFcrm5QigTPkOXrT+Fjz1HAZmhkT3da1B7qkMgPZN/6CcORjqnGoiY29QNdB4X/Gze pxgoEYfMZ4VuXdkCm8vlqaMMPWMX4zwdGg0XxTUTwMXqN6BpTRdKsdSdx/M5nyxxguyg NDmQ== X-Gm-Message-State: AOJu0YwpW2FVAmixQ598C4Z4YOTAyrl8kGHkBRZoEXJph5F2eViN0P4O BvTzlxim0zBZeQvPMjlgnKAf5qqzv/c= X-Google-Smtp-Source: AGHT+IGnyZFwN4g+dxQiJWToMDGs/GsZW4NycKCksUL/eol0amcGrNblxtOtMub4jRqQnszDV3lPeg== X-Received: by 2002:a05:6a00:b84:b0:67e:ca79:36f0 with SMTP id g4-20020a056a000b8400b0067eca7936f0mr4024498pfj.0.1691790950287; Fri, 11 Aug 2023 14:55:50 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id e25-20020aa78c59000000b00682af82a9desm3858841pfd.98.2023.08.11.14.55.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Aug 2023 14:55:49 -0700 (PDT) Message-ID: Date: Fri, 11 Aug 2023 15:55:48 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US Subject: [committed] Fix subdi3 synthesis on rx port To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jeff Law via Gcc-patches From: Jeff Law Reply-To: Jeff Law Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Some of Andrew's recent match.pd changes triggered a regression in my tester for the rx processor for c-torture/execute/pr66940.c which would be exposed only during an LTO compilation. Specifically the subdi3_internal pattern had the wrong idiom to detect a carry from the high word into the low word. It had the wrong opcode and the operands were reversed. This resulted in combine doing a simplification that was valid according to the presented RTL, but which ultimately got the wrong result. I would often say this was a latent bug. But the testsuite shows builtin-arith-overflow-14 and builtin-arith-overflow-p18 failures are fixed as well. So it's been visible indefinitely, but nobody's ever looked into those failures. Committed to the trunk. Jeff commit db08a096e4b19b91a7ec64f31a45549bb1f077ff Author: Jeff Law Date: Fri Aug 11 15:52:57 2023 -0600 [committed] Fix subdi3 synthesis on rx port Some of Andrew's recent match.pd changes triggered a regression in my tester for the rx processor for c-torture/execute/pr66940.c which would be exposed only during an LTO compilation. Specifically the subdi3_internal pattern had the wrong idiom to detect a carry from the high word into the low word. It had the wrong opcode and the operands were reversed. This resulted in combine doing a simplification that was valid according to the presented RTL, but which ultimately got the wrong result. I would often say this was a latent bug. But the testsuite shows builtin-arith-overflow-14 and builtin-arith-overflow-p18 failures are fixed as well. So it's been visible indefinitely, but nobody's ever looked into those failures. Committed to the trunk. gcc/ * config/rx/rx.md (subdi3): Fix test for borrow. diff --git a/gcc/config/rx/rx.md b/gcc/config/rx/rx.md index 6959c6095c6..f6b13b92aa5 100644 --- a/gcc/config/rx/rx.md +++ b/gcc/config/rx/rx.md @@ -1722,7 +1722,7 @@ (define_insn_and_split "subdi3_internal" (minus:SI (match_operand:SI 4 "register_operand" " 1, 1") (match_operand:SI 5 "rx_compare_operand" " rQ,rQ")) - (geu:SI (match_dup 2) (match_dup 3)))) + (gtu:SI (match_dup 3) (match_dup 2)))) (clobber (reg:CC CC_REG))] "" "#"