<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/155030>155030</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Basic Block has trailing DbgRecords!
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          claudeha
      </td>
    </tr>
</table>

<pre>
    termux emscripten 4.0.13 clang 22.0.0git fails to compile libpng

`
...
            make: make install-libLTLIBRARIES install-data                              depbase=`echo png.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\                 /bin/sh ./libtool --tag=CC   --mode=compile /data/data/com.termux/files/usr/opt/emscripten/emcc -DHAVE_CONFIG_H -I. -I/data/data/com.termux/files/home/opt/emscripten/pthreads-exceptions/include -g -O2 -MT png.lo -MD -MP -MF $depbase.Tpo -c -o png.lo png.c &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: /data/data/com.termux/files/usr/opt/emscripten/emcc -DHAVE_CONFIG_H -I. -I/data/data/com.termux/files/home/opt/emscripten/pthreads-exceptions/include -g -O2 -MT png.lo -MD -MP -MF .deps/png.Tpo -c png.c -o png.o Basic Block has trailing DbgRecords!                                        label %if.then2 Basic Block has trailing DbgRecords!                                        label %if.then2 fatal error: error in backend: Broken module found, compilation                   aborted! PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: 0.      Program arguments: /data/data/com.termux/files/usr/opt/emscripten-llvm/bin/clang -target wasm32-unknown-emscripten -pthread -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-cxx-exceptions -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=/data/data/com.termux/files/usr/opt/emscripten/cache/sysroot -D__EMSCRIPTEN_SHARED_MEMORY__=1 -DEMSCRIPTEN -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -DHAVE_CONFIG_H -I. -I/data/data/com.termux/files/home/opt/emscripten/pthreads-exceptions/include -g3 -O2 -MT png.lo -MD -MP -MF .deps/png.Tpo -c png.c -opng.o -fexceptions 1.      <eof> parser at end of file                                         2.      Code generation clang: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 22.0.0git Target: wasm32-unknown-emscripten Thread model: posix InstalledDir: /data/data/com.termux/files/usr/opt/emscripten-llvm/bin       Build config: +assertions                                                   clang: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /data/data/com.termux/files/usr/tmp/png-e8e13e.c clang: note: diagnostic msg: /data/data/com.termux/files/usr/tmp/png-e8e13e.sh clang: note: diagnostic msg: ******************** make: *** [Makefile:1269: png.lo] Error 1                                   emmake: error: 'make install-libLTLIBRARIES install-data' failed (returned 2)
`

github would not let me attach, so see:

- https://mathr.co.uk/tmp/png-e8e13e.c
- https://mathr.co.uk/tmp/png-e8e13e.sh

sorry for brevity and formatting, posting from phone.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzcV0tv4zgS_jX0pUBBpqzIPvjgZ8dA0gkS7-sUUFRJYpsiBZLK498vKMlOMNvTm-nZxgIjCJBNFevxVdXHEndOVhpxSdI1SbcT3vna2KVQvCuw5pPcFG9Lj7bpXgEbJ6xsPWqYRXE0TUAoritgLIqjuJIeSi6VA29AmKaVCkHJvNUViVfhvopJvIqiiMQr-HA1_IQkWfVPkNp5rhRVMr853hzWD6uHw-7xslxwz-GHV4Ftzh2SZEuuYhS1gVZXkTJAsg04LICwzJFs08e7I2xP0i1hK8JmJNtEBbYurLGrIJKsB8lNpMwgEG6WhUiSNUk3_2GdsH0uNWF7V0NE2F7J3BujgFLPK5JsN2ELpY0pgodnlAjbh8DeH8I00QA6YftSKgxOdc4StjetJ2z_nor-jxBAt9erv--eNndf94cvT9dADxHQ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