Re: [cc65] Re: Patch for reading a 'volatile' pointer

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2010-12-12 21:58:37
Good evening and please excuse my late response.

On Thu, Dec 09, 2010 at 11:30:09PM -0600, Dave Dribin wrote:
> On Thu, Dec 9, 2010 at 8:45 AM, Dave Dribin <ddribin@gmail.com> wrote:
> > Here's a patch (against 2.13.2) that causes a read from a 'volatile'
> > pointer to not be optimized out.  This most certainly does not cover
> > all volatile cases, but it does work for the particular case I care
> > about. ;-) I'm sure it is not implemented well, but will hopefully
> > serve as a starting point for someone who really knows the code base.
>
> Bah.... I botched that patch (won't compile). Try this one.

Thanks for the contribution!

Your code is almost exactly identical to what I would have written, when
implementing it without changing the compiler structure. But it is just about
10-15% of what has to be done, and the missing parts are the reason why I
didn't do it. Each and every optimizer routine that removes or rewrites code
has to check the new CodeEntry flag for every code line in question, otherwise
volatile processing might work in a few cases, but fail in many others. So
while it's a start, it is just that.

So how to proceed? I'm willing to apply the patch in this or a similar form,
but everybody has to realize that this will change the current situation only
a bit. Instead of "volatile is parsed but ignored", which is a clear and
unambiguous statement, it would then be "volatile is parsed and might
sometimes work". If this is considered an improvement, I will apply the patch.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Dec 12 21:58:46 2010

This archive was generated by hypermail 2.1.8 : 2010-12-12 21:58:48 CET