From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-75ec6ae7ffaso47262685a.2 for ; Mon, 12 Jun 2023 20:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686626345; x=1689218345; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=eVxcMMciJwt6vpgbO6sTS82mGEbtVfdX2073v1o9XOA=; b=nwaSPzr3OV6uQuhoOHo54cSyOZfAs7MK0GRJeD/9FOrLODVqMMFlDK4A4zvuFH//CF K1cOxNrn01Y7LTZ1Gh4A1Nq4WsSSjctK8jLdWnVlMYWTAT0eh030WNTqqhyeDGKGv8eq GA/1CF3rjhSh0/Cmsy1CLG3Yo9c8NbAQoHfUBIFOXKCSQxck5KxXju8VMiBmGd82Sxys MTDN/CJqJTlf448jfVOn137viGEBPR3A7dfagCTVD9PFbAWCAhJ2dC3gv2LAi3CnlvKP /XTbNOOE+V23O9lKWNv+umKDVycTGFElI3+aWt+WfbOPtSZpn0f9ffiDkHwiRPcAe1k6 Lq6A== 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-Google-Smtp-Source: ACHHUZ5wwz4xHxWIbCQCws1HVrPL2pAVgtowGx01pQ5b5DZ54o3Xx8P3wCKpASH7bq0nuPgVJdxMOFYKBWwHrP0033w= 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 From: Akari Takahashi Date: Tue, 13 Jun 2023 12:18:54 +0900 Message-ID: Subject: [PATCH] Fix note_defect3 function To: gcc-patches@gcc.gnu.org Content-Type: multipart/alternative; boundary="0000000000002a140b05fdfa4c98" 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 List-Id: --0000000000002a140b05fdfa4c98 Content-Type: text/plain; charset="UTF-8" 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) { --- --0000000000002a140b05fdfa4c98--