comparison gcc/testsuite/gcc.dg/tree-ssa/pr45397.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-phiopt1" } */
3
4 int foo_add (const unsigned char *tmp, int i, int val)
5 {
6 return (unsigned char)(((tmp[i] + val)>0xFF)?0xFF:(((tmp[i] + val)<0)?0:(tmp[i] + val)));
7 }
8
9 int foo_sub (const unsigned char *tmp, int i, int val)
10 {
11 return (unsigned char)(((tmp[i] - val)>0xFF)?0xFF:(((tmp[i] - val)<0)?0:(tmp[i] - val)));
12 }
13
14 int foo_mul (const unsigned char *tmp, int i, int val)
15 {
16 return (unsigned char)(((tmp[i] * val)>0xFF)?0xFF:(((tmp[i] * val)<0)?0:(tmp[i] * val)));
17 }
18
19 /* All cases should end up using min/max for the saturated operations and
20 have no control flow. */
21 /* { dg-final { scan-tree-dump-times "MAX_EXPR" 3 "phiopt1" } } */
22 /* { dg-final { scan-tree-dump-times "MIN_EXPR" 3 "phiopt1" } } */
23 /* { dg-final { scan-tree-dump-not "if " "phiopt1" } } */