Commit 6b208988 by Paul Koning

pdp11.c (output_addr_const_pdp11): Output negative values with sign rather than as unsigned.

* config/pdp11/pdp11.c (output_addr_const_pdp11): Output negative
values with sign rather than as unsigned.

From-SVN: r167566
parent 0e29f7e5
...@@ -1881,7 +1881,8 @@ void ...@@ -1881,7 +1881,8 @@ void
output_addr_const_pdp11 (FILE *file, rtx x) output_addr_const_pdp11 (FILE *file, rtx x)
{ {
char buf[256]; char buf[256];
int i;
restart: restart:
switch (GET_CODE (x)) switch (GET_CODE (x))
{ {
...@@ -1905,7 +1906,13 @@ output_addr_const_pdp11 (FILE *file, rtx x) ...@@ -1905,7 +1906,13 @@ output_addr_const_pdp11 (FILE *file, rtx x)
break; break;
case CONST_INT: case CONST_INT:
fprintf (file, "%#o", (int) INTVAL (x) & 0xffff); i = INTVAL (x);
if (i < 0)
{
i = -i;
fprintf (file, "-");
}
fprintf (file, "%#o", i & 0xffff);
break; break;
case CONST: case CONST:
...@@ -1953,16 +1960,10 @@ output_addr_const_pdp11 (FILE *file, rtx x) ...@@ -1953,16 +1960,10 @@ output_addr_const_pdp11 (FILE *file, rtx x)
goto restart; goto restart;
output_addr_const_pdp11 (file, XEXP (x, 0)); output_addr_const_pdp11 (file, XEXP (x, 0));
fprintf (file, "-"); if (GET_CODE (XEXP (x, 1)) != CONST_INT
if (GET_CODE (XEXP (x, 1)) == CONST_INT || INTVAL (XEXP (x, 1)) >= 0)
&& INTVAL (XEXP (x, 1)) < 0) fprintf (file, "-");
{ output_addr_const_pdp11 (file, XEXP (x, 1));
fprintf (file, targetm.asm_out.open_paren);
output_addr_const_pdp11 (file, XEXP (x, 1));
fprintf (file, targetm.asm_out.close_paren);
}
else
output_addr_const_pdp11 (file, XEXP (x, 1));
break; break;
case ZERO_EXTEND: case ZERO_EXTEND:
......
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