diff options
author | David Edelsohn <edelsohn@gnu.org> | 2008-10-29 23:33:02 +0000 |
---|---|---|
committer | David Edelsohn <dje@gcc.gnu.org> | 2008-10-29 19:33:02 -0400 |
commit | 2665ab87beb7932fd554efd21ae7762eb9ecac20 (patch) | |
tree | 380041a9e470fb548f755620e8410ed56fc16390 /gcc | |
parent | 81a39e89f3bb0a5b2c2d59b30254b2ca7e339bc0 (diff) | |
download | gcc-2665ab87beb7932fd554efd21ae7762eb9ecac20.zip gcc-2665ab87beb7932fd554efd21ae7762eb9ecac20.tar.gz gcc-2665ab87beb7932fd554efd21ae7762eb9ecac20.tar.bz2 |
re PR target/37878 (PPC64 ldu command generated with invalid offset)
PR target/37878
* config/rs6000/predicates.md (word_offset_memref_operand):
Restructure code and look inside auto-inc/dec addresses.
From-SVN: r141450
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/rs6000/predicates.md | 22 |
2 files changed, 23 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c064c10..b3448e3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-10-29 David Edelsohn <edelsohn@gnu.org> + + PR target/37878 + * config/rs6000/predicates.md (word_offset_memref_operand): + Restructure code and look inside auto-inc/dec addresses. + 2008-10-29 Steve Ellcey <sje@cup.hp.com> PR target/32277 diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index a04a7d8..af80ef4 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -373,11 +373,23 @@ ;; Return 1 if the operand is a memory operand with an address divisible by 4 (define_predicate "word_offset_memref_operand" - (and (match_operand 0 "memory_operand") - (match_test "GET_CODE (XEXP (op, 0)) != PLUS - || ! REG_P (XEXP (XEXP (op, 0), 0)) - || GET_CODE (XEXP (XEXP (op, 0), 1)) != CONST_INT - || INTVAL (XEXP (XEXP (op, 0), 1)) % 4 == 0"))) + (match_operand 0 "memory_operand") +{ + /* Address inside MEM. */ + op = XEXP (op, 0); + + /* Extract address from auto-inc/dec. */ + if (GET_CODE (op) == PRE_INC + || GET_CODE (op) == PRE_DEC) + op = XEXP (op, 0); + else if (GET_CODE (op) == PRE_MODIFY) + op = XEXP (op, 1); + + return (GET_CODE (op) != PLUS + || ! REG_P (XEXP (op, 0)) + || GET_CODE (XEXP (op, 1)) != CONST_INT + || INTVAL (XEXP (op, 1)) % 4 == 0); +}) ;; Return 1 if the operand is an indexed or indirect memory operand. (define_predicate "indexed_or_indirect_operand" |