diff mbox

Sched patch: better condition mutex testing

Message ID 4DDF5D5B.2090707@codesourcery.com
State New
Headers show

Commit Message

Bernd Schmidt May 27, 2011, 8:14 a.m. UTC
When regrename is enabled, it makes new copies of its replacement
registers, which means that pointer equality tests can't be used
afterwards to check whether two regs are equal.
sched_insn_conditions_mutex_p has one such test, and it causes
pessimized code in some situations on C6X.

The following patch fixes it. Regression tested with a 4.5 c6x-elf
compiler. I tried to bootstrap ia64, but that has PR48496. Ok?


Bernd
* sched-deps.c (conditions_mutex_p): Use rtx_equal_p to compare
	registers.

Comments

Vladimir Makarov May 30, 2011, 9:27 p.m. UTC | #1
On 05/27/2011 04:14 AM, Bernd Schmidt wrote:
> When regrename is enabled, it makes new copies of its replacement
> registers, which means that pointer equality tests can't be used
> afterwards to check whether two regs are equal.
> sched_insn_conditions_mutex_p has one such test, and it causes
> pessimized code in some situations on C6X.
>
> The following patch fixes it. Regression tested with a 4.5 c6x-elf
> compiler. I tried to bootstrap ia64, but that has PR48496. Ok?
>
Sure, It is ok.  Thanks, Bernd.
diff mbox

Patch

Index: gcc/sched-deps.c
===================================================================
--- gcc/sched-deps.c	(revision 325327)
+++ gcc/sched-deps.c	(working copy)
@@ -563,7 +563,7 @@  conditions_mutex_p (const_rtx cond1, con
 	  (rev1==rev2
 	  ? reversed_comparison_code (cond2, NULL)
 	  : GET_CODE (cond2))
-      && XEXP (cond1, 0) == XEXP (cond2, 0)
+      && rtx_equal_p (XEXP (cond1, 0), XEXP (cond2, 0))
       && XEXP (cond1, 1) == XEXP (cond2, 1))
     return 1;
   return 0;