diff mbox

[RFC] RL78 - clean-up of missing operand mode warnings.

Message ID 534D9A6E.9090609@yahoo.com
State New
Headers show

Commit Message

Richard Hulme April 15, 2014, 8:45 p.m. UTC
Hi,

This patch cleans up some warnings when building due to missing operand 
modes.

"trampoline_init" in rl78.md still produces warnings but I'm not 
entirely sure about how best to fix that insn and I didn't want to break 
anything.

Regards,

Richard


2014-04-15  Richard Hulme  <peper03@yahoo.com>

	* config/rl78/rl78.md (addsi3, addsi3_internal_virt,
	addsi3_internal_real, subsi3, subsi3_internal_virt,
	subsi3_internal_real): Add missing modes to operands.
	* config/rl78/rl78-real.md (*movqi_real, *xorqi3_real): Likewise.
	* config/rl78/rl78-virt.md (*movqi_virt, *xorqi3_vidr): Likewise.

---
  gcc/config/rl78/rl78-real.md |    4 ++--
  gcc/config/rl78/rl78-virt.md |    4 ++--
  gcc/config/rl78/rl78.md      |   12 ++++++------
  3 files changed, 10 insertions(+), 10 deletions(-)

operands[2]));
@@ -218,7 +218,7 @@
  (define_insn "addsi3_internal_virt"
    [(set (match_operand:SI          0 "nonimmediate_operand" "=v,&vm, vm")
  	(plus:SI (match_operand:SI 1 "general_operand"      "0, vim, vim")
-		 (match_operand    2 "general_operand"      "vim,vim,vim")))
+		 (match_operand:SI 2 "general_operand"      "vim,vim,vim")))
     (clobber (reg:HI AX_REG))
     (clobber (reg:HI BC_REG))
     ]
@@ -230,7 +230,7 @@
  (define_insn "addsi3_internal_real"
    [(set (match_operand:SI          0 "nonimmediate_operand" "=v,&vU, vU")
  	(plus:SI (match_operand:SI 1 "general_operand"      "+0, viU, viU")
-		 (match_operand    2 "general_operand" 
"viWabWhlWh1,viWabWhlWh1,viWabWhlWh1")))
+		 (match_operand:SI 2 "general_operand" 
"viWabWhlWh1,viWabWhlWh1,viWabWhlWh1")))
     (clobber (reg:HI AX_REG))
     (clobber (reg:HI BC_REG))
     ]
@@ -245,7 +245,7 @@
  (define_expand "subsi3"
    [(set (match_operand:SI           0 "nonimmediate_operand" "=&vm")
  	(minus:SI (match_operand:SI 1 "general_operand"      "vim")
-		  (match_operand    2 "general_operand"    "vim")))
+		  (match_operand:SI 2 "general_operand"    "vim")))
     ]
    ""
    "emit_insn (gen_subsi3_internal_virt (operands[0], operands[1], 
operands[2]));
@@ -255,7 +255,7 @@
  (define_insn "subsi3_internal_virt"
    [(set (match_operand:SI           0 "nonimmediate_operand" "=v,&vm, vm")
  	(minus:SI (match_operand:SI 1 "general_operand"      "0, vim, vim")
-		  (match_operand    2 "general_operand"      "vim,vim,vim")))
+		  (match_operand:SI 2 "general_operand"      "vim,vim,vim")))
     (clobber (reg:HI AX_REG))
     (clobber (reg:HI BC_REG))
     ]
@@ -267,7 +267,7 @@
  (define_insn "subsi3_internal_real"
    [(set (match_operand:SI           0 "nonimmediate_operand" "=v,&vU, vU")
  	(minus:SI (match_operand:SI 1 "general_operand"      "+0, viU, viU")
-		  (match_operand    2 "general_operand" 
"viWabWhlWh1,viWabWhlWh1,viWabWhlWh1")))
+		  (match_operand:SI 2 "general_operand" 
"viWabWhlWh1,viWabWhlWh1,viWabWhlWh1")))
     (clobber (reg:HI AX_REG))
     (clobber (reg:HI BC_REG))
     ]

Comments

DJ Delorie April 15, 2014, 8:58 p.m. UTC | #1
I typically leave the mode off when the operand accepts a CONST_INT as
I've had problems with patterns matching CONST_INTs otherwise, as
CONST_INT rtx's do not have a mode (or have VOIDmode).

(yes, I know gcc is supposed to accomodate that, but like I said, I've
had problems...)
Richard Hulme April 17, 2014, 8:01 p.m. UTC | #2
On 15/04/14 22:58, DJ Delorie wrote:
> I typically leave the mode off when the operand accepts a CONST_INT as
> I've had problems with patterns matching CONST_INTs otherwise, as
> CONST_INT rtx's do not have a mode (or have VOIDmode).
>
> (yes, I know gcc is supposed to accomodate that, but like I said, I've
> had problems...)

Ok, that's fine.  I was just trying to mop up one little bit of the sea 
of warnings.

It seems a little inconsistent, however, that *movqi_real and 
*xorqi3_real don't specify modes but *movhi_real and 
*andqi_real/*iorqi_real do (and they also accept CONST_INTs).  Not that 
I'm advocating generating more warnings, but my inner OCD likes 
consistency :)

Richard.
DJ Delorie April 17, 2014, 11:06 p.m. UTC | #3
> It seems a little inconsistent, however, that *movqi_real and 
> *xorqi3_real don't specify modes but *movhi_real and 
> *andqi_real/*iorqi_real do (and they also accept CONST_INTs).  Not that 
> I'm advocating generating more warnings, but my inner OCD likes 
> consistency :)

Adding the mode might be the right way, but I've seen cases where it
wasn't.  My paranoia supercedes my OCD ;-)
diff mbox

Patch

diff --git a/gcc/config/rl78/rl78-real.md b/gcc/config/rl78/rl78-real.md
index 5d5c598..847a82d 100644
--- a/gcc/config/rl78/rl78-real.md
+++ b/gcc/config/rl78/rl78-real.md
@@ -45,7 +45,7 @@ 

  (define_insn "*movqi_real"
    [(set (match_operand:QI 0 "nonimmediate_operand" 
"=g,RaxbcWab,RaxbcWab,a,                          bcx,R, 
WabWd2WhlWh1WhbWbcWs1v, bcx")
-	(match_operand    1 "general_operand"      "0,K,        M, 
RInt8sJvWabWdeWd2WhlWh1WhbWbcWs1,Wab,aInt8J,a,                      R"))]
+	(match_operand:QI 1 "general_operand"      "0,K,        M, 
RInt8sJvWabWdeWd2WhlWh1WhbWbcWs1,Wab,aInt8J,a,                      R"))]
    "rl78_real_insns_ok ()"
    "@
     ; mov\t%0, %1
@@ -194,7 +194,7 @@ 
  (define_insn "*xorqi3_real"
    [(set (match_operand:QI         0 "nonimmediate_operand"  "=A,R,v")
  	(xor:QI (match_operand:QI 1 "general_operand"       "%0,0,0")
-		(match_operand    2 "general_operand"       "iRvWabWhbWh1Whl,A,i")))
+		(match_operand:QI 2 "general_operand"       "iRvWabWhbWh1Whl,A,i")))
     ]
    "rl78_real_insns_ok ()"
    "xor\t%0, %2"
diff --git a/gcc/config/rl78/rl78-virt.md b/gcc/config/rl78/rl78-virt.md
index 1db3751..189cf79 100644
--- a/gcc/config/rl78/rl78-virt.md
+++ b/gcc/config/rl78/rl78-virt.md
@@ -35,7 +35,7 @@ 

  (define_insn "*movqi_virt"
    [(set (match_operand:QI 0 "nonimmediate_operand" "=vY,v,Wfr")
-	(match_operand    1 "general_operand" "vInt8JY,Wfr,vInt8J"))]
+	(match_operand:QI 1 "general_operand" "vInt8JY,Wfr,vInt8J"))]
    "rl78_virt_insns_ok ()"
    "v.mov %0, %1"
    [(set_attr "valloc" "op1")]
@@ -126,7 +126,7 @@ 
  (define_insn "*xor3_virt"
    [(set (match_operand:QI         0 "rl78_nonfar_nonimm_operand" 
"=v,vm,m")
  	(xor:QI (match_operand:QI 1 "rl78_nonfar_operand" "%0,vm,vm")
-		(match_operand    2 "general_operand" "i,vm,vim")))
+		(match_operand:QI 2 "general_operand" "i,vm,vim")))
     ]
    "rl78_virt_insns_ok ()"
    "v.xor\t%0, %1, %2"
diff --git a/gcc/config/rl78/rl78.md b/gcc/config/rl78/rl78.md
index eb4c468..ede4eac 100644
--- a/gcc/config/rl78/rl78.md
+++ b/gcc/config/rl78/rl78.md
@@ -208,7 +208,7 @@ 
  (define_expand "addsi3"
    [(set (match_operand:SI          0 "nonimmediate_operand" "=&vm")
  	(plus:SI (match_operand:SI 1 "general_operand"      "vim")
-		 (match_operand    2 "general_operand"      "vim")))
+		 (match_operand:SI 2 "general_operand"      "vim")))
     ]
    ""
    "emit_insn (gen_addsi3_internal_virt (operands[0], operands[1],