[PATCH] Make CSE path following use the CFG

Steven Bosscher stevenb.gcc@gmail.com
Sat Dec 9 23:41:00 GMT 2006


Hi,

The TER changes uncovered a bug in libjava with my patch (it made the
compiler trip over the purge_all_dead_edges gcc_assert), so I've added
this hunk to deal with insns that may be trapping before the
validate_change (e.g. a load, where the load is replaced with a reg):

*************** cse_insn (rtx insn, rtx libcall_insn)
*** 4862,4867 ****
--- 4862,4875 ----

              validate_change (insn, &SET_SRC (sets[i].rtl), new, 1);
              apply_change_group ();
+
+             /* With non-call exceptions, if this was an insn that could
+                trap, me may have made it non-throwing now.  For example
+                we may have replaced a load with a register.  */
+             if (flag_non_call_exceptions
+                 && insn == BB_END (BLOCK_FOR_INSN (insn)))
+               purge_dead_edges (BLOCK_FOR_INSN (insn));
+
              break;
            }


I've re-retested it on i686 and x86_64, and I'm going to commit the
patch tomorrow.

Gr.
Steven



More information about the Gcc-patches mailing list