GAS/ia64: spurious dv conflict

Andreas Schwab schwab@suse.de
Wed Oct 1 13:08:00 GMT 2003


The following input when assembled with -x gives a spurious dependency
warning:

.text
start:	
	.pred.rel.mutex p1, p2
(p3)	cmp.eq p1, p2 = r1, r2;;
(p1)	mov r4 = 2
(p2)	mov r4 = 4
	rfi
L:	

mutex.s: Assembler messages:
mutex.s:6: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 4
mutex.s:6: Warning: Only the first path encountering the conflict is reported
mutex.s:5: Warning: This is the location of the conflicting usage

The problem is that a predicated compare causes the mutex relation to be
removed.  But this is wrong: if the mutex relation was present before the
comparison it is surely still present after it, independent of the
predicate.  If the relation was not present before, we don't know the
relation after it.  So in essence the state does not change.

Andreas.

gas/
	* config/tc-ia64.c (note_register_values): Don't clear mutex
	relation on predicated compare.

testsuite/
	* gas/ia64/dv-mutex.s: Add test with predicated compare.
	* gas/ia64/dv-mutex.d: Update.

Index: gas/config/tc-ia64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.91
diff -u -p -a -r1.91 tc-ia64.c
--- gas/config/tc-ia64.c	30 Jun 2003 04:10:48 -0000	1.91
+++ gas/config/tc-ia64.c	1 Oct 2003 13:06:39 -0000
@@ -9036,10 +9036,6 @@ note_register_values (idesc)
 	    {
 	      add_qp_mutex (p1mask | p2mask);
 	    }
-	  else
-	    {
-	      clear_qp_mutex (p1mask | p2mask);
-	    }
 	}
     }
   /* Look for mov imm insns into GRs.  */
Index: gas/testsuite/gas/ia64/dv-mutex.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/ia64/dv-mutex.d,v
retrieving revision 1.5
diff -u -p -a -r1.5 dv-mutex.d
--- gas/testsuite/gas/ia64/dv-mutex.d	26 Sep 2003 03:54:09 -0000	1.5
+++ gas/testsuite/gas/ia64/dv-mutex.d	1 Oct 2003 13:06:39 -0000
@@ -25,3 +25,9 @@ Disassembly of section \.text:
   50:	1d 00 00 00 01 00 	\[MFB\]       nop\.m 0x0
   56:	00 00 00 02 00 00 	            nop\.f 0x0
   5c:	00 00 20 00       	            rfi;;
+  60:	6a 08 04 04 02 78 	\[MMI\] \(p03\) cmp\.eq p1,p2=r1,r2;;
+  66:	40 10 00 00 42 81 	      \(p01\) mov r4=2
+  6c:	40 00 00 84       	      \(p02\) mov r4=4
+  70:	1d 00 00 00 01 00 	\[MFB\]       nop\.m 0x0
+  76:	00 00 00 02 00 00 	            nop\.f 0x0
+  7c:	00 00 20 00       	            rfi;;
Index: gas/testsuite/gas/ia64/dv-mutex.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/ia64/dv-mutex.s,v
retrieving revision 1.2
diff -u -p -a -r1.2 dv-mutex.s
--- gas/testsuite/gas/ia64/dv-mutex.s	29 Aug 2000 12:15:51 -0000	1.2
+++ gas/testsuite/gas/ia64/dv-mutex.s	1 Oct 2003 13:06:39 -0000
@@ -21,4 +21,10 @@ start:	
 (p1)	mov r4 = 2
 (p2)	mov r4 = 4
 	rfi
+
+// predicated compares don't remove mutex
+(p3)	cmp.eq p1, p2 = r1, r2;;
+(p1)	mov r4 = 2
+(p2)	mov r4 = 4
+	rfi
 L:	

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Binutils mailing list