1  /* PR target/105292 */
       2  /* Reported by Koakuma <koachan+gccbugs@protonmail.com> */
       3  
       4  /* { dg-do compile } */
       5  /* { dg-options "-O3 -mvis2" } */
       6  
       7  extern void get_vbytes_v2 (unsigned);
       8  
       9  typedef struct {
      10    unsigned ctt_info;
      11    unsigned ctt_size;
      12  } ctf_type_t;
      13  
      14  typedef struct {
      15    unsigned short cts_offset;
      16    unsigned short cts_bits;
      17  } ctf_slice_t;
      18  
      19  void flip_types_len (ctf_type_t *t, int bsx1, int bsx2)
      20  {
      21    const int kind = t->ctt_info;
      22  
      23    get_vbytes_v2 (t->ctt_size);
      24  
      25    if (kind == 4)
      26      {
      27        ctf_slice_t *s = (ctf_slice_t *)t;
      28        s->cts_offset = __builtin_bswap16(bsx1);
      29        s->cts_bits   = __builtin_bswap16(bsx2);
      30      }
      31  }