From patchwork Tue Jun 13 03:18:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akari Takahashi X-Patchwork-Id: 107054 Return-Path: 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 (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 ; 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 ; 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 ; 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: 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Akari Takahashi via Gcc-patches From: Akari Takahashi Reply-To: Akari Takahashi Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768555955460970099?= X-GMAIL-MSGID: =?utf-8?q?1768555955460970099?= 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 --- --- 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) {