static readonly long variableZero=0;
public static void Broken2( long ticks2) //ticks2==634363497820000000
long ticks = ticks2+variableZero;
if (ticks != (ticks - (ticks % 10000L)))
enters the if clause even for values of ticks2 for which it shouldn't. If variableZero is replaced by a compile-time constant the code works.
This happens only in the release build and only when running without a debugger.
This report is based on the following stackoverflow thread:
Code to reproduce: