From d49447530a24e85bbc8f3dd18b038c7a8f729289 Mon Sep 17 00:00:00 2001 From: segher Date: Tue, 24 Nov 2015 14:04:11 +0000 Subject: [PATCH] rs6000: Fix for and_operand oversight (PR68332, PR67677) 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. 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230811 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/config/rs6000/predicates.md | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ada1e3094c86..5203b2865d37 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-11-24 Segher Boessenkool + + 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. + 2015-11-24 Kyrylo Tkachov * config/aarch64/aarch64.md (*condjump): Rename to... diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index 3b1a4561fba5..362188f1d163 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -864,7 +864,8 @@ ;; 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")))) -- 2.47.2