diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2015-03-20 17:43:48 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2015-03-20 17:43:48 +0000 |
commit | 05f23918fa15005e945818fdfb9f602353193871 (patch) | |
tree | c2a933c296dcdeac6a15c8a08b09cb1030a56ed8 /gcc/lra.c | |
parent | e251e8157e03185147aae03265bae837a54042a5 (diff) | |
download | gcc-05f23918fa15005e945818fdfb9f602353193871.zip gcc-05f23918fa15005e945818fdfb9f602353193871.tar.gz gcc-05f23918fa15005e945818fdfb9f602353193871.tar.bz2 |
re PR rtl-optimization/64366 (Segmentation fault in remove_pseudos)
2015-03-20 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/64366
* lra.c (lra_update_insn_regno_info): Consider regs in
CALL_INSN_FUNCTION_USAGE memory.
2015-03-20 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/64366
* gcc.target/sh/pr64366.c: New.
From-SVN: r221541
Diffstat (limited to 'gcc/lra.c')
-rw-r--r-- | gcc/lra.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1633,7 +1633,8 @@ lra_update_insn_regno_info (rtx_insn *insn) lra_insn_recog_data_t data; struct lra_static_insn_data *static_data; enum rtx_code code; - + rtx link; + if (! INSN_P (insn)) return; data = lra_get_insn_recog_data (insn); @@ -1648,6 +1649,18 @@ lra_update_insn_regno_info (rtx_insn *insn) if ((code = GET_CODE (PATTERN (insn))) == CLOBBER || code == USE) add_regs_to_insn_regno_info (data, XEXP (PATTERN (insn), 0), uid, code == USE ? OP_IN : OP_OUT, false); + if (CALL_P (insn)) + /* On some targets call insns can refer to pseudos in memory in + CALL_INSN_FUNCTION_USAGE list. Process them in order to + consider their occurrences in calls for different + transformations (e.g. inheritance) with given pseudos. */ + for (link = CALL_INSN_FUNCTION_USAGE (insn); + link != NULL_RTX; + link = XEXP (link, 1)) + if (((code = GET_CODE (XEXP (link, 0))) == USE || code == CLOBBER) + && MEM_P (XEXP (XEXP (link, 0), 0))) + add_regs_to_insn_regno_info (data, XEXP (XEXP (link, 0), 0), uid, + code == USE ? OP_IN : OP_OUT, false); if (NONDEBUG_INSN_P (insn)) setup_insn_reg_info (data, freq); } |