public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* simplify_relational_operation and unsigned char
@ 2009-10-29 14:18 Amir Gonnen
  2009-10-29 17:19 ` Richard Henderson
  2009-10-29 19:26 ` Dave Korn
  0 siblings, 2 replies; 3+ messages in thread
From: Amir Gonnen @ 2009-10-29 14:18 UTC (permalink / raw)
  To: gcc

(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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-29 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-29 14:18 simplify_relational_operation and unsigned char Amir Gonnen
2009-10-29 17:19 ` Richard Henderson
2009-10-29 19:26 ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).