Work around freeze if built with GCC8+ due to pointer overflow optimizations in test.c

Recent GCC optimizes away pointer comparisons used by overflow checks in test.c implementation.
This causes memtest to calculate wrong memory addresses which ends up in endless loops, freezes or crashes.

Disable strict pointer overflow check optimization via -fno-strict-overflow flag until code is amended to comply.

Signed-off-by: Igor V. Kovalenko <>
Change-Id: I5b9ac082060092a0fb2a698c6d3e6f61af6a3578
Tested-by: build bot (Jenkins) <>
Reviewed-by: Martin Roth <>
diff --git a/Makefile b/Makefile
index ca1602e..7732491 100644
--- a/Makefile
+++ b/Makefile
@@ -75,7 +75,7 @@
 	$(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
 test.o: test.c
-	$(CC) -c -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin -ffreestanding test.c
+	$(CC) -c -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin -ffreestanding -fno-strict-overflow test.c
 random.o: random.c
 	$(CC) -c -Wall -march=i486 -m32 -O3 -fomit-frame-pointer -fno-builtin -ffreestanding random.c