aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChung-Ju Wu <jasonwucj@gmail.com>2018-04-25 11:22:55 +0000
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>2018-04-25 11:22:55 +0000
commitbfeb66850ffd5f25430db8a42f1dbfdc224a4ac2 (patch)
treeb052f949d43b11b818407c6667ff4a9fa34f67ef /gcc
parentc77562ca508af45672a9f5644f62930501729667 (diff)
downloadgcc-bfeb66850ffd5f25430db8a42f1dbfdc224a4ac2.zip
gcc-bfeb66850ffd5f25430db8a42f1dbfdc224a4ac2.tar.gz
gcc-bfeb66850ffd5f25430db8a42f1dbfdc224a4ac2.tar.bz2
[NDS32] Fix print operand for cctl register.
gcc/ * config/nds32/nds32.c (nds32_print_operand): Set op_value ealier. From-SVN: r259643
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/nds32/nds32.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3c41147..3c7e29d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2018-04-25 Chung-Ju Wu <jasonwucj@gmail.com>
+ * config/nds32/nds32.c (nds32_print_operand): Set op_value ealier.
+
+2018-04-25 Chung-Ju Wu <jasonwucj@gmail.com>
+
* config/nds32/nds32.h (ASM_APP_ON): Add missing newline character.
2018-04-25 Richard Biener <rguenther@suse.de>
diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c
index 8994c13..da8af4c 100644
--- a/gcc/config/nds32/nds32.c
+++ b/gcc/config/nds32/nds32.c
@@ -2944,13 +2944,15 @@ nds32_asm_globalize_label (FILE *stream, const char *name)
static void
nds32_print_operand (FILE *stream, rtx x, int code)
{
+ HOST_WIDE_INT op_value = 0;
HOST_WIDE_INT one_position;
HOST_WIDE_INT zero_position;
bool pick_lsb_p = false;
bool pick_msb_p = false;
int regno;
- int op_value;
+ if (CONST_INT_P (x))
+ op_value = INTVAL (x);
switch (code)
{
@@ -3003,7 +3005,6 @@ nds32_print_operand (FILE *stream, rtx x, int code)
case 'V':
/* 'x' is supposed to be CONST_INT, get the value. */
gcc_assert (CONST_INT_P (x));
- op_value = INTVAL (x);
/* According to the Andes architecture,
the system/user register index range is 0 ~ 1023.