Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-12.c

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