comparison gcc/testsuite/gcc.dg/fold-minus-6.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-cddce1" } */
3
4 int
5 fn1 (int x)
6 {
7 return 42L - (42 / x) * x;
8 }
9
10 long
11 fn2 (int x)
12 {
13 return 42L - (42 / x) * x;
14 }
15
16 int
17 fn3 (long int x)
18 {
19 return 42L - (42 / x) * x;
20 }
21
22 int
23 fn4 (unsigned int a, int b)
24 {
25 return a - (unsigned) ((a / b) * b);
26 }
27
28 int
29 fn5 (int a, unsigned int b)
30 {
31 return a - ((a / b) * b);
32 }
33
34 unsigned int
35 fn6 (int a, int b)
36 {
37 return a - ((a / b) * b);
38 }
39
40 /* { dg-final { scan-tree-dump-not " / " "cddce1" } } */
41 /* { dg-final { scan-tree-dump-not " - " "cddce1" } } */
42 /* { dg-final { scan-tree-dump-not " \\+ " "cddce1" } } */