diff mbox

[ARM] fix PR target/48637

Message ID 4E098E5D.30900@buzzard.freeserve.co.uk
State New
Headers show

Commit Message

Richard Earnshaw June 28, 2011, 8:18 a.m. UTC
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.
diff mbox

Patch

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;