X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Flto-section-in.c;h=6783f4aab5f9fcd5f36de4bbf210d160e8aa9e2f;hb=f7dba16a88a2911be8b6e6c09412c14d4a3dd317;hp=4b88fb10749104e119569d316fde4ee7a4f6d858;hpb=673ca05f187ae8180b4149e16022f28187e076f4;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/lto-section-in.c b/gcc/lto-section-in.c index 4b88fb10749..6783f4aab5f 100644 --- a/gcc/lto-section-in.c +++ b/gcc/lto-section-in.c @@ -53,6 +53,7 @@ const char *lto_section_name[LTO_N_SECTION_TYPES] = "cgraph", "vars", "refs", + "asm", "jmpfuncs", "pureconst", "reference", @@ -63,70 +64,6 @@ const char *lto_section_name[LTO_N_SECTION_TYPES] = }; -/* Read an ULEB128 Number of IB. */ - -unsigned HOST_WIDE_INT -lto_input_uleb128 (struct lto_input_block *ib) -{ - unsigned HOST_WIDE_INT result = 0; - int shift = 0; - unsigned HOST_WIDE_INT byte; - - while (true) - { - byte = lto_input_1_unsigned (ib); - result |= (byte & 0x7f) << shift; - shift += 7; - if ((byte & 0x80) == 0) - return result; - } -} - -/* HOST_WIDEST_INT version of lto_input_uleb128. IB is as in - lto_input_uleb128. */ - -unsigned HOST_WIDEST_INT -lto_input_widest_uint_uleb128 (struct lto_input_block *ib) -{ - unsigned HOST_WIDEST_INT result = 0; - int shift = 0; - unsigned HOST_WIDEST_INT byte; - - while (true) - { - byte = lto_input_1_unsigned (ib); - result |= (byte & 0x7f) << shift; - shift += 7; - if ((byte & 0x80) == 0) - return result; - } -} - -/* Read an SLEB128 Number of IB. */ - -HOST_WIDE_INT -lto_input_sleb128 (struct lto_input_block *ib) -{ - HOST_WIDE_INT result = 0; - int shift = 0; - unsigned HOST_WIDE_INT byte; - - while (true) - { - byte = lto_input_1_unsigned (ib); - result |= (byte & 0x7f) << shift; - shift += 7; - if ((byte & 0x80) == 0) - { - if ((shift < HOST_BITS_PER_WIDE_INT) && (byte & 0x40)) - result |= - ((HOST_WIDE_INT)1 << shift); - - return result; - } - } -} - - /* Hooks so that the ipa passes can call into the lto front end to get sections. */ @@ -483,6 +420,16 @@ lto_get_function_in_decl_state (struct lto_file_decl_data *file_data, void lto_section_overrun (struct lto_input_block *ib) { - internal_error ("bytecode stream: trying to read %d bytes " - "after the end of the input buffer", ib->p - ib->len); + fatal_error ("bytecode stream: trying to read %d bytes " + "after the end of the input buffer", ib->p - ib->len); +} + +/* Report out of range value. */ + +void +lto_value_range_error (const char *purpose, HOST_WIDE_INT val, + HOST_WIDE_INT min, HOST_WIDE_INT max) +{ + fatal_error ("%s out of range: Range is %i to %i, value is %i", + purpose, (int)min, (int)max, (int)val); }