[llvm-bugs] [Bug 24879] New: Alternations in back-references are not handled correctly.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 18 14:53:01 PDT 2015


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

            Bug ID: 24879
           Summary: Alternations in back-references are not handled
                    correctly.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Support Libraries
          Assignee: unassignedbugs at nondot.org
          Reporter: charlesturner7c5 at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

I'm trying to match the following code in FileCheck

    rev r0, r0

For any ARM register r0. So my check line necessarily looks like this,

    CHECK:  rev [[R0:r[0-9]+|lr]], [[R0]]

Unfortunately, that fails to match. Letting test contain the above CHECK line,
I get

$ echo "rev r0, r0" | FileCheck test
test:1:8: error: expected string not found in input
CHECK: rev [[R0:r[0-9]+|lr]], [[R0]]
       ^
<stdin>:1:2: note: scanning from here
 rev r0, r0

If test instead contains the line 

     CHECK:  rev [[R0:r[0-9]+]], [[R0]]

It does match rev r0, r0. The alternation is the problem. I had a quick look at
the code and found that the above CHECK line essentially expands to this,

$ echo "rev lr, lr" | egrep '(r[0-9]+|lr), \1'

That egrep command *does* match, so indeed, there must be a bug in the
implementation in Regex.cpp, which appears to call out to something from
OpenBSD's libc/regex implementation.

I didn't get time to dig into that code. I also couldn't find any easily
searchable OpenBSD bug tracker in the 30 seconds I spent looking.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150918/ff3a0bb2/attachment-0001.html>


More information about the llvm-bugs mailing list