Skip to content

Commit

Permalink
Workaround clang optimization bug
Browse files Browse the repository at this point in the history
  • Loading branch information
filipnavara committed Jan 31, 2024
1 parent be0c6c9 commit 39ae75f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/coreclr/nativeaot/Runtime/CommonMacros.inl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ inline bool IS_ALIGNED(T* val, uintptr_t alignment)
// Convert from a PCODE to the corresponding PINSTR. On many architectures this will be the identity function;
// on ARM, this will mask off the THUMB bit.
inline TADDR PCODEToPINSTR(PCODE pc)
#if __clang__
__attribute__ ((optnone))
#endif
{
#ifdef TARGET_ARM
return dac_cast<TADDR>(pc & ~THUMB_CODE);
Expand All @@ -65,6 +68,9 @@ inline TADDR PCODEToPINSTR(PCODE pc)
// Convert from a PINSTR to the corresponding PCODE. On many architectures this will be the identity function;
// on ARM, this will raise the THUMB bit.
inline PCODE PINSTRToPCODE(TADDR addr)
#if __clang__
__attribute__ ((optnone))
#endif
{
#ifdef TARGET_ARM
return dac_cast<PCODE>(addr | THUMB_CODE);
Expand Down

0 comments on commit 39ae75f

Please sign in to comment.