Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rDjc4-002x4L-78 for pgsql-bugs@arkaria.postgresql.org; Thu, 14 Dec 2023 11:10:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rDjc2-0076Qy-Lp for pgsql-bugs@arkaria.postgresql.org; Thu, 14 Dec 2023 11:10:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rDjc2-0076Qq-7g for pgsql-bugs@lists.postgresql.org; Thu, 14 Dec 2023 11:10:42 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rDjbz-00ALga-Ny for pgsql-bugs@lists.postgresql.org; Thu, 14 Dec 2023 11:10:40 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3333131e08dso8397513f8f.2 for ; Thu, 14 Dec 2023 03:10:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702552238; x=1703157038; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UpVygc0VGCVcjD1k3fdfs6yp1Beb4eVjX6j56NhWljo=; b=UEz2QVUzjQsFyzxnV3NV4kDChKEPCSgplr+zqeBCBvuCa4b/rhAcRMVtNAFnoaWqbJ pnfJqC2dPtx6iZsfPP6wMn0oVOoEC+OdOuI5X5W8/IhGAtxdxQnI0hTpO7g7pVkREcmk g1+odSHXXgGUPqJxFskFE2byzRPRt6+J/rDa25g4758vdCYuMQsj3Cf0wPekuci+PsVz Y6SPDsDlX/AqekRcxSajhdyyc+4CFskUCGsPueuxV2wldLguS2NJtLkAv1sdK7idW4ma a6Jh9tT4RuHfkquz0Vxnn+6pZH22My01MQBKf4JErcr7g0WRV7L31cpAupHZJ5LTcGIr KLZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702552238; x=1703157038; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UpVygc0VGCVcjD1k3fdfs6yp1Beb4eVjX6j56NhWljo=; b=qtqshI4Fr1kR2OPIvvXVFZ9IHQmeiVq8iCKwA9OlzwN4y7TuYUVymQILXJKKKZJQ46 otVSmeh/ufdw+1y/uQDmFGe+8RNaBoLyxKuJDyGdQckX0+z8RPFWjs97Dem5rF0jehqo tU0adiQBa+QbjKE/OjIX4HcHOnwKwzDr6TpyPpKK/NEqBzXGiUHOFfiNLAai3vVDQPgO OZ6WWn9oMlPe23lf+kc7KA8cbiijwXpwnKgwXUgndyQWznh1XW+UE5QDm/MXqA+MzSWT eJat+oX/e0nC8V4rAMdF62lt5hy0vC96lnre/H/5kU++C7FfjU7VKY5D62NkS3tpk5UQ YObg== X-Gm-Message-State: AOJu0Yxrr2yDovCHkz92lfyvjkllgpU7B50AWogGJ6ihW36InfwFCZ3h wAc3KxSP69dlc5MwygidzOVNZHLaxZp/5Q== X-Google-Smtp-Source: AGHT+IFAdeuhlC60HFm3m4fN20hRcEuObKcBCPkm/CNZiJOCVJTByJATXPUkoVMRvVkP0BJUYgCyzA== X-Received: by 2002:adf:e343:0:b0:333:39d4:ff80 with SMTP id n3-20020adfe343000000b0033339d4ff80mr5192766wrj.90.1702552238127; Thu, 14 Dec 2023 03:10:38 -0800 (PST) Received: from jrouhaud ([2a01:e0a:c:bcf0:9169:d12f:aadc:d32]) by smtp.gmail.com with ESMTPSA id dd6-20020a0560001e8600b003363ebb2106sm3702537wrb.11.2023.12.14.03.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:10:37 -0800 (PST) Date: Thu, 14 Dec 2023 12:10:36 +0100 From: Julien Rouhaud To: rekgrpth@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18248: Expression is always zero Message-ID: References: <18248-4250c882e2a8b8f6@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18248-4250c882e2a8b8f6@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Thu, Dec 14, 2023 at 05:32:49AM +0000, PG Bug reporting form wrote: > > The value of expression 'thistimecnt >> 31 >> 31 >> 2' (in > src/timezone/zic.c) is zero regardless of the value of the left operand > 'thistimecnt', because it is shifted by 64 (in total) bits, which is greater > or equal to its size of 64 bits. > > Maybe this was what was meant? > thistimecnt >> 31 >> 2 Note that this is code imported as-is from upstream IANA tzcode, so we wouldn't make any change ourself. Looking at their git history they added it to remove some theoretical int limits: https://github.com/eggert/tz/commit/cc8aec6ecb1ecc3099f173e2bca9785ae8359c03