insn-attrtab for unsigned comparisons
Kaz Kojima
kkojima@rr.iij4u.or.jp
Sun Jun 13 23:43:00 GMT 2004
Hi,
When I tried to bootstrap sh-linux on sh-elf-3_5-branch and mainline
without --disable-werror, I saw several warnings in compiling
insn-attrrab.c:
insn-attrtab.c: In function `get_attr_braf_cbranch_p':
insn-attrtab.c:3988: warning: comparison between signed and unsigned
insn-attrtab.c:3996: warning: comparison between signed and unsigned
...
The line insn-attrtab.c:3988 looks like
else if ((((INSN_ADDRESSES_SET_P () ? INSN_ADDRESSES (INSN_UID (GET_CODE (operands[0]) == LABEL_REF ? XEXP (operands[0], 0) : operands[0])) : 0) - (insn_current_reference_address (insn))) + (10328)) <= (unsigned) (20658))
and the corresponding line of sh.md is
(leu (plus (minus (match_dup 0) (pc)) (const_int 10328))
(const_int 20658))
It seems genattrtab generates the output like
"(output_for_exp0 <= (unsigned) output_for_exp1)"
for the expression (leu exp0 exp1). If it was
"((unsigned) output_for_exp0 <= (unsigned) output_for_exp1)",
the above warnings could be avoided. Is it a bad idea?
Regards,
kaz
More information about the Gcc
mailing list