diff options
Diffstat (limited to 'gcc/print-rtl.c')
-rw-r--r-- | gcc/print-rtl.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 66dcf92..7e0a0a0 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -178,6 +178,23 @@ print_mem_expr (FILE *outfile, const_tree expr) fputc (' ', outfile); print_generic_expr (outfile, CONST_CAST_TREE (expr), dump_flags); } + +/* Print X to FILE. */ + +static void +print_poly_int (FILE *file, poly_int64 x) +{ + HOST_WIDE_INT const_x; + if (x.is_constant (&const_x)) + fprintf (file, HOST_WIDE_INT_PRINT_DEC, const_x); + else + { + fprintf (file, "[" HOST_WIDE_INT_PRINT_DEC, x.coeffs[0]); + for (int i = 1; i < NUM_POLY_INT_COEFFS; ++i) + fprintf (file, ", " HOST_WIDE_INT_PRINT_DEC, x.coeffs[i]); + fprintf (file, "]"); + } +} #endif /* Subroutine of print_rtx_operand for handling code '0'. @@ -509,9 +526,11 @@ rtx_writer::print_rtx_operand_code_r (const_rtx in_rtx) if (REG_EXPR (in_rtx)) print_mem_expr (m_outfile, REG_EXPR (in_rtx)); - if (REG_OFFSET (in_rtx)) - fprintf (m_outfile, "+" HOST_WIDE_INT_PRINT_DEC, - REG_OFFSET (in_rtx)); + if (maybe_ne (REG_OFFSET (in_rtx), 0)) + { + fprintf (m_outfile, "+"); + print_poly_int (m_outfile, REG_OFFSET (in_rtx)); + } fputs (" ]", m_outfile); } if (regno != ORIGINAL_REGNO (in_rtx)) |