bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in gas, with expressions in macros


From: Ian Lance Taylor
Subject: Re: Bug in gas, with expressions in macros
Date: 22 May 2002 08:40:27 -0700
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

<address@hidden> writes:

> Does anyone know if this situation has been pursued at all? I still get the
> error in larger files despite having listings turned off. It appears that X_op
> ends up being O_subtract instead of O_constant when you do subtraction of two
> variables in the same memory section (or subtraction of two constants inside a
> macro that may or may not be in the same memory section). I'm interested in
> providing/finding/assisting with a fix for this problem. Please let me know if
> you have anymore information. Thanks,

This happens because listings are implemented by putting each input
line into a separate frag.  Then listing information is associated
with each frag.  Frags do not have a constant size, so the expression
evaluator can not reduce a subtraction operation involving symbols in
separate frags.  The evaluator can reduce a subtraction operation
involving symbols in the same frag.  When not doing a listing, a frag
can hold a fairly large number of instructions, though each frag will
end at an instruction which may require relaxation, such as a branch
on a processor which supports different sizes of branch instructions.

If you write your code carefully, and have a sufficiently large file,
you will be able to cause the same error even when not generating a
listing.

Basically, gas is a mix of a one-pass assembler and a two-pass
assembler.  A .if expression is evaluated in the first pass.  A
subtraction operation may be evaluated in the first pass, or it may be
evaluated in the second pass.  When the subtraction evaluation is
forced to wait until the second pass, you can't use it in a .if
expression.

I doubt that anybody is working on this.

I don't know what you are trying to do, but if you just want a flag
in the .if expression you may be able to rely on the fact that .if
expressions are evaluated in the first pass, and simply use a symbol
value as a flag.

> **********************************************************************
> This e-mail and any files transmitted with it are confidential and may
> be legally privileged or otherwise exempt from disclosure under
> applicable law. This e-mail and its files are intended solely for
> the individual or entity to whom they are addressed and their content
> is the property of Smiths Aerospace.  If you are not the intended
> recipient, please do not read, copy, use or disclose this communication.
> If you have received this e-mail in error please notify the e-mail 
> administrator at address@hidden and then delete this e-mail, its
> files and any copies.
> 
> This footnote also confirms that this e-mail message has been scanned
> for the presence of known computer viruses.
> ***********************************************************************

I hope I didn't violate some sort of contract by reading this e-mail.
It's kind of nuts to send a long disclaimer like this to a public
mailing list.

Ian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]