This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/13191] New: Redundant sign extends
- From: "amodra at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Nov 2003 23:53:56 -0000
- Subject: [Bug middle-end/13191] New: Redundant sign extends
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following testcase taken from lmbench shows gcc inserting needless sign
extends to convert intermediate results to ints (ppc64 logical operations are
done on full 64 bit registers). Ideally, gcc could implement this function with
just one sign extend for the final result. Different results, but still not
ideal, are seen when using an int for iter.
typedef long iter;
int
do_integer_bitwise (iter iterations, int r)
{
int s = iterations;
#if 0
while (iterations-- > 0)
#endif
{
r^=iterations; s^=r; r|=s;
r^=iterations; s^=r; r|=s;
r^=iterations; s^=r; r|=s;
r^=iterations; s^=r; r|=s;
}
return r;
}
--
Summary: Redundant sign extends
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: amodra at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13191