This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Serious structure return code-size/speed regression with SRA


Jakub Jelinek wrote:

Hi!

struct A { int a : 1, b : 1, c : 1, d : 1, e : 1, f : 1, g : 1, h : 1,
              i : 1, j : 1, k : 1, l : 1, m : 1, n : 1, o : 1, p : 1,
              q : 2, r : 2, s : 2, t : 2, u : 2, v : 2, w : 2, x : 2; };
struct A foo (struct A x)
{
 return x;
}
struct A a, b;
struct A bar (void)
{
 return a;
}
void baz (void)
{
 a = b;
}
void test (struct A x)
{
 a = x;
}

On say x86-64, foo is 529 bytes long (without padding) on HEAD at -O2,
while only 3 bytes long (2 insns) in 3.4.1.  Similarly the test function.
bar and baz are the same size/speed as in 3.4.1.
The problem is that assignment of the struct argument is in SRA split up
into a series of field assignments, which is definitely way worse in this
case.

I think you should file a PR, mark it as a regression, target it at 3.5.0, and assign it to Richard Henderson, who will no doubt fix it with his usual efficacy.

--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]