public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] combine: Do not allow asm as I2 in a special case
@ 2014-12-10 20:12 Segher Boessenkool
  2014-12-10 22:57 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Segher Boessenkool @ 2014-12-10 20:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool

My rs6000 patch putting a clobber of the carry in every asm regressed
guality/pr41353-1.c.  This is because the asm (in f3 in that testcase,
for example) now is a PARALLEL, and the special case for I2 a parallel
and I3 a register move now triggers.  Before, when the asm was not a
parallel, can_combine_p disallowed combining I2.  The effect of the
change is that some debug info becomes invalid and is deleted later,
causing the testsuite regression.

Let's not allow combining an asm in this special case either.

Bootstrapped and tested on powerpc64-linux; okay for mainline?


Segher


2014-12-10  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/
	* combine.c (try_combine): Do not allow combining a PARALLEL I2
	with a register move I3 if that I2 is an asm.


diff --git a/gcc/combine.c b/gcc/combine.c
index f5ade9e..8995c1d3 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2748,6 +2748,13 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
 					SET_DEST (XVECEXP (p2, 0, i))))
 	  break;
 
+      /* Make sure this PARALLEL is not an asm.  We do not allow combining
+	 that usually (see can_combine_p), so do not here either.  */
+      for (i = 0; i < XVECLEN (p2, 0); i++)
+	if (GET_CODE (XVECEXP (p2, 0, i)) == SET
+	    && GET_CODE (SET_SRC (XVECEXP (p2, 0, i))) == ASM_OPERANDS)
+	  break;
+
       if (i == XVECLEN (p2, 0))
 	for (i = 0; i < XVECLEN (p2, 0); i++)
 	  if (GET_CODE (XVECEXP (p2, 0, i)) == SET
-- 
1.8.1.4


---
 gcc/combine.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/combine.c b/gcc/combine.c
index f5ade9e..8995c1d3 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2748,6 +2748,13 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
 					SET_DEST (XVECEXP (p2, 0, i))))
 	  break;
 
+      /* Make sure this PARALLEL is not an asm.  We do not allow combining
+	 that usually (see can_combine_p), so do not here either.  */
+      for (i = 0; i < XVECLEN (p2, 0); i++)
+	if (GET_CODE (XVECEXP (p2, 0, i)) == SET
+	    && GET_CODE (SET_SRC (XVECEXP (p2, 0, i))) == ASM_OPERANDS)
+	  break;
+
       if (i == XVECLEN (p2, 0))
 	for (i = 0; i < XVECLEN (p2, 0); i++)
 	  if (GET_CODE (XVECEXP (p2, 0, i)) == SET
-- 
1.8.1.4

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

* Re: [PATCH] combine: Do not allow asm as I2 in a special case
  2014-12-10 20:12 [PATCH] combine: Do not allow asm as I2 in a special case Segher Boessenkool
@ 2014-12-10 22:57 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2014-12-10 22:57 UTC (permalink / raw)
  To: Segher Boessenkool, gcc-patches

On 12/10/14 13:12, Segher Boessenkool wrote:
> My rs6000 patch putting a clobber of the carry in every asm regressed
> guality/pr41353-1.c.  This is because the asm (in f3 in that testcase,
> for example) now is a PARALLEL, and the special case for I2 a parallel
> and I3 a register move now triggers.  Before, when the asm was not a
> parallel, can_combine_p disallowed combining I2.  The effect of the
> change is that some debug info becomes invalid and is deleted later,
> causing the testsuite regression.
>
> Let's not allow combining an asm in this special case either.
>
> Bootstrapped and tested on powerpc64-linux; okay for mainline?
>
>
> Segher
>
>
> 2014-12-10  Segher Boessenkool  <segher@kernel.crashing.org>
>
> gcc/
> 	* combine.c (try_combine): Do not allow combining a PARALLEL I2
> 	with a register move I3 if that I2 is an asm.
OK.
jeff

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

end of thread, other threads:[~2014-12-10 22:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-10 20:12 [PATCH] combine: Do not allow asm as I2 in a special case Segher Boessenkool
2014-12-10 22:57 ` 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).