This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Incrementing volatiles?
- To: Andreas Schwab <schwab at issan dot informatik dot uni-dortmund dot de>
- Subject: Re: Incrementing volatiles?
- From: Bill Currie <bcurrie at tssc dot co dot nz>
- Date: Wed, 15 Jul 1998 12:56:50 +1200
- CC: Horst von Brand <vonbrand at inf dot utfsm dot cl>, Matthias Urlichs <smurf at noris dot de>, egcs at cygnus dot com
- Organization: Telecommunication Systems Support Centre
- References: <199807111302.JAA10664@pincoya.inf.utfsm.cl> <vyzaf6e9lwx.fsf@issan.informatik.uni-dortmund.de>
Andreas Schwab wrote:
> But that would be an awful special case. All accesses to a volatile
> variable must be exactly as specified by the user, which means that they
> must never be moved, duplicated or combined.
Eh? The user said `increment bar', not `grab bar, add one to it and
stuff the value back into bar'. By your definition above, gcc is
broken.
Maybe gcc should have some rtxs for incrementing/decrementing a pseudo
(both ++/-- and +=/-=, so that even unoptimised code gets the
`optimised' version). Actualy, rtxs should be defined for *ALL* <op>=
operations. This way, if the cpu supports the stated op, the correct
asm can be generated, otherwise the rtx expands into the current form
(the whole purpose of define_expand AIUI).
Hmm.. I might look into this myself and see how far I get as I too am
interested in this issue.
Bill
--
Leave others their otherness