2018-06-25 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2017-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/78643
+ PR target/80583
+ * expr.c (get_inner_reference): If DECL_MODE of a non-bitfield
+ is BLKmode for vector field with vector raw mode, use TYPE_MODE
+ instead of DECL_MODE.
+
2017-11-29 Jakub Jelinek <jakub@redhat.com>
PR target/80819
size. */
mode = TYPE_MODE (DECL_BIT_FIELD_TYPE (field));
else if (!DECL_BIT_FIELD (field))
- mode = DECL_MODE (field);
+ {
+ mode = DECL_MODE (field);
+ /* 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))
+ && VECTOR_MODE_P (TYPE_MODE_RAW (TREE_TYPE (field))))
+ mode = TYPE_MODE (TREE_TYPE (field));
+ }
else if (DECL_MODE (field) == BLKmode)
blkmode_bitfield = true;
2018-06-25 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2017-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/78643
+ PR target/80583
+ * gcc.target/i386/pr80583.c: New test.
+
2017-11-29 Jakub Jelinek <jakub@redhat.com>
PR target/80819
--- /dev/null
+/* PR target/80583 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -mno-avx" } */
+
+typedef int V __attribute__((__vector_size__(32)));
+struct S { V a; };
+
+V __attribute__((target ("avx")))
+foo (struct S *b)
+{
+ V x = b->a;
+ return x;
+}