diff --git a/flang/runtime/random.cpp b/flang/runtime/random.cpp index e0a421fd283962..69de9b8c96fb5d 100644 --- a/flang/runtime/random.cpp +++ b/flang/runtime/random.cpp @@ -42,7 +42,7 @@ void RTNAME(RandomInit)(bool repeatable, bool /*image_distinct*/) { #ifdef CLOCK_REALTIME timespec ts; clock_gettime(CLOCK_REALTIME, &ts); - generator.seed(ts.tv_sec & ts.tv_nsec); + generator.seed(ts.tv_sec ^ ts.tv_nsec); #else generator.seed(time(nullptr)); #endif