As we've moved to 64-bit systems, the padding information has become
conditionally inaccurate. I also hit cases where invalid tree codes
did not get flagged as invalid.
gcc/
* tree-core.h (tree_decl_with_vis, tree_function_decl):
Note additional padding on 64-bits
* tree.c (cache_integer_cst): Note why no caching of enum literals.
(get_tree_code_name): Robustify error case.
/* Belong to FUNCTION_DECL exclusively. */
unsigned regdecl_flag : 1;
/* 14 unused bits. */
+ /* 32 more unused on 64 bit HW. */
};
struct GTY(()) tree_var_decl {
unsigned replaceable_operator : 1;
/* 11 bits left for future expansion. */
+ /* 32 bits on 64-bit HW. */
};
struct GTY(()) tree_translation_unit_decl {
break;
case ENUMERAL_TYPE:
+ /* The slot used by TYPE_CACHED_VALUES is used for the enum
+ members. */
break;
default:
{
const char *invalid = "<invalid tree code>";
- if (code >= MAX_TREE_CODES)
+ /* The tree_code enum promotes to signed, but we could be getting
+ invalid values, so force an unsigned comparison. */
+ if (unsigned (code) >= MAX_TREE_CODES)
{
if (code == 0xa5a5)
return "ggc_freed";