From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4163 invoked by alias); 18 Jan 2015 22:22:13 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 4137 invoked by uid 48); 18 Jan 2015 22:22:08 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/64659] [SH] Immedate values not used for atomic ops Date: Sun, 18 Jan 2015 22:22:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg01764.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64659 Oleg Endo changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2015-01-18 Ever confirmed|0 |1 --- Comment #1 from Oleg Endo --- The predicates must include "const_int" in match_code, otherwise the generated predicate code will check the operand mode and will reject const_int since they don't have a mode. The following fixes the issue: Index: gcc/config/sh/predicates.md =================================================================== --- gcc/config/sh/predicates.md (revision 219823) +++ gcc/config/sh/predicates.md (working copy) @@ -1139,18 +1139,20 @@ ;; values. Using these predicates avoids the usage of 'force_reg' in the ;; expanders. (define_predicate "atomic_arith_operand" - (ior (match_code "subreg,reg") - (and (match_test "satisfies_constraint_I08 (op)") - (match_test "mode != QImode") - (match_test "mode != HImode") - (match_test "TARGET_SH4A")))) + (and (match_code "subreg,reg,const_int") + (ior (match_operand 0 "arith_reg_operand") + (and (match_test "satisfies_constraint_I08 (op)") + (match_test "mode != QImode") + (match_test "mode != HImode") + (match_test "TARGET_SH4A"))))) (define_predicate "atomic_logical_operand" - (ior (match_code "subreg,reg") - (and (match_test "satisfies_constraint_K08 (op)") - (match_test "mode != QImode") - (match_test "mode != HImode") - (match_test "TARGET_SH4A")))) + (and (match_code "subreg,reg,const_int") + (ior (match_operand 0 "arith_reg_operand") + (and (match_test "satisfies_constraint_K08 (op)") + (match_test "mode != QImode") + (match_test "mode != HImode") + (match_test "TARGET_SH4A"))))) ;; A predicate describing the T bit register in any form. (define_predicate "t_reg_operand"