aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/avr/avr.c
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2012-06-28 13:53:51 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2012-06-28 13:53:51 +0000
commitb04ffa565302de59ad22d8211925f78c52b042e5 (patch)
tree25d4b89100af9db23b7feb3d67f9815625d19593 /gcc/config/avr/avr.c
parentbd8e704ff4bfb4594a4d9e1dd816cafa0e67f1d0 (diff)
downloadgcc-b04ffa565302de59ad22d8211925f78c52b042e5.zip
gcc-b04ffa565302de59ad22d8211925f78c52b042e5.tar.gz
gcc-b04ffa565302de59ad22d8211925f78c52b042e5.tar.bz2
re PR other/53595 (Code size increase of +10% between two 4.7.1 snapshot)
PR 53595 * config/avr/avr.c (avr_hard_regno_call_part_clobbered): New. * config/avr/avr-protos.h (avr_hard_regno_call_part_clobbered): New. * config/avr/avr.h (HARD_REGNO_CALL_PART_CLOBBERED): Forward to avr_hard_regno_call_part_clobbered. From-SVN: r189049
Diffstat (limited to 'gcc/config/avr/avr.c')
-rw-r--r--gcc/config/avr/avr.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 8199d2e..68048b6 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -8856,6 +8856,28 @@ avr_hard_regno_mode_ok (int regno, enum machine_mode mode)
}
+/* Implement `HARD_REGNO_CALL_PART_CLOBBERED'. */
+
+int
+avr_hard_regno_call_part_clobbered (unsigned regno, enum machine_mode mode)
+{
+ /* FIXME: This hook gets called with MODE:REGNO combinations that don't
+ represent valid hard registers like, e.g. HI:29. Returning TRUE
+ for such registers can lead to performance degradation as mentioned
+ in PR53595. Thus, report invalid hard registers as FALSE. */
+
+ if (!avr_hard_regno_mode_ok (regno, mode))
+ return 0;
+
+ /* Return true if any of the following boundaries is crossed:
+ 17/18, 27/28 and 29/30. */
+
+ return ((regno < 18 && regno + GET_MODE_SIZE (mode) > 18)
+ || (regno < REG_Y && regno + GET_MODE_SIZE (mode) > REG_Y)
+ || (regno < REG_Z && regno + GET_MODE_SIZE (mode) > REG_Z));
+}
+
+
/* Implement `MODE_CODE_BASE_REG_CLASS'. */
enum reg_class