public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PR 66685: parallel returns being misclassified
@ 2015-07-01  8:27 Richard Sandiford
  2015-07-01  8:35 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Sandiford @ 2015-07-01  8:27 UTC (permalink / raw)
  To: gcc-patches

This patch should restore bootstrap on hppa (and probably other targets
besides).  The change to use target-insns.def put more stress on the
emit()/classify_insn() group of functions, which were missing a case
for parallel returns.

Tested with a cross-compiler that it fixes the hppa problem.  Bootstrap
in progress on x86_64-linux-gnu.  OK to install?

Sorry for the slow response on this one.  I'd misread the PR and thought
that it was the bug fixed in r225000.

Thanks,
Richard


gcc/
	PR bootstrap/66685
	* rtl.c (classify_insn): Handle returns in PARALLELs.

Index: gcc/rtl.c
===================================================================
--- gcc/rtl.c	2015-07-01 09:13:29.782160299 +0100
+++ gcc/rtl.c	2015-07-01 09:13:29.778160333 +0100
@@ -686,6 +686,8 @@ classify_insn (rtx x)
       for (j = XVECLEN (x, 0) - 1; j >= 0; j--)
 	if (GET_CODE (XVECEXP (x, 0, j)) == CALL)
 	  return CALL_INSN;
+	else if (ANY_RETURN_P (XVECEXP (x, 0, j)))
+	  return JUMP_INSN;
 	else if (GET_CODE (XVECEXP (x, 0, j)) == SET
 		 && GET_CODE (SET_DEST (XVECEXP (x, 0, j))) == PC)
 	  return JUMP_INSN;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PR 66685: parallel returns being misclassified
  2015-07-01  8:27 PR 66685: parallel returns being misclassified Richard Sandiford
@ 2015-07-01  8:35 ` Richard Biener
  2015-07-01 15:25   ` Richard Sandiford
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2015-07-01  8:35 UTC (permalink / raw)
  To: GCC Patches, richard.sandiford

On Wed, Jul 1, 2015 at 10:27 AM, Richard Sandiford
<richard.sandiford@arm.com> wrote:
> This patch should restore bootstrap on hppa (and probably other targets
> besides).  The change to use target-insns.def put more stress on the
> emit()/classify_insn() group of functions, which were missing a case
> for parallel returns.
>
> Tested with a cross-compiler that it fixes the hppa problem.  Bootstrap
> in progress on x86_64-linux-gnu.  OK to install?

Ok.

Richard.

> Sorry for the slow response on this one.  I'd misread the PR and thought
> that it was the bug fixed in r225000.
>
> Thanks,
> Richard
>
>
> gcc/
>         PR bootstrap/66685
>         * rtl.c (classify_insn): Handle returns in PARALLELs.
>
> Index: gcc/rtl.c
> ===================================================================
> --- gcc/rtl.c   2015-07-01 09:13:29.782160299 +0100
> +++ gcc/rtl.c   2015-07-01 09:13:29.778160333 +0100
> @@ -686,6 +686,8 @@ classify_insn (rtx x)
>        for (j = XVECLEN (x, 0) - 1; j >= 0; j--)
>         if (GET_CODE (XVECEXP (x, 0, j)) == CALL)
>           return CALL_INSN;
> +       else if (ANY_RETURN_P (XVECEXP (x, 0, j)))
> +         return JUMP_INSN;
>         else if (GET_CODE (XVECEXP (x, 0, j)) == SET
>                  && GET_CODE (SET_DEST (XVECEXP (x, 0, j))) == PC)
>           return JUMP_INSN;
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PR 66685: parallel returns being misclassified
  2015-07-01  8:35 ` Richard Biener
@ 2015-07-01 15:25   ` Richard Sandiford
  2015-07-01 16:45     ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Sandiford @ 2015-07-01 15:25 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, segher

Richard Biener <richard.guenther@gmail.com> writes:
> On Wed, Jul 1, 2015 at 10:27 AM, Richard Sandiford
> <richard.sandiford@arm.com> wrote:
>> This patch should restore bootstrap on hppa (and probably other targets
>> besides).  The change to use target-insns.def put more stress on the
>> emit()/classify_insn() group of functions, which were missing a case
>> for parallel returns.
>>
>> Tested with a cross-compiler that it fixes the hppa problem.  Bootstrap
>> in progress on x86_64-linux-gnu.  OK to install?
>
> Ok.

I think this has probably broken bootstrap on powerpc64, where sibcalls
have both calls and returns.  The loop picks the last candidate,
which is the return.

Is this patch OK?

Thanks,
Richard

gcc/
	PR bootstrap/66685
	* rtl.c (classify_insn): Only return JUMP_INSN for parallel returns if
	there are no CALLs in the same pattern.

Index: gcc/rtl.c
===================================================================
--- gcc/rtl.c	2015-07-01 16:19:55.055415254 +0100
+++ gcc/rtl.c	2015-07-01 16:19:55.383411635 +0100
@@ -683,17 +683,20 @@ classify_insn (rtx x)
   if (GET_CODE (x) == PARALLEL)
     {
       int j;
+      bool has_return_p = false;
       for (j = XVECLEN (x, 0) - 1; j >= 0; j--)
 	if (GET_CODE (XVECEXP (x, 0, j)) == CALL)
 	  return CALL_INSN;
 	else if (ANY_RETURN_P (XVECEXP (x, 0, j)))
-	  return JUMP_INSN;
+	  has_return_p = true;
 	else if (GET_CODE (XVECEXP (x, 0, j)) == SET
 		 && GET_CODE (SET_DEST (XVECEXP (x, 0, j))) == PC)
 	  return JUMP_INSN;
 	else if (GET_CODE (XVECEXP (x, 0, j)) == SET
 		 && GET_CODE (SET_SRC (XVECEXP (x, 0, j))) == CALL)
 	  return CALL_INSN;
+      if (has_return_p)
+	return JUMP_INSN;
     }
 #ifdef GENERATOR_FILE
   if (GET_CODE (x) == MATCH_OPERAND

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PR 66685: parallel returns being misclassified
  2015-07-01 15:25   ` Richard Sandiford
@ 2015-07-01 16:45     ` Jeff Law
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Law @ 2015-07-01 16:45 UTC (permalink / raw)
  To: Richard Biener, GCC Patches, segher, richard.sandiford

On 07/01/2015 09:25 AM, Richard Sandiford wrote:
> Richard Biener <richard.guenther@gmail.com> writes:
>> On Wed, Jul 1, 2015 at 10:27 AM, Richard Sandiford
>> <richard.sandiford@arm.com> wrote:
>>> This patch should restore bootstrap on hppa (and probably other targets
>>> besides).  The change to use target-insns.def put more stress on the
>>> emit()/classify_insn() group of functions, which were missing a case
>>> for parallel returns.
>>>
>>> Tested with a cross-compiler that it fixes the hppa problem.  Bootstrap
>>> in progress on x86_64-linux-gnu.  OK to install?
>>
>> Ok.
>
> I think this has probably broken bootstrap on powerpc64, where sibcalls
> have both calls and returns.  The loop picks the last candidate,
> which is the return.
>
> Is this patch OK?
>
> Thanks,
> Richard
>
> gcc/
> 	PR bootstrap/66685
> 	* rtl.c (classify_insn): Only return JUMP_INSN for parallel returns if
> 	there are no CALLs in the same pattern.
OK.
jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-01 16:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-01  8:27 PR 66685: parallel returns being misclassified Richard Sandiford
2015-07-01  8:35 ` Richard Biener
2015-07-01 15:25   ` Richard Sandiford
2015-07-01 16:45     ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).