Commit 00a7ba58 by Jakub Jelinek Committed by Jakub Jelinek

gcov-io.c (gcov_read_words): Don't call memmove if excess is 0.

	* gcov-io.c (gcov_read_words): Don't call memmove if excess is 0.
	* data-streamer-in.c (streamer_read_hwi): Shift UHWI 1 instead of
	HWI 1 and negate the unsigned value.
	* expmed.c (expand_sdiv_pow2): For modes wider than word always
	use AND instead of shift.
	* wide-int-print.cc (print_decs): Negate UHWI instead of HWI.
c-family/
	* c-ada-spec.c (dump_ada_nodes): Don't call qsort if 
	comments->count <= 1, as comments->entries might be NULL.

From-SVN: r212264
parent e2152673
2014-07-03 Jakub Jelinek <jakub@redhat.com>
* gcov-io.c (gcov_read_words): Don't call memmove if excess is 0.
* data-streamer-in.c (streamer_read_hwi): Shift UHWI 1 instead of
HWI 1 and negate the unsigned value.
* expmed.c (expand_sdiv_pow2): For modes wider than word always
use AND instead of shift.
* wide-int-print.cc (print_decs): Negate UHWI instead of HWI.
2014-07-03 Marek Polacek <polacek@redhat.com> 2014-07-03 Marek Polacek <polacek@redhat.com>
* doc/invoke.texi (-fsanitize=bounds): Tweak wording. * doc/invoke.texi (-fsanitize=bounds): Tweak wording.
......
2014-07-03 Jakub Jelinek <jakub@redhat.com>
* c-ada-spec.c (dump_ada_nodes): Don't call qsort if
comments->count <= 1, as comments->entries might be NULL.
2014-07-01 Marek Polacek <polacek@redhat.com> 2014-07-01 Marek Polacek <polacek@redhat.com>
* c.opt (Wint-conversion): New option. * c.opt (Wint-conversion): New option.
......
...@@ -636,6 +636,7 @@ dump_ada_nodes (pretty_printer *pp, const char *source_file) ...@@ -636,6 +636,7 @@ dump_ada_nodes (pretty_printer *pp, const char *source_file)
comments = cpp_get_comments (parse_in); comments = cpp_get_comments (parse_in);
/* Sort the comments table by sloc. */ /* Sort the comments table by sloc. */
if (comments->count > 1)
qsort (comments->entries, comments->count, sizeof (cpp_comment), qsort (comments->entries, comments->count, sizeof (cpp_comment),
compare_comment); compare_comment);
......
...@@ -174,7 +174,7 @@ streamer_read_hwi (struct lto_input_block *ib) ...@@ -174,7 +174,7 @@ streamer_read_hwi (struct lto_input_block *ib)
if ((byte & 0x80) == 0) if ((byte & 0x80) == 0)
{ {
if ((shift < HOST_BITS_PER_WIDE_INT) && (byte & 0x40)) if ((shift < HOST_BITS_PER_WIDE_INT) && (byte & 0x40))
result |= - ((HOST_WIDE_INT)1 << shift); result |= - (HOST_WIDE_INT_1U << shift);
return result; return result;
} }
......
...@@ -3795,7 +3795,8 @@ expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d) ...@@ -3795,7 +3795,8 @@ expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d)
temp = gen_reg_rtx (mode); temp = gen_reg_rtx (mode);
temp = emit_store_flag (temp, LT, op0, const0_rtx, mode, 0, -1); temp = emit_store_flag (temp, LT, op0, const0_rtx, mode, 0, -1);
if (shift_cost (optimize_insn_for_speed_p (), mode, ushift) if (GET_MODE_BITSIZE (mode) >= BITS_PER_WORD
|| shift_cost (optimize_insn_for_speed_p (), mode, ushift)
> COSTS_N_INSNS (1)) > COSTS_N_INSNS (1))
temp = expand_binop (mode, and_optab, temp, gen_int_mode (d - 1, mode), temp = expand_binop (mode, and_optab, temp, gen_int_mode (d - 1, mode),
NULL_RTX, 0, OPTAB_LIB_WIDEN); NULL_RTX, 0, OPTAB_LIB_WIDEN);
......
...@@ -489,14 +489,15 @@ gcov_read_words (unsigned words) ...@@ -489,14 +489,15 @@ gcov_read_words (unsigned words)
if (excess < words) if (excess < words)
{ {
gcov_var.start += gcov_var.offset; gcov_var.start += gcov_var.offset;
#if IN_LIBGCOV
if (excess) if (excess)
{ {
#if IN_LIBGCOV
memcpy (gcov_var.buffer, gcov_var.buffer + gcov_var.offset, 4); memcpy (gcov_var.buffer, gcov_var.buffer + gcov_var.offset, 4);
}
#else #else
memmove (gcov_var.buffer, gcov_var.buffer + gcov_var.offset, excess * 4); memmove (gcov_var.buffer, gcov_var.buffer + gcov_var.offset,
excess * 4);
#endif #endif
}
gcov_var.offset = 0; gcov_var.offset = 0;
gcov_var.length = excess; gcov_var.length = excess;
#if IN_LIBGCOV #if IN_LIBGCOV
......
...@@ -62,7 +62,8 @@ print_decs (const wide_int_ref &wi, char *buf) ...@@ -62,7 +62,8 @@ print_decs (const wide_int_ref &wi, char *buf)
|| (wi.get_len () == 1)) || (wi.get_len () == 1))
{ {
if (wi::neg_p (wi)) if (wi::neg_p (wi))
sprintf (buf, "-" HOST_WIDE_INT_PRINT_UNSIGNED, -wi.to_shwi ()); sprintf (buf, "-" HOST_WIDE_INT_PRINT_UNSIGNED,
-(unsigned HOST_WIDE_INT) wi.to_shwi ());
else else
sprintf (buf, HOST_WIDE_INT_PRINT_DEC, wi.to_shwi ()); sprintf (buf, HOST_WIDE_INT_PRINT_DEC, wi.to_shwi ());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment