This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch][4.0] PR 21171
Hi,
On Mon, 13 Jun 2005, Richard Earnshaw wrote:
> > http://gcc.gnu.org/ml/gcc-patches/2005-04/msg02750.html
> >
> > 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?
Ciao,
Michael.