This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19792] New: Missed optimizations due to signedness in the way
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Feb 2005 13:50:36 -0000
- Subject: [Bug tree-optimization/19792] New: Missed optimizations due to signedness in the way
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider:
extern unsigned char size_lookup[257];
int
foo (unsigned int t)
{
return (size_lookup [(int) t] == size_lookup[t]);
}
int
bar (unsigned int t)
{
int a = t;
return a == t;
}
Both functions should return 1, and in fact that's what the RTL optimizers
notice, but the tree optimizers don't.
This is somewhat related to PR 19790.
--
Summary: Missed optimizations due to signedness in the way
Product: gcc
Version: unknown
Status: UNCONFIRMED
Keywords: missed-optimization, TREE
Severity: enhancement
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kazu at cs dot umass dot edu
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19792