Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/gcc.dg/pr19340.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/gcc.dg/pr19340.c Fri Oct 27 22:46:09 2017 +0900 @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fschedule-insns2 -fsched2-use-superblocks" } */ +/* { dg-require-effective-target scheduling } */ + +extern double f (double x); + +double g (int a) +{ + int b, c, d, e = 0; + double h; + + for (d = 0; d < a; d++) + for (c = 0; c < a; c++) + b = 1; + + h = (double) e / (double) a; + + if (h) + { + h = 1.0 / h; + h = f (h); + } + else + h = 1.0; + + return h; +}