From b0907a6ca0f7591fd741247210aa8ac709dd784a Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Thu, 14 May 2009 02:07:00 +0000 Subject: [PATCH] mips.c (mips_print_operand): Check for invalid values of LETTER. * config/mips/mips.c (mips_print_operand) : Check for invalid values of LETTER. From-SVN: r147517 --- gcc/ChangeLog | 5 +++++ gcc/config/mips/mips.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4b5637b67675..ea7ec0627670 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-05-13 Adam Nemet + + * config/mips/mips.c (mips_print_operand) : + Check for invalid values of LETTER. + 2009-05-13 Taras Glek * attribs.c moved out attribute registration into register_attribute diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 9d712d2f096e..d8686ddd6f80 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -7292,6 +7292,8 @@ mips_print_operand (FILE *file, rtx op, int letter) || (letter == 'L' && TARGET_BIG_ENDIAN) || letter == 'D') regno++; + else if (letter && letter != 'z' && letter != 'M' && letter != 'L') + output_operand_lossage ("invalid use of '%%%c'", letter); /* We need to print $0 .. $31 for COP0 registers. */ if (COP0_REG_P (regno)) fprintf (file, "$%s", ®_names[regno][4]); @@ -7303,6 +7305,8 @@ mips_print_operand (FILE *file, rtx op, int letter) case MEM: if (letter == 'D') output_address (plus_constant (XEXP (op, 0), 4)); + else if (letter && letter != 'z') + output_operand_lossage ("invalid use of '%%%c'", letter); else output_address (XEXP (op, 0)); break; @@ -7310,6 +7314,8 @@ mips_print_operand (FILE *file, rtx op, int letter) default: if (letter == 'z' && op == CONST0_RTX (GET_MODE (op))) fputs (reg_names[GP_REG_FIRST], file); + else if (letter && letter != 'z') + output_operand_lossage ("invalid use of '%%%c'", letter); else if (CONST_GP_P (op)) fputs (reg_names[GLOBAL_POINTER_REGNUM], file); else