Comment 7 for bug 1642109

Revision history for this message
In , Jakub-gcc (jakub-gcc) wrote :

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;