Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/tree-ssa/pr45397.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 "-O2 -fdump-tree-phiopt1" } */ | 2 /* { dg-options "-O2 -fdump-tree-phiopt -fdump-tree-evrp" } */ |
3 | 3 |
4 int foo_add (const unsigned char *tmp, int i, int val) | 4 int foo_add (const unsigned char *tmp, int i, int val) |
5 { | 5 { |
6 return (unsigned char)(((tmp[i] + val)>0xFF)?0xFF:(((tmp[i] + val)<0)?0:(tmp[i] + val))); | 6 return (unsigned char)(((tmp[i] + val)>0xFF)?0xFF:(((tmp[i] + val)<0)?0:(tmp[i] + val))); |
7 } | 7 } |
16 return (unsigned char)(((tmp[i] * val)>0xFF)?0xFF:(((tmp[i] * val)<0)?0:(tmp[i] * val))); | 16 return (unsigned char)(((tmp[i] * val)>0xFF)?0xFF:(((tmp[i] * val)<0)?0:(tmp[i] * val))); |
17 } | 17 } |
18 | 18 |
19 /* All cases should end up using min/max for the saturated operations and | 19 /* All cases should end up using min/max for the saturated operations and |
20 have no control flow. */ | 20 have no control flow. */ |
21 /* { dg-final { scan-tree-dump-times "MAX_EXPR" 3 "phiopt1" } } */ | 21 /* EVRP leaves copies in the IL which confuses phiopt1 so we have |
22 /* { dg-final { scan-tree-dump-times "MIN_EXPR" 3 "phiopt1" } } */ | 22 to rely on phiopt2 instead. */ |
23 /* { dg-final { scan-tree-dump-not "if " "phiopt1" } } */ | 23 /* { dg-final { scan-tree-dump-not " & 255;" "evrp" } } */ |
24 /* { dg-final { scan-tree-dump-times "MAX_EXPR" 3 "phiopt1" { xfail *-*-* } } } */ | |
25 /* { dg-final { scan-tree-dump-times "MIN_EXPR" 3 "phiopt1" { xfail *-*-* } } } */ | |
26 /* { dg-final { scan-tree-dump-not "if " "phiopt1" { xfail *-*-* } } } */ | |
27 /* { dg-final { scan-tree-dump-times "MAX_EXPR" 3 "phiopt2" } } */ | |
28 /* { dg-final { scan-tree-dump-times "MIN_EXPR" 3 "phiopt2" } } */ | |
29 /* { dg-final { scan-tree-dump-not "if " "phiopt2" } } */ |