public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: tim.ousley@ni.com To: gcc-gnats@gcc.gnu.org Subject: c++/5395: volatile keyword changes volatile write's into write, then read Date: Tue, 15 Jan 2002 14:46:00 -0000 [thread overview] Message-ID: <20020115223708.10146.qmail@sources.redhat.com> (raw) >Number: 5395 >Category: c++ >Synopsis: volatile keyword changes volatile write's into write, then read >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Jan 15 14:46:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Tim Ousley >Release: gcc 3.0.2 >Organization: >Environment: redhat Linux 7.2 >Description: 'volatile' keyword changes a variable write into a write followed by a read. This makes it quite difficult to access hardware registers, which can confuse the hardware when read. For instance, an access to a volatile address produces: movw $100, 10000 movw 10000, %ax This only happens when using g++. If I change the filename from vol_bug.cpp to vol_bug.c, the code does not write, then read from a volatile location. >How-To-Repeat: gcc3 vol_bug.cpp -Os -S >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="vol_bug.ii" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="vol_bug.ii" IyA1ICJ2b2xfYnVnLmNwcCIKaW5saW5lIHZvaWQgd3JpdGUxNiggdW5zaWduZWQgaW50IGFkZHJl c3MsIGNvbnN0IGludCBkYXRhKQp7CiAgIGNoYXIqIGFkZHIgPSAoY2hhciAqKWFkZHJlc3M7CiAg ICoodm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgKikgKChjaGFyICopKGFkZHIpKSA9IGRhdGE7Cn0K CmludCBtYWluKCl7CiAgIHdyaXRlMTYoMTAwMDAsMTAwKTsKICAgd3JpdGUxNigxMDAwMCwyMDAp OwoKICAgcmV0dXJuIDA7Cn0K
next reply other threads:[~2002-01-15 22:46 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-01-15 14:46 tim.ousley [this message] 2002-02-06 5:54 jakub
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=20020115223708.10146.qmail@sources.redhat.com \ --to=tim.ousley@ni.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: linkBe 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).