Message ID | dc69d060-9336-a1fd-fd9b-6bc9a024eb57@gmail.com |
---|---|
State | Repeat Merge |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp164030wrr; Wed, 16 Nov 2022 17:52:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf4HCCSVjrgR4Wofj5IkBoltdUmbqiYjZqQKCEBPTt+aq8euc6WJgUXeR2zX+Z7f7UvXbYkX X-Received: by 2002:a05:6402:3789:b0:467:7664:c7f4 with SMTP id et9-20020a056402378900b004677664c7f4mr364980edb.99.1668649949374; Wed, 16 Nov 2022 17:52:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668649949; cv=none; d=google.com; s=arc-20160816; b=sVAH/jFOHkBMBToGigYH0+gWT3YgGA4hJTpKZcj6Lo8a+mtI1Y+vT45RA7rZ1EfX4r BLdOvlXOKmdyO1JvqAhgKLFpuGVSmPhgHHm+jYCr60MCKmzXw7+758ioPwJii7rF2s8l iQOFthkhZpBHVw0xuZNwBSHyj0TFw986wAPcnK5cwkDL4I8wiBnaIpF+qkqkuWIIDZ+V rUwBsDrKYAPUkHdZ/DwobCA2vjEIHxMfaoX7rn7YtsHqlz9Onc4JvzsC3d9JauSnU7RB 1dyam+3ZkktAuY9ygfl4adv4ECwvaE6+7lub8VePonX/UJd+5vaVWAILuQwbuvsxdvkF z4Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:to:subject :content-language:user-agent:mime-version:date:message-id :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=mfRffxxIBjb6rxiJTlp/RyUZ9qeUQe7nc/FkDSGFOmg=; b=hBm2UMLqoLYK9ZpQ7V9m7gSh6+xWufRiaQH7skmF4W/Y2EMaFTmq7ax2eMQ3lGx6/I coLNGa7dJ1LuN55C+E03qmht7UGSk+z5tBKlfoUX5gu6y/iedQZycWZXUSYiB6/x0NK/ uOMJdrB+JB8OYvMSBYW76gb0VjpVDPwdJLw+DsaINAEtMwg4yVrUTEl4LP08c7EcYIQO ECt9IJqYNG/1XvxvQDKCcctM4+zBLCcOYGckW56TwjqMYL5dXEZ5uFSY4rhisYN5ECR4 mPK8oEf3HGv1xULHEMp0XfskXwfdbG/51qxGLDBAXX5R40dyWox6OumPHwE4oR0f2Soa PN4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=AzaYsY5k; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id g17-20020a1709065d1100b007313312730esi16446955ejt.85.2022.11.16.17.52.29 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 17:52:29 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=AzaYsY5k; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 224CC3954425 for <ouuuleilei@gmail.com>; Thu, 17 Nov 2022 01:52:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 224CC3954425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668649948; bh=mfRffxxIBjb6rxiJTlp/RyUZ9qeUQe7nc/FkDSGFOmg=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=AzaYsY5kO00lyHxXebJe20Qu2lsIG7RJo234k4EjW7UCY9HtzorIX+M2gM9WROFoE 4wMLdxGu/jvrrNBTPdliq3o4Yu+/n6u11Z8RTLtxMXpQtZHiJaPUDBkgeF9K7NpQPK 5/3HOkB8yPt6E24HPT0CWi/AVhnHuE24tDHyyYA4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by sourceware.org (Postfix) with ESMTPS id D415C38A816A for <gcc-patches@gcc.gnu.org>; Thu, 17 Nov 2022 01:51:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D415C38A816A Received: by mail-pg1-x531.google.com with SMTP id 136so678043pga.1 for <gcc-patches@gcc.gnu.org>; Wed, 16 Nov 2022 17:51:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=mfRffxxIBjb6rxiJTlp/RyUZ9qeUQe7nc/FkDSGFOmg=; b=VslIbnPv8MGUgbOeOxz1S1E4AKY7GcQ3EV8FiYIYEquGPauM0oB/YNcXAV3feCA1IM emreZCxrjQvNf6TbuZRVvGsdt4aj/owBeSEXTWZxs8Bul5+ZDMo8xqmS+CaaeZtRIbAQ rICymMrLXC0hj3n8meZAswsvl5ZxiDGfyXnEG0dduwA04KvxUnLST/QYkBZl2QnSrnnv D+YimlebWoooLpU70PGb1OmEjpmX/U3K236s+3yPJlpYkUibY9ikte3PXoSlU94tPm0T aMel3xcPd52aiVOcVZjy0dOqCtyAV7QYWhpVih934F9mw7Dua8lG303cby6LpSnNpBti mgTg== X-Gm-Message-State: ANoB5pmLVLkoOqPqIs8mSSayGHgPRQy6eIJ9iKsUwxPSDst3qfPv5edF fIE1aChIFB0z1OfRC8hLUcju43Is3Po= X-Received: by 2002:a62:2fc1:0:b0:562:fcae:5f10 with SMTP id v184-20020a622fc1000000b00562fcae5f10mr809045pfv.28.1668649900459; Wed, 16 Nov 2022 17:51:40 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id w13-20020a627b0d000000b0056ee49d6e95sm11522321pfc.86.2022.11.16.17.51.39 for <gcc-patches@gcc.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Nov 2022 17:51:39 -0800 (PST) Content-Type: multipart/mixed; boundary="------------vPSBewH9PMGr8LuAvFG46LAV" Message-ID: <dc69d060-9336-a1fd-fd9b-6bc9a024eb57@gmail.com> Date: Wed, 16 Nov 2022 18:51:38 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Content-Language: en-US Subject: [committed] Fix multiple recent sh3/sh3eb regressions To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org> X-Spam-Status: No, score=-8.5 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Jeff Law via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Jeff Law <jeffreyalaw@gmail.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749706289316103210?= X-GMAIL-MSGID: =?utf-8?q?1749706289316103210?= |
Series |
[committed] Fix multiple recent sh3/sh3eb regressions
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Jeff Law
Nov. 17, 2022, 1:51 a.m. UTC
So my tester started showing even more regressions on the sh3/sh4 runs recently (beyond the one recently reported in BZ triggered by some DCE related changes). Bisection kept showing inconsistent results. I was starting to think memory management error, but valgrind didn't flag anything. After a bit of head-banging I was able to track it down to predicate tests called from the SH specific combiner passes. And once I started getting inside the actual code for the predicate function it became pretty obvious. The predicate routines are supposed to return a bool, fine and they dutifully set the low bit in %eax properly. The *caller* was looking at the full register. Uh-oh. Naturally we became dependent on what happened to be in the upper 31 bits of a register. That's why the bug would come and go so willy-nilly. This was ultimately chased down to an incorrect prototype in sh_treg_combine.cc for predicates functions defined via define_predicate. Removing the bogus prototypes and instead including the generated tm-preds.h fixes this problem. I also checked the other ports for similar problems (specifically looking for a extern int.*_operand, then for each of the hits looking to see if the predicate was defined via define_predicate). No other ports had similar braindamage. This fixes the most recent regressions in my tester for sh3/sh3eb and I strongly suspect sh4. It does not fix 107704, but I think Richi and I both agree that's a visitation order issue and we were just getting lucky before. Committing to the trunk. Jeff commit e214cab68cb34e77622b91113f7698cf137bbdd6 Author: Jeff Law <jlaw@ventanamicro.com> Date: Wed Nov 16 18:47:59 2022 -0700 Fix multiple recent sh3/sh3eb regressions So my tester started showing even more regressions on the sh3/sh4 runs recently (beyond the one recently reported in BZ triggered by some DCE related changes). Bisection kept showing inconsistent results. I was starting to think memory management error, but valgrind didn't flag anything. After a bit of head-banging I was able to track it down to predicate tests called from the SH specific combiner passes. And once I started getting inside the actual code for the predicate function it became pretty obvious. The predicate routines are supposed to return a bool, fine and they dutifully set the low bit in %eax properly. The *caller* was looking at the full register. Uh-oh. Naturally we became dependent on what happened to be in the upper 31 bits of a register. That's why the bug would come and go so willy-nilly. This was ultimately chased down to an incorrect prototype in sh_treg_combine.cc for predicate functions defined via define_predicate. Removing the bogus prototypes and instead including the generated tm-preds.h fixes this problem. I also checked the other ports for similar problems (specifically looking for a extern int.*_operand, then for each of the hits looking to see if the predicate was defined via define_predicate). No other ports had similar braindamage. This fixes the most recent regressions in my tester for sh3/sh3eb and I strongly suspect sh4. It does not fix 107704, but I think Richi and I both agree that's a visitation order issue and we were just getting lucky before. gcc/ * config/sh/sh_treg_combine.cc: Include tm-preds.h. (t_reg_operand): Remove bogus prototype. (negt_reg_operand): Likewise.
diff --git a/gcc/config/sh/sh_treg_combine.cc b/gcc/config/sh/sh_treg_combine.cc index f6553c04a0d..ab7dc5d4985 100644 --- a/gcc/config/sh/sh_treg_combine.cc +++ b/gcc/config/sh/sh_treg_combine.cc @@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see #include "cfgrtl.h" #include "tree-pass.h" #include "expr.h" +#include "tm-preds.h" /* This pass tries to optimize for example this: @@ -426,10 +427,6 @@ is_conditional_insn (rtx_insn* i) return GET_CODE (p) == SET && GET_CODE (XEXP (p, 1)) == IF_THEN_ELSE; } -// FIXME: Remove dependency on SH predicate function somehow. -extern int t_reg_operand (rtx, machine_mode); -extern int negt_reg_operand (rtx, machine_mode); - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // RTL pass class