1 /* { dg-do compile } */ 2 /* { dg-options "-O2 -fdump-tree-ethread-stats" } */ 3 typedef struct basic_block_def *basic_block; 4 struct basic_block_def; 5 struct edge_def; 6 typedef struct edge_def *edge; 7 typedef struct VEC_edge_base 8 { 9 unsigned num; 10 } VEC_edge_base; 11 typedef struct VEC_edge_none 12 { 13 VEC_edge_base base; 14 } VEC_edge_none; 15 static __inline__ unsigned VEC_edge_base_length(VEC_edge_base * vec_)16VEC_edge_base_length (VEC_edge_base * vec_) 17 { 18 return vec_ ? vec_->num : 0; 19 } 20 21 typedef struct VEC_edge_gc 22 { 23 VEC_edge_base base; 24 } VEC_edge_gc; 25 struct basic_block_def 26 { 27 VEC_edge_gc *succs; 28 }; 29 void foo (void); 30 31 unsigned char cleanup_empty_eh(basic_block bb)32cleanup_empty_eh (basic_block bb) 33 { 34 edge e_out; 35 switch (VEC_edge_base_length (&bb->succs->base)) 36 { 37 case 1: 38 foo (); 39 } 40 } 41 /* { dg-final { scan-tree-dump "Jumps threaded: 1" "ethread"} } */ 42 43