From c75a3ddc67afe85c5bf177d76a47b487ee6277be Mon Sep 17 00:00:00 2001 From: Philip Blundell Date: Thu, 15 May 2003 18:13:41 +0000 Subject: [PATCH] re PR target/10730 ([arm] -O2 generates invalid asm) 2003-05-15 Philip Blundell PR target/10730 * config/arm/arm.c (adjacent_mem_locations): Reject offsets involving invalid constants. From-SVN: r66838 --- gcc/ChangeLog | 6 ++++++ gcc/config/arm/arm.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2da0549d77b..772b5e0a50a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-05-15 Philip Blundell + + PR target/10730 + * config/arm/arm.c (adjacent_mem_locations): Reject offsets + involving invalid constants. + 2003-05-15 John David Anglin * pa.c (hppa_expand_prologue): Remove blockage. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 500bd72ed7c..d776766dc7f 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -4571,6 +4571,12 @@ adjacent_mem_locations (a, b) else reg1 = REGNO (XEXP (b, 0)); + /* Don't accept any offset that will require multiple instructions to handle, + since this would cause the arith_adjacentmem pattern to output an overlong + sequence. */ + if (!const_ok_for_op (PLUS, val0) || !const_ok_for_op (PLUS, val1)) + return 0; + return (reg0 == reg1) && ((val1 - val0) == 4 || (val0 - val1) == 4); } return 0;