From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Greg Minshall Newsgroups: gmane.emacs.devel Subject: Re: make check fails? (emacs-26.1 w/modules) Date: Wed, 05 Sep 2018 23:26:48 +0300 Message-ID: <19423.1536179208@minshall-apollo.minshall.org> References: <367ca660-33f5-f4d6-c03c-146056b4ece2@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: blaine.gmane.org 1536179981 26783 195.159.176.226 (5 Sep 2018 20:39:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Sep 2018 20:39:41 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 05 22:39:37 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxeaO-0006rO-Mw for ged-emacs-devel@m.gmane.org; Wed, 05 Sep 2018 22:39:36 +0200 Original-Received: from localhost ([::1]:58013 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxecV-0002dC-3R for ged-emacs-devel@m.gmane.org; Wed, 05 Sep 2018 16:41:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxebC-0001ja-56 for emacs-devel@gnu.org; Wed, 05 Sep 2018 16:40:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxeO8-0006ER-FM for emacs-devel@gnu.org; Wed, 05 Sep 2018 16:26:57 -0400 Original-Received: from hiwela.pair.com ([209.68.5.201]:44585) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fxeO2-00067n-W8; Wed, 05 Sep 2018 16:26:51 -0400 Original-Received: from hiwela.pair.com (localhost [127.0.0.1]) by hiwela.pair.com (Postfix) with ESMTP id 4AE899804FA; Wed, 5 Sep 2018 16:26:50 -0400 (EDT) Original-Received: from minshall-entroware-apollo.cliq.com (unknown [78.179.75.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hiwela.pair.com (Postfix) with ESMTPSA id 1DC828F082E; Wed, 5 Sep 2018 16:26:50 -0400 (EDT) Original-Received: from minshall-apollo.minshall.org (localhost [127.0.0.1]) by minshall-entroware-apollo.cliq.com (Postfix) with ESMTP id 576996C01A9; Wed, 5 Sep 2018 23:26:48 +0300 (+03) In-reply-to: Your message of "Wed, 05 Sep 2018 00:54:46 -0700." <367ca660-33f5-f4d6-c03c-146056b4ece2@cs.ucla.edu> X-Mailer: MH-E 8.6+git; nmh 1.6; GNU Emacs 26.1 Content-ID: <19422.1536179208.1@minshall-apollo.minshall.org> X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 209.68.5.201 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229313 Archived-At: Paul, i'm more or less stuck. using a copy of "gcc -E" (garnered from 'make V=1'), and deleting here and there, for module_intern() (just one of many routines that are truncated, on my system, by "gcc -O2"), my current minimal'ish example is this (surrounded by the rest of the "gcc -E" output): ---- static emacs_value module_intern (emacs_env *env, const char *name) { if (module_non_local_exit_check (env)) return module_nil; if (module_non_local_exit_check (env)) return module_nil; struct handler *internal_cleanup_CATCHER_ALL; if (_setjmp (internal_cleanup_CATCHER_ALL->jmp)) { return module_nil; } return lisp_to_value (env, intern (name)); } ---- note that lines 3 and 4 duplicate 1 and 2; if 3 and 4 are deleted, the compiler emits "good" code. the "if" conditions there can be complemented ("!") without changing the compiler behavior. and, some form of _setjmp() must be there, though what the range is i'm not sure. similarly, if "anything" is changed in module_non_local_exit_check(), which is currently: ---- static enum emacs_funcall_exit module_non_local_exit_check (emacs_env *env) { module_assert_thread (); module_assert_env (env); return env->private_members->pending_non_local_exit; } ---- the compiler doesn't truncate module_intern(). with -O2, i get (only up to the "ret" is relevant, except for checking i didn't miss anything): ---- .type module_intern, @function module_intern: .LFB791: .cfi_startproc subq $8, %rsp .cfi_def_cfa_offset 16 call module_non_local_exit_check xorl %eax, %eax addq $8, %rsp .cfi_def_cfa_offset 8 ret .cfi_endproc .LFE791: .size module_intern, .-module_intern .section .text.unlikely .LCOLDE18: .text .LHOTE18: .section .text.unlikely .LCOLDB19: .text .LHOTB19: .p2align 4,,15 .type module_make_float, @function ---- below is the full, unoptimized code. i installed clang 6.0, and it, even at -O3, seemed to output correct code for module_intern(), at least. i'm open to all thoughts. (including, "give up!" :) cheers, Greg ---- with *out* -O2 (or, any other optimization level), the compiler generates this: ---- .type module_intern, @function module_intern: .LFB791: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 movq %rsp, %rbp .cfi_def_cfa_register 6 subq $32, %rsp movq %rdi, -24(%rbp) movq %rsi, -32(%rbp) movq -24(%rbp), %rax movq %rax, %rdi call module_non_local_exit_check testl %eax, %eax je .L119 movl $0, %eax jmp .L120 .L119: movq -24(%rbp), %rax movq %rax, %rdi call module_non_local_exit_check testl %eax, %eax je .L121 movl $0, %eax jmp .L120 .L121: movq -8(%rbp), %rax addq $56, %rax movq %rax, %rdi call _setjmp testl %eax, %eax je .L124 movl $0, %eax jmp .L120 .L124: movq -32(%rbp), %rax movq %rax, %rdi call intern movq %rax, %rdx movq -24(%rbp), %rax movq %rdx, %rsi movq %rax, %rdi call lisp_to_value .L120: leave .cfi_def_cfa 7, 8 ret .cfi_endproc .LFE791: .size module_intern, .-module_intern .type module_non_local_exit_check, @function ----