public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/8634: incorrect inlining of memcpy under -O2
@ 2002-11-25 11:54 duchier
  0 siblings, 0 replies; only message in thread
From: duchier @ 2002-11-25 11:54 UTC (permalink / raw)
  To: gcc-gnats


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-11-19 10:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-25 11:54 optimization/8634: incorrect inlining of memcpy under -O2 duchier

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