public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/9059: unused arrays not optimized away when followed by external call
@ 2002-12-26  6:56 stefaandr
  0 siblings, 0 replies; 2+ messages in thread
From: stefaandr @ 2002-12-26  6:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9059
>Category:       optimization
>Synopsis:       unused arrays not optimized away when followed by external call
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          pessimizes-code
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 26 06:56:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     stefaandr@hotmail.com
>Release:        gcc (GCC) 3.4 20021225 (experimental)
>Organization:
>Environment:
intel piii, redhat 8.0
>Description:
attached file says it all, i suppose

stack-variables which are never consumed, should not appear in the assembler output anymore.  they are indeed removed when the variable is no array (or an array of size 1), but they're in case of this source file, even though they go out of scope without ever being used.  
please note that removing the external function call stops this from being triggered.

Reading specs from /tmp/inst/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with:
Thread model: posix
gcc version 3.4 20021225 (experimental)
 /tmp/inst/lib/gcc-lib/i686-pc-linux-gnu/3.4/cc1plus -E -D__GNUG__=3 -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=4 -D__GNUC_PATCHLEVEL__=0 -D_GNU_SOURCE test3.cpp -Wall -W -O3 test3.ii
ignoring nonexistent directory "/tmp/inst/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /tmp/inst/include/c++/3.4
 /tmp/inst/include/c++/3.4/i686-pc-linux-gnu
 /tmp/inst/include/c++/3.4/backward
 /usr/local/include
 /tmp/inst/include
 /tmp/inst/lib/gcc-lib/i686-pc-linux-gnu/3.4/include
 /usr/include
End of search list.
 /tmp/inst/lib/gcc-lib/i686-pc-linux-gnu/3.4/cc1plus -fpreprocessed test3.ii -quiet -dumpbase test3.cpp -auxbase-strip test3.s -O3 -Wall -W -version -o test3.s
GNU C++ version 3.4 20021225 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 3.2 20020903 (Red Hat Linux 8.0 3.2-7).
>How-To-Repeat:
look at the assembler output of the attached source with -O3
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test3.ii"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test3.ii"

IyAxICJ0ZXN0My5jcHAiCiMgMSAiPGJ1aWx0LWluPiIKIyAxICI8Y29tbWFuZCBsaW5lPiIKIyAx
ICJ0ZXN0My5jcHAiCmV4dGVybiB2b2lkIGNhbGwoKTsKCnZvaWQgdGVzdCgpIHsKICAgICAgICBp
bnQgeFs1XTsKICAgICAgICB4WzRdID0gMTIzNDsKfTsKCmludCBtYWluKCkgewogICAgICAgIHRl
c3QoKTsKCiAgICAgICAgY2FsbCgpOwp9Owo=


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

* Re: optimization/9059: unused arrays not optimized away when followed by external call
@ 2003-02-18 10:33 ebotcazou
  0 siblings, 0 replies; 2+ messages in thread
From: ebotcazou @ 2003-02-18 10:33 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, stefaandr

Synopsis: unused arrays not optimized away when followed by external call

State-Changed-From-To: open->analyzed
State-Changed-By: ebotcazou
State-Changed-When: Tue Feb 18 10:33:34 2003
State-Changed-Why:
    Confirmed on all versions I tested.

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


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

end of thread, other threads:[~2003-02-18 10:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-26  6:56 optimization/9059: unused arrays not optimized away when followed by external call stefaandr
2003-02-18 10:33 ebotcazou

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).