This is the mail archive of the 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]

[PATCH/RFA] genattrtab: Put a unsigned cast for unsignedcomparisons


In mainline, genattrtab generates the output like
"(output_for_exp0 OP (unsigned) output_for_exp1)"
for unsigned comparison OPs i.e. GEU, GTU, LEU and LTU.
This causes several warnings when compiling insn-attrrab.c on sh-linux:

and in a follow-up, Jim suggested that a patch to put a unsigned cast
before the first operand is reasonable.

The appended patch incorporates it.  Bootstrapped on i686-pc-linux-gnu
with no new failures.  OK for mainline?

2004-06-25  Kaz Kojima  <>

	* genattrtab.c (write_test_expr): Put a unsigned cast before
	the first operand for GEU, GTU, LEU and LTU.

diff -upr ORIG/gcc/gcc/genattrtab.c LOCAL/gcc/gcc/genattrtab.c
--- ORIG/gcc/gcc/genattrtab.c	2004-05-14 10:06:21.000000000 +0900
+++ LOCAL/gcc/gcc/genattrtab.c	2004-06-25 13:45:59.000000000 +0900
@@ -4579,6 +4579,15 @@ write_test_expr (rtx exp, int flags)
     case PLUS:   case MINUS:  case MULT:     case DIV:      case MOD:
     case AND:    case IOR:    case XOR:
     case ASHIFT: case LSHIFTRT: case ASHIFTRT:
+      switch (code)
+	{
+	case GEU: case GTU: case LEU: case LTU:
+	  printf ("(unsigned) ");
+	  break;
+	default:
+	  break;
+	}
       write_test_expr (XEXP (exp, 0), flags | comparison_operator);
       switch (code)

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