aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgrtl.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-04-29 16:18:55 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2019-04-29 16:18:55 +0200
commit1008df90cca4a4f49f2a898115f8756fafff3187 (patch)
tree65b74e56f1a118c9e0f26cb15c7ca45a6794cce3 /gcc/cfgrtl.c
parent4e29671cb258f486e498a0697f88861ff351de50 (diff)
downloadgcc-1008df90cca4a4f49f2a898115f8756fafff3187.zip
gcc-1008df90cca4a4f49f2a898115f8756fafff3187.tar.gz
gcc-1008df90cca4a4f49f2a898115f8756fafff3187.tar.bz2
re PR rtl-optimization/90257 (8% degradation on cpu2006 403.gcc starting with r270484)
PR rtl-optimization/90257 * cfgrtl.c (flow_active_insn_p): Return true for USE of a function return value. Revert the revert: 2019-04-21 H.J. Lu <hongjiu.lu@intel.com> PR target/90178 Revert: 2018-11-21 Uros Bizjak <ubizjak@gmail.com> Revert the revert: 2013-10-26 Vladimir Makarov <vmakarov@redhat.com> Revert: 2013-10-25 Vladimir Makarov <vmakarov@redhat.com> * lra-spills.c (lra_final_code_change): Remove useless move insns. From-SVN: r270653
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r--gcc/cfgrtl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 08e534f..e06fb8d 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -543,7 +543,7 @@ update_bb_for_insn (basic_block bb)
}
-/* Like active_insn_p, except keep the return value clobber around
+/* Like active_insn_p, except keep the return value use or clobber around
even after reload. */
static bool
@@ -556,8 +556,12 @@ flow_active_insn_p (const rtx_insn *insn)
programs that fail to return a value. Its effect is to
keep the return value from being live across the entire
function. If we allow it to be skipped, we introduce the
- possibility for register lifetime confusion. */
- if (GET_CODE (PATTERN (insn)) == CLOBBER
+ possibility for register lifetime confusion.
+ Similarly, keep a USE of the function return value, otherwise
+ the USE is dropped and we could fail to thread jump if USE
+ appears on some paths and not on others, see PR90257. */
+ if ((GET_CODE (PATTERN (insn)) == CLOBBER
+ || GET_CODE (PATTERN (insn)) == USE)
&& REG_P (XEXP (PATTERN (insn), 0))
&& REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0)))
return true;