workaround for optimization bug in clang

Taken from Eternity Engine, fixes desync in competn/doom/fp2-3655.lmp and
dmn01m909.lmp
This commit is contained in:
Roman Fomin 2022-06-23 08:39:43 +07:00
parent b76e9b1a9f
commit 3c526e7068
2 changed files with 8 additions and 0 deletions

View File

@ -7,3 +7,5 @@
* Check if the lump can be a Doom patch in `R_GenerateLookup()`.
* Fix `gcc-12 -O3` compiler warnings.
* Only create autoload subdirectory relative to `D_DoomPrefDir()`.
* Workaround for optimization bug in clang (taken from Eternity Engine, fixes
desync in competn/doom/fp2-3655.lmp and dmn01m909.lmp).

View File

@ -116,7 +116,13 @@ void (*colfunc)(void) = R_DrawColumn; // current column draw function
// killough 5/2/98: reformatted
//
// Workaround for optimization bug in clang
// fixes desync in competn/doom/fp2-3655.lmp and in dmnsns.wad dmn01m909.lmp
#if defined(__clang__)
int R_PointOnSide(volatile fixed_t x, volatile fixed_t y, node_t *node)
#else
int R_PointOnSide(fixed_t x, fixed_t y, node_t *node)
#endif
{
if (!node->dx)
return x <= node->x ? node->dy > 0 : node->dy < 0;