+2013-06-06 Richard Biener <rguenther@suse.de>
+
+ * lto-streamer.h (enum LTO_tags): Move LTO_tree_pickle_reference
+ after LTO_null.
+ (lto_tag_is_tree_code_p): Adjust.
+ (lto_tag_is_gimple_code_p): Likewise.
+ (lto_gimple_code_to_tag): Likewise.
+ (lto_tag_to_gimple_code): Likewise.
+ (lto_tree_code_to_tag): Likewise.
+ (lto_tag_to_tree_code): Likewise.
+ * data-streamer.h (streamer_write_hwi_in_range): Use
+ uhwi streaming to stream the normalized range.
+ (streamer_read_hwi_in_range): Likewise.
+
2013-06-05 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm.md (enabled_for_depr_it): New attribute.
&& range < 0x7fffffff);
val -= min;
- streamer_write_char_stream (obs, val & 255);
- if (range >= 0xff)
- streamer_write_char_stream (obs, (val >> 8) & 255);
- if (range >= 0xffff)
- streamer_write_char_stream (obs, (val >> 16) & 255);
- if (range >= 0xffffff)
- streamer_write_char_stream (obs, (val >> 24) & 255);
+ streamer_write_uhwi_stream (obs, (unsigned HOST_WIDE_INT) val);
}
/* Input VAL into OBS and verify it is in range MIN...MAX that is supposed
HOST_WIDE_INT max)
{
HOST_WIDE_INT range = max - min;
- HOST_WIDE_INT val = streamer_read_uchar (ib);
+ unsigned HOST_WIDE_INT uval = streamer_read_uhwi (ib);
gcc_checking_assert (range > 0 && range < 0x7fffffff);
- if (range >= 0xff)
- val |= ((HOST_WIDE_INT)streamer_read_uchar (ib)) << 8;
- if (range >= 0xffff)
- val |= ((HOST_WIDE_INT)streamer_read_uchar (ib)) << 16;
- if (range >= 0xffffff)
- val |= ((HOST_WIDE_INT)streamer_read_uchar (ib)) << 24;
- val += min;
+ HOST_WIDE_INT val = (HOST_WIDE_INT) (uval + (unsigned HOST_WIDE_INT) min);
if (val < min || val > max)
lto_value_range_error (purpose, val, min, max);
return val;
{
LTO_null = 0,
+ /* Special for streamer. Reference to previously-streamed node. */
+ LTO_tree_pickle_reference,
+
/* Reserve enough entries to fit all the tree and gimple codes handled
by the streamer. This guarantees that:
/* EH try/catch node. */
LTO_eh_catch,
- /* Special for global streamer. Reference to previously-streamed node. */
- LTO_tree_pickle_reference,
-
/* References to indexable tree nodes. These objects are stored in
tables that are written separately from the function bodies that
reference them. This way they can be instantiated even when the
static inline bool
lto_tag_is_tree_code_p (enum LTO_tags tag)
{
- return tag > LTO_null && (unsigned) tag <= MAX_TREE_CODES;
+ return tag > LTO_tree_pickle_reference && (unsigned) tag <= MAX_TREE_CODES;
}
static inline bool
lto_tag_is_gimple_code_p (enum LTO_tags tag)
{
- return (unsigned) tag >= NUM_TREE_CODES + 1
- && (unsigned) tag < 1 + NUM_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE;
+ return (unsigned) tag >= NUM_TREE_CODES + 2
+ && (unsigned) tag < 2 + NUM_TREE_CODES + LAST_AND_UNUSED_GIMPLE_CODE;
}
static inline enum LTO_tags
lto_gimple_code_to_tag (enum gimple_code code)
{
- return (enum LTO_tags) ((unsigned) code + NUM_TREE_CODES + 1);
+ return (enum LTO_tags) ((unsigned) code + NUM_TREE_CODES + 2);
}
lto_tag_to_gimple_code (enum LTO_tags tag)
{
gcc_assert (lto_tag_is_gimple_code_p (tag));
- return (enum gimple_code) ((unsigned) tag - NUM_TREE_CODES - 1);
+ return (enum gimple_code) ((unsigned) tag - NUM_TREE_CODES - 2);
}
static inline enum LTO_tags
lto_tree_code_to_tag (enum tree_code code)
{
- return (enum LTO_tags) ((unsigned) code + 1);
+ return (enum LTO_tags) ((unsigned) code + 2);
}
lto_tag_to_tree_code (enum LTO_tags tag)
{
gcc_assert (lto_tag_is_tree_code_p (tag));
- return (enum tree_code) ((unsigned) tag - 1);
+ return (enum tree_code) ((unsigned) tag - 2);
}
/* Check that tag ACTUAL == EXPECTED. */