+2015-02-24 Alan Modra <amodra@gmail.com>
+
+ PR target/65182
+ * config/rs6000/rs6000.c (get_memref_parts): Only return true
+ when *base is a reg. Handle nested plus addresses. Simplify
+ pre_modify test.
+
2015-02-22 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/xtensa.h (CONSTANT_ALIGNMENT, DATA_ALIGNMENT):
else
return false;
- if (GET_CODE (XEXP (mem, 0)) == PRE_MODIFY)
- addr_rtx = XEXP (XEXP (mem, 0), 1);
- else
- addr_rtx = (XEXP (mem, 0));
+ addr_rtx = (XEXP (mem, 0));
+ if (GET_CODE (addr_rtx) == PRE_MODIFY)
+ addr_rtx = XEXP (addr_rtx, 1);
- if (GET_CODE (addr_rtx) == REG)
- {
- *base = addr_rtx;
- *offset = 0;
- }
- else if (GET_CODE (addr_rtx) == PLUS
- && CONST_INT_P (XEXP (addr_rtx, 1)))
+ *offset = 0;
+ while (GET_CODE (addr_rtx) == PLUS
+ && CONST_INT_P (XEXP (addr_rtx, 1)))
{
- *base = XEXP (addr_rtx, 0);
- *offset = INTVAL (XEXP (addr_rtx, 1));
+ *offset += INTVAL (XEXP (addr_rtx, 1));
+ addr_rtx = XEXP (addr_rtx, 0);
}
- else
+ if (!REG_P (addr_rtx))
return false;
+ *base = addr_rtx;
return true;
}