This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/17549] [4.0 Regression] 10% increase in codesize with C code compared to GCC 3.3
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Feb 2005 23:13:27 -0000
- Subject: [Bug tree-optimization/17549] [4.0 Regression] 10% increase in codesize with C code compared to GCC 3.3
- References: <20040918113641.17549.miguel55angel@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From steven at gcc dot gnu dot org 2005-02-07 23:13 -------
Using var_to_partition does not help. The reason is that the SSA names with
the same root var are not in the same partition, e.g.
int
foo (int x, int a, int b)
{
x = a + b;
x = x * a;
x = x * b;
return x;
}
-->
Sorted Coalesce list:
Partition map
Partition 0 (x_3 - 3 )
Partition 1 (x_4 - 4 )
Partition 2 (x_5 - 5 )
After Coalescing:
Partition map
Partition 0 (a_1 - 1 )
Partition 1 (b_2 - 2 )
Partition 2 (x_3 - 3 )
Partition 3 (x_4 - 4 )
Partition 4 (x_5 - 5 )
Partition 5 (<retval>_7 - 7 )
Replacing Expressions
x_3 replace with --> a_1 + b_2
x_4 replace with --> a_1 * x_3
x_5 replace with --> b_2 * x_4
<retval>_7 --> <retval>
x_3 --> x
x_4 not coalesced with x --> New temp: 'x.0'
x_5 not coalesced with x.0 --> New temp: 'x.1'
b_2 --> b
a_1 --> a
After Root variable replacement:
Partition map
Partition 0 (a - 1 )
Partition 1 (b - 2 )
Partition 2 (x - 3 )
Partition 3 (x.0 - 4 )
Partition 4 (x.1 - 5 )
Partition 5 (<retval> - 7 )
So if you replace the root var comparison in my hack with a check to make sure
def and def2 are not in the same partition, that whole check will always be
false and you still get crap code.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17549