(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
rotate-9.c
       1  /* PR tree-optimization/86401 */
       2  /* { dg-do compile } */
       3  /* { dg-options "-O2 -fno-ipa-icf -fdump-tree-optimized" } */
       4  /* { dg-final { scan-tree-dump-times "r\[<>]\[<>]" 2 "optimized" } } */
       5  
       6  unsigned int
       7  f1 (unsigned int x, unsigned int s)
       8  {
       9    unsigned int t = s % (__CHAR_BIT__ * __SIZEOF_INT__);
      10    return (x << t) | (x >> (((__CHAR_BIT__ * __SIZEOF_INT__) - t) % (__CHAR_BIT__ * __SIZEOF_INT__)));
      11  }
      12  
      13  unsigned int
      14  f2 (unsigned int x, unsigned int s)
      15  {
      16    int n = __CHAR_BIT__ * __SIZEOF_INT__;
      17    unsigned int t = s % n;
      18    return (x << t) | (x >> ((n - t) % n));
      19  }