From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#43725: 28.0.50; Include feature/native-comp into master Date: Fri, 19 Feb 2021 11:13:14 +0000 Message-ID: References: <87wny8xwcc.fsf@gnus.org> <83im9sqk1b.fsf@gnu.org> <83v9drp8va.fsf@gnu.org> <831rdjd95w.fsf@gnu.org> <83k0r53ygd.fsf@gnu.org> <83im6o4hrc.fsf@gnu.org> Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19651"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43725@debbugs.gnu.org, larsi@gnus.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 19 12:14:18 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lD3jm-0004zQ-6K for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Feb 2021 12:14:18 +0100 Original-Received: from localhost ([::1]:37590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lD3jk-00060C-Va for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Feb 2021 06:14:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lD3jW-0005zp-6Q for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2021 06:14:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37264) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lD3jV-00056y-Vu for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2021 06:14:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lD3jV-0004Bo-PZ for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2021 06:14:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Feb 2021 11:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43725 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, larsi@gnus.org, 43725@debbugs.gnu.org, monnier@iro.umontreal.ca Original-Received: via spool by submit@debbugs.gnu.org id=B.161373320616052 (code B ref -1); Fri, 19 Feb 2021 11:14:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Feb 2021 11:13:26 +0000 Original-Received: from localhost ([127.0.0.1]:48810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lD3it-0004An-3m for submit@debbugs.gnu.org; Fri, 19 Feb 2021 06:13:26 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:39198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lD3is-0004Ag-8A for submit@debbugs.gnu.org; Fri, 19 Feb 2021 06:13:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lD3is-0005xs-2f for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2021 06:13:22 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:49321) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lD3iq-0004og-29; Fri, 19 Feb 2021 06:13:21 -0500 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 11JBDFuV018550 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 19 Feb 2021 11:13:15 GMT In-Reply-To: <83im6o4hrc.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 19 Feb 2021 09:51:51 +0200") Received-SPF: pass client-ip=205.166.94.24; envelope-from=akrl@sdf.org; helo=mx.sdf.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:200317 Archived-At: Eli Zaretskii writes: >> From: Andrea Corallo >> Cc: bug-gnu-emacs@gnu.org, larsi@gnus.org, monnier@iro.umontreal.ca, >> 43725@debbugs.gnu.org >> Date: Thu, 18 Feb 2021 20:53:05 +0000 >>=20 >> >> comp.c:1174:22: warning: logical =E2=80=98or=E2=80=99 of collectively= exhaustive tests is always true [-Wlogical-op] >> >> 1174 | if (val > LONG_MAX || val < LONG_MIN) >> >> | ^~ >> >>=20 >> >> Not sure what's the best way to silence it or if we want to revert to >> >> the previous formulation. >>=20 >> Hi Eli, >>=20 >> sorry just to make sure I understand the suggestions: >>=20 >> > You can either condition that by WIDE_EMACS_INT, >>=20 >> Put it under #ifdef I guess. >>=20 >> > or add a comparison > between LONG_MAX and INT_MAX. >>=20 >> Not sure I understand how you'd write this. > > Maybe it will be easier to do something like this instead: > > #if EMACS_INT_MAX > LONG_MAX > return emit_rvalue_from_unsigned_long_long (... > #else > return gcc_jit_context_new_rvalue_from_long (... > #endif > > Does that work well? Unfortunately this is a compile time (for the native compiler) decision. If val fits into a long we want to emit simply that. At this point I'm starting to think that the original formulation is probably the lesser of evils. > Btw, why does the 'long long' variant say "unsigned", while the 'long' > variant doesn't? 'emit_rvalue_from_unsigned_long_long' was added by me as libgccjit so far has no long long support. As this is shifting the numeric argument to emit the code that re-create the long long equivalent using an unsigned was the natural choice to avoid UB. Admittedly we could just cast inside 'emit_rvalue_from_unsigned_long_long' and rename it into 'emit_rvalue_from_long_long' but I'm not sure is that important. Andrea