diff mbox series

[25/32] Remove global call sets: regcprop.c

Message ID mpth85ive3d.fsf@arm.com
State New
Headers show
Series Support multiple ABIs in the same translation unit | expand

Commit Message

Richard Sandiford Sept. 11, 2019, 7:15 p.m. UTC
This is a direct replacement of an existing test for fully and
partially clobbered registers.


2019-09-11  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* regcprop.c (copyprop_hardreg_forward_1): Use the recorded
	mode of the register when deciding whether it is no longer
	available after a call.

Comments

Jeff Law Sept. 29, 2019, 9:34 p.m. UTC | #1
On 9/11/19 1:15 PM, Richard Sandiford wrote:
> This is a direct replacement of an existing test for fully and
> partially clobbered registers.
> 
> 
> 2019-09-11  Richard Sandiford  <richard.sandiford@arm.com>
> 
> gcc/
> 	* regcprop.c (copyprop_hardreg_forward_1): Use the recorded
> 	mode of the register when deciding whether it is no longer
> 	available after a call.
> 
OK
jeff
diff mbox series

Patch

Index: gcc/regcprop.c
===================================================================
--- gcc/regcprop.c	2019-09-11 19:47:32.898202916 +0100
+++ gcc/regcprop.c	2019-09-11 19:48:51.961645788 +0100
@@ -1055,16 +1055,15 @@  copyprop_hardreg_forward_1 (basic_block
 
 	  function_abi abi = call_insn_abi (insn);
 	  for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
-	    if ((abi.clobbers_full_reg_p (regno)
-		 || (targetm.hard_regno_call_part_clobbered
-		     (abi.id (), regno, vd->e[regno].mode)))
+	    if (vd->e[regno].mode != VOIDmode
+		&& abi.clobbers_reg_p (vd->e[regno].mode, regno)
 		&& (regno < set_regno || regno >= set_regno + set_nregs))
 	      kill_value_regno (regno, 1, vd);
 
 	  /* If SET was seen in CALL_INSN_FUNCTION_USAGE, and SET_SRC
-	     of the SET isn't in regs_invalidated_by_call hard reg set,
-	     but instead among CLOBBERs on the CALL_INSN, we could wrongly
-	     assume the value in it is still live.  */
+	     of the SET isn't clobbered by ABI, but instead among
+	     CLOBBERs on the CALL_INSN, we could wrongly assume the
+	     value in it is still live.  */
 	  if (ksvd.ignore_set_reg)
 	    kill_clobbered_values (insn, vd);
 	}