public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: duchier@ps.uni-sb.de
To: gcc-gnats@gcc.gnu.org
Subject: optimization/8634: incorrect inlining of memcpy under -O2
Date: Mon, 25 Nov 2002 11:54:00 -0000	[thread overview]
Message-ID: <20021119105136.24389.qmail@sources.redhat.com> (raw)


>Number:         8634
>Category:       optimization
>Synopsis:       incorrect inlining of memcpy under -O2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 19 02:56:03 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Denys Duchier
>Release:        GCC 3.2
>Organization:
>Environment:
Gentoo Linux 1.4
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: /var/tmp/portage/gcc-3.2-r2/work/gcc-3.2/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib --enable-languages=c,c++,ada,f77,objc,java --enable-threads=posix --enable-long-long --disable-checking --enable-cstdio=stdio --enable-clocale=generic --enable-__cxa_atexit --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/include/g++-v32 --with-local-prefix=/usr/local --enable-shared --enable-nls --without-included-gettext
Thread model: posix
gcc version 3.2
>Description:
memcpy of a small const array is incorrectly compiled inline
under -O2 or -O3 optimization, but not -O
>How-To-Repeat:
compile and run the attachment and observe the output:
the program performs the memcpy and then prints one line
for each element of the arrays, first the source then the
destination.  under -O2 optimization, the 2nd 3rd and 4th
bytes of the dest array are garbbled.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="bug.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug.cc"

I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nLmg+CnVzaW5nIG5hbWVzcGFjZSBz
dGQ7CmludCBtYWluKCkKewogIGNoYXIqIGJ1ZmZlciA9IG5ldyBjaGFyWzhdOwogIGNvbnN0IGNo
YXIgaGVhZFtdID0gewogICAgJ0EnLCAnQicsICdDJywgJ0QnLAogICAgJ0UnLCAnRicsICdHJywg
J0gnCiAgfTsKICBhc20oImZvbzoiKTsKICBtZW1jcHkoYnVmZmVyLGhlYWQsc2l6ZW9mKGhlYWQp
KTsKICBhc20oImJhejoiKTsKICBmb3IoaW50IGk9MDtpPDg7aSsrKQogICAgY291dCA8PCAiWyIg
PDwgaSA8PCAiXSA9ICIgPDwgaGVhZFtpXSA8PCAiICwgIiA8PCBidWZmZXJbaV0gPDwgZW5kbDsK
ICByZXR1cm4gMDsKfQo=


                 reply	other threads:[~2002-11-19 10:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20021119105136.24389.qmail@sources.redhat.com \
    --to=duchier@ps.uni-sb.de \
    --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).