This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/43360] [4.3/4.4/4.5 Regression] wrong loop invariant hoisting
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Mar 2010 08:23:49 -0000
- Subject: [Bug rtl-optimization/43360] [4.3/4.4/4.5 Regression] wrong loop invariant hoisting
- References: <bug-43360-12544@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from steven at gcc dot gnu dot org 2010-03-17 08:23 -------
So why not just something like the following:
Note that uses in REG_EQUAL notes are taken into account in
the computation of invariants. Hence it is safe to retain the
note even if the note contains register references. */
- if (! inv->always_executed
- && (note = find_reg_note (inv->insn, REG_EQUAL, NULL_RTX)))
+ note = find_reg_note (inv->insn, REG_EQUAL, NULL_RTX);
+ if (note
+ && (! inv->always_executed
+ || ! check_maybe_invariant (XEXP (note, 0)))
remove_note (inv->insn, note);
}
else
In other words, nuke the note if it is not always executed or if the note value
is not invariant?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43360