llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.26k stars 11.67k forks source link

[llvm][17.0.1] (aarch32) base function failure missing return statement of 'writeRegister' #73202

Open pan20000 opened 10 months ago

pan20000 commented 10 months ago

llvm 17.0.1 /llvm/lib/ExecutionEngine/JITLink/aarch32.cpp

   168  template <EdgeKind_aarch32 Kind>
   169  bool checkRegister(const ThumbRelocation &R, HalfWords Reg) {
   170    uint16_t Hi = R.Hi & FixupInfo<Kind>::RegMask.Hi;
   171    uint16_t Lo = R.Lo & FixupInfo<Kind>::RegMask.Lo;
   172    return Hi == Reg.Hi && Lo == Reg.Lo;
   173  }
   174
   175  template <EdgeKind_aarch32 Kind>
   176  bool **writeRegister**(WritableThumbRelocation &R, HalfWords Reg) {
   177    static constexpr HalfWords Mask = FixupInfo<Kind>::RegMask;
   178    assert((Mask.Hi & Reg.Hi) == Reg.Hi && (Mask.Hi & Reg.Hi) == Reg.Hi &&
   179           "Value bits exceed bit range of given mask");
   180    R.Hi = (R.Hi & ~Mask.Hi) | Reg.Hi;
   181    R.Lo = (R.Lo & ~Mask.Lo) | Reg.Lo;      ****//  missing  return statement**** 
   182  }
   183
llvmbot commented 10 months ago

@llvm/issue-subscribers-jitlink

Author: None (pan20000)

llvm 17.0.1 /llvm/lib/ExecutionEngine/JITLink/aarch32.cpp 168 template <EdgeKind_aarch32 Kind> 169 bool checkRegister(const ThumbRelocation &R, HalfWords Reg) { 170 uint16_t Hi = R.Hi & FixupInfo<Kind>::RegMask.Hi; 171 uint16_t Lo = R.Lo & FixupInfo<Kind>::RegMask.Lo; 172 return Hi == Reg.Hi && Lo == Reg.Lo; 173 } 174 175 template <EdgeKind_aarch32 Kind> 176 bool **writeRegister**(WritableThumbRelocation &R, HalfWords Reg) { 177 static constexpr HalfWords Mask = FixupInfo<Kind>::RegMask; 178 assert((Mask.Hi & Reg.Hi) == Reg.Hi && (Mask.Hi & Reg.Hi) == Reg.Hi && 179 "Value bits exceed bit range of given mask"); 180 R.Hi = (R.Hi & ~Mask.Hi) | Reg.Hi; 181 R.Lo = (R.Lo & ~Mask.Lo) | Reg.Lo; ****// missing return statement**** 182 } 183
eymay commented 10 months ago

Same as #64418, this is fixed in upstream. Please check the latest version.

weliveindetail commented 10 months ago

Same as #64418, this is fixed in upstream. Please check the latest version.

This wasn't backported to the release branch though: https://github.com/llvm/llvm-project/blob/release/17.x/llvm/lib/ExecutionEngine/JITLink/aarch32.cpp#L176