This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gas:Reject ++ and --


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]