<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 - ARM: Builtins should use AAPCS ABI for non-windows platforms"
   href="https://bugs.llvm.org/show_bug.cgi?id=33030">33030</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ARM: Builtins should use AAPCS ABI for non-windows platforms
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>compiler-rt
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>manojgupta@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>echristo@gmail.com, llozano@chromium.org, llvm-bugs@lists.llvm.org, renato.golin@linaro.org, weimingz@codeaurora.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>COMPILER_RT_ABI is incorrectly defined  in compiler-rt trunk.

For ARM, COMPILER_RT_ABI used to be defined as aapcs unconditionally. 

#define COMPILER_RT_ABI __attribute__((pcs("aapcs")))

However, r298974 changed the following define conditional on HF:

# ifdef COMPILER_RT_ARMHF_TARGET
#   define COMPILER_RT_ABI
# else
#   define COMPILER_RT_ABI __attribute__((pcs("aapcs")))
# endif

This does not work on Non-Windows platforms since llvm always expects AAPCS ABI
for the builtins.

E.g. d2ulz is expected to have AAPCS calling convention.

$ grep -r d2ulz  llvm/lib/Target/ARM/

llvm/lib/Target/ARM/ARMISelLowering.cpp:      { RTLIB::FPTOUINT_F64_I64,
"__aeabi_d2ulz", CallingConv::ARM_AAPCS, ISD::SETCC_INVALID },</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>