This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: gas:Reject ++ and --
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 17 Mar 2004 11:36:47 -0500 (EST)
- Subject: Re: gas:Reject ++ and --
- References: <40587B89.5050107@codesourcery.com>
On Wed, 17 Mar 2004, Nathan Sidwell wrote:
> Hi,
> the attached patch causes gas to not interpret ++ and -- as two
> + or - operators in a row. The current behaviour is to allow
> 'a ++ b' as if it was 'a + (+b)' and '++ a' as if '+(+a)'. The problem
> I was having was a port which had an addressing mode syntax of the form
> reg++[reg]
> and desiring to process this as
> <expr> "++[" <expr> "]"
> but the expression evaluator ate the '++' as two '+' operators and
> then barfed.
I'd check for <reg> separately and before <expr> to avoid
problems like this.
> Regardless of those issues, the current '++' and '--' behaviour surprises
> at least some programmers (me and my users :)
Agree.
> built and tested on i686-pc-linux-gnu, ok?
A few test-cases to reflect the change? There is framework for
tests for errors using the dg- stuff. If nothing else see the
CRIS and MMIX gas testsuites, grep for dg-error.
brgds, H-P