This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] MIPS: In mips_print_address_operand pass the mode argument to mips_classify_address


Hi,

Currently the mips_print_operand_address function ignores its mode argument, and when it calls
mips_classify_address it forces the mode argument to be the machine's word mode.  This patch
makes mips_print_operand_address pass the mode argument provided to it to mips_classify_address,
so that it uses the actual mode of the mem rtx.  This patch is also a pre-requisite for the
following patch: https://gcc.gnu.org/ml/gcc-patches/2016-05/msg00314.html.

I have tested the patch on the mips-mti-elf toolchain and there have been no regressions.

The patch and ChangeLog are below.


Ok to commit?

Many thanks,



Andrew


gcc/
	* config/mips/mips.c (mips_print_operand_address): Pass the mode argument to
	mips_classify_address.



diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 399f231..6cdda3b 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -8634,11 +8634,14 @@ mips_print_operand (FILE *file, rtx op, int letter)
 /* Implement TARGET_PRINT_OPERAND_ADDRESS.  */
 
 static void
-mips_print_operand_address (FILE *file, machine_mode /*mode*/, rtx x)
+mips_print_operand_address (FILE *file, machine_mode mode, rtx x)
 {
   struct mips_address_info addr;
 
-  if (mips_classify_address (&addr, x, word_mode, true))
+  if (mode == VOIDmode)
+    mode = word_mode;
+
+  if (mips_classify_address (&addr, x, mode, true))
     switch (addr.type)
       {
       case ADDRESS_REG:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]