<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [ASM] cannot set unwind info for eflags register"
   href="https://llvm.org/bugs/show_bug.cgi?id=23033">23033</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[ASM] cannot set unwind info for eflags register
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.6
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>FreeBSD
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>alexandre.martins@stormshield.eu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14102" name="attach_14102" title="sample code">attachment 14102</a> <a href="attachment.cgi?id=14102&action=edit" title="sample code">[details]</a></span>
sample code

I currently trying to make a bare c++ new kernel.
In one of piece of assembly code, I play with eflags register, and i want to
provide unwinding info.
However, clang rejects the use of eflags as register, but it works with gcc


$ clang36 -m32 -c check.s 
check.s:11:23: error: invalid register name
    .cfi_offset eflags, 0
                      ^
check.s:16:24: error: invalid register name
    .cfi_restore eflags
                       ^
$ gcc49 -m32 -c check.s
$ echo $?
0
$ readelf -wf check.o 
Contenu de la section .eh_frameĀ :

00000000 00000014 00000000 CIE
  Version:               1
  Augmentation:          "zR"
  Code alignment factor: 1
  Data alignment factor: -4
  Return address column: 8
  Augmentation data:     1b

  DW_CFA_def_cfa: r4 (esp) ofs 4
  DW_CFA_offset: r8 (eip) at cfa-4
  DW_CFA_nop
  DW_CFA_nop

00000018 0000001c 0000001c FDE cie=00000000 pc=00000000..00000007
  DW_CFA_advance_loc: 1 to 00000001
  DW_CFA_def_cfa_offset: 8
  DW_CFA_advance_loc: 2 to 00000003
  DW_CFA_def_cfa_register: r5 (ebp)
  DW_CFA_advance_loc: 1 to 00000004
  DW_CFA_offset: r9 (eflags) at cfa+0
  DW_CFA_advance_loc: 1 to 00000005
  DW_CFA_restore: mauvais registreĀ : r9 (eflags)
  DW_CFA_advance_loc: 1 to 00000006
  DW_CFA_def_cfa: r4 (esp) ofs 4


Can be possible to add support of this register ?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>