diff mbox series

Handle CLOBBER in reg_overlap_mentioned_p (PR86882)

Message ID 4244c7f4e17974613f45b60d766aa86f1b7c2c41.1537285902.git.segher@kernel.crashing.org
State New
Headers show
Series Handle CLOBBER in reg_overlap_mentioned_p (PR86882) | expand

Commit Message

Segher Boessenkool Sept. 18, 2018, 3:58 p.m. UTC
Combine will put CLOBBER (with a non-void mode) anywhere in a pattern
to poison it.  reg_overlap_mentioned_p did not handle this.  This patch
fixes that.

Tested on the PR testcase on x86_64-linux; also bootstrapped and
regression checked on powerpc64-linux {-m32,-m64}.  Is this okay for
trunk and backports?

What should I do with the testcase?  I don't think tool-generated
testcases are useful at all (instead, we should ship the tool!); but
if people want it anyway, should this be gcc.target/x86_64, or more
general somehow?


Segher


2018-09-18  Segher Boessenkool  <segher@kernel.crashing.org>

	PR rtl-optimization/86882
	* rtlanal.c (reg_overlap_mentioned_p): Handle CLOBBER.

---
 gcc/rtlanal.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Richard Sandiford Sept. 18, 2018, 4:10 p.m. UTC | #1
Segher Boessenkool <segher@kernel.crashing.org> writes:
> Combine will put CLOBBER (with a non-void mode) anywhere in a pattern
> to poison it.  reg_overlap_mentioned_p did not handle this.  This patch
> fixes that.
>
> Tested on the PR testcase on x86_64-linux; also bootstrapped and
> regression checked on powerpc64-linux {-m32,-m64}.  Is this okay for
> trunk and backports?

Yes, thanks.

> What should I do with the testcase?  I don't think tool-generated
> testcases are useful at all (instead, we should ship the tool!); but
> if people want it anyway, should this be gcc.target/x86_64, or more
> general somehow?

Seems obvious enough not to need a testcase IMO.

Richard

> Segher
>
>
> 2018-09-18  Segher Boessenkool  <segher@kernel.crashing.org>
>
> 	PR rtl-optimization/86882
> 	* rtlanal.c (reg_overlap_mentioned_p): Handle CLOBBER.

>
> ---
>  gcc/rtlanal.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
> index 6c620a4..e8b6b9c 100644
> --- a/gcc/rtlanal.c
> +++ b/gcc/rtlanal.c
> @@ -1815,6 +1815,7 @@ reg_overlap_mentioned_p (const_rtx x, const_rtx in)
>   recurse:
>    switch (GET_CODE (x))
>      {
> +    case CLOBBER:
>      case STRICT_LOW_PART:
>      case ZERO_EXTRACT:
>      case SIGN_EXTRACT:
diff mbox series

Patch

diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 6c620a4..e8b6b9c 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1815,6 +1815,7 @@  reg_overlap_mentioned_p (const_rtx x, const_rtx in)
  recurse:
   switch (GET_CODE (x))
     {
+    case CLOBBER:
     case STRICT_LOW_PART:
     case ZERO_EXTRACT:
     case SIGN_EXTRACT: