File: ssa-dom-thread-12.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A8-2019-q3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 571,828 kB
  • sloc: ansic: 2,937,651; cpp: 881,644; ada: 597,189; makefile: 65,528; asm: 56,499; xml: 46,621; exp: 24,747; sh: 19,684; python: 7,256; pascal: 4,370; awk: 3,497; perl: 2,695; yacc: 316; ml: 285; f90: 234; lex: 198; objc: 194; haskell: 119
file content (36 lines) | stat: -rw-r--r-- 963 bytes parent folder | download | duplicates (2)
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
/* { dg-do compile } */ 
/* { dg-options "-O2 -fdump-tree-dom2-details -w" } */
typedef long unsigned int size_t;
union tree_node;
typedef union tree_node *tree;
typedef union gimple_statement_d *gimple;
typedef const union gimple_statement_d *const_gimple;
union gimple_statement_d
{
  unsigned num_ops;
  tree exp;
};

unsigned int x;
static inline tree
gimple_op (const_gimple gs, unsigned i)
{
  if (!(i < gs->num_ops))
    abort ();
  return gs->exp;
}

unsigned char
scan_function (gimple stmt)
{
  unsigned i;
  for (i = 0; i < stmt->num_ops - 3 ; i++)
    gimple_call_arg (stmt, i);
  gimple_op (stmt, 1);
}

/* The test which bypasses the loop is simplified prior to DOM to check
   that stmt->num_ops - 3 != 0.  When that test is false, we can derive
   a value for stmt->num_ops.  That in turn allows us to thread the jump
   for the conditional at the start of the call to gimple_op.  */
/* { dg-final { scan-tree-dump-times "Threaded" 1 "dom2"} } */