public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-64659-4-Wpcs3Vlfvl@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64659-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64659

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-01-18
     Ever confirmed|0                           |1

--- Comment #1 from Oleg Endo <olegendo at gcc dot gnu.org> ---
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"


  reply	other threads:[~2015-01-18 22:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-18 21:37 [Bug target/64659] New: " olegendo at gcc dot gnu.org
2015-01-18 22:22 ` olegendo at gcc dot gnu.org [this message]
2015-01-18 22:40 ` [Bug target/64659] " olegendo at gcc dot gnu.org
2015-01-28 21:12 ` olegendo at gcc dot gnu.org
2015-02-01 10:47 ` olegendo at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-64659-4-Wpcs3Vlfvl@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).