diff options
author | Tom de Vries <tom@codesourcery.com> | 2015-01-09 18:54:20 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2015-01-09 18:54:20 +0000 |
commit | 486b97f297eb20c5b72140ea257ff63143a69ab7 (patch) | |
tree | 381a5fca650264f9920f721e61b4238adc3072c2 /gcc | |
parent | a5dbcace37f1cfe87beda11af3e4ce2c0beb9a91 (diff) | |
download | gcc-486b97f297eb20c5b72140ea257ff63143a69ab7.zip gcc-486b97f297eb20c5b72140ea257ff63143a69ab7.tar.gz gcc-486b97f297eb20c5b72140ea257ff63143a69ab7.tar.bz2 |
Handle CALL_INSN_FUNCTION_USAGE clobbers in regcprop.c
2015-01-09 Tom de Vries <tom@codesourcery.com>
PR rtl-optimization/64539
* regcprop.c (kill_clobbered_values): Factor out of ...
(copyprop_hardreg_forward_1): ... here. Use kill_clobbered_values
instead of note_stores with kill_clobbered_value.
From-SVN: r219400
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/regcprop.c | 34 |
2 files changed, 29 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a22c073..340b03f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-01-09 Tom de Vries <tom@codesourcery.com> + + PR rtl-optimization/64539 + * regcprop.c (kill_clobbered_values): Factor out of ... + (copyprop_hardreg_forward_1): ... here. Use kill_clobbered_values + instead of note_stores with kill_clobbered_value. + 2015-01-09 Andreas Tobler <andreast@gcc.gnu.org> * ginclude/unwind-arm-common.h: Revert previous commit. diff --git a/gcc/regcprop.c b/gcc/regcprop.c index 8c4f564..c809e77 100644 --- a/gcc/regcprop.c +++ b/gcc/regcprop.c @@ -734,6 +734,26 @@ cprop_find_used_regs (rtx *loc, void *data) } } +/* Apply clobbers of INSN in PATTERN and C_I_F_U to value_data VD. */ + +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); + } + } +} + /* Perform the forward copy propagation on basic block BB. */ static bool @@ -800,7 +820,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) /* Within asms, a clobber cannot overlap inputs or outputs. I wouldn't think this were true for regular insns, but scan_rtx treats them like that... */ - note_stores (PATTERN (insn), kill_clobbered_value, vd); + kill_clobbered_values (insn, vd); /* Kill all auto-incremented values. */ /* ??? REG_INC is useless, since stack pushes aren't done that way. */ @@ -1035,17 +1055,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) but instead among CLOBBERs on the CALL_INSN, we could wrongly assume the value in it is still live. */ if (ksvd.ignore_set_reg) - { - note_stores (PATTERN (insn), kill_clobbered_value, vd); - 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); - } - } + kill_clobbered_values (insn, vd); } bool copy_p = (set |