<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Incomplete support for `--target`in the code-gen layer"
   href="https://bugs.llvm.org/show_bug.cgi?id=52418">52418</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incomplete support for `--target`in the code-gen layer
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>flang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Driver
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>andrzej.warzynski@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>David.Truby@arm.com, jperier@nvidia.com, kirankumartp@gmail.com, llvm-bugs@lists.llvm.org, sscalpone@nvidia.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This came up during a discussion on <a href="https://reviews.llvm.org/D112961">https://reviews.llvm.org/D112961</a>.

As per the comment at the top of
"flang/lib/Optimizer/CodeGen/DescriptorModel.h", various assumptions about the
target machine are made in the code-gen layer. This is likely to cause
`--target` (or e.g. `-m64` and `-m32`) to malfunction when using Flang's
interoperability with C (see how various CFI structures are lowered).

Note that `--target` is not available in the driver yet. Also, it is possible
that the assumptions made when lowering the CFI structures will affect other
parts of the code-gen too. However, I suspect that most things will work
correctly when generating code for the host/native target.

I'm creating this issue as a placeholder and as a note for our future selves.
This is currently _not_ being investigated or worked on.

-Andrzej

[1] <a href="https://github.com/flang-compiler/f18-llvm-project">https://github.com/flang-compiler/f18-llvm-project</a>
[2] <a href="https://github.com/llvm/llvm-project">https://github.com/llvm/llvm-project</a></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>