This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/25809] New: missed PRE optimization - move "invariant casts" out of loops
- From: "dorit at il dot ibm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jan 2006 14:30:11 -0000
- Subject: [Bug tree-optimization/25809] New: missed PRE optimization - move "invariant casts" out of loops
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In testcases that have reduction, like gcc.dg/vect/vect-reduc-2char.c and
gcc.dg/vect-reduc-2short.c, the following casts appear:
signed char sdiff;
unsigned char ux, udiff;
sdiff_0 = ...
loop:
# sdiff_41 = PHI <sdiff_39, sdiff_0>;
.....
ux_36 = ....
udiff_37 = (unsigned char) sdiff_41;
udiff_38 = x_36 + udiff_37;
sdiff_39 = (signed char) udiff_38;
end_loop
although these casts could be taken out of loop all together. i.e., transform
the code into something like the following:
signed char sdiff;
unsigned char ux, udiff;
sdiff_0 = ...
udiff_1 = (unsigned char) sdiff_0;
loop:
# udiff_3 = PHI <udiff_2, udiff_1>;
.....
ux_36 = ....
udiff_2 = ux_36 + udiff_3;
end_loop
sdiff_39 = (signed char) udiff_2;
see this discussion thread:
http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01827.html
--
Summary: missed PRE optimization - move "invariant casts" out of
loops
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dorit at il dot ibm dot com
GCC build triplet: ppc64-yellowdog-linux
GCC host triplet: ppc64-yellowdog-linux
GCC target triplet: ppc64-yellowdog-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25809