https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78643

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
E.g. the following untested patch fixes it (or we could do it in the callers):
--- gcc/expr.c.jj       2017-08-29 19:03:09.000000000 +0200
+++ gcc/expr.c  2017-08-30 02:09:33.150618229 +0200
@@ -7010,7 +7010,11 @@ get_inner_reference (tree exp, HOST_WIDE
             size.  */
        mode = TYPE_MODE (DECL_BIT_FIELD_TYPE (field));
       else if (!DECL_BIT_FIELD (field))
-       mode = DECL_MODE (field);
+       {
+         mode = DECL_MODE (field);
+         if (mode == BLKmode && VECTOR_TYPE_P (TREE_TYPE (exp)))
+           mode = TYPE_MODE (TREE_TYPE (exp));
+       }
       else if (DECL_MODE (field) == BLKmode)
        blkmode_bitfield = true;

Reply via email to