This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix PR34916, 35519 Combine (Dataflow merge regression.)

This patch fixes combine bugs. Now cleaned up with Change log entry.

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 <>

       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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]