This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC/RFT] Patch (java): Switch to new verifier
On Mon, 7 Mar 2005 10:08:10 -0800, Richard Henderson <rth@redhat.com> wrote:
> On Sat, Mar 05, 2005 at 03:15:36PM +0000, Andrew Haley wrote:
> > The rule is that a fetch from an unused variable may be deleted by the
> > tree optimizers. I could fix this fairly easily by making the target
> > of a load volatile.
>
> Or the load itself via casts: *(volatile T *)addr.
Ignoramus am I, but still...
If the load has a possible side-effect (a NullPointerException in
this case), can the optimizers still rightly remove the load even
if the variable is unused? Marking it volatile seems like a
workaround rather than the solution, IMHO.
Ranjit.
--
Ranjit Mathew Email: rmathew AT gmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.hostingzero.com/