Message ID | CAPzzfctOqwsbG4ig4gT2eUWc5C+YdLZPJfKtHDgN8OKSQU+PzA@mail.gmail.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp275606vqr; Mon, 12 Jun 2023 20:19:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7lXiV2rDsgKQOQoP6Fhwz7njrmoI/4cenRFAWhpdSGNtd+1qVyCcFAHvukfzrPAI5/dcEX X-Received: by 2002:a17:907:72cc:b0:978:73fb:1771 with SMTP id du12-20020a17090772cc00b0097873fb1771mr9230638ejc.32.1686626391893; Mon, 12 Jun 2023 20:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686626391; cv=none; d=google.com; s=arc-20160816; b=ybIyDTrIegsxJxuwOSRWuZdg2m1/VT/TOuljQsoDs9DM5InCJ1Hvo/IgZMviSXe8kG thMhrQ7t3CAJV4BMwN+dzbKGL1W3K8uZg6g285ITD7Yy72VUfByCXZVmrJHtcqrIIFUK f+Bd9jh4JBHwse7K2s1gvKC4KYobs4YWpQWhXh6Z+W66gC7lZZ4181oloV+dTPFr84qh x8rCexyQr9tPU4mew8Drt5KWoS4VPdKm7dbT9+b8aJLuZeCAHU40DJEQcWVZTEt1hKns mrwBn56LJ/JYFsUhBPqTRCeMrktM3e4oTRqIcVJjArMNA0ikuc9Hq66XJbDgildnn3G1 S9cg== 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 :message-id:date:mime-version:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=DrkLfPwYFGw4lQs9+cWbjT0xF4+R29IGudKnPKN4MqE=; b=HRpEZF1SbqXmcaNlCfqa7G6LouBhAceFUB6sgG5pLnxIpZtwWxfr89Tr89y8+WnVLl Mz3i6bWywpSIsrNvs5zxNwXu4gf2k93odq6556DmP4UGtqwsNI9z/3j2PsUjK1iO2Trt yLZcqJtC5+vomHMTafvKzUp9/0tU4s6r2swgjay16C1BS982Y8VxV+4vRHTkt3+AbcTa +PKdh5f1FRHRmhGoS8OUrKaRRyIhDURZvtA+6waADpjBox/+Sac1wKkBFf/kZVKAMpLd 6S6fZd1XOiVlyMxuOeMf0C/MbNgA6Et+OWmb/rID0MgZxlE4ecFXlLgYqBZ48RzKM5WW 06LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="P/ymTuIs"; 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 t11-20020a170906a10b00b00977eb940999si6165948ejy.72.2023.06.12.20.19.51 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 20:19:51 -0700 (PDT) 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="P/ymTuIs"; 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 8DDCF3858418 for <ouuuleilei@gmail.com>; Tue, 13 Jun 2023 03:19:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8DDCF3858418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686626390; bh=DrkLfPwYFGw4lQs9+cWbjT0xF4+R29IGudKnPKN4MqE=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=P/ymTuIsSRRYh/EQ0gNXzrmS6PxYutDwC+cYGkF0+zF6fAKMg9rVYUGPROloh3+w9 OU0wcAvEpLfJEVolo8pLORuc39yV9hhsVvpVrDBVwUoTDLncepxLqoJQXb/GbtxImN 2sT7Qg7GKDhNfm6+gTxcbWJK+MJBnUTcx2IU03AI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by sourceware.org (Postfix) with ESMTPS id B05973858CDA for <gcc-patches@gcc.gnu.org>; Tue, 13 Jun 2023 03:19:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B05973858CDA Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-75ec6ae7ffaso47262685a.2 for <gcc-patches@gcc.gnu.org>; Mon, 12 Jun 2023 20:19:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686626345; x=1689218345; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=eVxcMMciJwt6vpgbO6sTS82mGEbtVfdX2073v1o9XOA=; b=G1LRRoS1rEnmQtEzpmG6OFEMkQXCj9AQ2sq7ufdyhcf1gBlQEPP3aGYEG/2wwjU298 aNx5AEfhgLSiNwhFqg5qLtmnMP7+BlAXYiVCUISIR/RBCNtail23CYSbewJI84pi1nPP h1QGbtoGF1BWsbwBcqLoH65THd6sldkeDUEaCmgfMBAgeZd5DjlYPY+myKCxIVwIargh 7HuEr7iTd2IylEpZ6JFVUNwOSEsw3R1L9a3E2/QJ1tGwcgPzgwleAHESk1BohsXAFoEH bwKDtb+XOktEjCsp4QXNmp+xaJrg0g2X0tOl+bkF4Em8Tum7F0HsHCgqGkXUkU9rm2Kq 3exw== X-Gm-Message-State: AC+VfDyXMCR5z62XnzRqIhal6mOj/AHCpcjH9Il9514cgJhKcyy+zv2r yIHOAtQ7SyM36c0cG1B0ZcEfVxZ6AbJwOBUeDypL+JEuHVo= X-Received: by 2002:a05:620a:8dc1:b0:75e:b9dc:ec2 with SMTP id rd1-20020a05620a8dc100b0075eb9dc0ec2mr9669184qkn.5.1686626345029; Mon, 12 Jun 2023 20:19:05 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 13 Jun 2023 12:18:54 +0900 Message-ID: <CAPzzfctOqwsbG4ig4gT2eUWc5C+YdLZPJfKtHDgN8OKSQU+PzA@mail.gmail.com> Subject: [PATCH] Fix note_defect3 function To: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Akari Takahashi via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Akari Takahashi <akaritakahashioss@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?1768555955460970099?= X-GMAIL-MSGID: =?utf-8?q?1768555955460970099?= |
Series |
Fix note_defect3 function
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Akari Takahashi
June 13, 2023, 3:18 a.m. UTC
Hello, I've noticed an issue with the note_defect3 function and have prepared a patch to fix it. The function is missing a return statement, which is causing undefined behavior. This patch adds the missing return statement, ensuring that the function returns the correct value. Please consider applying this patch to correct the issue. Thank you. Best regards, Takahashi Akari --- ---
Comments
On 6/12/23 21:18, Akari Takahashi via Gcc-patches wrote: > Hello, > > I've noticed an issue with the note_defect3 function and have prepared a > patch to fix it. The function is missing a return statement, which is > causing undefined behavior. This patch adds the missing return statement, > ensuring that the function returns the correct value. > > Please consider applying this patch to correct the issue. Thank you. > > Best regards, > > Takahashi Akari Thanks. Reviewing that file it looks like it was just supposed to be used for the sh5/sh5media processor. My recollection is those were never actually produced and support for them was removed from GCC some time ago. This file was missed during that removal. Rather than apply the patch, I think the better choice is to just remove the divtab.cc file unless someone has a real use for it. Is there a particular reason you were investigating the divtab.cc file? jeff
Hi Jeff, Thank you for your response. Regarding the divtab.cc file, I actually came across it by accident while working on another task. I didn't have a specific reason for investigating the file, but I noticed the issue and thought it was worth bringing to your attention. Thank you for taking care of this issue. Best Regards, Takahashi Akari On Tue, Jun 13, 2023 at 10:50 PM Jeff Law <jeffreyalaw@gmail.com> wrote: > > > On 6/12/23 21:18, Akari Takahashi via Gcc-patches wrote: > > Hello, > > > > I've noticed an issue with the note_defect3 function and have prepared a > > patch to fix it. The function is missing a return statement, which is > > causing undefined behavior. This patch adds the missing return statement, > > ensuring that the function returns the correct value. > > > > Please consider applying this patch to correct the issue. Thank you. > > > > Best regards, > > > > Takahashi Akari > Thanks. Reviewing that file it looks like it was just supposed to be > used for the sh5/sh5media processor. My recollection is those were > never actually produced and support for them was removed from GCC some > time ago. This file was missed during that removal. > > Rather than apply the patch, I think the better choice is to just remove > the divtab.cc file unless someone has a real use for it. > > Is there a particular reason you were investigating the divtab.cc file? > > jeff >
diff --git a/gcc/config/sh/divtab.cc b/gcc/config/sh/divtab.cc index 30d57f2a1dd..cd3e709e3ab 100644 --- a/gcc/config/sh/divtab.cc +++ b/gcc/config/sh/divtab.cc @@ -75,12 +75,13 @@ note_defect3 (int val, double d2, double y2d, double x) if (defect < min_defect3) { min_defect3 = defect; min_defect3_x = x; min_defect3_val = val; } + return defect; } /* This function assumes 32-bit integers. */ static double calc_defect (double x, int constant, int factor) {