summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.dg/torture/pr54684.C
blob: 4934011e45fcec3119b1dd358c5e1f0722d3dee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// { dg-do compile }
// { dg-options "-fno-short-enums" }

typedef union tree_node *tree;
typedef union gimple_statement_d *gimple;
struct vec_prefix { unsigned num_; };
template<typename T> struct vec_t {
    unsigned length (void) const;
    T &operator[] (unsigned);
    vec_prefix prefix_;
    T vec_[1];
};
template<typename T> inline unsigned vec_t<T>::length (void) const {
    return prefix_.num_;
}
template<typename T> T & vec_t<T>::operator[] (unsigned ix) {
    ((void)(__builtin_expect(!(ix < prefix_.num_), 0) ? __builtin_unreachable(), 0 : 0));
    return vec_[ix];
}
enum tree_code { PARM_DECL };
struct tree_base {
    enum tree_code code : 16;
    unsigned default_def_flag : 1;
};
union tree_node {
    struct tree_base base;
};
struct ipa_param_descriptor {
    tree decl;
    unsigned used : 1;
};
typedef struct ipa_param_descriptor ipa_param_descriptor_t;
struct ipa_node_params {
    vec_t<ipa_param_descriptor_t> *descriptors;
};
static inline int ipa_get_param_count (struct ipa_node_params *info) {
    return ((info->descriptors) ? (info->descriptors)->length () : 0);
}
static inline tree ipa_get_param (struct ipa_node_params *info, int i) {
    return ((*(info->descriptors))[i]).decl;
}
static inline void ipa_set_param_used (struct ipa_node_params *info, int i, bool val) {
    ((*(info->descriptors))[i]).used = val;
}
int ipa_get_param_decl_index (struct ipa_node_params *info, tree ptree)
{
  int i, count;
  count = ipa_get_param_count (info);
  for (i = 0; i < count; i++)
    if (ipa_get_param (info, i) == ptree)       return i;
  return -1;
}
bool visit_ref_for_mod_analysis (gimple stmt __attribute__ ((__unused__)),
				 tree op, void *data)
{
  struct ipa_node_params *info = (struct ipa_node_params *) data;
  if (op && ((enum tree_code) (op)->base.code) == PARM_DECL)
    {
      int index = ipa_get_param_decl_index (info, op);
      ((void)(__builtin_expect(!(index >= 0), 0) ? __builtin_unreachable(), 0 : 0));
      ipa_set_param_used (info, index, true);
    }
}
OpenPOWER on IntegriCloud