diff options
author | krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-22 19:52:34 +0000 |
---|---|---|
committer | krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-22 19:52:34 +0000 |
commit | 19f693555e6306279aab4fd0ce30db83ff9e2246 (patch) | |
tree | ddf0e6a9a37ef629ed736da96036b927d492ddaa /gcc/postreload.c | |
parent | ea0e88d1e2658f33c84769c883246c1e686827f8 (diff) | |
download | gcc-19f693555e6306279aab4fd0ce30db83ff9e2246.tar.gz |
2011-11-22 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* postreload.c (reload_combine): Mark reg_state as invalid at
volatile insns if there has been a use already.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181631 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/postreload.c')
-rw-r--r-- | gcc/postreload.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/postreload.c b/gcc/postreload.c index 886d024926c..5c189129445 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -1312,11 +1312,21 @@ reload_combine (void) is and then later disable any optimization that would cross it. */ if (LABEL_P (insn)) last_label_ruid = reload_combine_ruid; - else if (BARRIER_P (insn) - || (INSN_P (insn) && volatile_insn_p (PATTERN (insn)))) - for (r = 0; r < FIRST_PSEUDO_REGISTER; r++) - if (! fixed_regs[r]) + else if (BARRIER_P (insn)) + { + /* Crossing a barrier resets all the use information. */ + for (r = 0; r < FIRST_PSEUDO_REGISTER; r++) + if (! fixed_regs[r]) reg_state[r].use_index = RELOAD_COMBINE_MAX_USES; + } + else if (INSN_P (insn) && volatile_insn_p (PATTERN (insn))) + /* Optimizations across insns being marked as volatile must be + prevented. All the usage information is invalidated + here. */ + for (r = 0; r < FIRST_PSEUDO_REGISTER; r++) + if (! fixed_regs[r] + && reg_state[r].use_index != RELOAD_COMBINE_MAX_USES) + reg_state[r].use_index = -1; if (! NONDEBUG_INSN_P (insn)) continue; |