diff mbox

[ARM,committed] Fix rtl checking failure in thumb2_reorg

Message ID 87y4ofcc0m.fsf@e105548-lin.cambridge.arm.com
State New
Headers show

Commit Message

Richard Sandiford Feb. 3, 2015, 2:20 p.m. UTC
The thumb2_reorg code:

      if (!OBJECT_P (src))
	op0 = XEXP (src, 0);

causes an rtl checking failure if SRC is an UNSPEC.  This doesn't matter
in practice without rtl checking since OP0 is only used if SRC is a unary
or binary operator.  This patch tightens the condition to reflect that.

The code was added in the 4.7-4.8 timeframe, although I don't know whether
it had to handle UNSPECs at that stage.  Either way, this is a regression
and so seems like stage 4 material.

Tested on arm-eabi, where it fixes many testsuite failures with checking
enabled.  Approved by Ramana off-list and committed.

Thanks,
Richard


gcc/
	* config/arm/arm.c (thumb2_reorg): Test UNARY_P and BINARY_P
	instead of OBJECT_P.
diff mbox

Patch

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	2015-02-02 17:08:56.007379607 +0000
+++ gcc/config/arm/arm.c	2015-02-03 14:05:28.000601072 +0000
@@ -17297,7 +17297,7 @@  thumb2_reorg (void)
 	      rtx src = XEXP (pat, 1);
 	      rtx op0 = NULL_RTX, op1 = NULL_RTX;
 
-	      if (!OBJECT_P (src))
+	      if (UNARY_P (src) || BINARY_P (src))
 		  op0 = XEXP (src, 0);
 
 	      if (BINARY_P (src))