annotate gcc/testsuite/gcc.dg/no-strict-overflow-6.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 /* Source: Ian Lance Taylor. */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 /* VRP test. We can not simplify the conditional when not using
kono
parents:
diff changeset
7 strict overflow semantics. We don't test this with
kono
parents:
diff changeset
8 -fstrict-overflow because it turns into an infinite loop. That is
kono
parents:
diff changeset
9 OK but it would also be OK to not do that. */
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 int
kono
parents:
diff changeset
12 foo ()
kono
parents:
diff changeset
13 {
kono
parents:
diff changeset
14 int i, bits;
kono
parents:
diff changeset
15 for (i = 1, bits = 1; i > 0; i += i)
kono
parents:
diff changeset
16 ++bits;
kono
parents:
diff changeset
17 return bits - sizeof(int) * __CHAR_BIT__;
kono
parents:
diff changeset
18 }
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 /* { dg-final { scan-tree-dump "return 0" "optimized" } } */