1  /* PR target/102543 */
       2  /* { dg-do compile } */
       3  /* { dg-options "-Ofast -march=skylake-avx512 -fdump-tree-optimized" } */
       4  /* { dg-final { scan-tree-dump-not "MEM\\\[" "optimized" } } */
       5  
       6  struct a
       7  {
       8    int a[100];
       9  };
      10  typedef struct a misaligned_t __attribute__ ((aligned (8)));
      11  typedef struct a aligned_t __attribute__ ((aligned (32)));
      12  
      13  __attribute__ ((used))
      14  __attribute__ ((noinline))
      15  void
      16  t(void *a, int misaligned, aligned_t *d)
      17  {
      18    int i,v;
      19    for (i=0;i<100;i++)
      20      {
      21        if (misaligned)
      22  	v=((misaligned_t *)a)->a[i];
      23        else
      24  	v=((aligned_t *)a)->a[i];
      25        d->a[i]+=v;
      26      }
      27  }
      28  struct b {int v; misaligned_t m;aligned_t aa;} b;
      29  aligned_t d;
      30  int
      31  main()
      32  {
      33    t(&b.m, 1, &d);
      34    return 0;
      35  }