This is the mail archive of the gcc-patches@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: GCC Status Report (2004-03-09)


> The object can be huge, allocating a temporary of the same size can be
> prohibitive, at least in certain environments (e.g. when stack size
> is very limited).

Yes, this was my initial concern.  Now there is another one: here's what I 
get on UltraSPARC at -O2 for

struct S {
  const int i1;
  const long l1;
  const int i2;
  const long l2;
  int i3;
  int i4;
};

int main(void)
{
  struct S s = { 0, 0, 0, 0 };

  s.i3 = 2;

  bar(&s);

  return 0;
}


main:
	!#PROLOGUE# 0
	save	%sp, -160, %sp
	!#PROLOGUE# 1
	stx	%g0, [%fp-24]
	add	%fp, -40, %o0
	mov	2, %g1
	mov	0, %i0
	st	%g1, [%fp-24]
	stx	%g0, [%fp-64]
	stx	%g0, [%fp-56]
	stx	%g0, [%fp-48]
	stx	%g0, [%fp-40]
	call	bar, 0
	stx	%g0, [%fp-32]
	return	%i7+8
	nop


The 3 stores

	stx	%g0, [%fp-64]
	stx	%g0, [%fp-56]
	stx	%g0, [%fp-48]

are totally useless.

-- 
Eric Botcazou


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