This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH/RFA] genattrtab: Put a unsigned cast for unsignedcomparisons
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: gcc-patches at gcc dot gnu dot org
- Cc: wilson at specifixinc dot com
- Date: Sat, 26 Jun 2004 06:37:30 +0900 (JST)
- Subject: [PATCH/RFA] genattrtab: Put a unsigned cast for unsignedcomparisons
Hi,
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:
http://gcc.gnu.org/ml/gcc/2004-06/msg00794.html
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?
Regards,
kaz
--
2004-06-25 Kaz Kojima <kkojima@gcc.gnu.org>
* 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)
{