Commit b5872261 by Jakub Jelinek Committed by Jakub Jelinek

re PR debug/84637 (gcc/dbxout.c:684:14: runtime error: negation of…

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
parent 035fc2ad
2018-04-17 Jakub Jelinek <jakub@redhat.com>
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 <jimw@sifive.com> 2018-04-17 Jim Wilson <jimw@sifive.com>
PR 84856 PR 84856
......
...@@ -464,7 +464,7 @@ dbxout_int (int num) ...@@ -464,7 +464,7 @@ dbxout_int (int num)
if (num < 0) if (num < 0)
{ {
putc ('-', asm_out_file); putc ('-', asm_out_file);
unum = -num; unum = -(unsigned int) num;
} }
else else
unum = num; unum = num;
...@@ -671,7 +671,7 @@ stabstr_D (HOST_WIDE_INT num) ...@@ -671,7 +671,7 @@ stabstr_D (HOST_WIDE_INT num)
{ {
char buf[64]; char buf[64];
char *p = buf + sizeof buf; char *p = buf + sizeof buf;
unsigned int unum; unsigned HOST_WIDE_INT unum;
if (num == 0) if (num == 0)
{ {
...@@ -681,7 +681,7 @@ stabstr_D (HOST_WIDE_INT num) ...@@ -681,7 +681,7 @@ stabstr_D (HOST_WIDE_INT num)
if (num < 0) if (num < 0)
{ {
stabstr_C ('-'); stabstr_C ('-');
unum = -num; unum = -(unsigned HOST_WIDE_INT) num;
} }
else else
unum = num; unum = num;
......
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