public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: gcc-bugzilla@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org
Subject: Re: [Bug c/22278] gcc -O2 discards cast to volatile
Date: Sat, 02 Jul 2005 22:08:00 -0000	[thread overview]
Message-ID: <m3r7eghnfm.fsf@uniton.integrable-solutions.net> (raw)
In-Reply-To: <20050702164836.14554.qmail@sourceware.org>

"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| See PR 21568 and http://gcc.gnu.org/ml/gcc/2005-05/msg00085.html.

Both those issues about completely *different* from the issue
submitted in this PR.  In the above cases, the accessed object actually
is NOT volatile.  This is not the same here.

In this PR, the only thing the function sees is that its parameter
is not declared pointer to volatile char, but just pointer to char.
That is NO basis for the compiler to assume that the cast performed
inside the body is invalid assumption.  No. Never.  
Consequently, it must assume that the pointed-to object might be
effectively volatile and consequently generate corresponding code.

There is a difference between cv-qualified object and a pointer to
cv-qualified object.  In the former cases, you do know for sure how
the object behaves, in the latter you don't.  Consequently you must
make conervative assumptions.

|            What    |Removed                     |Added
| ----------------------------------------------------------------------------
|              Status|UNCONFIRMED                 |RESOLVED
|          Resolution|                            |DUPLICATE

Andrew --

  Once again, refrain from closing an issue when you do not fully
understand the issue at hand.

The PR should be reopen as wrong-code generation.

-- Gaby


  reply	other threads:[~2005-07-02 22:08 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-02 16:43 [Bug c/22278] New: " olivier dot baudron at m4x dot org
2005-07-02 16:48 ` [Bug c/22278] " pinskia at gcc dot gnu dot org
2005-07-02 22:08   ` Gabriel Dos Reis [this message]
2005-07-02 16:59 ` olivier dot baudron at m4x dot org
2005-07-02 17:03 ` pinskia at gcc dot gnu dot org
2005-07-02 17:33 ` falk at debian dot org
2005-07-02 17:42 ` pinskia at gcc dot gnu dot org
2005-07-02 17:53 ` falk at debian dot org
2005-07-02 20:38 ` falk at debian dot org
2005-07-02 22:07 ` gcc2eran at tromer dot org
2005-07-02 22:08 ` gdr at integrable-solutions dot net
2005-07-02 22:10 ` gdr at integrable-solutions dot net
2005-07-02 22:10 ` gdr at integrable-solutions dot net
2005-07-02 22:11 ` gdr at integrable-solutions dot net
2005-07-02 22:12 ` gdr at integrable-solutions dot net
2005-07-02 22:19 ` falk at debian dot org
2005-07-02 22:20 ` gdr at integrable-solutions dot net
2005-07-02 22:20 ` pinskia at gcc dot gnu dot org
2005-07-02 22:39 ` gdr at integrable-solutions dot net
2005-07-02 22:49 ` pinskia at gcc dot gnu dot org
2005-07-02 23:30 ` gcc2eran at tromer dot org
2005-07-03  0:03   ` Gabriel Dos Reis
2005-07-02 23:45 ` falk at debian dot org
2005-07-02 23:54 ` gdr at integrable-solutions dot net
2005-07-03  0:03 ` gdr at integrable-solutions dot net
2005-07-03  1:19 ` gcc2eran at tromer dot org
2005-07-03  1:27 ` joseph at codesourcery dot com
2005-07-03  1:42 ` gdr at integrable-solutions dot net
2005-07-03  1:43 ` gdr at integrable-solutions dot net
2005-07-03  1:47 ` gcc2eran at tromer dot org
2005-07-03  1:54 ` hugh at mimosa dot com
2005-07-03  2:30 ` gcc2eran at tromer dot org
2005-07-03  2:54 ` gdr at integrable-solutions dot net
2005-07-03  4:14 ` gcc2eran at tromer dot org
2005-07-03  4:43   ` Gabriel Dos Reis
2005-07-03  4:43 ` gdr at integrable-solutions dot net
2005-07-03  5:11   ` Gabriel Dos Reis
2005-07-03  5:09 ` gcc2eran at tromer dot org
2005-07-03  5:11 ` gdr at integrable-solutions dot net
2005-07-03  5:18 ` gdr at integrable-solutions dot net
2005-07-03  5:40 ` hugh at mimosa dot com
2005-07-03  6:59 ` gcc2eran at tromer dot org
2005-07-03  7:09 ` schlie at comcast dot net
2005-07-03  7:27 ` gdr at integrable-solutions dot net
2005-07-03  7:54 ` schlie at comcast dot net
2005-07-05  2:17 ` james at juranfamily dot org
2005-07-15  6:41 ` neroden at gcc dot gnu dot org
2005-07-15  7:52   ` Gabriel Dos Reis
2005-07-15  8:10 ` gdr at integrable-solutions dot net
2005-07-16 16:35 ` hugh at mimosa dot com
2005-07-16 17:53 ` gdr at integrable-solutions dot net
2005-07-17  8:09 ` hugh at mimosa dot com
2005-07-17 16:59 ` rth at gcc dot gnu dot org
2005-07-19 20:28 ` [Bug tree-optimization/22278] " cvs-commit at gcc dot gnu dot org
2005-07-20  0:11 ` cvs-commit at gcc dot gnu dot org
2005-07-20  0:26 ` rth at gcc dot gnu dot org
2005-08-11 23:56 ` cvs-commit at gcc dot gnu dot org

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=m3r7eghnfm.fsf@uniton.integrable-solutions.net \
    --to=gdr@integrable-solutions.net \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-bugzilla@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).