This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/30967] New: Extra sign/zero extend with word comparison result
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Feb 2007 11:41:58 -0000
- Subject: [Bug rtl-optimization/30967] New: Extra sign/zero extend with word comparison result
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Testcase:
int f1(int a, int b)
{
return a == b;
}
------
We produce right now:
_f1:
xor r4,r3,r4
cntlzw r4,r4 <--- sign never 1
srwi r4,r4,5 <--- upper bits defined as 0
extsw r3,r4
blr
The sign extend is incorrect as r4's sign will never be 1 and all the upper
bits will always be zero because of srwi.
we have the same issue if the return value is unsigned int also in that there
is an extra zero extend.
This is even with -fsee.
--
Summary: Extra sign/zero extend with word comparison result
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc64-apple-darwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30967