This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix PR34916, 35519 Combine (Dataflow merge regression.)
- From: Andy H <hutchinsonandy at aim dot com>
- To: gcc-patches at gcc dot gnu dot org, steven at gcc dot gnu dot org
- Date: Tue, 18 Mar 2008 17:35:39 -0400
- Subject: Fix PR34916, 35519 Combine (Dataflow merge regression.)
This patch fixes combine bugs. Now cleaned up with Change log entry.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35519
which appeared after dataflow merge (rev 125624).
Could this be committed please? I have tested with cygwin/AVR port and
there were no regressions.
I cannot test on other targets due to speed of Dejagnu under cygwin.
PS I have assignment paperwork on file with FSF.
2008-03-16 Andy Hutchinson <hutchinsonandy@aim.com>
PR rtl-optimization/34916
PR middle-end/35519
* combine.c (create_log_links): Do not create duplicate LOG_LINKS
between instruction pairs.
Index: combine.c
===================================================================
--- combine.c (revision 133282)
+++ combine.c (working copy)
@@ -976,8 +976,17 @@
assignments later. */
if (regno >= FIRST_PSEUDO_REGISTER
|| asm_noperands (PATTERN (use_insn)) < 0)
- LOG_LINKS (use_insn) =
- alloc_INSN_LIST (insn, LOG_LINKS (use_insn));
+ {
+ /* Don't add duplicates links between instructions. */
+ rtx links;
+ for (links = LOG_LINKS (use_insn); links; links = XEXP (links, 1))
+ if (insn == XEXP (links, 0))
+ break;
+
+ if (!links)
+ LOG_LINKS (use_insn) =
+ alloc_INSN_LIST (insn, LOG_LINKS (use_insn));
+ }
}
next_use[regno] = NULL_RTX;
}