[PATCH] Handle CALL_INSN_FUNCTION_USAGE clobbers in regcprop.c

Tom de Vries Tom_deVries@mentor.com
Fri Jan 9 20:12:00 GMT 2015


On 09-01-15 11:48, Jakub Jelinek wrote:
> On Fri, Jan 09, 2015 at 11:35:41AM +0100, Tom de Vries wrote:
>> 2015-01-09  Tom de Vries  <tom@codesourcery.com>
>>
>> 	PR rtl-optimization/64539
>> 	* regcprop.c (copyprop_hardreg_forward_1): Handle clobbers in
>> 	CALL_INSN_FUNCTION_USAGE.
>
> To avoid the duplication, wouldn't it be better to add
>
> static void
> kill_clobbered_values (rtx_insn *insn, struct value_data *vd)
> {
>    note_stores (PATTERN (insn), kill_clobbered_value, vd);
>    if (CALL_P (insn))
>      {
>        rtx exp;
>        for (exp = CALL_INSN_FUNCTION_USAGE (insn); exp; exp = XEXP (exp, 1))
> 	{
> 	  rtx x = XEXP (exp, 0);
> 	  if (GET_CODE (x) == CLOBBER)
> 	    kill_value (SET_DEST (x), vd);
> 	}
>      }
> }
> function (with appropriate function comment) and use it in both places?
>
> Otherwise LGTM.

Committed as attached.

Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Handle-CALL_INSN_FUNCTION_USAGE-clobbers-in-regcprop.patch
Type: text/x-patch
Size: 2179 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150109/a17bc210/attachment.bin>


More information about the Gcc-patches mailing list