aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjasonwucj <jasonwucj@138bc75d-0d04-0410-961f-82ee72b054a4>2018-04-25 11:22:55 +0000
committerjasonwucj <jasonwucj@138bc75d-0d04-0410-961f-82ee72b054a4>2018-04-25 11:22:55 +0000
commit4ce8f901c5c1fe14e7255a65bf5a020430aa8ab2 (patch)
treeb052f949d43b11b818407c6667ff4a9fa34f67ef
parent48f649b48ed43dd225073d66cbdbacbc47da1ead (diff)
[NDS32] Fix print operand for cctl register.
gcc/ * config/nds32/nds32.c (nds32_print_operand): Set op_value ealier. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@259643 138bc75d-0d04-0410-961f-82ee72b054a4
-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 3c41147be5f..3c7e29d2d7d 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 8994c13d7b0..da8af4c6f1a 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.