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

Joerg Sonnenberger joerg at britannica.bec.de
Wed Feb 23 12:32:54 PST 2011


On Wed, Feb 23, 2011 at 12:06:52PM -0800, Jim Grosbach wrote:
> 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.

Since you seem to operate under the impression that you are right and I
am wrong, feel free to change it however you like as long as it doesn't
break the x86 backend.

Joerg



More information about the llvm-commits mailing list