[llvm-commits] [llvm] r125595 - in /llvm/trunk: lib/MC/MCParser/AsmParser.cpp test/MC/AsmParser/exprs.s test/MC/AsmParser/paren.s

Jim Grosbach grosbach at apple.com
Wed Feb 23 12:06:52 PST 2011


On Feb 23, 2011, at 11:54 AM, Joerg Sonnenberger wrote:

> On Wed, Feb 16, 2011 at 09:47:22AM -0800, Jim Grosbach wrote:
>> What about other targets? ARM, MIPS, etc.. shouldn't accept
>> bracket-as-parens expressions unless that's part of their documented
>> syntax.
> 
> Can you name a specific platform for which GAS doesn't accept it?
> 
>> For example, the following is not legal ARM assembly and should give a
>> syntax error on the '[' token.
>> add r0, r1, #[_foo - _bar]
>> 
>> With these changes, that's not happening anymore.
> 
> _foo:
> _bar:
> 	add r0, r1, #[_foo - _bar]
> 
> is accepted by GAS and gives the same result as the expression with ().


You are operating under the mistaken impression that what gas accepts is the definition of what is legal assembly. This is a bug in gas for it to accept that expression for ARM. It may or may not be a bug for it to accept it for X86. I don't know X86 assembly syntax well enough to know the answer to that.

-Jim



More information about the llvm-commits mailing list