public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rs6000: Fix for and_operand oversight (PR68332, PR67677)
@ 2015-11-24  7:51 Segher Boessenkool
  2015-11-24 15:57 ` David Edelsohn
  0 siblings, 1 reply; 2+ messages in thread
From: Segher Boessenkool @ 2015-11-24  7:51 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

Calling rs6000_is_valid_and_mask on a reg instead of on a const_int is
not a good idea, as PR68332 and PR67677 as well as testing with
--enable-checking=yes,rtl show.  Fix this.

Bootstrapped and tested on powerpc64-linux.  Is this okay for trunk?


Segher


2015-11-24  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/66217
	PR target/67677
	PR target/68332
	* config/rs6000/predicates.md (and_operand): Check that the operand
	is a const_int before calling rs6000_is_valid_and_mask.

---
 gcc/config/rs6000/predicates.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index 3b1a456..362188f 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -864,7 +864,8 @@ (define_predicate "non_logical_cint_operand"
 ;; Return 1 if the operand is either a non-special register or a
 ;; constant that can be used as the operand of a logical AND.
 (define_predicate "and_operand"
-  (ior (match_test "rs6000_is_valid_and_mask (op, mode)")
+  (ior (and (match_code "const_int")
+	    (match_test "rs6000_is_valid_and_mask (op, mode)"))
        (if_then_else (match_test "fixed_regs[CR0_REGNO]")
 	 (match_operand 0 "gpc_reg_operand")
 	 (match_operand 0 "logical_operand"))))
-- 
1.9.3

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

* Re: [PATCH] rs6000: Fix for and_operand oversight (PR68332, PR67677)
  2015-11-24  7:51 [PATCH] rs6000: Fix for and_operand oversight (PR68332, PR67677) Segher Boessenkool
@ 2015-11-24 15:57 ` David Edelsohn
  0 siblings, 0 replies; 2+ messages in thread
From: David Edelsohn @ 2015-11-24 15:57 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: GCC Patches

On Tue, Nov 24, 2015 at 2:13 AM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> Calling rs6000_is_valid_and_mask on a reg instead of on a const_int is
> not a good idea, as PR68332 and PR67677 as well as testing with
> --enable-checking=yes,rtl show.  Fix this.
>
> Bootstrapped and tested on powerpc64-linux.  Is this okay for trunk?
>
>
> Segher
>
>
> 2015-11-24  Segher Boessenkool  <segher@kernel.crashing.org>
>
>         PR target/66217
>         PR target/67677
>         PR target/68332
>         * config/rs6000/predicates.md (and_operand): Check that the operand
>         is a const_int before calling rs6000_is_valid_and_mask.

Okay.

Thanks, David

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

end of thread, other threads:[~2015-11-24 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-24  7:51 [PATCH] rs6000: Fix for and_operand oversight (PR68332, PR67677) Segher Boessenkool
2015-11-24 15:57 ` David Edelsohn

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).