From 4ce8f901c5c1fe14e7255a65bf5a020430aa8ab2 Mon Sep 17 00:00:00 2001 From: jasonwucj Date: Wed, 25 Apr 2018 11:22:55 +0000 Subject: [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 --- gcc/ChangeLog | 4 ++++ gcc/config/nds32/nds32.c | 5 +++-- 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,3 +1,7 @@ +2018-04-25 Chung-Ju Wu + + * config/nds32/nds32.c (nds32_print_operand): Set op_value ealier. + 2018-04-25 Chung-Ju Wu * config/nds32/nds32.h (ASM_APP_ON): Add missing newline character. 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. -- cgit v1.2.3