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

    <tr>
        <th>Summary</th>
        <td>
            lib/Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.cpp:301:1: error: control reaches end of non-void function [-Werror=return-type]
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          cheusov-brainshells
      </td>
    </tr>
</table>

<pre>
    clang-17.0.6 fails to build with the following error:

```
[ 27%] Building CXX object lib/Target/CSKY/MCTargetDesc/CMakeFiles/LLVMCSKYDesc.dir/CSKYAsmBackend.cpp.o
[ 27%] Building CXX object lib/Target/CSKY/MCTargetDesc/CMakeFiles/LLVMCSKYDesc.dir/CSKYELFObjectWriter.cpp.o
[ 27%] Building CXX object lib/Target/CSKY/MCTargetDesc/CMakeFiles/LLVMCSKYDesc.dir/CSKYELFStreamer.cpp.o
[ 27%] Building CXX object lib/Target/CSKY/MCTargetDesc/CMakeFiles/LLVMCSKYDesc.dir/CSKYInstPrinter.cpp.o
[ 27%] Building CXX object lib/Target/CSKY/MCTargetDesc/CMakeFiles/LLVMCSKYDesc.dir/CSKYMCAsmInfo.cpp.o
[ 27%] Building CXX object lib/Target/CSKY/MCTargetDesc/CMakeFiles/LLVMCSKYDesc.dir/CSKYMCExpr.cpp.o
[ 27%] Building CXX object lib/Target/CSKY/MCTargetDesc/CMakeFiles/LLVMCSKYDesc.dir/CSKYMCTargetDesc.cpp.o
[ 27%] Building CXX object lib/Target/CSKY/MCTargetDesc/CMakeFiles/LLVMCSKYDesc.dir/CSKYMCCodeEmitter.cpp.o
/tmp/obj_pkgsrc/lang/llvm/work/llvm-17.0.6.src/lib/Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.cpp: In member function 'unsigned int llvm::CSKYMCCodeEmitter::getImmJMPIX(const llvm::MCInst&, unsigned int, llvm::SmallVectorImpl<llvm::MCFixup>&, const llvm::MCSubtargetInfo&) const':
/tmp/obj_pkgsrc/lang/llvm/work/llvm-17.0.6.src/lib/Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.cpp:301:1: error: control reaches end of non-void function [-Werror=return-type]
 301 | }
      | ^
cc1plus: some warnings being treated as errors
*** [lib/Target/CSKY/MCTargetDesc/CMakeFiles/LLVMCSKYDesc.dir/CSKYMCCodeEmitter.cpp.o] Error code 1

```
Patch:


--- lib/Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.cpp~ 2023-11-28 08:52:28.000000000 +0000
+++ lib/Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.cpp  2024-07-01 21:55:32.992601162 +0000
@@ -297,7 +297,7 @@
   else if (MI.getOperand(Idx).getImm() == 40)
     return 3;
   else
- assert(0);
+    abort();
 }
 
 MCFixupKind CSKYMCCodeEmitter::getTargetFixup(const MCExpr *Expr) const {

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVkuP27YT_zTjy0ACNbQs66CDXwL8T4wssH8k21OhB20zK5ECSe1uLv3sBSV5192kRYCidQVaNOfN4cyPKqyVJyVEBvEa4u2s6N1Zm6w6i97qp6A0hVT2LJrGzkpdf8uqplCnIEpCFi7wWMjGotNY9rKp8Vm6M7qzwKNuGv0s1QmFMdoAXwHbAru8F2wa4zJeIyVAMcRbXHtDXnHz8IC6_Coqh40sgfL_F-YkHFC-uf_wC1B-2IyUrbCVpx6KR5HLRlig_OPHzwcv5nlhLc2ktbLtuqgeharDqutC_W_7333MPw0mvxjphLlZEPfOiKK9VQB7Zd2dkepmGThsVrbdq6O-lfvdS3ezrb-p3CqCja7FrpXu_flT7toOKNfl11-7x5M13qRHGz81Ty1Q_qzN47SaICicxH4qvB-5B77CvcJWtKUweOxV5aRWCJT0akDGGqVyOATAV8BX31kZySfh9m37v8Pd_gFoWWllr5UOG1_1QAugDV4b9us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