| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-optimized -fno-short-enums" } */ |
| 3 |
typedef const union tree_node *const_tree; |
| 4 |
typedef struct |
| 5 |
{ |
| 6 |
} |
| 7 |
double_int; |
| 8 |
double_int double_int_zext (double_int, unsigned); |
| 9 |
enum tree_code |
| 10 |
{ ERROR_MARK, IDENTIFIER_NODE, TREE_LIST, BLOCK, ENUMERAL_TYPE, BOOLEAN_TYPE, |
| 11 |
INTEGER_TYPE, ARRAY_TYPE, INTEGER_CST, VAR_DECL, PARM_DECL, RESULT_DECL, |
| 12 |
}; |
| 13 |
enum tree_code_class |
| 14 |
{ tcc_exceptional, tcc_constant, tcc_type, tcc_declaration, tcc_reference, }; |
| 15 |
struct tree_base |
| 16 |
{ |
| 17 |
__extension__ enum tree_code code:16; |
| 18 |
unsigned unsigned_flag:1; |
| 19 |
}; |
| 20 |
struct tree_type |
| 21 |
{ |
| 22 |
unsigned int precision:10; |
| 23 |
union tree_type_symtab |
| 24 |
{ |
| 25 |
} symtab; |
| 26 |
}; |
| 27 |
union tree_node |
| 28 |
{ |
| 29 |
struct tree_base base; |
| 30 |
struct tree_type type; |
| 31 |
}; |
| 32 |
const enum tree_code_class tree_code_type[] = |
| 33 |
{ tcc_exceptional, 1, 0, 0, 0, 0, 2, }; |
| 34 |
extern void tree_class_check_failed (const_tree, const char *); |
| 35 |
|
| 36 |
void |
| 37 |
int_fits_type_p (const_tree c, const_tree type) |
| 38 |
{ |
| 39 |
double_int dc, dd; |
| 40 |
{ |
| 41 |
if (((enum tree_code) (type)->base.code) == INTEGER_TYPE && (( |
| 42 |
{ |
| 43 |
__typeof |
| 44 |
(type) __t |
| 45 |
= (type); |
| 46 |
if |
| 47 |
(tree_code_type |
| 48 |
[(int) |
| 49 |
(((enum |
| 50 |
tree_code) |
| 51 |
(__t)-> |
| 52 |
base. |
| 53 |
code))] |
| 54 |
!= |
| 55 |
(tcc_type)) |
| 56 |
tree_class_check_failed |
| 57 |
(__t, |
| 58 |
__FUNCTION__); |
| 59 |
__t;})-> |
| 60 |
base. |
| 61 |
unsigned_flag)) |
| 62 |
dd = double_int_zext (dd, (( |
| 63 |
{ |
| 64 |
__typeof (type) __t = (type); |
| 65 |
if (tree_code_type |
| 66 |
[(int) |
| 67 |
(((enum tree_code) (__t)->base. |
| 68 |
code))] != |
| 69 |
(tcc_type)) |
| 70 |
tree_class_check_failed (__t, |
| 71 |
__FUNCTION__); |
| 72 |
__t;} |
| 73 |
)->type.precision)); |
| 74 |
} |
| 75 |
} |
| 76 |
/* The switch should be switch converted and later constant propagated. */ |
| 77 |
/* { dg-final { scan-tree-dump-not "tree_code_type" "optimized"} } */ |