[LLVMbugs] [Bug 17315] New: flex scanner results in "Bad machine code: Using an undefined physical register" after r188766

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Sep 21 10:50:23 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17315

            Bug ID: 17315
           Summary: flex scanner results in "Bad machine code: Using an
                    undefined physical register" after r188766
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dimitry at andric.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11254
  --> http://llvm.org/bugs/attachment.cgi?id=11254&action=edit
Testcase for flex scanner "Bad machine code" bug

While attempting to build a recent version of FreeBSD with clang trunk r191105,
I got a few "Bad machine code" errors, in a flex scanner that is generated
during the build process:

*** Bad machine code: Using an undefined physical register ***
- function:    yylex
- basic block: BB#8 sw.bb (0x2a5b0f10)
- instruction: TCRETURNri %vreg32, 0, <regmask>, %ESP<imp-use>,
%ECX<imp-use,kill>; GR32_TC:%vreg32
- operand 4:   %ECX<imp-use,kill>

*** Bad machine code: Using an undefined physical register ***
- function:    yylex
- basic block: BB#11 sw.bb10 (0x2a5ad3ac)
- instruction: TCRETURNri %vreg26, 0, <regmask>, %ESP<imp-use>, %ECX<imp-use>;
GR32_TC:%vreg26
- operand 4:   %ECX<imp-use>
fatal error: error in backend: Found 2 machine code errors.

This error does not occur with the 3.3 release version of clang we are using in
FreeBSD itself.  After reducing the test case to the attached file, I was able
to bisect where the problem started appearing:

http://llvm.org/viewvc/llvm-project?view=revision&revision=188766

To reproduce, compile the attached testcase with:

clang -O2 -fPIC -fstack-protector -c flexbug.c

-- 
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/20130921/e7cce647/attachment.html>


More information about the llvm-bugs mailing list