Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 257575 Details for
Bug 349113
[4.4] please include fix for PR 46915
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for PR4915
gcc-4.5-PR46915.diff (text/plain), 5.41 KB, created by
Guy Martin (RETIRED)
on 2010-12-19 20:32:53 UTC
(
hide
)
Description:
patch for PR4915
Filename:
MIME Type:
Creator:
Guy Martin (RETIRED)
Created:
2010-12-19 20:32:53 UTC
Size:
5.41 KB
patch
obsolete
>--- branches/gcc-4_5-branch/gcc/config/pa/pa.c 2010/10/04 00:20:02 164925 >+++ branches/gcc-4_5-branch/gcc/config/pa/pa.c 2010/12/19 19:50:17 168072 >@@ -6097,35 +6097,92 @@ > } > > /* Return TRUE if INSN, a jump insn, has an unfilled delay slot and >- it branches to the next real instruction. Otherwise, return FALSE. */ >+ it branches into the delay slot. Otherwise, return FALSE. */ > > static bool > branch_to_delay_slot_p (rtx insn) > { >+ rtx jump_insn; >+ > if (dbr_sequence_length ()) > return FALSE; > >- return next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn); >+ jump_insn = next_active_insn (JUMP_LABEL (insn)); >+ while (insn) >+ { >+ insn = next_active_insn (insn); >+ if (jump_insn == insn) >+ return TRUE; >+ >+ /* We can't rely on the length of asms. So, we return FALSE when >+ the branch is followed by an asm. */ >+ if (!insn >+ || GET_CODE (PATTERN (insn)) == ASM_INPUT >+ || extract_asm_operands (PATTERN (insn)) != NULL_RTX >+ || get_attr_length (insn) > 0) >+ break; >+ } >+ >+ return FALSE; > } > >-/* Return TRUE if INSN, a jump insn, needs a nop in its delay slot. >+/* Return TRUE if INSN, a forward jump insn, needs a nop in its delay slot. > > This occurs when INSN has an unfilled delay slot and is followed >- by an ASM_INPUT. Disaster can occur if the ASM_INPUT is empty and >- the jump branches into the delay slot. So, we add a nop in the delay >- slot just to be safe. This messes up our instruction count, but we >- don't know how big the ASM_INPUT insn is anyway. */ >+ by an asm. Disaster can occur if the asm is empty and the jump >+ branches into the delay slot. So, we add a nop in the delay slot >+ when this occurs. */ > > static bool > branch_needs_nop_p (rtx insn) > { >- rtx next_insn; >+ rtx jump_insn; > > if (dbr_sequence_length ()) > return FALSE; > >- next_insn = next_real_insn (insn); >- return GET_CODE (PATTERN (next_insn)) == ASM_INPUT; >+ jump_insn = next_active_insn (JUMP_LABEL (insn)); >+ while (insn) >+ { >+ insn = next_active_insn (insn); >+ if (!insn || jump_insn == insn) >+ return TRUE; >+ >+ if (!(GET_CODE (PATTERN (insn)) == ASM_INPUT >+ || extract_asm_operands (PATTERN (insn)) != NULL_RTX) >+ && get_attr_length (insn) > 0) >+ break; >+ } >+ >+ return FALSE; >+} >+ >+/* Return TRUE if INSN, a forward jump insn, can use nullification >+ to skip the following instruction. This avoids an extra cycle due >+ to a mis-predicted branch when we fall through. */ >+ >+static bool >+use_skip_p (rtx insn) >+{ >+ rtx jump_insn = next_active_insn (JUMP_LABEL (insn)); >+ >+ while (insn) >+ { >+ insn = next_active_insn (insn); >+ >+ /* We can't rely on the length of asms, so we can't skip asms. */ >+ if (!insn >+ || GET_CODE (PATTERN (insn)) == ASM_INPUT >+ || extract_asm_operands (PATTERN (insn)) != NULL_RTX) >+ break; >+ if (get_attr_length (insn) == 4 >+ && jump_insn == next_active_insn (insn)) >+ return TRUE; >+ if (get_attr_length (insn) > 0) >+ break; >+ } >+ >+ return FALSE; > } > > /* This routine handles all the normal conditional branch sequences we >@@ -6139,7 +6196,7 @@ > output_cbranch (rtx *operands, int negated, rtx insn) > { > static char buf[100]; >- int useskip = 0; >+ bool useskip; > int nullify = INSN_ANNULLED_BRANCH_P (insn); > int length = get_attr_length (insn); > int xdelay; >@@ -6177,12 +6234,7 @@ > /* A forward branch over a single nullified insn can be done with a > comclr instruction. This avoids a single cycle penalty due to > mis-predicted branch if we fall through (branch not taken). */ >- if (length == 4 >- && next_real_insn (insn) != 0 >- && get_attr_length (next_real_insn (insn)) == 4 >- && JUMP_LABEL (insn) == next_nonnote_insn (next_real_insn (insn)) >- && nullify) >- useskip = 1; >+ useskip = (length == 4 && nullify) ? use_skip_p (insn) : FALSE; > > switch (length) > { >@@ -6470,7 +6522,7 @@ > output_bb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which) > { > static char buf[100]; >- int useskip = 0; >+ bool useskip; > int nullify = INSN_ANNULLED_BRANCH_P (insn); > int length = get_attr_length (insn); > int xdelay; >@@ -6496,13 +6548,7 @@ > /* A forward branch over a single nullified insn can be done with a > extrs instruction. This avoids a single cycle penalty due to > mis-predicted branch if we fall through (branch not taken). */ >- >- if (length == 4 >- && next_real_insn (insn) != 0 >- && get_attr_length (next_real_insn (insn)) == 4 >- && JUMP_LABEL (insn) == next_nonnote_insn (next_real_insn (insn)) >- && nullify) >- useskip = 1; >+ useskip = (length == 4 && nullify) ? use_skip_p (insn) : FALSE; > > switch (length) > { >@@ -6661,7 +6707,7 @@ > output_bvb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which) > { > static char buf[100]; >- int useskip = 0; >+ bool useskip; > int nullify = INSN_ANNULLED_BRANCH_P (insn); > int length = get_attr_length (insn); > int xdelay; >@@ -6687,13 +6733,7 @@ > /* A forward branch over a single nullified insn can be done with a > extrs instruction. This avoids a single cycle penalty due to > mis-predicted branch if we fall through (branch not taken). */ >- >- if (length == 4 >- && next_real_insn (insn) != 0 >- && get_attr_length (next_real_insn (insn)) == 4 >- && JUMP_LABEL (insn) == next_nonnote_insn (next_real_insn (insn)) >- && nullify) >- useskip = 1; >+ useskip = (length == 4 && nullify) ? use_skip_p (insn) : FALSE; > > switch (length) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 349113
: 257575