ivcanon-1.c

来自「Mac OS X 10.4.9 for x86 Source Code gcc」· C语言 代码 · 共 39 行

C
39
字号
/* APPLE LOCAL file lno *//* { dg-do compile } */ /* { dg-options "-O2 -ftree-loop-optimize -funroll-loops -fdump-tree-optimized" } */void foo(void){  int n = 16875;  while (n)    {      if (n&1)	bar (n);      n >>= 1;    }}static inline int power (long x, unsigned int n){  long y = n % 2 ? x : 1;  while (n >>= 1)    {      x = x * x;      if (n % 2)	y = y * x;    }  return y;}void test(long x){  bar (power (x, 10));  bar (power (x, 27));}/* All loops should be completely unrolled, so there should be no labels.  *//* { dg-final { scan-tree-dump-times "<L" 0 "optimized"} } */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?