public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/6019: doubled struct initialization
@ 2002-03-20  9:16 Gunther Vogel
  0 siblings, 0 replies; 2+ messages in thread
From: Gunther Vogel @ 2002-03-20  9:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6019
>Category:       optimization
>Synopsis:       doubled struct initialization
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          pessimizes-code
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 20 09:16:02 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Gunther Vogel
>Release:        3.0.4
>Organization:
>Environment:
System: Linux whiterider 2.4.17 #10 Tue Feb 26 17:24:09 CET 2002 i686 unknown
Architecture: i686

host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --prefix=/usr/src/packages/BUILD/gccgpp-buildroot/usr --mandir=/share/man --with-cpu=athlon --disable-cpp --disable-nls
>Description:
	The first generated movl $2538, ... instructions looks
	superfluous to me.  This effect occurs if and only if
	optimization (gcc -O[1-3] -S t.c) is used.  Using different
	-march= options (i[3-6]86, athlon) moves things around a bit,
	but keeps the repetition.  (Please take my apology if this is
	just some kind of subtle optimization I don't comprehend.)
>How-To-Repeat:

// begin file t.c
typedef struct B_ {
		int b;
	} B;

extern void bar(B*);

void foo()
{
	B b = { 2538 };
	bar(&b);
}
// end file t.c

// begin excerpt t.s generated by gcc -O2 -S t.c
foo:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$20, %esp
	movl	$2538, -4(%ebp)
	leal	-8(%ebp), %eax
	movl	$2538, -8(%ebp)
	pushl	%eax
	call	bar
	movl	%ebp, %esp
	popl	%ebp
	ret
// end excerpt t.s

>Fix:
	unknown

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: optimization/6019: doubled struct initialization
@ 2002-12-06 16:04 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2002-12-06 16:04 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, gunther.vogel, nobody

Synopsis: doubled struct initialization

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Fri Dec  6 16:04:17 2002
State-Changed-Why:
    This is fixed in 3.2 and 3.3CVS

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6019


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-07  0:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-20  9:16 optimization/6019: doubled struct initialization Gunther Vogel
2002-12-06 16:04 bangerth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).