[PATCH] arm: correct barrier immediate checks

Jan Beulich JBeulich@suse.com
Mon Apr 8 09:26:00 GMT 2013


Both do_barrier() and do_t_barrier() used && instead of || in a constraint()
invocation. While fixing this, I also noticed that the mask used in the first
part of the condition was too strict - according to the specification, only
2 bits should really be looked at.

gas/
2013-04-08  Jan Beulich <jbeulich@suse.com>

	* gas/config/tc-arm.c (do_barrier): Correct constraint()
	argument.
	(do_t_barrier): Likewise.

--- 2013-04-08/gas/config/tc-arm.c
+++ 2013-04-08/gas/config/tc-arm.c
@@ -7542,9 +7542,9 @@ do_barrier (void)
 {
   if (inst.operands[0].present)
     {
-      constraint ((inst.instruction & 0xf0) != 0x40
-		  && inst.operands[0].imm > 0xf
-		  && inst.operands[0].imm < 0x0,
+      constraint ((inst.instruction & 0xc0) != 0x40
+		  || inst.operands[0].imm > 0xf
+		  || inst.operands[0].imm < 0x0,
 		  _("bad barrier type"));
       inst.instruction |= inst.operands[0].imm;
     }
@@ -10073,9 +10073,9 @@ do_t_barrier (void)
 {
   if (inst.operands[0].present)
     {
-      constraint ((inst.instruction & 0xf0) != 0x40
-		  && inst.operands[0].imm > 0xf
-		  && inst.operands[0].imm < 0x0,
+      constraint ((inst.instruction & 0xc0) != 0x40
+		  || inst.operands[0].imm > 0xf
+		  || inst.operands[0].imm < 0x0,
 		  _("bad barrier type"));
       inst.instruction |= inst.operands[0].imm;
     }



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: binutils-mainline-arm-barrier-imm.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20130408/e2376054/attachment.ksh>


More information about the Binutils mailing list