public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: stefaandr@hotmail.com
To: gcc-gnats@gcc.gnu.org
Subject: optimization/9059: unused arrays not optimized away when followed by external call
Date: Thu, 26 Dec 2002 06:56:00 -0000	[thread overview]
Message-ID: <20021226145230.8752.qmail@sources.redhat.com> (raw)


>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=


             reply	other threads:[~2002-12-26 14:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-26  6:56 stefaandr [this message]
2003-02-18 10:33 ebotcazou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021226145230.8752.qmail@sources.redhat.com \
    --to=stefaandr@hotmail.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).