This is the mail archive of the 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][4.0] PR 21171


On Mon, 13 Jun 2005, Richard Earnshaw wrote:

> >
> > 
> > OK for 4.0?
> > 
> > Zdenek
> The use of volatile in this test was always a red herring.  The code
> should execute correctly even when the variables aren't volatile
> qualified.  Your patch (IIRC) only addresses the volatile issue so,

In tree-ssa, instructions of this form:
  ((T*)1000)->mem = x;

i.e. where an INTEGER_CST is dereferenced, will have their
has_volatile_ops flag set (see get_indirect_ref_operands) .  This has
nothing to do with the user specifying any volatile himself.  Zdeneks fix
will make IVops not substitute the integer constant used in such context
with some SSA_NAME (in which case the reason for setting has_volatile_ops
would be missing, so DCE will then remove the store).

For completeness: this bug also results in a miscompilation of grub, which 
is also fixed by the bug.

> while it might be useful in some real cases, doesn't really fix this
> particular problem.

Really?  Does the problem still actually occur with the patched compiler?


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