Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/no-strict-overflow-7.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* { dg-do compile } */ | 1 /* { dg-do compile } */ |
2 /* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */ | 2 /* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */ |
3 | 3 |
4 /* Source: Ian Lance Taylor. Dual of strict-overflow-6.c. */ | 4 /* Source: Ian Lance Taylor. Dual of strict-overflow-6.c. */ |
5 | 5 |
6 /* We can simplify the conditional because pointer overflow always has | 6 /* We can only simplify the conditional when using strict overflow |
7 undefined semantics. */ | 7 semantics. */ |
8 | 8 |
9 int | 9 int |
10 foo (char* p) | 10 foo (char* p) |
11 { | 11 { |
12 return p + 1000 < p; | 12 return p + 1000 < p; |
13 } | 13 } |
14 | 14 |
15 /* { dg-final { scan-tree-dump "return 0" "optimized" } } */ | 15 /* { dg-final { scan-tree-dump "\[+\]\[ \]*1000" "optimized" } } */ |