[LLVMbugs] [Bug 22167] New: '*p++' uses an extra register

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 8 17:35:12 PST 2015


            Bug ID: 22167
           Summary: '*p++' uses an extra register
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: paul_robinson at playstation.sony.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13650
  --> http://llvm.org/bugs/attachment.cgi?id=13650&action=edit

This is on x86-64 Linux, compiling at -O2.
The relevant bit from the source looks like this:

  while (1) {
    Op op = static_cast<Op>(*pData++);
    switch (op) {

Some cases in the switch will increment pData further, others don't.
The curious thing is that the generated code maintains copies of both
the un-incremented and post-incremented values of pData, basically
using two registers where one would be sufficient.  Ultimately this
requires a couple extra register-copy instructions to keep everything
sorted out.

I wouldn't be all that fussed, except having two copies of pData around
apparently causes debug info to get confused about which register has
the correct value in it, and sometimes the debug info claims pData is
not available when actually it is.

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/20150109/41cae006/attachment.html>

More information about the llvm-bugs mailing list