From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1285) id 28B4D3858D1E; Sun, 19 May 2024 09:40:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28B4D3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716111614; bh=HYc+fdvExtEwechqKJoJq85P8aSnXCsiai/rXIZsx3M=; h=From:To:Subject:Date:From; b=YebvxxwID0iltAddywt04gElWnCET4nTVmPRS03z4o8d2P+uQg0pMZdVPBYMB/VYn zG4eWcjnCNGPzQsW4TkzpRZ/ac9hiDCQ6yDrSNJqmJjmfGkhX/Voyruyts2mB8l4bT EbSh1nqmnVZIJVTRVmsZgZARoZVhG4ULyntDgMSA= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Eric Botcazou To: gcc-cvs@gcc.gnu.org Subject: [gcc r15-649] Fix oversight in latest change to can_mult_highpart_p X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 1676ef6e91b902f592270e4bcf10b4fc342e200d X-Git-Newrev: 3db8dd4139a7a5ce941684f1fc05ee0652e35544 Message-Id: <20240519094014.28B4D3858D1E@sourceware.org> Date: Sun, 19 May 2024 09:40:14 +0000 (GMT) List-Id: https://gcc.gnu.org/g:3db8dd4139a7a5ce941684f1fc05ee0652e35544 commit r15-649-g3db8dd4139a7a5ce941684f1fc05ee0652e35544 Author: Eric Botcazou Date: Sun May 19 11:38:40 2024 +0200 Fix oversight in latest change to can_mult_highpart_p gcc/ * optabs-query.cc (can_mult_highpart_p): Test for the existence of a wider mode instead of requiring it. Diff: --- gcc/optabs-query.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gcc/optabs-query.cc b/gcc/optabs-query.cc index de145be7075f..5149de57468d 100644 --- a/gcc/optabs-query.cc +++ b/gcc/optabs-query.cc @@ -510,17 +510,16 @@ int can_mult_highpart_p (machine_mode mode, bool uns_p) { optab op; - scalar_int_mode int_mode; + scalar_int_mode int_mode, wider_mode; op = uns_p ? umul_highpart_optab : smul_highpart_optab; if (optab_handler (op, mode) != CODE_FOR_nothing) return 1; /* If the mode is integral, synth from widening or larger operations. */ - if (is_a (mode, &int_mode)) + if (is_a (mode, &int_mode) + && GET_MODE_WIDER_MODE (int_mode).exists (&wider_mode)) { - scalar_int_mode wider_mode = GET_MODE_WIDER_MODE (int_mode).require (); - op = uns_p ? umul_widen_optab : smul_widen_optab; if (convert_optab_handler (op, wider_mode, mode) != CODE_FOR_nothing) return 2;