From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 283CC3858022; Tue, 22 Nov 2022 08:49:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 283CC3858022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669106948; bh=ZWhz5JDqMZX3ynr9yCVafl+q+Em+gbodmvaYNPN4NbE=; h=From:To:Subject:Date:From; b=fu19Pj8s1ReRIjUSmHJFUs6U1fSEIM1Zmviw+NZv8wAjk70fKL35uhhPWSu9nzAhD BRhx2QoxfSqcRx53I7JODAydzyrnh4R72hZBtfr6kKzHIDnKwf0GtuVgs+5PX1CRHJ Kadk2iyun7+iN/hD2CPup1MqptuQhO7VB69OUX9c= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4227] tree-optimization/107672 - avoid vector mode type_for_mode call X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: 1a06ae6f2f4f292fd05a900bcf433cb4282da1e3 X-Git-Newrev: 09b7993ab6d93716f77c03ff9a9165fa4b579f0d Message-Id: <20221122084908.283CC3858022@sourceware.org> Date: Tue, 22 Nov 2022 08:49:08 +0000 (GMT) List-Id: https://gcc.gnu.org/g:09b7993ab6d93716f77c03ff9a9165fa4b579f0d commit r13-4227-g09b7993ab6d93716f77c03ff9a9165fa4b579f0d Author: Richard Biener Date: Tue Nov 22 09:03:53 2022 +0100 tree-optimization/107672 - avoid vector mode type_for_mode call The following avoids using type_for_mode on vector modes which might not work for all frontends. Instead we look for the inner mode type and use build_vector_type_for_mode instead. PR tree-optimization/107672 * tree-vect-stmts.cc (supportable_widening_operation): Avoid type_for_mode on vector modes. Diff: --- gcc/tree-vect-stmts.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index bc0ef136f19..b35b986889d 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -12195,9 +12195,15 @@ supportable_widening_operation (vec_info *vinfo, intermediate_type = vect_halve_mask_nunits (prev_type, intermediate_mode); else - intermediate_type - = lang_hooks.types.type_for_mode (intermediate_mode, - TYPE_UNSIGNED (prev_type)); + { + gcc_assert (VECTOR_MODE_P (intermediate_mode)); + tree intermediate_element_type + = lang_hooks.types.type_for_mode (GET_MODE_INNER (intermediate_mode), + TYPE_UNSIGNED (prev_type)); + intermediate_type + = build_vector_type_for_mode (intermediate_element_type, + intermediate_mode); + } if (VECTOR_BOOLEAN_TYPE_P (intermediate_type) && VECTOR_BOOLEAN_TYPE_P (prev_type)