Debian Codegraph @

gcc/testsuite/gcc.dg/torture/crc-side-instr-16.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fdump-tree-crc-details" } */
3 /* { dg-skip-if "" { *-*-* } { "-O0" "-O1" "-Os" "-flto" } } */
4
5 typedef unsigned short ee_u16;
6 typedef unsigned char ee_u8;
7
8 __attribute__ ((noinline,noipa))
9 int foo (int c)
10 {
11 return c*c;
12 }
13
14 ee_u16 crcu8 (ee_u8 data, ee_u16 crc) {
15 ee_u16 i = 0, x16 = 0, carry = 0;
16 int c;
17 for (i = 0; i < 8; i++) {
18 c += i*2;
19 c = foo (c); //Warning, encountered unsupported statement, while executing gimple statements!
20 x16 = (ee_u8) ((data & 1) ^ ((ee_u8) crc & 1));
21 data >>= 1;
22 if (x16 == 1) {
23 crc ^= 0x4002;
24 carry = 1;
25 } else
26 carry = 0;
27 crc >>= 1;
28 if (carry)
29 {
30 crc |= 0x8000;
31 }
32 else
33 crc &= 0x7fff;
34 }
35 return crc;
36 }
37
38 /* { dg-final { scan-tree-dump-times "calculates CRC!" 0 "crc" } } */