From 7f26e60c2600f0a676fc9370390ebf0a3c78f31c Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 3 Apr 2020 17:47:18 -0600 Subject: [PATCH] Fix stdarg-3 regression on xstormy16 port PR rtl-optimization/92264 * config/stormy16/stormy16.c (xstormy16_preferred_reload_class): Handle reloading of auto-increment addressing modes. --- gcc/ChangeLog | 6 ++++++ gcc/config/stormy16/stormy16.c | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6317e385cac..25d1c5d1c38 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2020-04-03 Jeff Law + + PR rtl-optimization/92264 + * config/stormy16/stormy16.c (xstormy16_preferred_reload_class): Handle + reloading of auto-increment addressing modes. + 2020-04-03 H.J. Lu PR target/94467 diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index 55fe82954c1..2141531e262 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -497,7 +497,17 @@ xstormy16_secondary_reload_class (enum reg_class rclass, static reg_class_t xstormy16_preferred_reload_class (rtx x, reg_class_t rclass) { - if (rclass == GENERAL_REGS && MEM_P (x)) + /* Only the first eight registers can be moved to/from memory. + So those prefer EIGHT_REGS. + + Similarly reloading an auto-increment address is going to + require loads and stores, so we must use EIGHT_REGS for those + too. */ + if (rclass == GENERAL_REGS + && (MEM_P (x) + || GET_CODE (x) == POST_INC + || GET_CODE (x) == PRE_DEC + || GET_CODE (x) == PRE_MODIFY)) return EIGHT_REGS; return rclass; -- 2.30.2