This is the mail archive of the
mailing list for the GCC project.
Re: msp430 port
- From: DJ Delorie <dj at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: rth at redhat dot com, nickc at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 Aug 2013 16:49:28 -0400
- Subject: Re: msp430 port
- References: <51E700D1 dot 702 at redhat dot com> <201307232208 dot r6NM8QpY018297 at greed dot delorie dot com> <51F81F81 dot 4070303 at redhat dot com> <201307310324 dot r6V3OkjY005420 at greed dot delorie dot com> <52127E4D dot 1030901 at redhat dot com>
> I'd say it's not as simple as you make it out to be. You can't blindly
> combine operations on volatile memory.
I'm not blindly combining them, I'm combining them when I know the
hardware will do the volatile-correct thing.
> ie, the programmer may have written them as separate statements and
> if they're volatile you should leave them alone.
Most of the programmers I know would expect "port |= 0x80;" to do a
hardware-specific "set bits" operation, not a series of
volatile-pedantic operations, especially when the ISA has a set of
insns specifically designed to do bit operations on volatile I/O
> With this change a series of statements involving
> volatiles might be combined into a single insn. That's not good.
If the insn does exactly the same thing as the operations, just
faster, why is it not good?
> I'll note that *NO* ports in the official GCC sources do this and that's
> because it's wrong.
m32c, rl78, and sh do this (to varying degrees) in the official