This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR middle-end/26306


Richard Kenner wrote:
Why treat aggregates differently from scalars in this context?

Because the idea is to force a memory reference in the case of a volatile scalar, but there's no well-defined meaning for a "memory reference" in
the case of BLKmode.

So, what's that got to with aggegates that are, say, SImode? And, why is there no well-defined meaning? (The obvious thing would be to touch all bytes that make up the aggregate.)


In C and C++, the notion of "volatile" doesn't say anything about aggregates. Of course, in C and C++, the specification doesn't say much about what happens in the presence of volatile, but if my compiler guarantees that for:

  volatile int i;
  void f() {
    i;
  }

I get a memory read for "i", why wouldn't I expect that for:

volatile struct S { int a; } i;

?

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]