diff mbox

[003/236] config/mn10300: Fix missing PATTERN in PARALLEL handling

Message ID 1407345815-14551-4-git-send-email-dmalcolm@redhat.com
State New
Headers show

Commit Message

David Malcolm Aug. 6, 2014, 5:19 p.m. UTC
gcc/
	* config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Fix the
	handling of PARALLEL to work on PATTERN (insn) and PATTERN (dep),
	rather than just on insn, dep themselves.  The latter are insns,
	and thus can't be PARALLEL.
---
 gcc/config/mn10300/mn10300.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Jeff Law Aug. 12, 2014, 8:53 p.m. UTC | #1
On 08/06/14 11:19, David Malcolm wrote:
> gcc/
> 	* config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Fix the
> 	handling of PARALLEL to work on PATTERN (insn) and PATTERN (dep),
> 	rather than just on insn, dep themselves.  The latter are insns,
> 	and thus can't be PARALLEL.
Approved.  Should go forward independently.

Jeff
Richard Henderson Aug. 19, 2014, 6:02 p.m. UTC | #2
On 08/06/2014 10:19 AM, David Malcolm wrote:
> @@ -2772,11 +2772,11 @@ mn10300_adjust_sched_cost (rtx insn, rtx link, rtx dep, int cost)
>    if (!TARGET_AM33)
>      return 1;
>  
> -  if (GET_CODE (insn) == PARALLEL)
> -    insn = XVECEXP (insn, 0, 0);
> +  if (GET_CODE (PATTERN (insn)) == PARALLEL)
> +    insn = XVECEXP (PATTERN (insn), 0, 0);
>  
> -  if (GET_CODE (dep) == PARALLEL)
> -    dep = XVECEXP (dep, 0, 0);
> +  if (GET_CODE (PATTERN (dep)) == PARALLEL)
> +    dep = XVECEXP (PATTERN (dep), 0, 0);

I think these tests are simply wrong and should be removed.

Certainly one can't expect to extract the first element of an insn's pattern
and then a few lines later test the pattern vs JUMP_P.


r~
diff mbox

Patch

diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index eb00077..99b5d19 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -2772,11 +2772,11 @@  mn10300_adjust_sched_cost (rtx insn, rtx link, rtx dep, int cost)
   if (!TARGET_AM33)
     return 1;
 
-  if (GET_CODE (insn) == PARALLEL)
-    insn = XVECEXP (insn, 0, 0);
+  if (GET_CODE (PATTERN (insn)) == PARALLEL)
+    insn = XVECEXP (PATTERN (insn), 0, 0);
 
-  if (GET_CODE (dep) == PARALLEL)
-    dep = XVECEXP (dep, 0, 0);
+  if (GET_CODE (PATTERN (dep)) == PARALLEL)
+    dep = XVECEXP (PATTERN (dep), 0, 0);
 
   /* For the AM34 a load instruction that follows a
      store instruction incurs an extra cycle of delay.  */