2018-04-30 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-dom-thread-12.c
blob63bd12a06a413cec1937f1011665d253cbefe640
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-dom2-details -w" } */
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
10 unsigned num_ops;
11 tree exp;
14 unsigned int x;
15 static inline tree
16 gimple_op (const_gimple gs, unsigned i)
18 if (!(i < gs->num_ops))
19 abort ();
20 return gs->exp;
23 unsigned char
24 scan_function (gimple stmt)
26 unsigned i;
27 for (i = 0; i < stmt->num_ops - 3 ; i++)
28 gimple_call_arg (stmt, i);
29 gimple_op (stmt, 1);
32 /* The test which bypasses the loop is simplified prior to DOM to check
33 that stmt->num_ops - 3 != 0. When that test is false, we can derive
34 a value for stmt->num_ops. That in turn allows us to thread the jump
35 for the conditional at the start of the call to gimple_op. */
36 /* { dg-final { scan-tree-dump-times "Threaded" 1 "dom2"} } */