From: Jakub Jelinek Date: Tue, 17 Apr 2018 22:18:47 +0000 (+0200) Subject: re PR debug/84637 (gcc/dbxout.c:684:14: runtime error: negation of -92233720368547758... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b5872261d5e448c85903c4f3df7e1970fc4c112a;p=gcc.git re PR debug/84637 (gcc/dbxout.c:684:14: runtime error: negation of -9223372036854775808 cannot be represented in type 'long int'; cast to an unsigned type to negate this value to itself) PR debug/84637 * dbxout.c (dbxout_int): Perform negation in unsigned int type. (stabstr_D): Change type of unum from unsigned int to unsigned HOST_WIDE_INT. Perform negation in unsigned HOST_WIDE_INT type. From-SVN: r259451 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bf4f7cc9221..2d4966d2a79 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-04-17 Jakub Jelinek + + PR debug/84637 + * dbxout.c (dbxout_int): Perform negation in unsigned int type. + (stabstr_D): Change type of unum from unsigned int to + unsigned HOST_WIDE_INT. Perform negation in unsigned HOST_WIDE_INT + type. + 2018-04-17 Jim Wilson PR 84856 diff --git a/gcc/dbxout.c b/gcc/dbxout.c index a77e652d3d2..81575369224 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -464,7 +464,7 @@ dbxout_int (int num) if (num < 0) { putc ('-', asm_out_file); - unum = -num; + unum = -(unsigned int) num; } else unum = num; @@ -671,7 +671,7 @@ stabstr_D (HOST_WIDE_INT num) { char buf[64]; char *p = buf + sizeof buf; - unsigned int unum; + unsigned HOST_WIDE_INT unum; if (num == 0) { @@ -681,7 +681,7 @@ stabstr_D (HOST_WIDE_INT num) if (num < 0) { stabstr_C ('-'); - unum = -num; + unum = -(unsigned HOST_WIDE_INT) num; } else unum = num;