From owner-freebsd-hackers@freebsd.org Fri Jan 15 03:47:13 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C00704D7246 for ; Fri, 15 Jan 2021 03:47:13 +0000 (UTC) (envelope-from "") Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DH6Z8538xz3rrL for ; Fri, 15 Jan 2021 03:47:12 +0000 (UTC) (envelope-from "") Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 943F52400FC for ; Fri, 15 Jan 2021 04:47:10 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DH6Z564lyz9rxK; Fri, 15 Jan 2021 04:47:09 +0100 (CET) From: Walter von Entferndt To: freebsd-hackers@freebsd.org Subject: Re: Implicit assumptions (was: Re: Some fun with -O2) Date: Fri, 15 Jan 2021 04:47:06 +0100 Message-ID: <4842729.YNO7O01DYZ@t450s.local.lan> In-Reply-To: References: <12075361.5MqMfjp4zD@t450s.local.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart3042245.bT80LyP3VS" Content-Transfer-Encoding: 7Bit X-Rspamd-Queue-Id: 4DH6Z8538xz3rrL X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=posteo.net (policy=none); spf=none (mx1.freebsd.org: domain of mout02.posteo.de has no SPF policy when checking 185.67.36.142) smtp.helo=mout02.posteo.de X-Spamd-Result: default: False [-2.69 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[posteo.net : No valid SPF, No valid DKIM,none]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[185.67.36.142:from]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.99)[-0.994]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; CTE_CASE(0.50)[]; ASN(0.00)[asn:8495, ipnet:185.67.36.0/23, country:DE]; MIME_TRACE(0.00)[0:+,1:+,2:+]; MAILMAN_DEST(0.00)[freebsd-hackers]; FREEMAIL_CC(0.00)[yahoo.com] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2021 03:47:13 -0000 This is a multi-part message in MIME format. --nextPart3042245.bT80LyP3VS Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Eventually we have a compile-time constant expression --nextPart3042245.bT80LyP3VS Content-Disposition: attachment; filename="check_mktime.c.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="check_mktime.c.diff" --- check_mktime.c.orig 2021-01-15 03:19:33.962253000 +0100 +++ check_mktime.c 2021-01-15 04:04:22.291014000 +0100 @@ -1,13 +1,16 @@ /* Test program from Paul Eggert (eggert@twinsun.com) and Tony Leneis (tony@plaza.ds.adp.com). */ # include +# include /* NBBY: #bits of a byte */ # include # include +# include /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv -static time_t time_t_max; +const time_t t0 = (time_t) 1 << (NBBY*sizeof t0 - 2); /* unused elsewhere */ +static const time_t time_t_max = t0|(t0 - 1); /* Values we'll use to set the TZ environment variable. */ static const char *const tz_strings[] = { @@ -106,9 +109,6 @@ time_t t, delta; int i, j; - for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) - continue; - time_t_max--; delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { --nextPart3042245.bT80LyP3VS--