Clean up some minor white space issues in trans-decl.c and trans-expr.c
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr54684.C
blob4934011e45fcec3119b1dd358c5e1f0722d3dee5
1 // { dg-do compile }
2 // { dg-options "-fno-short-enums" }
4 typedef union tree_node *tree;
5 typedef union gimple_statement_d *gimple;
6 struct vec_prefix { unsigned num_; };
7 template<typename T> struct vec_t {
8     unsigned length (void) const;
9     T &operator[] (unsigned);
10     vec_prefix prefix_;
11     T vec_[1];
13 template<typename T> inline unsigned vec_t<T>::length (void) const {
14     return prefix_.num_;
16 template<typename T> T & vec_t<T>::operator[] (unsigned ix) {
17     ((void)(__builtin_expect(!(ix < prefix_.num_), 0) ? __builtin_unreachable(), 0 : 0));
18     return vec_[ix];
20 enum tree_code { PARM_DECL };
21 struct tree_base {
22     enum tree_code code : 16;
23     unsigned default_def_flag : 1;
25 union tree_node {
26     struct tree_base base;
28 struct ipa_param_descriptor {
29     tree decl;
30     unsigned used : 1;
32 typedef struct ipa_param_descriptor ipa_param_descriptor_t;
33 struct ipa_node_params {
34     vec_t<ipa_param_descriptor_t> *descriptors;
36 static inline int ipa_get_param_count (struct ipa_node_params *info) {
37     return ((info->descriptors) ? (info->descriptors)->length () : 0);
39 static inline tree ipa_get_param (struct ipa_node_params *info, int i) {
40     return ((*(info->descriptors))[i]).decl;
42 static inline void ipa_set_param_used (struct ipa_node_params *info, int i, bool val) {
43     ((*(info->descriptors))[i]).used = val;
45 int ipa_get_param_decl_index (struct ipa_node_params *info, tree ptree)
47   int i, count;
48   count = ipa_get_param_count (info);
49   for (i = 0; i < count; i++)
50     if (ipa_get_param (info, i) == ptree)       return i;
51   return -1;
53 bool visit_ref_for_mod_analysis (gimple stmt __attribute__ ((__unused__)),
54                                  tree op, void *data)
56   struct ipa_node_params *info = (struct ipa_node_params *) data;
57   if (op && ((enum tree_code) (op)->base.code) == PARM_DECL)
58     {
59       int index = ipa_get_param_decl_index (info, op);
60       ((void)(__builtin_expect(!(index >= 0), 0) ? __builtin_unreachable(), 0 : 0));
61       ipa_set_param_used (info, index, true);
62     }