Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-2.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-thread1-details -w" } */
3
4 // Copied from ssa-dom-thread-12.c.
5
6 typedef long unsigned int size_t;
7 union tree_node;
8 typedef union tree_node *tree;
9 typedef union gimple_statement_d *gimple;
10 typedef const union gimple_statement_d *const_gimple;
11 union gimple_statement_d
12 {
13 unsigned num_ops;
14 tree exp;
15 };
16 void gimple_call_arg (gimple, unsigned);
17
18 unsigned int x;
19 static inline tree
20 gimple_op (const_gimple gs, unsigned i)
21 {
22 if (!(i < gs->num_ops))
23 __builtin_abort ();
24 return gs->exp;
25 }
26
27 unsigned char
28 scan_function (gimple stmt)
29 {
30 unsigned i;
31 for (i = 0; i < stmt->num_ops - 3 ; i++)
32 gimple_call_arg (stmt, i);
33 gimple_op (stmt, 1);
34 }
35
36 /* The test which bypasses the loop is simplified prior to DOM to check
37 that stmt->num_ops - 3 != 0. When that test is false, we can derive
38 a value for stmt->num_ops. That in turn allows us to thread the jump
39 for the conditional at the start of the call to gimple_op. */
40 /* { dg-final { scan-tree-dump-times "Registering.*jump thread" 1 "thread1"} } */