From 1c64aba8cdf6509533f554ad86640f274cdbe37f Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 19 Oct 2022 12:53:35 -0700 Subject: Always use TYPE_MODE instead of DECL_MODE for vector field e034c5c8957 re PR target/78643 (ICE in convert_move, at expr.c:230) fixed the case where DECL_MODE of a vector field is BLKmode and its TYPE_MODE is a vector mode because of target attribute. Remove the BLKmode check for the case where DECL_MODE of a vector field is a vector mode and its TYPE_MODE isn't a vector mode because of target attribute. gcc/ PR target/107304 * expr.cc (get_inner_reference): Always use TYPE_MODE for vector field with vector raw mode. gcc/testsuite/ PR target/107304 * gcc.target/i386/pr107304.c: New test. --- gcc/expr.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gcc/expr.cc') diff --git a/gcc/expr.cc b/gcc/expr.cc index efe387e..9145193 100644 --- a/gcc/expr.cc +++ b/gcc/expr.cc @@ -7905,8 +7905,7 @@ get_inner_reference (tree exp, poly_int64_pod *pbitsize, /* For vector fields re-check the target flags, as DECL_MODE could have been set with different target flags than the current function has. */ - if (mode == BLKmode - && VECTOR_TYPE_P (TREE_TYPE (field)) + if (VECTOR_TYPE_P (TREE_TYPE (field)) && VECTOR_MODE_P (TYPE_MODE_RAW (TREE_TYPE (field)))) mode = TYPE_MODE (TREE_TYPE (field)); } -- cgit v1.1