public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [ARM] fix PR target/48637
@ 2011-06-28  8:38 Richard Earnshaw
  0 siblings, 0 replies; only message in thread
From: Richard Earnshaw @ 2011-06-28  8:38 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]

For a long time now the compiler has permitted printing a symbol with
the %c operator, but for some reason we've never permitted
symbol+offset.  This patch fixes this omission and also makes the
compiler slightly more friendly to users of ASM statements by not
generating an ICE when it can't handle an expression.  Tested on
arm-eabi and installed on trunk.

This is not a regression, so I don't propose to back-port it to older
compilers (though doing so would most-likely be trivial).

R.

2011-06-27  Richard Earnshaw  <rearnsha@arm.com>

        PR target/48637
        * arm.c (arm_print_operand): Allow sym+offset.  Don't abort on
	invalid asm operands.


[-- Attachment #2: arm.patch --]
[-- Type: text/x-patch, Size: 601 bytes --]

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index efffcf8..8b9cb25 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -16242,8 +16242,17 @@ arm_print_operand (FILE *stream, rtx x, int code)
 	  output_addr_const (stream, x);
 	  break;
 
+	case CONST:
+	  if (GET_CODE (XEXP (x, 0)) == PLUS
+	      && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF)
+	    {
+	      output_addr_const (stream, x);
+	      break;
+	    }
+	  /* Fall through.  */
+
 	default:
-	  gcc_unreachable ();
+	  output_operand_lossage ("Unsupported operand for code '%c'", code);
 	}
       return;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-28  8:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-28  8:38 [ARM] fix PR target/48637 Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).