From: Chung-Ju Wu Date: Wed, 25 Apr 2018 11:22:55 +0000 (+0000) Subject: [NDS32] Fix print operand for cctl register. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bfeb66850ffd5f25430db8a42f1dbfdc224a4ac2;p=gcc.git [NDS32] Fix print operand for cctl register. gcc/ * config/nds32/nds32.c (nds32_print_operand): Set op_value ealier. From-SVN: r259643 --- 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.