diff options
author | Hariharan Sandanagobalane <hariharan@picochip.com> | 2009-02-04 16:17:47 +0000 |
---|---|---|
committer | Hariharan Sandanagobalane <hariharans@gcc.gnu.org> | 2009-02-04 16:17:47 +0000 |
commit | 5b43bf058b51b25a6e90692bc61b3efad883b7e7 (patch) | |
tree | c23ecf0172ace4c94e988440c80873a057c4dd6e | |
parent | 062c4bb37ac6f2af6753060d8f8db5230bc18b49 (diff) | |
download | gcc-5b43bf058b51b25a6e90692bc61b3efad883b7e7.zip gcc-5b43bf058b51b25a6e90692bc61b3efad883b7e7.tar.gz gcc-5b43bf058b51b25a6e90692bc61b3efad883b7e7.tar.bz2 |
picochip.c (GO_IF_LEGITIMATE_ADDRESS): Disallow non-indexable addresses even before reload.
* config/picochip/picochip.c (GO_IF_LEGITIMATE_ADDRESS): Disallow
non-indexable addresses even before reload.
From-SVN: r143929
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/picochip/picochip.c | 16 |
2 files changed, 12 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fb586ed..a13903c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-02-04 Hariharan Sandanagobalane <hariharan@picochip.com> + + * config/picochip/picochip.c (GO_IF_LEGITIMATE_ADDRESS): Disallow + non-indexable addresses even before reload. + 2009-02-03 Joseph Myers <joseph@codesourcery.com> PR c/29129 diff --git a/gcc/config/picochip/picochip.c b/gcc/config/picochip/picochip.c index a0686bd..0667656 100644 --- a/gcc/config/picochip/picochip.c +++ b/gcc/config/picochip/picochip.c @@ -1200,8 +1200,7 @@ picochip_legitimate_address_register (rtx x, unsigned strict) /* Determine whether the given constant is in the range required for the given base register. */ static int -picochip_const_ok_for_base (enum machine_mode mode, int regno, int offset, - int strict) +picochip_const_ok_for_base (enum machine_mode mode, int regno, int offset) { HOST_WIDE_INT corrected_offset; @@ -1209,17 +1208,16 @@ picochip_const_ok_for_base (enum machine_mode mode, int regno, int offset, { if (GET_MODE_SIZE(mode) <= 4) { - /* We can allow incorrect offsets if strict is 0. If strict is 1, - we are in reload and these memory accesses need to be changed. */ - if (offset % GET_MODE_SIZE (mode) != 0 && strict == 1) + /* We used to allow incorrect offsets if strict is 0. But, this would + then rely on reload doing the right thing. We have had problems + there before, and on > 4.3 compiler, there are no benefits. */ + if (offset % GET_MODE_SIZE (mode) != 0) return 0; corrected_offset = offset / GET_MODE_SIZE (mode); } else { - /* We can allow incorrect offsets if strict is 0. If strict is 1, - we are in reload and these memory accesses need to be changed. */ - if (offset % 4 != 0 && strict == 1) + if (offset % 4 != 0) return 0; corrected_offset = offset / 4; } @@ -1272,7 +1270,7 @@ picochip_legitimate_address_p (int mode, rtx x, unsigned strict) picochip_legitimate_address_register (base, strict) && CONST_INT == GET_CODE (offset) && picochip_const_ok_for_base (mode, REGNO (base), - INTVAL (offset),strict)); + INTVAL (offset))); break; } |