simplify_relational_operation and unsigned char
Amir Gonnen
amirgonnen@gmail.com
Thu Oct 29 14:18:00 GMT 2009
(gcc-4.4.1)
Hi,
I found out some strange behavior of simplify_relational_operation.
Apparently it assumes QImode is signed even though this could not be
deduced from the EQ operator.
Here is an example:
rtx reg = gen_reg_rtx(QImode);
...
rtx test = simplify_relational_operation(EQ, VOIDmode, QImode, reg,
GEN_INT(129));
In this case simplify_relational_operation returns const_int 0 because
of comparisons optimization with upper and lower bounds performed on
simplify_const_relational_operation.
The problem with this behavior was the removal of a "case 129:" in a
switch during cse pass (proprietary target and backend).
Perhaps EQ and NE could be treated as unsigned, like the
GEU,LEU,GTU,LTU operators?
Amir
More information about the Gcc
mailing list