PRU: Remove TARGET_HARD_REGNO_CALL_PART_CLOBBERED
authorDimitar Dimitrov <dimitar@dinux.eu>
Sun, 15 Sep 2019 15:01:22 +0000 (18:01 +0300)
committerDimitar Dimitrov <dimitar@dinux.eu>
Tue, 5 May 2020 17:42:57 +0000 (20:42 +0300)
Per clarification in [1], macro is supposed to check for partial
clobbering of single HW registers. Since PRU declares only 8-bit
HW registers, and ABI does not define individual bit clobbering,
it is safe to remove the implementation.

[1] https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00778.html

gcc/ChangeLog:

2020-05-05  Dimitar Dimitrov  <dimitar@dinux.eu>

* config/pru/pru.c (pru_hard_regno_call_part_clobbered): Remove.
(TARGET_HARD_REGNO_CALL_PART_CLOBBERED): Remove.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
gcc/ChangeLog
gcc/config/pru/pru.c

index b3c8b731570356d21247744e2a4a56e30477b543..6b4d53da318d88f481569d33c6fa9d074babfe60 100644 (file)
@@ -1,3 +1,8 @@
+2020-05-05  Dimitar Dimitrov  <dimitar@dinux.eu>
+
+       * config/pru/pru.c (pru_hard_regno_call_part_clobbered): Remove.
+       (TARGET_HARD_REGNO_CALL_PART_CLOBBERED): Remove.
+
 2020-05-05  Dimitar Dimitrov  <dimitar@dinux.eu>
 
        * config/pru/pru.h: Mark R3.w0 as caller saved.
index 45b18ed6fe4b99ebfb72c73b0a5a83651f79d078..a715f6b07ceebc1fd4ac1b3a0388166e0783faff 100644 (file)
@@ -556,37 +556,6 @@ pru_hard_regno_scratch_ok (unsigned int regno)
 }
 
 
-/* Implement TARGET_HARD_REGNO_CALL_PART_CLOBBERED.  */
-
-static bool
-pru_hard_regno_call_part_clobbered (unsigned, unsigned regno,
-                                   machine_mode mode)
-{
-  HARD_REG_SET caller_saved_set;
-  HARD_REG_SET callee_saved_set;
-
-  CLEAR_HARD_REG_SET (caller_saved_set);
-  CLEAR_HARD_REG_SET (callee_saved_set);
-
-  /* r0 and r1 are caller saved.  */
-  add_range_to_hard_reg_set (&caller_saved_set, 0, 2 * 4);
-
-  add_range_to_hard_reg_set (&caller_saved_set, FIRST_ARG_REGNUM,
-                            LAST_ARG_REGNUM + 1 - FIRST_ARG_REGNUM);
-
-  /* Treat SP as callee saved.  */
-  add_range_to_hard_reg_set (&callee_saved_set, STACK_POINTER_REGNUM, 4);
-
-  /* r3 to r13 are callee saved.  */
-  add_range_to_hard_reg_set (&callee_saved_set, FIRST_CALLEE_SAVED_REGNUM,
-                            LAST_CALEE_SAVED_REGNUM + 1
-                            - FIRST_CALLEE_SAVED_REGNUM);
-
-  return overlaps_hard_reg_set_p (caller_saved_set, mode, regno)
-        && overlaps_hard_reg_set_p (callee_saved_set, mode, regno);
-}
-
-
 /* Worker function for `HARD_REGNO_RENAME_OK'.
    Return nonzero if register OLD_REG can be renamed to register NEW_REG.  */
 
@@ -2935,9 +2904,6 @@ pru_unwind_word_mode (void)
 
 #undef  TARGET_HARD_REGNO_SCRATCH_OK
 #define TARGET_HARD_REGNO_SCRATCH_OK pru_hard_regno_scratch_ok
-#undef  TARGET_HARD_REGNO_CALL_PART_CLOBBERED
-#define TARGET_HARD_REGNO_CALL_PART_CLOBBERED \
-  pru_hard_regno_call_part_clobbered
 
 #undef TARGET_FUNCTION_ARG
 #define TARGET_FUNCTION_ARG pru_function_arg