This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

[PATCH] arm: correct barrier immediate checks


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;
     }



Attachment: binutils-mainline-arm-barrier-imm.patch
Description: Text document


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