[Bug target/64659] [SH] Immedate values not used for atomic ops
olegendo at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Jan 18 22:22:00 GMT 2015
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"
More information about the Gcc-bugs
mailing list