diff options
author | Paul Koning <pkoning@gcc.gnu.org> | 2010-12-07 14:55:07 -0500 |
---|---|---|
committer | Paul Koning <pkoning@gcc.gnu.org> | 2010-12-07 14:55:07 -0500 |
commit | 6b208988ad7a00e531e9807966d724b511cee25d (patch) | |
tree | ec12099bebfeb9aa04035d5651698fa6fbf68ea0 /gcc | |
parent | 0e29f7e5af0d4b5c1369fc5052b94476eadde83c (diff) | |
download | gcc-6b208988ad7a00e531e9807966d724b511cee25d.zip gcc-6b208988ad7a00e531e9807966d724b511cee25d.tar.gz gcc-6b208988ad7a00e531e9807966d724b511cee25d.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/pdp11/pdp11.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c index 2617d30..bb220f0 100644 --- a/gcc/config/pdp11/pdp11.c +++ b/gcc/config/pdp11/pdp11.c @@ -1881,7 +1881,8 @@ void output_addr_const_pdp11 (FILE *file, rtx x) { char buf[256]; - + int i; + restart: switch (GET_CODE (x)) { @@ -1905,7 +1906,13 @@ output_addr_const_pdp11 (FILE *file, rtx x) break; 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; case CONST: @@ -1953,16 +1960,10 @@ output_addr_const_pdp11 (FILE *file, rtx x) goto restart; output_addr_const_pdp11 (file, XEXP (x, 0)); - fprintf (file, "-"); - if (GET_CODE (XEXP (x, 1)) == CONST_INT - && INTVAL (XEXP (x, 1)) < 0) - { - 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)); + if (GET_CODE (XEXP (x, 1)) != CONST_INT + || INTVAL (XEXP (x, 1)) >= 0) + fprintf (file, "-"); + output_addr_const_pdp11 (file, XEXP (x, 1)); break; case ZERO_EXTEND: |