aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-11-05 08:04:49 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-11-05 08:04:49 +0000
commit692e7e54e095f281b9d6663434dd11d6caaa3d9b (patch)
tree8490f0de089656778d55be2076e56b803a60cf85 /gcc
parentb008f16b7a279da845070dce786ea3afd5925364 (diff)
downloadgcc-692e7e54e095f281b9d6663434dd11d6caaa3d9b.zip
gcc-692e7e54e095f281b9d6663434dd11d6caaa3d9b.tar.gz
gcc-692e7e54e095f281b9d6663434dd11d6caaa3d9b.tar.bz2
re PR middle-end/87852 (FAIL: gcc.c-torture/execute/pr53465.c)
2018-11-05 Richard Biener <rguenther@suse.de> PR rtl-optimization/87852 * fwprop.c (use_killed_between): Only consider single-defs of the use whose definition statement dominates the use. From-SVN: r265791
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/fwprop.c24
2 files changed, 21 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 80c897a..b3a2567 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-11-05 Richard Biener <rguenther@suse.de>
+
+ PR rtl-optimization/87852
+ * fwprop.c (use_killed_between): Only consider single-defs of the
+ use whose definition statement dominates the use.
+
2018-11-05 Martin Liska <mliska@suse.cz>
PR web/87829
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index 0fca0f1..78c08e0 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -731,14 +731,15 @@ local_ref_killed_between_p (df_ref ref, rtx_insn *from, rtx_insn *to)
}
-/* Check if the given DEF is available in INSN. This would require full
- computation of available expressions; we check only restricted conditions:
- - if DEF is the sole definition of its register, go ahead;
- - in the same basic block, we check for no definitions killing the
- definition of DEF_INSN;
- - if USE's basic block has DEF's basic block as the sole predecessor,
- we check if the definition is killed after DEF_INSN or before
+/* Check if USE is killed between DEF_INSN and TARGET_INSN. This would
+ require full computation of available expressions; we check only a few
+ restricted conditions:
+ - if the reg in USE has only one definition, go ahead;
+ - in the same basic block, we check for no definitions killing the use;
+ - if TARGET_INSN's basic block has DEF_INSN's basic block as its sole
+ predecessor, we check if the use is killed after DEF_INSN or before
TARGET_INSN insn, in their respective basic blocks. */
+
static bool
use_killed_between (df_ref use, rtx_insn *def_insn, rtx_insn *target_insn)
{
@@ -762,12 +763,17 @@ use_killed_between (df_ref use, rtx_insn *def_insn, rtx_insn *target_insn)
know that this definition reaches use, or we wouldn't be here.
However, this is invalid for hard registers because if they are
live at the beginning of the function it does not mean that we
- have an uninitialized access. */
+ have an uninitialized access. And we have to check for the case
+ where a register may be used uninitialized in a loop as above. */
regno = DF_REF_REGNO (use);
def = DF_REG_DEF_CHAIN (regno);
if (def
&& DF_REF_NEXT_REG (def) == NULL
- && regno >= FIRST_PSEUDO_REGISTER)
+ && regno >= FIRST_PSEUDO_REGISTER
+ && (BLOCK_FOR_INSN (DF_REF_INSN (def)) == def_bb
+ ? DF_INSN_LUID (DF_REF_INSN (def)) < DF_INSN_LUID (def_insn)
+ : dominated_by_p (CDI_DOMINATORS,
+ def_bb, BLOCK_FOR_INSN (DF_REF_INSN (def)))))
return false;
/* Check locally if we are in the same basic block. */