<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 - __muldsi3 is compiled to call itself when targeting riscv64"
   href="https://bugs.llvm.org/show_bug.cgi?id=43388">43388</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__muldsi3 is compiled to call itself when targeting riscv64
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>9.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>andrew@ziglang.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22538" name="attach_22538" title="test.ll">attachment 22538</a> <a href="attachment.cgi?id=22538&action=edit" title="test.ll">[details]</a></span>
test.ll

Downstream issue: <a href="https://github.com/ziglang/zig/issues/3275">https://github.com/ziglang/zig/issues/3275</a>

LLVM IR attached.
Output assembly:

000000000000001c __muldsi3:
      1c: 13 01 01 f7                   addi    sp, sp, -144
      20: 23 34 11 08                   sd      ra, 136(sp)
      24: 23 30 81 08                   sd      s0, 128(sp)
      28: 13 04 01 09                   addi    s0, sp, 144
      2c: 23 20 a4 fe                   sw      a0, -32(s0)
      30: 37 06 01 00                   lui     a2, 16
      34: 1b 06 f6 ff                   addiw   a2, a2, -1
      38: b3 76 c5 00                   and     a3, a0, a2
      3c: 33 f7 c5 00                   and     a4, a1, a2
      40: 23 38 a4 fc                   sd      a0, -48(s0)
      44: 13 85 06 00                   mv      a0, a3
      48: 23 34 b4 fc                   sd      a1, -56(s0)
      4c: 93 05 07 00                   mv      a1, a4
      50: 23 30 c4 fc                   sd      a2, -64(s0)
      54: 23 3c e4 fa                   sd      a4, -72(s0)
      58: 97 00 00 00                   auipc   ra, 0
      5c: e7 80 00 00                   jalr    ra  // invalid recursive call
      60: 93 55 05 01                   srli    a1, a0, 16
      64: 03 56 24 fe                   lhu     a2, -30(s0)
      68: 23 38 a4 fa                   sd      a0, -80(s0)
      6c: 13 05 06 00                   mv      a0, a2
      70: 83 36 84 fb                   ld      a3, -72(s0)
      74: 23 34 b4 fa                   sd      a1, -88(s0)
      78: 93 85 06 00                   mv      a1, a3
      7c: 23 30 c4 fa                   sd      a2, -96(s0)
      80: 97 00 00 00                   auipc   ra, 0
      84: e7 80 00 00                   jalr    ra  // invalid recursive call
      88: 83 35 84 fa                   ld      a1, -88(s0)
      8c: 33 85 a5 00                   add     a0, a1, a0
      90: 83 35 04 fb                   ld      a1, -80(s0)
      94: 03 36 04 fc                   ld      a2, -64(s0)
      98: b3 f6 c5 00                   and     a3, a1, a2
      9c: 13 17 05 01                   slli    a4, a0, 16
      a0: b3 e6 e6 00                   or      a3, a3, a4
      a4: 03 37 84 fc                   ld      a4, -56(s0)
      a8: 23 2e e4 fc                   sw      a4, -36(s0)
      ac: b3 f7 c6 00                   and     a5, a3, a2
      b0: 9b d6 06 01                   srliw   a3, a3, 16
      b4: 03 58 e4 fd                   lhu     a6, -34(s0)
      b8: 83 55 04 fe                   lhu     a1, -32(s0)
      bc: 23 3c a4 f8                   sd      a0, -104(s0)
      c0: 13 05 08 00                   mv      a0, a6
      c4: 23 38 f4 f8                   sd      a5, -112(s0)
      c8: 23 34 d4 f8                   sd      a3, -120(s0)
      cc: 23 30 04 f9                   sd      a6, -128(s0)
      d0: 97 00 00 00                   auipc   ra, 0
      d4: e7 80 00 00                   jalr    ra  // invalid recursive call
      d8: 83 35 84 f8                   ld      a1, -120(s0)
      dc: 33 85 a5 00                   add     a0, a1, a0
      e0: 23 22 a4 fe                   sw      a0, -28(s0)
      e4: 13 15 05 01                   slli    a0, a0, 16
      e8: 83 35 04 f9                   ld      a1, -112(s0)
      ec: 33 e5 a5 00                   or      a0, a1, a0
      f0: 23 24 a4 fe                   sw      a0, -24(s0)
      f4: 03 35 84 f9                   ld      a0, -104(s0)
      f8: 9b 55 05 01                   srliw   a1, a0, 16
      fc: 03 56 64 fe                   lhu     a2, -26(s0)
     100: b3 85 c5 00                   add     a1, a1, a2
     104: 03 35 04 fa                   ld      a0, -96(s0)
     108: 03 36 04 f8                   ld      a2, -128(s0)
     10c: 23 3c b4 f6                   sd      a1, -136(s0)
     110: 93 05 06 00                   mv      a1, a2
     114: 97 00 00 00                   auipc   ra, 0
     118: e7 80 00 00                   jalr    ra  // invalid recursive call
     11c: 83 35 84 f7                   ld      a1, -136(s0)
     120: 33 85 a5 00                   add     a0, a1, a0
     124: 23 26 a4 fe                   sw      a0, -20(s0)
     128: 03 35 84 fc                   ld      a0, -56(s0)
     12c: 83 35 04 fd                   ld      a1, -48(s0)
     130: 03 36 84 fe                   ld      a2, -24(s0)
     134: 23 38 a4 f6                   sd      a0, -144(s0)
     138: 13 05 06 00                   mv      a0, a2
     13c: 03 34 01 08                   ld      s0, 128(sp)
     140: 83 30 81 08                   ld      ra, 136(sp)
     144: 13 01 01 09                   addi    sp, sp, 144
     148: 67 80 00 00                   ret</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>