This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix for i386/sync.md


This marks some operands in i386/sync.md as in-out rather than output. I noticed this bug when trying to merge more of the mainline into the reload-branch, which aborted when it ran across a sync_add pattern. Really, one of the generator programs should be made to spot such problems.

Bootstrapped & regtested on i686-linux. Not sure if there are other tests that could be run to exercise this.


Bernd


Index: ChangeLog
===================================================================
--- ChangeLog	(revision 110644)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2006-02-02  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+	* config/i386/sync.md (sync_add<mode>, sync_sub<mode>, sync_ior<mode>,
+	sync_and<mode>, sync_xor<mode>): Operand 0 is in-out.
+
 2006-02-06  Daniel Berlin  <dberlin@dberlin.org>
 
 	* tree-ssa-pre.c (bb_value_sets_t): Add antic_safe_loads.
Index: config/i386/sync.md
===================================================================
--- config/i386/sync.md	(revision 110644)
+++ config/i386/sync.md	(working copy)
@@ -1,5 +1,5 @@
 ;; GCC machine description for i386 synchronization instructions.
-;; Copyright (C) 2005
+;; Copyright (C) 2005, 2006
 ;; Free Software Foundation, Inc.
 ;;
 ;; This file is part of GCC.
@@ -230,7 +230,7 @@ (define_insn "sync_lock_test_and_set<mod
   "xchg{<modesuffix>}\t{%1, %0|%0, %1}")
 
 (define_insn "sync_add<mode>"
-  [(set (match_operand:IMODE 0 "memory_operand" "=m")
+  [(set (match_operand:IMODE 0 "memory_operand" "+m")
 	(unspec_volatile:IMODE
 	  [(plus:IMODE (match_dup 0)
 	     (match_operand:IMODE 1 "nonmemory_operand" "r<immconstraint>"))]
@@ -240,7 +240,7 @@ (define_insn "sync_add<mode>"
   "lock\;add{<modesuffix>}\t{%1, %0|%0, %1}")
 
 (define_insn "sync_sub<mode>"
-  [(set (match_operand:IMODE 0 "memory_operand" "=m")
+  [(set (match_operand:IMODE 0 "memory_operand" "+m")
 	(unspec_volatile:IMODE
 	  [(minus:IMODE (match_dup 0)
 	     (match_operand:IMODE 1 "nonmemory_operand" "r<immconstraint>"))]
@@ -250,7 +250,7 @@ (define_insn "sync_sub<mode>"
   "lock\;sub{<modesuffix>}\t{%1, %0|%0, %1}")
 
 (define_insn "sync_ior<mode>"
-  [(set (match_operand:IMODE 0 "memory_operand" "=m")
+  [(set (match_operand:IMODE 0 "memory_operand" "+m")
 	(unspec_volatile:IMODE
 	  [(ior:IMODE (match_dup 0)
 	     (match_operand:IMODE 1 "nonmemory_operand" "r<immconstraint>"))]
@@ -260,7 +260,7 @@ (define_insn "sync_ior<mode>"
   "lock\;or{<modesuffix>}\t{%1, %0|%0, %1}")
 
 (define_insn "sync_and<mode>"
-  [(set (match_operand:IMODE 0 "memory_operand" "=m")
+  [(set (match_operand:IMODE 0 "memory_operand" "+m")
 	(unspec_volatile:IMODE
 	  [(and:IMODE (match_dup 0)
 	     (match_operand:IMODE 1 "nonmemory_operand" "r<immconstraint>"))]
@@ -270,7 +270,7 @@ (define_insn "sync_and<mode>"
   "lock\;and{<modesuffix>}\t{%1, %0|%0, %1}")
 
 (define_insn "sync_xor<mode>"
-  [(set (match_operand:IMODE 0 "memory_operand" "=m")
+  [(set (match_operand:IMODE 0 "memory_operand" "+m")
 	(unspec_volatile:IMODE
 	  [(xor:IMODE (match_dup 0)
 	     (match_operand:IMODE 1 "nonmemory_operand" "r<immconstraint>"))]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]