File: pr94899.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (49 lines) | stat: -rw-r--r-- 891 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */

typedef __INT16_TYPE__ int16_t;
typedef __INT32_TYPE__ int32_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __UINT32_TYPE__ uint32_t;

#define MAGIC (~ (uint32_t) 0 / 2 + 1)

int
f_i16_i16 (int16_t x, int16_t y)
{
  return x + MAGIC < y + MAGIC;
}

int
f_i16_i32 (int16_t x, int32_t y)
{
  return x + MAGIC < y + MAGIC;
}

int
f_i32_i32 (int32_t x, int32_t y)
{
  return x + MAGIC < y + MAGIC;
}

int
f_u32_i32 (uint32_t x, int32_t y)
{
  return x + MAGIC < y + MAGIC;
}

int
f_u32_u32 (uint32_t x, uint32_t y)
{
  return x + MAGIC < y + MAGIC;
}

int
f_i32_i32_sub (int32_t x, int32_t y)
{
  return x - MAGIC < y - MAGIC;
}

/* The addition/subtraction of constants should be optimized away.  */
/* { dg-final { scan-tree-dump-not " \\+ " "optimized"} } */
/* { dg-final { scan-tree-dump-not " \\- " "optimized"} } */