public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: jfran@clip.dia.fi.upm.es
To: gcc-gnats@gcc.gnu.org
Subject: optimization/4888: incorrect code with -Ox, x >= 2
Date: Mon, 05 Nov 2001 02:49:00 -0000	[thread overview]
Message-ID: <20011116115850.5475.qmail@sourceware.cygnus.com> (raw)


>Number:         4888
>Category:       optimization
>Synopsis:       incorrect code with -Ox, x >= 2
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 16 04:06:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     jfran
>Release:        gcc >=2.96 <=3.0.2
>Organization:
>Environment:

>Description:
With optimizations enabled, "f=x; y=*(type*)&f;" reads garbage 
on 'y' unless 'type'=='char' (problem with memory alias?) 

"f=x; g(); y=*(type*)&f;" works fine if g() is not
inlined.
>How-To-Repeat:
Compile with -O0, execute.
Compile with -O2, execute.
Uncomment the commented line.
Test again.
>Fix:

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

I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGcoKTsKCmludCBtYWluKCkgewogIGRvdWJsZSBmOwog
IHVuc2lnbmVkIGludCAqaTsKICBpbnQgeDsKICBmID0gMS4wOwogIGkgPSAodW5zaWduZWQgaW50
ICopJmY7CiAgLy8gZygpOwogIHggPSBpWzFdOwogIHByaW50ZigiJXhcbiIsIHgpOwogIHJldHVy
biAwOwp9Cgp2b2lkIGcoKSB7Cn0K


             reply	other threads:[~2001-11-16 12:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-05  2:49 jfran [this message]
2001-11-21  2:56 rth
2001-11-21  3:03 rth

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=20011116115850.5475.qmail@sourceware.cygnus.com \
    --to=jfran@clip.dia.fi.upm.es \
    --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).