diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2008-07-17 09:07:31 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2008-07-17 09:07:31 +0000 |
commit | b08c51086fceec9cd27858dae48bf55fbbfccc1c (patch) | |
tree | 281a1a220070390be3fb15977c0425a4318f99c9 /gcc/fwprop.c | |
parent | 8a63781b058d0ef87b54a648cd00fd2e96cd69c1 (diff) | |
download | gcc-b08c51086fceec9cd27858dae48bf55fbbfccc1c.tar.gz |
re PR middle-end/36753 (Forward propagation interacts badly with global register variable)
gcc:
2008-07-17 Paolo Bonzini <bonzini@gnu.org>
PR rtl-optimization/36753
* fwprop.c (use_killed_between): Don't shortcut
single-definition global registers.
gcc/testsuite:
2008-07-17 Paolo Bonzini <bonzini@gnu.org>
PR rtl-optimization/36753
* gcc.target/i386/pr36753.c: New.
From-SVN: r137913
Diffstat (limited to 'gcc/fwprop.c')
-rw-r--r-- | gcc/fwprop.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/fwprop.c b/gcc/fwprop.c index e6700019644..fbe432974f4 100644 --- a/gcc/fwprop.c +++ b/gcc/fwprop.c @@ -527,10 +527,15 @@ use_killed_between (struct df_ref *use, rtx def_insn, rtx target_insn) return true; /* Check if the reg in USE has only one definition. We already - know that this definition reaches use, or we wouldn't be here. */ + 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. */ regno = DF_REF_REGNO (use); def = DF_REG_DEF_CHAIN (regno); - if (def && (def->next_reg == NULL)) + if (def + && def->next_reg == NULL + && regno >= FIRST_PSEUDO_REGISTER) return false; /* Check locally if we are in the same basic block. */ |