Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jan 2021 12:25:23 +0100
From:      Thierry Thomas <thierry@freebsd.org>
To:        FreeBSD Hackerz <hackers@freebsd.org>
Subject:   Some fun with -O2
Message-ID:  <YAAqI08bgBtfpssP@graf.pompo.net>

next in thread | raw e-mail | index | archive | help
Letīs check a small C program, check_mktime.c, fetchable from
<https://people.freebsd.org/~thierry/check_mktime.c>.

$CC -o check_mktime -O2 check_mktime.c
./check_mktime

It is OK with clang90.
It loops forever with gcc9, gcc10, clang10 and clang11,
but OK without -O2.

It is part of the configure script of ports/math/oleo, and I guess that
the same part could be found in other configure scripts.

Note a similar program is part of glibc: see
<https://code.woboq.org/userspace/glibc/time/tst-mktime2.c.html>.

Regards.
-- 
Th. Thomas.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YAAqI08bgBtfpssP>