https://llvm.org/bugs/show_bug.cgi?id=23734

            Bug ID: 23734
           Summary: [mips] MipsAsmParser doesn't handle expressions with
                    multiple leading parens
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: MIPS
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

These expressions occur a lot in the FreeBSD kernel, as a result of macro
expansion.  For example (simplified from the original):

sd $7, ((8) - 1) + 40 ($29)

The loop in MipsAsmParser::parseMemOffset consumes the two leading parens and
then calls MCAsmParser::parseParenExpression().  This then parses until the end
of the ((8) - 1) expression.  The next token is then +, which is unexpected
(lparen then register is expected).

This is caused by the desire to be able to parse ((%lo .... )) expressions,
using the existing infrastructure.  I suspect that the correct solution is to
extend AsmParser to allow unrecognised tokens to be handled by targets in
parseExpression().

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to