(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
i386/
pr90358.c
       1  /* PR target/90358 */
       2  /* { dg-do run { target { sse4_runtime } } } */
       3  /* { dg-options "-O3 -msse4" } */
       4  
       5  struct s { unsigned int a, b, c; };
       6  
       7  void __attribute__ ((noipa))
       8  foo (struct s *restrict s1, struct s *restrict s2, int n)
       9  {
      10    for (int i = 0; i < n; ++i)
      11      {
      12        s1[i].b = s2[i].b;
      13        s1[i].c = s2[i].c;
      14        s2[i].c = 0;
      15      }
      16  }
      17                              
      18  #define N 12
      19  
      20  int
      21  main ()
      22  {
      23    struct s s1[N], s2[N];
      24    for (unsigned int j = 0; j < N; ++j)
      25      {
      26        s2[j].a = j * 5;
      27        s2[j].b = j * 5 + 2;
      28        s2[j].c = j * 5 + 4;
      29      }
      30    foo (s1, s2, N);
      31    for (unsigned int j = 0; j < N; ++j)
      32    if (s1[j].b != j * 5 + 2)
      33      __builtin_abort ();
      34    return 0;
      35  }